Skip to content

Conversation

@Minchan-Kwon
Copy link
Contributor

@Minchan-Kwon Minchan-Kwon commented Dec 12, 2025

Added the images describing the benchmark suite

Summary by CodeRabbit

  • New Features

    • Added a module exposing multiple independent clocks for toggling/monitoring.
    • Added a dual-channel data-capture module that produces a combined 2-bit output (one channel captures inverted input).
    • Added an arithmetic/aggregation module with reset, validation gating, and a ready indicator.
  • Chores

    • SDC generation tool simplified: fewer optional flags, deterministic pattern inclusion, and automatic clock prerequisites.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Walkthrough

Adds three auto-generated Verilog netlist modules (get_clocks, get_pins, get_ports) and refactors the SDC-generation script (scripts/generate_sdc.py) to always append patterns and prefix generated commands with create_clock prerequisites.

Changes

Cohort / File(s) Summary
New Verilog netlist modules
auto_generated/netlist_files/get_clocks_netlist.v, auto_generated/netlist_files/get_pins_netlist.v, auto_generated/netlist_files/get_ports_netlist.v
Added get_clocks (four clock inputs, dummy_out toggled on any posedge, output is reg), get_pins (two-module DFF instantiation, 2-bit data_out), and get_ports (clk/rst/valid-driven update, result_out reg, ready_out constant wire).
SDC generation script
scripts/generate_sdc.py
Simplified generation: removed -filter, -of_objects, and related branching; patterns for clocks/ports/pins are always generated and appended; commands are prefixed with create_clock prerequisite lines; PATTERNS dictionary and per-object generators updated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • scripts/generate_sdc.py — ensure removal of optional flags and new deterministic path don't break external callers and validate pattern composition and create_clock prefixes.
    • auto_generated/netlist_files/get_pins_netlist.v — confirm DFF instantiation connections and intended bit ordering/concatenation for data_out; note file end-of-file newline is missing.
    • auto_generated/netlist_files/get_ports_netlist.v — validate reset/valid sequencing and widths for data1_in/data2_in/result_out.
    • auto_generated/netlist_files/get_clocks_netlist.v — verify sensitivity list and non-blocking assignment semantics for dummy_out across multiple clocks.

Possibly related PRs

Suggested reviewers

  • AlexandreSinger

Poem

🐇 I hopped through nets where clock seeds grow,
I planted patterns row by row,
Three modules sprung and scripts now sing—
a tiny toggle, two DFFs, one ring. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title claims to add image descriptions for a benchmark suite, but the actual changes are new Verilog modules and modifications to a Python script for SDC generation. Update the PR title to accurately reflect the actual changes, such as 'Add Verilog netlist modules (get_clocks, get_pins, get_ports) and refactor SDC generation' or a more specific description of what was changed.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2205ca and bf0920b.

