ram: integrate OpenSTA for timing and power reporting#10784
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates the Static Timing Analysis (STA) engine into the RAM generator, adding methods to retrieve and report the worst setup slack and total power of the generated RAM. The reviewer recommends adding defensive checks to prevent segmentation faults if these reporting methods are called before a RAM block is generated, as well as handling unconstrained timing values in the Tcl interface to avoid formatting errors.
76ee747 to
95c0df8
Compare
There is no need for a user to manually call these functions. Make them internal functions which are called at the end of the ram generation automatically. |
|
For now, you should assume that no timing constraints have been applied to the RAM. Report the unconstrained worst slack for both hold and setup, as that represents the cycle time of the RAM. I don't know what STA gives you for the power number if there aren't any activity factors propagated. |
|
I have made the updates to the code, ready for review @rovinski |
rovinski
left a comment
There was a problem hiding this comment.
My comment about the power meant that I don't know myself what STA does when you estimate power, but there haven't been any activity factors applied. It might generate them, or it might just give back bogus results. It is worth finding out.
| -power_pin VPWR \ | ||
| -ground_pin VGND \ |
There was a problem hiding this comment.
It is usually better to do such changes in a separate PR because the downstream LEF changes are distracting from the main purpose of this PR.
faaad98 to
3fac55c
Compare
|
@gemini-code-assist /review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
… generate, unconstrained worst slack and leakage power is reported Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
… tidy error Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
|
@codex review |
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
…to specify cell Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fac55cf1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| r_ports, | ||
| w_ports); | ||
|
|
||
| reportTimingAndPower(); |
There was a problem hiding this comment.
Move reports after final RAM generation
In the generate_ram Tcl flow this call runs inside generate_ram_netlist, but ram.tcl then continues with ord::design_created, PDN insertion, pin placement, filler insertion, and routing. For normal generate_ram users the newly logged timing/power therefore describes the pre-PDN/pre-filler netlist; cells inserted by ram_filler are omitted from the reported total power, so the number is stale for the final RAM macro.
Useful? React with 👍 / 👎.
| true, /* unconstrained */ | ||
| scenes, /* scenes */ | ||
| sta::MinMaxAll::min(), /* min_max */ |
There was a problem hiding this comment.
Filter zero-length paths before logging minimum delay
With the unconstrained min-path query left unfiltered, designs with primary/clock startpoints at zero arrival can be selected as the “shortest” path; the new goldens all report RAM minimum path delay: 0.000 ns, which is not a useful RAM min/cycle delay. Please constrain/filter the returned path to real data paths before logging it, otherwise users get a silently misleading minimum-delay report.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Did some investigation and found that because no create_clock is defined in these automated RAM test the fastest min path appear to always be through the latch/flip-flop clock pins which will report a value of zero second which is misleading.
I added in a check to restrict the pin search to only the functional endpoints (flip-flop/latch D pins and primary Q outputs) since this is more accurate of how the RAMs will perform. This should also works with any RAM sizes and configurations instead of trying to define a specific number of pins that we want to restrict the test to.
Update is made in c121752
There was a problem hiding this comment.
I think the real solution is just that clock should be excluded and everything else should be included.
You may also need to set clocks to propagated? I'm not sure if that affects the datapath timing.
3fac55c to
025ef12
Compare
…to call it at the end of generate_ram after filler insertion and routing Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
…orage/latch D pins and primary Q outputs Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
Signed-off-by: Thinh Nguyen <nguyenthinh19011@gmail.com>
|
Ready for review @rovinski @maliberty |
|
@rovinski please do your review first |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af382e0daa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| false, /* hold */ | ||
| false, /* recovery */ | ||
| false, /* removal */ | ||
| false, /* clk_gating_setup */ |
There was a problem hiding this comment.
Include clock-gate setup paths in timing report
For RAMs whose write address/enable decoder feeds the clock-gate enable path (the gcand/cg chain in makeSlice), forcing clk_gating_setup off means those control paths are never candidates for the reported maximum path delay. If that path is critical, the new report will understate the RAM cycle/setup requirement even though the generated netlist contains clock-gating checks.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
All paths need to be considered
rovinski
left a comment
There was a problem hiding this comment.
One other note: it's going to be important to run parasitic extraction (RCX) before doing the timing. I don't think it's being run right now - the timing will not be as accurate unless it's run.
| // restrict path searches to the RAM's data endpoints (storage/latch | ||
| // D pins and primary Q outputs) since unconstrained searches |
There was a problem hiding this comment.
You need to consider all non-clock inputs as potential start points. This includes A and WE
| false, /* hold */ | ||
| false, /* recovery */ | ||
| false, /* removal */ | ||
| false, /* clk_gating_setup */ |
There was a problem hiding this comment.
All paths need to be considered
| true, /* unconstrained */ | ||
| scenes, /* scenes */ | ||
| sta::MinMaxAll::min(), /* min_max */ |
There was a problem hiding this comment.
I think the real solution is just that clock should be excluded and everything else should be included.
You may also need to set clocks to propagated? I'm not sure if that affects the datapath timing.
| ram_gen->ramRouting(thread_count); | ||
| } | ||
|
|
||
| void ram_report_timing_power() |
There was a problem hiding this comment.
As a side note, I think a lot of this function naming is redundant. It is already inside the ram namespace you could just do ram::report_timing_power, etc. Something to perhaps address in a separate PR.
Summary
Integrates openSTA into the RAM module to display timing and power after RAM generation
Unconstrained worst setup and hold path delays (min clock period and cycle time) and total leakage power are displayed automatically after RAM generation
Type of Change
Impact
After generating a RAM, user can now see timing and power report numbers

Verification
./etc/Build.sh).Related Issues
#9392
@rovinski