diff --git a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_base_vseq.sv b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_base_vseq.sv index 3d6b30fd..e6c52888 100644 --- a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_base_vseq.sv +++ b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_base_vseq.sv @@ -11,10 +11,38 @@ class ibex_icache_base_vseq `uvm_object_utils(ibex_icache_base_vseq) `uvm_object_new + // The two actual sequences. We don't subclass them in subclasses of this virtual sequence, but we + // might want to set control knobs. To allow this, we construct the sequences in pre_start. + // Subclasses should override pre_start, call this super to construct the sequence, and then set + // any control knobs they need. + ibex_icache_core_base_seq core_seq; + ibex_icache_mem_resp_seq mem_seq; + virtual task dut_init(string reset_kind = "HARD"); super.dut_init(); endtask + virtual task pre_start(); + super.pre_start(); + `uvm_create_on(core_seq, p_sequencer.core_sequencer_h) + `uvm_create_on(mem_seq, p_sequencer.mem_sequencer_h) + endtask : pre_start + + virtual task body(); + // Start the core and memory sequences. We use fork/join_any so that we don't wait for the + // memory sequence (which is reactive so will never finish). + fork + begin + `DV_CHECK_RANDOMIZE_FATAL(core_seq) + core_seq.start(p_sequencer.core_sequencer_h); + end + begin + `DV_CHECK_RANDOMIZE_FATAL(mem_seq) + mem_seq.start(p_sequencer.mem_sequencer_h); + end + join_any + endtask : body + virtual task dut_shutdown(); // check for pending ibex_icache operations and wait for them to complete // TODO diff --git a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_passthru_vseq.sv b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_passthru_vseq.sv index 11d75d03..1e29bf3f 100644 --- a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_passthru_vseq.sv +++ b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_passthru_vseq.sv @@ -7,33 +7,16 @@ class ibex_icache_passthru_vseq extends ibex_icache_base_vseq; `uvm_object_utils(ibex_icache_passthru_vseq) `uvm_object_new - ibex_icache_core_base_seq core_seq; - ibex_icache_mem_resp_seq mem_seq; + virtual task pre_start(); + super.pre_start(); - task body(); - // Start the core and memory sequences. We use fork/join_any so that we don't wait for the - // memory sequence (which is reactive so will never finish). - fork - begin - `uvm_create_on(core_seq, p_sequencer.core_sequencer_h) + // Constrain branch targets and leave the cache disabled. + core_seq.constrain_branches = 1'b1; + core_seq.force_disable = 1'b1; - // Constrain branch targets and leave the cache disabled. - core_seq.constrain_branches = 1'b1; - core_seq.force_disable = 1'b1; + // Increase the frequency of seed updates + mem_seq.gap_between_seeds = 49; - `DV_CHECK_RANDOMIZE_FATAL(core_seq) - core_seq.start(p_sequencer.core_sequencer_h); - end - begin - `uvm_create_on(mem_seq, p_sequencer.mem_sequencer_h) - - // Increase the frequency of seed updates - mem_seq.gap_between_seeds = 49; - - `DV_CHECK_RANDOMIZE_FATAL(mem_seq) - mem_seq.start(p_sequencer.mem_sequencer_h); - end - join_any - endtask : body + endtask : pre_start endclass : ibex_icache_passthru_vseq diff --git a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv index 85209e07..8e8a07ef 100644 --- a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv +++ b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv @@ -9,26 +9,6 @@ class ibex_icache_sanity_vseq extends ibex_icache_base_vseq; `uvm_object_utils(ibex_icache_sanity_vseq) `uvm_object_new - // An un-specialized base sequence for the core agent and a basic slave sequence for the memory - // agent - ibex_icache_core_base_seq core_seq; - ibex_icache_mem_resp_seq mem_seq; - - task body(); - // Start the core and memory sequences. We use fork/join_any so that we don't wait for the - // memory sequence (which is reactive so will never finish). - fork - begin - `uvm_create_on(core_seq, p_sequencer.core_sequencer_h) - `DV_CHECK_RANDOMIZE_FATAL(core_seq) - core_seq.start(p_sequencer.core_sequencer_h); - end - begin - `uvm_create_on(mem_seq, p_sequencer.mem_sequencer_h) - `DV_CHECK_RANDOMIZE_FATAL(mem_seq) - mem_seq.start(p_sequencer.mem_sequencer_h); - end - join_any - endtask : body + // No customisation of base class needed endclass : ibex_icache_sanity_vseq