Skip to content

Commit

Permalink
fixing script to use hard reset or powergood for assertion if it's found
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Norris committed Jan 30, 2024
1 parent 4fb774f commit 2ab4fc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ecc/rtl/ecc_reg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/keyvault/rtl/kv_reg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion tools/scripts/rdl_post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 2ab4fc4

Please sign in to comment.