mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-22 21:07:34 -04:00
[dv] Add missing isolation forks
This commit is contained in:
parent
120607f4f2
commit
455dbe30f1
7 changed files with 106 additions and 90 deletions
|
@ -30,13 +30,15 @@ class ibex_mem_intf_monitor extends uvm_monitor;
|
|||
virtual task run_phase(uvm_phase phase);
|
||||
wait (vif.monitor_cb.reset === 1'b0);
|
||||
forever begin
|
||||
fork : check_mem_intf
|
||||
collect_address_phase();
|
||||
collect_response_phase();
|
||||
wait (vif.monitor_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach this point when mid-test reset is asserted
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork : check_mem_intf
|
||||
collect_address_phase();
|
||||
collect_response_phase();
|
||||
wait (vif.monitor_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach this point when mid-test reset is asserted
|
||||
disable fork;
|
||||
end join
|
||||
handle_reset();
|
||||
end
|
||||
endtask : run_phase
|
||||
|
|
|
@ -24,13 +24,15 @@ class ibex_mem_intf_response_driver extends uvm_driver #(ibex_mem_intf_seq_item)
|
|||
reset_signals();
|
||||
wait (cfg.vif.response_driver_cb.reset === 1'b0);
|
||||
forever begin
|
||||
fork : drive_stimulus
|
||||
send_grant();
|
||||
get_and_drive();
|
||||
wait (cfg.vif.response_driver_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only be reached after mid-test reset
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork : drive_stimulus
|
||||
send_grant();
|
||||
get_and_drive();
|
||||
wait (cfg.vif.response_driver_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only be reached after mid-test reset
|
||||
disable fork;
|
||||
end join
|
||||
handle_reset();
|
||||
end
|
||||
endtask : run_phase
|
||||
|
|
|
@ -24,12 +24,14 @@ class irq_monitor extends uvm_monitor;
|
|||
virtual task run_phase(uvm_phase phase);
|
||||
forever begin
|
||||
wait (vif.monitor_cb.reset === 1'b0);
|
||||
fork : monitor_irq
|
||||
collect_irq();
|
||||
wait (vif.monitor_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach here on mid-test reset
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork : monitor_irq
|
||||
collect_irq();
|
||||
wait (vif.monitor_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach here on mid-test reset
|
||||
disable fork;
|
||||
end join
|
||||
end
|
||||
endtask : run_phase
|
||||
|
||||
|
|
|
@ -20,15 +20,17 @@ class irq_request_driver extends uvm_driver #(irq_seq_item);
|
|||
reset_signals();
|
||||
wait (vif.driver_cb.reset === 1'b0);
|
||||
forever begin
|
||||
fork : drive_irq
|
||||
// Setup a single get_REQ -> drive -> send_RSP long-running task.
|
||||
// This seq_item contains all signals on the interface at once.
|
||||
get_and_drive();
|
||||
wait (vif.driver_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach here on mid-test reset
|
||||
disable fork;
|
||||
handle_reset();
|
||||
fork begin : isolation_fork
|
||||
fork : drive_irq
|
||||
// Setup a single get_REQ -> drive -> send_RSP long-running task.
|
||||
// This seq_item contains all signals on the interface at once.
|
||||
get_and_drive();
|
||||
wait (vif.driver_cb.reset === 1'b1);
|
||||
join_any
|
||||
// Will only reach here on mid-test reset
|
||||
disable fork;
|
||||
handle_reset();
|
||||
end join
|
||||
end
|
||||
endtask : run_phase
|
||||
|
||||
|
|
36
dv/uvm/core_ibex/env/core_ibex_scoreboard.sv
vendored
36
dv/uvm/core_ibex/env/core_ibex_scoreboard.sv
vendored
|
@ -89,23 +89,25 @@ class core_ibex_scoreboard extends uvm_scoreboard;
|
|||
|
||||
// Helper method which returns if either of the counter thresholds are reached.
|
||||
virtual task dfd_wait_for_pass_events();
|
||||
fork
|
||||
begin
|
||||
fault_threshold_total_reached.wait_trigger();
|
||||
`uvm_info(`gfn,
|
||||
$sformatf({"double_fault detector : reached threshold [%0d] ",
|
||||
"for total double faults seen."}, cfg.double_fault_threshold_total),
|
||||
UVM_LOW)
|
||||
end
|
||||
begin
|
||||
fault_threshold_consecutive_reached.wait_trigger();
|
||||
`uvm_info(`gfn,
|
||||
$sformatf({"double_fault detector : reached threshold [%0d] ",
|
||||
"for consecutive double faults seen."}, cfg.double_fault_threshold_consecutive),
|
||||
UVM_LOW)
|
||||
end
|
||||
join_any
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork
|
||||
begin
|
||||
fault_threshold_total_reached.wait_trigger();
|
||||
`uvm_info(`gfn,
|
||||
$sformatf({"double_fault detector : reached threshold [%0d] ",
|
||||
"for total double faults seen."}, cfg.double_fault_threshold_total),
|
||||
UVM_LOW)
|
||||
end
|
||||
begin
|
||||
fault_threshold_consecutive_reached.wait_trigger();
|
||||
`uvm_info(`gfn,
|
||||
$sformatf({"double_fault detector : reached threshold [%0d] ",
|
||||
"for consecutive double faults seen."}, cfg.double_fault_threshold_consecutive),
|
||||
UVM_LOW)
|
||||
end
|
||||
join_any
|
||||
disable fork;
|
||||
end join
|
||||
endtask
|
||||
|
||||
endclass
|
||||
|
|
|
@ -400,21 +400,23 @@ class core_ibex_base_test extends uvm_test;
|
|||
virtual task check_next_core_status(core_status_t core_status, string error_msg = "",
|
||||
int timeout = 9999999);
|
||||
cur_run_phase.raise_objection(this);
|
||||
fork
|
||||
begin
|
||||
wait_for_mem_txn(cfg.signature_addr, CORE_STATUS);
|
||||
signature_data = signature_data_q.pop_front();
|
||||
`DV_CHECK_EQ_FATAL(signature_data, core_status, error_msg);
|
||||
end
|
||||
begin : wait_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn,
|
||||
$sformatf("Did not receive core_status %0s within %0d cycle timeout period",
|
||||
core_status.name(), timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if we successfully beat the timeout period
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork
|
||||
begin
|
||||
wait_for_mem_txn(cfg.signature_addr, CORE_STATUS);
|
||||
signature_data = signature_data_q.pop_front();
|
||||
`DV_CHECK_EQ_FATAL(signature_data, core_status, error_msg);
|
||||
end
|
||||
begin : wait_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn,
|
||||
$sformatf("Did not receive core_status %0s within %0d cycle timeout period",
|
||||
core_status.name(), timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if we successfully beat the timeout period
|
||||
disable fork;
|
||||
end join
|
||||
cur_run_phase.drop_objection(this);
|
||||
endtask
|
||||
|
||||
|
@ -422,23 +424,25 @@ class core_ibex_base_test extends uvm_test;
|
|||
virtual task wait_for_csr_write(csr_num_e csr, int timeout = 9999999);
|
||||
bit [11:0] csr_addr;
|
||||
cur_run_phase.raise_objection(this);
|
||||
fork
|
||||
begin
|
||||
do begin
|
||||
wait_for_mem_txn(cfg.signature_addr, WRITE_CSR);
|
||||
csr_addr = signature_data_q.pop_front();
|
||||
signature_data = signature_data_q.pop_front();
|
||||
end while (csr_addr != csr);
|
||||
end
|
||||
begin : wait_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn,
|
||||
$sformatf("Did not receive write to csr 0x%0x within %0d cycle timeout period",
|
||||
csr, timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if we successfully beat the timeout period
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork
|
||||
begin
|
||||
do begin
|
||||
wait_for_mem_txn(cfg.signature_addr, WRITE_CSR);
|
||||
csr_addr = signature_data_q.pop_front();
|
||||
signature_data = signature_data_q.pop_front();
|
||||
end while (csr_addr != csr);
|
||||
end
|
||||
begin : wait_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn,
|
||||
$sformatf("Did not receive write to csr 0x%0x within %0d cycle timeout period",
|
||||
csr, timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if we successfully beat the timeout period
|
||||
disable fork;
|
||||
end join
|
||||
cur_run_phase.drop_objection(this);
|
||||
endtask
|
||||
|
||||
|
|
|
@ -438,18 +438,20 @@ class core_ibex_debug_intr_basic_test extends core_ibex_base_test;
|
|||
// Task that waits for xRET to be asserted within a certain number of cycles
|
||||
virtual task wait_ret(string ret, int timeout);
|
||||
cur_run_phase.raise_objection(this);
|
||||
fork
|
||||
begin
|
||||
wait_ret_raw(ret);
|
||||
end
|
||||
begin : ret_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn, $sformatf({"No %0s detected, or incorrect privilege mode switch in ",
|
||||
"timeout period of %0d cycles"}, ret, timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if dret successfully detected within timeout period
|
||||
disable fork;
|
||||
fork begin : isolation_fork
|
||||
fork
|
||||
begin
|
||||
wait_ret_raw(ret);
|
||||
end
|
||||
begin : ret_timeout
|
||||
clk_vif.wait_clks(timeout);
|
||||
`uvm_fatal(`gfn, $sformatf({"No %0s detected, or incorrect privilege mode switch in ",
|
||||
"timeout period of %0d cycles"}, ret, timeout))
|
||||
end
|
||||
join_any
|
||||
// Will only get here if dret successfully detected within timeout period
|
||||
disable fork;
|
||||
end join
|
||||
cur_run_phase.drop_objection(this);
|
||||
endtask
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue