[alert,dv] Make the base driver explicit that it's just for alerts#29505
[alert,dv] Make the base driver explicit that it's just for alerts#29505rswarbrick wants to merge 3 commits intolowRISC:masterfrom
Conversation
28205f9 to
a9308a9
Compare
ab39ead to
02226d1
Compare
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>
02226d1 to
2c90c7b
Compare
|
|
||
| task alert_esc_base_driver::get_req(); | ||
| task alert_base_driver::get_req(); | ||
| @(posedge cfg.vif.rst_n); |
There was a problem hiding this comment.
Here isn't it best to point at a in_reset internal signal?
| join_none | ||
| endtask : get_and_drive | ||
| join | ||
| endtask |
There was a problem hiding this comment.
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[$], |
There was a problem hiding this comment.
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"
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_*_driversubclasses didn't actually use the code inalert_esc_base_driver), but it was a little tricky to understand.