diff --git a/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_monitor.sv b/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_monitor.sv index 5c804c42..e8c48f8f 100644 --- a/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_monitor.sv +++ b/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_monitor.sv @@ -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 diff --git a/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_response_driver.sv b/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_response_driver.sv index 4f6ac069..0a349a5c 100644 --- a/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_response_driver.sv +++ b/dv/uvm/core_ibex/common/ibex_mem_intf_agent/ibex_mem_intf_response_driver.sv @@ -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 diff --git a/dv/uvm/core_ibex/common/irq_agent/irq_monitor.sv b/dv/uvm/core_ibex/common/irq_agent/irq_monitor.sv index b94c5d16..b56cbbc1 100644 --- a/dv/uvm/core_ibex/common/irq_agent/irq_monitor.sv +++ b/dv/uvm/core_ibex/common/irq_agent/irq_monitor.sv @@ -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 diff --git a/dv/uvm/core_ibex/common/irq_agent/irq_request_driver.sv b/dv/uvm/core_ibex/common/irq_agent/irq_request_driver.sv index 7e138062..8c729212 100644 --- a/dv/uvm/core_ibex/common/irq_agent/irq_request_driver.sv +++ b/dv/uvm/core_ibex/common/irq_agent/irq_request_driver.sv @@ -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 diff --git a/dv/uvm/core_ibex/env/core_ibex_scoreboard.sv b/dv/uvm/core_ibex/env/core_ibex_scoreboard.sv index 8eb3fa11..ff004efd 100644 --- a/dv/uvm/core_ibex/env/core_ibex_scoreboard.sv +++ b/dv/uvm/core_ibex/env/core_ibex_scoreboard.sv @@ -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 diff --git a/dv/uvm/core_ibex/tests/core_ibex_base_test.sv b/dv/uvm/core_ibex/tests/core_ibex_base_test.sv index 71f5ab93..3d24ff46 100644 --- a/dv/uvm/core_ibex/tests/core_ibex_base_test.sv +++ b/dv/uvm/core_ibex/tests/core_ibex_base_test.sv @@ -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 diff --git a/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv b/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv index 2610c553..3b39a98c 100644 --- a/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv +++ b/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv @@ -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