Sending the same sequence Consecutively

Hello,

I have created my own example based off of the OVM2.0 Xbus example, and i am having trouble finding out how to send the same sequence multiple times. I would believe the best way to do this would to create a for loop in my test library, but i cannot seem to find out how to do that, since the set_config_string parameter does not seem to have any indicators of how many times that sequence should be sent. So how can i declare to send this same sequence (SPI_DAS_set_mux_read_sample_seq) multiple times?

class test_read_modify_write1 extends SPI_demo_base_test;
`ovm_component_utils(test_read_modify_write1)
function new(string name = “test_read_modify_write1”, ovm_component parent=null);
super.new(name,parent);
endfunction : new
virtual function void build();
set_config_string(“SPI_demo_tb0.DAS0.DAS_spi_agent.sequencer”,
“default_sequence”, “SPI_DAS_set_mux_read_sample_seq”);
super.build();
endfunction : build
endclass : test_read_modify_write1

Thanks,
Luke

Hi Luke:

The default sequence is only started once - which I think is the issue you are running into. I’m not sure if you mean to start the sequence in serial or parallel.

There are several ways you could make that sequence run multiple times - assuming that you can’t just put a loop in the sequence itself.

One way is to do it procedurally:

In the appropriate place (that depends entirely on your environment, but possibly in the same place where you set the default sequence) in the run task, you can start the sequence yourself in a couple of ways:

Run a sequence multiple times serially:

for (int i = 0; … ) begin
SPI_DAS_set_mux_read_sample_seq.start(
SPI_demo_tb0.DAS0.DAS_spi_agent.sequencer);
end

To run the sequence multiple times in parallel, you’ll need an array of
sequences, and you can do something like this:

for (int i = 0; … ) begin
fork
SPI_DAS_set_mux_read_sample_seq[i].start(
SPI_demo_tb0.DAS0.DAS_spi_agent.sequencer);
join_none
#0;
end

Another way to do it using the sequencer built-in sequences:

If you only have this one sequence registered in the sequence, then you can use the built-in exhaustive or random sequence:

  1. Remove the simple_sequence from the registered sequences, since you don’t want that to run

  2. Change the count variable in the sequencer (using set_config_int), to be the number of times you want the sequence to run. Note that this will make the sequence run times serially.

-Andy