Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class ibex_icache_core_agent_cfg extends dv_base_agent_cfg;
// interface handle used by driver, monitor & the sequencer, via cfg handle
virtual ibex_icache_core_if vif;

// Triggered before a reset. The driver stops the item it is driving and clears the control
// signals.
event stop_driving;

`uvm_object_utils_begin(ibex_icache_core_agent_cfg)
`uvm_object_utils_end

Expand Down
26 changes: 21 additions & 5 deletions dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_driver.sv
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class ibex_icache_core_driver

virtual task automatic reset_signals();
cfg.vif.reset();

// Clear the signals on every stop, including one between items
forever begin
@(cfg.stop_driving);
cfg.vif.reset();
end
endtask

// drive trans received from sequencer
Expand All @@ -36,11 +42,21 @@ class ibex_icache_core_driver

rsp.saw_error = 1'b0;

case (req.trans_type)
ICacheCoreTransTypeBranch: drive_branch_trans(rsp, req);
ICacheCoreTransTypeReq: drive_req_trans(rsp, req);
default: `uvm_fatal(`gfn, "Unknown transaction type")
endcase
// Killing a sequence does not stop the item being driven, which could then raise req just
// before reset. Run the item until it ends or a stop arrives.
fork begin : isolation_fork
fork
case (req.trans_type)
ICacheCoreTransTypeBranch: drive_branch_trans(rsp, req);
ICacheCoreTransTypeReq: drive_req_trans(rsp, req);
default: `uvm_fatal(`gfn, "Unknown transaction type")
endcase
@(cfg.stop_driving);
join_any
disable fork;
end join
// The item may have driven the signals after a stop in this time step, so clear them again
if (cfg.stop_driving.triggered) cfg.vif.reset();

`uvm_info(`gfn, "item sent", UVM_HIGH)
seq_item_port.item_done(rsp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ class ibex_icache_core_base_seq extends dv_base_seq #(

// Called from the environment when resetting the DUT. Should ensure that the req_i signal is
// dropped (to avoid any memory requests making it out of the DUT when it should be in reset)
//
// This must not be called while we're in body (otherwise we'd have multiple drivers for req_i).
task reset_ifs();
cfg.vif.driver_cb.req <= 1'b0;
-> cfg.stop_driving;
endtask

endclass
Loading