Skip to content

[alert,dv] Make the base driver explicit that it's just for alerts#29505

Draft
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
rswarbrick:alert-base-driver
Draft

[alert,dv] Make the base driver explicit that it's just for alerts#29505
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
rswarbrick:alert-base-driver

Conversation

@rswarbrick
Copy link
Copy Markdown
Contributor

@rswarbrick rswarbrick commented Mar 19, 2026

This PR is in draft because it depends on #29504, which contains the first commit. Merge that first.

This was already the case (because the esc_*_driver subclasses didn't actually use the code in alert_esc_base_driver), but it was a little tricky to understand.

The two types of interface are pretty unrelated and the existing code
had some strange corners. Make things more explicit and change
esc_receiver_driver and esc_sender_driver to derive directly from
dv_base_driver instead of alert_esc_base_driver.

A little upsettingly, this took a bit of extra thought because it
turns out that the alert handler common vseq runs esc_receiver
sequences in a loop to respond to escalations. That's perfectly fine,
but *that* doesn't expect the driver to respond when a reset is
asserted. This seems a bit odd to me, so I've tweaked the vseq so that
it only starts the (one item) sequence when the agent is not in reset.

Doing *that* was also a bit tricky, because the agent's monitor
doesn't maintain its copy of dv_base_agent_cfg::in_reset. This is
being fixed properly in a separate PR, so I've just mirrored the
monitor's internal "under_reset" signal here.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
The task changes some signals and is called as a result of seeing a
reset. Pick a name that doesn't sound like it is causing a reset to
happen.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
This was already the case (because the esc_*_driver subclasses didn't
actually use the code in alert_esc_base_driver), but it was a little
tricky to understand.

Note that alert_base_driver is now an abstract class (because
drive_req needs implementing by the child classes).

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>

task alert_esc_base_driver::get_req();
task alert_base_driver::get_req();
@(posedge cfg.vif.rst_n);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here isn't it best to point at a in_reset internal signal?

join_none
endtask : get_and_drive
join
endtask
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: that follows one of our past discussion, I'd not remove the end of method labels as my preference would be to have it particularly when the rest of the class follows this


`uvm_component_utils(alert_esc_base_driver)
virtual class alert_base_driver extends dv_base_driver#(alert_esc_seq_item, alert_esc_agent_cfg);
alert_esc_seq_item r_alert_ping_send_q[$], r_alert_rsp_q[$],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know if we have a rule in our coding style, but I never declare multiple variables on the same line as it was forbidden in my previous company, and I think it's a good practice. The main reason was to avoid to change a signal type for one and which doesn't applies to the others (by negligence), diff are easier to track and we can add comments on the same line.

PS: I have checked and it's also part of Doulos guidelines -> look for "Have only one declaration or statement per line"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:DV DV issue: testbench, test case, etc. IP:alert_handler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants