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.
  • Documentation

    • Added an auto-generated benchmark README and updated SDC syntax docs with an illustrative image.

✏️ 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 updates the SDC-generation script to always generate and append object patterns and prefix commands with create_clock prerequisites; also adds an auto_generated README and a minor docs image addition.

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 (inputs: clk1, clk2, clk_gen, clock; output dummy_out as reg, toggles on any posedge), get_pins (modules get_pins and DFF; two DFFs instantiated, data_out is 2-bit reg concatenation), and get_ports (ports clk, rst, data1_in, data2_in, valid_in; result_out reg updated when valid_in, ready_out is constant wire).
SDC generation script
scripts/generate_sdc.py
Removed support for -filter, -of_objects, and related branching; PATTERNS updated; generators for clocks/ports/pins now always append a deterministic pattern and prefix commands with create_clock prerequisite lines.
Documentation additions
auto_generated/README.md, docs/syntax/README.md
Added an auto_generated README describing the benchmark suite; added an image reference under SDC Syntax README.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay extra attention to:
    • scripts/generate_sdc.py — pattern composition, removal of optional flags, and create_clock prefix correctness.
    • auto_generated/netlist_files/get_pins_netlist.v — DFF instantiation, signal directions, bit ordering, and missing EOF newline.
    • auto_generated/netlist_files/get_ports_netlist.v — reset and valid sequencing and signal widths.
    • auto_generated/netlist_files/get_clocks_netlist.v — multi-clock sensitivity list and non-blocking assignment semantics.

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 title describes only documentation/image changes, but the PR includes substantial code changes: four new Verilog modules, a Python script refactor, and a README. The title is misleading about the actual scope. Update the title to reflect the primary changes: consider something like 'Add Verilog netlists for SDC testing and update generate_sdc.py' or provide a more comprehensive title that captures the main deliverables.
✅ 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

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

@coderabbitai coderabbitai bot Dec 12, 2025

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Coderabbit is correct here @Minchan-Kwon . All of the examples I see here are Glob, not regex. For now, I think its ok to just support Glob. If you want to support Regex, you would need some slightly different examples.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Collaborator

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

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

Looks great @Minchan-Kwon

A couple of comments.

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
Collaborator

Choose a reason for hiding this comment

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

Coderabbit is correct here @Minchan-Kwon . All of the examples I see here are Glob, not regex. For now, I think its ok to just support Glob. If you want to support Regex, you would need some slightly different examples.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this picture a lot. Can you please add a reference to it in the syntax document that I wrote. You can add images to the README. I think this belongs at the top of that page as a summary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this image as well, but it may not fit with the Syntax docs. You could add your own README in the autogen suite for this if you would like.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same with this one. Normally, I like to always have the images in documentation somewhere so they are easier to access.

@Minchan-Kwon Minchan-Kwon marked this pull request as draft December 14, 2025 19:34
@Minchan-Kwon Minchan-Kwon marked this pull request as ready for review December 16, 2025 18:58
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: 2

🧹 Nitpick comments (2)
auto_generated/README.md (2)

1-1: Capitalize and hyphenate the title.

Line 1 should follow standard capitalization conventions for hyphenated compound adjectives.

-# Auto Generated Suite
+# Auto-Generated Suite

9-9: Simplify the phrasing for conciseness.

Consider removing the redundant "of" to streamline the text.

-All of the SDCs in this suite have been generated using generate_sdc.py included in the repository.
+All the SDCs in this suite have been generated using generate_sdc.py included in the repository.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

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

⛔ Files ignored due to path filters (3)
  • auto_generated/images/Syntax-Suite.png is excluded by !**/*.png
  • auto_generated/images/Timing-Suite.png is excluded by !**/*.png
  • docs/images/Synopsys-Design-Constraints.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • auto_generated/README.md (1 hunks)
  • docs/syntax/README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/syntax/README.md
🧰 Additional context used
🪛 LanguageTool
auto_generated/README.md

[grammar] ~1-~1: Use a hyphen to join words.
Context: # Auto Generated Suite This is a benchmark sui...

(QB_NEW_EN_HYPHEN)


[style] ~8-~8: Consider removing “of” to be more concise
Context: ...uto_generated/images/Syntax-Suite.png) All of the SDCs in this suite have been generated ...

(ALL_OF_THE)


This is a benchmark suite automatically generated to test a CAD tool's ability to parse Synopsys Design Constraints.
It is a collection of all valid combinations of SDCs and their corresponding RTL files written in Verilog.
The specific commands included in this benchmark are listed in the [syntax document](./docs/syntax/README.md).
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

Correct the relative path to the syntax documentation.

The path ./docs/syntax/README.md is incorrect relative to the current file location. Since this file is at auto_generated/README.md, the path should traverse up one directory level to reach docs/syntax/README.md.

-The specific commands included in this benchmark are listed in the [syntax document](./docs/syntax/README.md).
+The specific commands included in this benchmark are listed in the [syntax document](../docs/syntax/README.md).
📝 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
The specific commands included in this benchmark are listed in the [syntax document](./docs/syntax/README.md).
The specific commands included in this benchmark are listed in the [syntax document](../docs/syntax/README.md).
🤖 Prompt for AI Agents
In auto_generated/README.md around line 5, the relative link to the syntax
documentation is incorrect; update the path to traverse up one directory by
changing ./docs/syntax/README.md to ../docs/syntax/README.md so the link
correctly points from auto_generated/README.md to docs/syntax/README.md.

It is a collection of all valid combinations of SDCs and their corresponding RTL files written in Verilog.
The specific commands included in this benchmark are listed in the [syntax document](./docs/syntax/README.md).

![auto-gen-syntax-suite.png](.auto_generated/images/Syntax-Suite.png)
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

Fix the image path and alt text.

The image path uses an unusual .auto_generated prefix that doesn't align with standard relative path conventions. Additionally, the alt text (auto-gen-syntax-suite.png) doesn't match the actual image filename (Syntax-Suite.png), which creates confusion.

-![auto-gen-syntax-suite.png](.auto_generated/images/Syntax-Suite.png)
+![Syntax Suite](./images/Syntax-Suite.png)
📝 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
![auto-gen-syntax-suite.png](.auto_generated/images/Syntax-Suite.png)
![Syntax Suite](./images/Syntax-Suite.png)
🤖 Prompt for AI Agents
In auto_generated/README.md around line 7, the image reference uses an
unconventional `.auto_generated` prefix and the alt text doesn't match the
actual filename; update the markdown image link to use a standard relative path
(for example ./auto_generated/images/Syntax-Suite.png) and correct the alt text
to match the image or be descriptive (e.g., "Syntax Suite") so the path is
conventional and the alt text reflects the actual image.

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.

2 participants