Conversation
There was a problem hiding this comment.
Greptile Summary
This PR introduces a comprehensive timing path export feature to OpenSTA that enhances Liberty library generation and timing analysis reporting. The implementation adds the ability to export detailed timing path information directly into Liberty files within a new paths() group inside timing arcs, and enables inline reporting of these paths during report_checks operations.
The core functionality works by extending the existing timing model generation infrastructure to capture and store detailed timing path information during static timing analysis. When creating timing models using the write_timing_model command, OpenSTA now extracts three types of timing paths: input-register paths (from inputs to sequential elements), combinational paths (through combinational logic), and register-output paths (from sequential elements to outputs). Each path vertex contains comprehensive information including instance names, cell types, pin names, net names, transition types, arrival times, slew rates, and capacitance values.
The implementation spans multiple components of OpenSTA. The timing arc infrastructure (TimingArc.hh, TimingArc.cc) is extended with new data structures (TimingPathVertex, TimingPath) and methods to store timing path information alongside slack values. The Liberty writer (LibertyWriter.cc) is enhanced to export this timing path data in proper Liberty syntax within paths() groups. The Liberty reader (LibertyReader.cc, LibertyReaderPvt.hh) is updated to parse the new timing path syntax. The timing model generation process (MakeTimingModel.cc, MakeTimingModelPvt.hh) is modified to extract timing paths during analysis and associate them with timing arcs. Finally, the path reporting system (ReportPath.cc, ReportPath.hh) is enhanced to detect and display inline timing paths from pre-characterized cells during standard timing reports and JSON output.
The feature is validated through comprehensive test cases covering different cell types: timing_cell_dff (sequential paths), timing_cell_comb (combinational paths), and timing_cell_complex (hierarchical multi-cell paths). The tests verify both Liberty export functionality and inline reporting in both standard and JSON formats. The implementation maintains backward compatibility while providing enhanced visibility into timing behavior within characterized cells.
Confidence score: 4/5
• This PR is generally safe to merge with proper testing, implementing a valuable new feature without breaking existing functionality
• Score reflects the complexity and breadth of changes across multiple core systems, requiring careful validation of timing analysis accuracy
• Key files needing attention: search/ReportPath.cc, search/MakeTimingModel.cc, liberty/LibertyWriter.cc, and liberty/LibertyReader.cc due to their central role in the new functionality
25 files reviewed, 12 comments
There was a problem hiding this comment.
Caution
Changes requested ❌
Reviewed everything up to 57817e5 in 1 minute and 44 seconds. Click for details.
- Reviewed
2472lines of code in25files - Skipped
1files when reviewing. - Skipped posting
11draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. test/timing_cell_comb.lib:1
- Draft comment:
The combinational cell liberty file has been updated with a new 'paths()' group exporting detailed vertex information. The timing constraints and path exports are clearly structured and their values look consistent with the design intent. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. test/timing_cell_dff.lib:48
- Draft comment:
The dff liberty file now exports separate timing path groups for hold and setup. The exported vertex information (instance, cell, pin, net, transition, arrival, slew, capacitance, is_driver) is clearly defined. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. test/report_json1.ok:1
- Draft comment:
The expected JSON output for report_checks is comprehensive – it includes startpoint, endpoint, source and target paths, and numerical values in exponential notation. Ensure tolerances for floating point rounding if needed. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
4. test/timing_cell_complex.ok:1
- Draft comment:
The full (text) timing report for the 'timing_cell_complex' design clearly displays all the expected stages from source clock to data arrival and required times. It correctly reports slack values with indication if timing is met. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. test/timing_cell_complex_json.ok:1
- Draft comment:
The JSON output for the complex design is very detailed and consistent with the text mode report. Verify that floating point formatting and vertex ordering remain stable across runs. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. test/regression_vars.tcl:140
- Draft comment:
The regression tests are well grouped and record both example and main tests. Ensure that any environment‐dependent paths (e.g. file paths in verilog_src fields) are configured consistently in your build/test system. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. test/write_timing_model_scalar.ok:1
- Draft comment:
The scalar timing model output for the 'counter' library includes input external delay and setup/hold timing details. The expected formatting appears correct. Consider documenting any tolerances for floating point outputs. - Reason this comment was not posted:
Confidence changes required:10%<= threshold50%None
8. test/timing_cell_dff.v:1
- Draft comment:
The verilog source for timing_cell_dff is concise and instantiates a BUF, a DFF, and another BUF as expected. The instance names (u1, r1, u2) match with Liberty exports. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
9. test/timing_cell_complex.v:1
- Draft comment:
The verilog design for the complex test instantiates both timing_cell_dff and timing_cell_comb correctly. The wiring is clear and consistent with exported timing paths. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
10. search/ReportPath.cc:1063
- Draft comment:
There's an extra 'string' at the end of the file (line 1063) which appears to be a stray text. It should be removed. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
11. test/timing_cell_comb.tcl:1
- Draft comment:
Typo alert: The header comment on line 1 reads "# timing cel comb example". Consider updating "cel" to "cell" if this is unintended. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While this is technically a typo, it's just in a comment that has no functional impact. The comment is correct about the typo, but fixing it won't improve code quality or functionality. Our rules specifically say not to make comments that are obvious or unimportant. Comment typos are generally not worth pointing out. The typo could potentially make the file harder to find in searches, or it could indicate a broader pattern of carelessness that should be addressed. While searchability is a minor concern, this is still just a cosmetic issue in a comment. The rules clearly state not to make unimportant comments, and comment typos fall into this category. This comment should be deleted as it points out an unimportant typo in a comment that has no functional impact on the code.
Workflow ID: wflow_bOVYhYh7wd5Aewx8
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Overall good start. Highlighted a few issues. Also want to discuss including internal reg2reg paths as those can be critical at our meeting. Would be good to get a walkthrough of what is being calculated on the fly during reporting. I skimmed that for now, would be good to discuss during our weekly meeting. |
803a1e7 to
1d432c7
Compare
akashlevy
left a comment
There was a problem hiding this comment.
Looking pretty great! Last thing is to enable keeping the N worst reg2reg paths.
4d72550 to
0e9664b
Compare
|
@magancarz is there any more work needed on this or can I review? |
|
@akashlevy we are currently working on adding more information about source and target clock paths with register-register internal paths reporting, but the overall structure of the code won't change, so you can start the review. |
…me values to liberty
…OpenSTA can parse it" This reverts commit 92fc56a.
…ching for internal paths if specific paths pins/instances are specified
1fa8878 to
6a0a6ad
Compare
|
Updated the pull request with latest changes. Aside from adding reporting more information about the source and target clock paths, we've also changed searching for the internal reg2reg paths to use all imported Liberty cells instead of only those from the leaf instances. |
|
bugbot run |
There was a problem hiding this comment.
Greptile Summary
This PR implements a comprehensive timing path export feature for OpenSTA's Liberty file generation. The changes enable detailed timing path information to be embedded directly in Liberty files and displayed inline during report_checks operations.
The implementation introduces new data structures (TimingPath, TimingPathVertex, InputRegisterTimingPath) in TimingArc.hh to represent complete timing paths with vertex-level details including instance names, cell types, pin names, net names, transition types, arrival times, slew rates, and capacitance values. The feature supports all major path types: input-register, combinational, and register-output paths.
Key architectural changes include:
- Liberty Writer Enhancement:
LibertyWriter.ccnow exports timing paths in newpaths()groups withintiming()blocks, andworst_slack_paths()sections for cells with internal timing paths - Liberty Reader Enhancement:
LibertyReader.ccadds comprehensive parsing support for the new timing path attributes and groups - Search Infrastructure: New methods in
Search.hh/ccfor finding internal timing paths (findInternalTimingPaths) and merging them with regular path ends (mergePaths) - Reporting Enhancement:
ReportPath.ccextends timing analysis reporting to display embedded timing paths inline with traditional STA results - Cell Data Storage:
Liberty.ccadds storage and retrieval methods for internal timing paths inLibertyCellusing a 2D array indexed by MinMax and RiseFall
The feature is controlled by new command-line options: write_timing_model -paths enables path export, while -internal_path_count limits the number of paths exported per pin. The report_checks command automatically displays these embedded paths when Liberty files containing timing path information are loaded.
The extensive test suite validates functionality across different scenarios including CDC (Clock Domain Crossing), propagated clocks, hierarchical designs, and various path groupings. Test files demonstrate the round-trip capability where timing paths can be exported to Liberty format and then re-imported for analysis.
Confidence score: 3/5
- This PR introduces complex functionality across multiple subsystems but contains several implementation issues that could cause runtime failures
- Score reflects concerns about undefined variable references, potential null pointer dereferences, and logic errors that need addressing before merge
- Core architectural design is sound but execution has technical debt that requires cleanup
74 files reviewed, 9 comments
|
|
||
| // r1 - r6 with six delay buffers | ||
| // path group: long | ||
| DFFHQx4_ASAP7_75t_R r6 (.D(w7), .CLK(clk), .Q(out)); |
There was a problem hiding this comment.
logic: All output registers r2-r6 drive the same output port 'out', which may cause multiple drivers and synthesis issues in some tools
There was a problem hiding this comment.
These should be driving different outputs ideally
| @@ -0,0 +1,20 @@ | |||
| module internal_paths_cell_hidden (input in, input clk, output out); | |||
|
|
|||
| wire w1, w2, w3, w4, w5, w6, w7, w8; | |||
There was a problem hiding this comment.
syntax: Missing wire w9 declaration - it's used on lines 14 and 18 but not declared
| wire w1, w2, w3, w4, w5, w6, w7, w8; | |
| wire w1, w2, w3, w4, w5, w6, w7, w8, w9; |
| set library [get_liberty_error "library" [lindex $args 0]] | ||
| set filename [file nativename [lindex $args 1]] | ||
| write_liberty_cmd $library $filename | ||
| set write_timing_paths [info exists flags(-paths)] |
There was a problem hiding this comment.
logic: Critical bug: flags variable is undefined. The write_liberty proc doesn't parse command line flags, so flags(-paths) will cause a runtime error.
| set write_timing_paths [info exists flags(-paths)] | |
| parse_key_args "write_liberty" args keys {} flags {-paths} | |
| set write_timing_paths [info exists flags(-paths)] |
| const bool scalar); | ||
| const bool scalar, | ||
| const bool paths, | ||
| const int internal_path_count); |
| @@ -36,6 +36,8 @@ makeTimingModel(const char *lib_name, | |||
| const char *filename, | |||
| const Corner *corner, | |||
| const bool scalar, | |||
| bool clk_used_as_data, | ||
| float time_offset) const | ||
| float time_offset, | ||
| const TimingArc *end_check_arc) const |
| bool report_clk_path, | ||
| float time_offset) const | ||
| float time_offset, | ||
| const TimingArc *end_check_arc) const |
| bool report_clk_path, | ||
| float time_offset) const | ||
| float time_offset, | ||
| const TimingArc *end_check_arc) const |
| set library [get_liberty_error "library" [lindex $args 0]] | ||
| set filename [file nativename [lindex $args 1]] | ||
| write_liberty_cmd $library $filename | ||
| set write_timing_paths [info exists flags(-paths)] |
| bool report_clk_path, | ||
| float time_offset) const | ||
| float time_offset, | ||
| const TimingArc *end_check_arc) const |
| } | ||
| } | ||
|
|
||
| void |
There was a problem hiding this comment.
I'm not sure I fully understand why everything is a static constexpr here...
There was a problem hiding this comment.
Would be good to get an explanation on what is happening here.
|
|
||
| // r1 - r6 with six delay buffers | ||
| // path group: long | ||
| DFFHQx4_ASAP7_75t_R r6 (.D(w7), .CLK(clk), .Q(out)); |
There was a problem hiding this comment.
These should be driving different outputs ideally
| // won't be visible while exporting register-register | ||
| // paths from the current one, if we will only | ||
| // import it from the Liberty | ||
| internal_paths_cell_hidden r4 (.in(w9), .clk(clk), .out(out)); |
|
|
||
| internal_paths_cell t4 (.in(w4), .clk(clk), .out(out)); | ||
|
|
||
| internal_paths_cell t5 (.in(w5), .clk(clk), .out(out)); |
|
@magancarz @kbieganski Summarizing the minor issues I found in my review + AI-assisted reviews:
|
This PR adds timing path export to Liberty files, as well as inline reporting of such paths in
report_checks. All paths types are exported: input-register, combinational, and register-output. Each path vertex has information about its instance, cell, pin, net names, transition type, arrival, slew and capacitance values.As an example, for this cell, OpenSTA exports paths to the new
paths()group inside each pin'stiming(), for each rise/fall case, along with the worst slack.Later, when the cell is used in static timing analysis with
report_checks, the exported timing paths are displayed inline in the reported path.Important
Adds timing path export to Liberty files and inline reporting in
report_checks, supporting input-register, combinational, and register-output paths.report_checks.TimingPathandTimingPathVertexstructs inTimingArc.hh.LibertyReader.ccto parse new timing path attributes.LibertyWriter.ccto write timing paths to Liberty files.ReportPathclass inReportPath.ccto handle new path reporting.timing_cell_dff,timing_cell_comb, andtiming_cell_complex.This description was created by
for 57817e5. You can customize this summary. It will automatically update as commits are pushed.