📒 Files selected for processing (3)
  • auto_generated/netlist_files/get_clocks_netlist.v (1 hunks)
  • auto_generated/netlist_files/get_pins_netlist.v (1 hunks)
  • auto_generated/netlist_files/get_ports_netlist.v (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • auto_generated/netlist_files/get_ports_netlist.v
  • auto_generated/netlist_files/get_clocks_netlist.v
  • auto_generated/netlist_files/get_pins_netlist.v

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
auto_generated/netlist_files/get_pins_netlist.v (1)

1-35: Verify file completeness.

The file appears to be missing a final newline at the end. While not a critical issue, it's a common best practice to end source files with a newline character.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1041d08 and a64eeea.

⛔ Files ignored due to path filters (3)
  • docs/images/Synopsys-Design-Constraints.png is excluded by !**/*.png
  • docs/images/Syntax-Suite.png is excluded by !**/*.png
  • docs/images/Timing-Suite.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • auto_generated/netlist_files/get_clocks_netlist.v (1 hunks)
  • auto_generated/netlist_files/get_pins_netlist.v (1 hunks)
  • auto_generated/netlist_files/get_ports_netlist.v (1 hunks)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/generate_sdc.py (1)

314-352: generate_get_pins: you’re iterating unused options → duplicate outputs and wasted generation

After the change, only -regexp/-nocase/-quiet are actually appended, but the loop still enumerates combinations over ["-hierarchical", "-hsc", "-filter", ...] (Line 321). That will generate many identical commands and file duplicates. Tighten optional_options (and update the docstring) to match what’s emitted.

 def generate_get_pins():
     '''
-    Required:
-    Optional: -hierarchical, -hsc, -filter, -regexp, -nocase(Valid only with -regexp), -quiet, -of_objects, patterns
-    Note: -hierarchical cannot be used with -of_objects
+    Optional: -regexp, -nocase (legal only with -regexp), -quiet
     '''
     commands = [] #List containing all possible combinations of options
-    optional_options = ["-hierarchical", "-hsc", "-filter", "-regexp", "-nocase", "-quiet", "-of_objects", "patterns"]
+    optional_options = ["-regexp", "-nocase", "-quiet"]
🧹 Nitpick comments (2)
scripts/generate_sdc.py (2)

236-273: generate_get_ports: consider dropping the create_clock prerequisite and/or align pattern to -regexp

get_ports generally doesn’t require clocks to exist; prefixing create_clock may be harmless but can add noise and (if the referenced port doesn’t exist) introduce avoidable tool errors in suites that only want to validate get_ports. Also, if -regexp is present, ensure pattern is a regex (not a glob-ish token like *in).

-            #Add create_clock prerequisites
-            pieces = ("create_clock -period 10 -name clk [get_ports clk]\n" + pieces)
+            # If you truly need prerequisites here, consider referencing a port that always exists
+            # in the benchmark netlist, or omit prerequisites for get_ports entirely.
+            # pieces = ("create_clock -period 10 -name clk [get_ports clk]\n" + pieces)
-            pattern = generate_pattern("port")
+            pattern = generate_pattern("port")  # consider generate_pattern("port_regex") when -regexp is set
             pieces.append(pattern)

274-313: generate_get_clocks: prereq clocks should be conditional on the chosen clock pattern

You always create 4 clocks (clk1/clk2/clk_gen/clock) even if the generated get_clocks pattern targets something else; this can create unnecessary constraints and failures if some ports don’t exist in a given netlist. Consider emitting prerequisites only for the clocks implied by the pattern (or ensure the netlists always define these ports).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a64eeea and f2205ca.

📒 Files selected for processing (1)
  • scripts/generate_sdc.py (5 hunks)

Comment on lines +103 to 108
"clock": ["clk*", "clk_gen", "clock", "clk1"],
"port": ["data*", "*in", "*out", "valid_in"],
"pin": ["u1/*", "*/Q", "u2/D", "*/clk"],
"cell": ["inst*", "reg_*", "*_buffer"],
"net": ["net*", "n[0-9]*", "*_data"]
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Ensure patterns match the selected mode (glob vs -regexp)

PATTERNS now feeds both plain mode and -regexp mode. Several entries (e.g., clk*, *in, */Q) look like glob patterns; under -regexp they may be invalid or at least semantically different than intended depending on the SDC implementation. Consider maintaining separate pattern banks (glob vs regex) or translating when -regexp is present.

 PATTERNS = {
-    "clock": ["clk*", "clk_gen", "clock", "clk1"],
-    "port": ["data*", "*in", "*out", "valid_in"],
-    "pin": ["u1/*", "*/Q", "u2/D", "*/clk"],
+    # Consider splitting into "glob" vs "regex" banks if -regexp is used.
+    "clock": ["clk*", "clk_gen", "clock", "clk1"],
+    "port": ["data*", "*in", "*out", "valid_in"],
+    "pin": ["u1/*", "*/Q", "u2/D", "*/clk"],
     "cell": ["inst*", "reg_*", "*_buffer"],
     "net": ["net*", "n[0-9]*", "*_data"]
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"clock": ["clk*", "clk_gen", "clock", "clk1"],
"port": ["data*", "*in", "*out", "valid_in"],
"pin": ["u1/*", "*/Q", "u2/D", "*/clk"],
"cell": ["inst*", "reg_*", "*_buffer"],
"net": ["net*", "n[0-9]*", "*_data"]
}
PATTERNS = {
# Consider splitting into "glob" vs "regex" banks if -regexp is used.
"clock": ["clk*", "clk_gen", "clock", "clk1"],
"port": ["data*", "*in", "*out", "valid_in"],
"pin": ["u1/*", "*/Q", "u2/D", "*/clk"],
"cell": ["inst*", "reg_*", "*_buffer"],
"net": ["net*", "n[0-9]*", "*_data"]
}
🤖 Prompt for AI Agents
In scripts/generate_sdc.py around lines 103 to 108, PATTERNS currently contains
glob-style entries that are being used regardless of whether the SDC engine is
invoked in plain (glob) or -regexp mode; this can produce incorrect or invalid
matches. Fix by branching on the selected mode: if mode == "regexp" either (a)
maintain a separate PATTERNS_REGEXP mapping with proper regular expressions for
each key, or (b) programmatically translate glob patterns to equivalent regex
(escaping as needed and converting * -> .* and ? -> .) before emitting them;
validate converted patterns (e.g., compile them) and use the appropriate bank
when generating the SDC output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant