From 2ab4fc439af79ca3a52b14140d92657b777411cb Mon Sep 17 00:00:00 2001 From: Michael Norris Date: Tue, 30 Jan 2024 10:38:09 -0800 Subject: [PATCH] fixing script to use hard reset or powergood for assertion if it's found --- src/ecc/rtl/ecc_reg.sv | 2 +- src/keyvault/rtl/kv_reg.sv | 2 +- tools/scripts/rdl_post_process.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ecc/rtl/ecc_reg.sv b/src/ecc/rtl/ecc_reg.sv index dacdd19b0..b267ae09d 100644 --- a/src/ecc/rtl/ecc_reg.sv +++ b/src/ecc/rtl/ecc_reg.sv @@ -1814,6 +1814,6 @@ module ecc_reg ( assign cpuif_rd_data = readback_data; assign cpuif_rd_err = readback_err; -`CALIPTRA_ASSERT_KNOWN(ERR_HWIF_IN, hwif_in, clk, hwif_in.reset_b) +`CALIPTRA_ASSERT_KNOWN(ERR_HWIF_IN, hwif_in, clk, hwif_in.hard_reset_b) endmodule \ No newline at end of file diff --git a/src/keyvault/rtl/kv_reg.sv b/src/keyvault/rtl/kv_reg.sv index 500aef16a..4acca90fb 100644 --- a/src/keyvault/rtl/kv_reg.sv +++ b/src/keyvault/rtl/kv_reg.sv @@ -443,6 +443,6 @@ module kv_reg ( assign cpuif_rd_data = readback_data; assign cpuif_rd_err = readback_err; -`CALIPTRA_ASSERT_KNOWN(ERR_HWIF_IN, hwif_in, clk, hwif_in.reset_b) +`CALIPTRA_ASSERT_KNOWN(ERR_HWIF_IN, hwif_in, clk, hwif_in.hard_reset_b) endmodule \ No newline at end of file diff --git a/tools/scripts/rdl_post_process.py b/tools/scripts/rdl_post_process.py index aeb547283..f7291e57d 100644 --- a/tools/scripts/rdl_post_process.py +++ b/tools/scripts/rdl_post_process.py @@ -25,6 +25,8 @@ def scrub_line_by_line(fname): mod_cnt = 0 mod_lines = "" + found_hard_reset = None + # Line by line manipulation # Look for unpacked arrays (could be struct arrays or signal arrays) # Look for unpacked struct types @@ -37,9 +39,10 @@ def scrub_line_by_line(fname): has_struct = re.search(r'\bstruct\b\s*(?:unpacked)?', line) is_endmodule = re.search(r'\bendmodule\b', line) has_reset = re.search(r'\bnegedge.+\_b\b', line) - if (has_reset is not None): + if (has_reset is not None and found_hard_reset is None): substring = re.search(r"negedge (\w+.\w+)", line) reset_name = substring.group(1) + found_hard_reset = re.search(r'hard|power',reset_name) # Skip lines with logic assignments or references to signals; we # only want to scrub signal definitions for unpacked arrays if (has_assign is not None or has_reg_strb is not None):