Get rid of some duplication in ICache virtual sequences

This commit is contained in:
Rupert Swarbrick 2020-05-15 15:06:23 +01:00 committed by Rupert Swarbrick
parent ab3ff7d57e
commit 30fff2da79
3 changed files with 37 additions and 46 deletions

View file

@ -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

View file

@ -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

View file

@ -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