-
Notifications
You must be signed in to change notification settings - Fork 772
test: Added a slight distortion in bazel - //test/orfs/mock-array:MockArray_8x8_flat_cts_openroad_test #9224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…kArray_8x8_flat_cts_openroad_test to avoid non-determinism issue Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses an intermittent test failure by introducing a deliberate distortion in the test data. The change modifies the power.tcl test script to alter the duty cycle for a few pins, ensuring a predictable difference in power calculations and making the test more robust. My review identified a minor discrepancy between the intended logic (modifying three pins) and the implementation (modifying four pins), and I've provided a suggestion to correct it.
test/orfs/mock-array/power.tcl
Outdated
|
|
||
| # Fixed duty to 0.55 for the first three pins to give a slight distortion | ||
| # to see the slightly different power numbers b/w VCD and user activity flows. | ||
| if { $vcd_pin_count <= 3 } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition $vcd_pin_count <= 3 will modify the duty cycle for the first four pins (when vcd_pin_count is 0, 1, 2, and 3). However, the comment on line 38 and the pull request description state that only the first three pins should be modified. To align with the intended logic, the condition should be changed to $vcd_pin_count < 3.
if { $vcd_pin_count < 3 } {
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Once user activity file is read, the total power is recomputed and My fix will produce different |
|
FWIW, Before the ND issue fix (by parallaxsw/OpenSTA#359)
After the ND issue fix
|
|
@oharboe FYI |
|
Thanks for curating and coming up with arobust plan for this use case. |
|
@oharboe I thought the goal of this check was to compare sta computed activities to vcd ones not vcd to itself. Is that intentional? |
|
The goal is to run through the flow to check that all.pins are annotated simulation works, etc. A demonstration and basic smoke test of the use case. I intended to check that default pin activations power and vcd power was different. If I get around to it, I would switch to generating .saif and using read_saif |
|
@jhkim-pii could you change the test to "I intended to check that default pin activations power and vcd power was different." rather than " distort a few of the activity factors " |
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
Unfortunately, I cannot edit the PR description above because the author is I updated the comment in |
|
I don't see a change from distortion to the intended approach. |
|
Oh, I misunderstood before. I reduced the duty and activity values by a factor or 10, and added read back checks for the annotated activity values. |
…k the annotated activity values Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
|
clang-tidy review says "All clean, LGTM! 👍" |
|
I mean if you don't read a vcd then sta will estimate activities and the corresponding power. That should be the first value. Then read the vcd and compute the power as the second value. Those should never match without any trickery. |
Yes, this was my plan with this test |
- Removed the tricky 10x activity scale down. - Added estimated power report before reading VCD. - Refactored for better readability. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
|
|
clang-tidy review says "All clean, LGTM! 👍" |
| @@ -57,6 +57,3 @@ for { set x 0 } { $x < $::env(ARRAY_COLS) } { incr x } { | |||
| check_log_for_warning log.txt | |||
| } | |||
| } | |||
|
|
|||
| set vcd_file $::env(VCD_STIMULI) | |||
| log_cmd read_vcd -scope TOP/MockArray $vcd_file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Removed the
read_vcdcommand. load_power.tclname does not look good. So renamed it, and the renaming caused more changes in other files.
Fixes #9062
Problem
Bazel //test/orfs/mock-array:MockArray_8x8_flat_cts_openroad_test suffers from intermittent failure.
Root-cause
1. Cause of intermittent failure
Non-determinism (ND) described and resolved in parallaxsw/OpenSTA#359
2. Inappropriate test case setup in
test/orfs/mock-array/power.tclTest case sequence
total_power_1)total_power_2)total_power_1 != total_power_2total_power_1 == total_power_2. Checker 1 is intended to catch such failure.abs(total_power_1 - total_power_2) < 1e-3So the test case expects a slight error b/w
total_power_1andtotal_power_2.But this is not a robust test because the two
total_powernumbers are basically computed from the same set of float numbers.The slight difference comes from the float-accumulation error because the float-accumulation sequences are different b/w VCD flow and user-activity flow.
Because of the ND-issue,
total_power_1andtotal_power_2are slightly different --> TEST PASStotal_power_1andtotal_power_2are exactly the same --> TEST FAILSolution
Once parallaxsw/OpenSTA#359 is merged, the intermittent failure will be gone.
But more robust test is to modify the test case in order to produce slightly different power numbers b/w VCD and user-activity flows.
If we intentionally distort a few of the activity factors (for the first three pins) in user-activity file, VCD and user-activity flows will use different sets of float numbers to accumulate and
total_power_1 != total_power_2will be satisfied always.This is more robust test and the test case will not suffer from the ND issue.