[csrng, dv] Handle and track reset in csrng_monitor - #31064
Open
KinzaQamar wants to merge 1 commit into
Open
Conversation
KinzaQamar
requested review from
hcallahan-lowrisc and
rswarbrick
and removed request for
a team and
rswarbrick
August 19, 2026 22:28
KinzaQamar
force-pushed
the
csrnd_cmds_test
branch
from
August 19, 2026 22:31
378cd17 to
7c98e62
Compare
rswarbrick
reviewed
Aug 20, 2026
| end | ||
| endtask | ||
|
|
||
| local task monitor_reset(); |
Contributor
There was a problem hiding this comment.
I'd suggest combining monitor_reset and handle_reset: the rather silly handle_reset task was a silly mistake from me....
Why not make handle_reset into a function and call it at the same time as setting cfg.in_reset here?
Contributor
Author
There was a problem hiding this comment.
Just double_checking if I understand your suggestion properly:
local task monitor_and_handle_reset();
fork
forever begin
@(cfg.vif.rst_n);
cfg.in_reset = !cfg.vif.rst_n;
end
handle_reset();
join_none
endtask
task body()
fork
monitor_and_handle_reset()
...
join_none
endtask
Contributor
There was a problem hiding this comment.
That approach looks sensible to me, thanks @KinzaQamar
|
|
||
| local task monitor_reset(); | ||
| forever begin | ||
| @(cfg.vif.rst_n); |
Contributor
There was a problem hiding this comment.
This is clever! I was about to leave a note saying that it wouldn't work... but I was wrong! Much simpler than what I'd suggest :-)
csrng_cmds tests were failing because the fork...join_any block in collect_valid_trans() contains two threads; one of which exits when the command receives an ack or a reset occurs. If reset occurs before all requested genbits blocks are collected by the monitor, the monitor still writes to the analysis port, causing the scoreboard comparison to fail on predicted vs. actual genbit blocks that don't exist. Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar
force-pushed
the
csrnd_cmds_test
branch
from
August 21, 2026 11:35
7c98e62 to
759cf79
Compare
hcallahan-lowrisc
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
csrng_cmds tests were failing because the fork...join_any block in collect_valid_trans() contains two threads; one of which exits when the command receives an ack or a reset occurs. If reset occurs before all requested genbits blocks are collected by the monitor, the monitor still writes to the analysis port, causing the scoreboard comparison to fail on predicted vs. actual genbit blocks that don't exist.