Code Browser Pages:
Files in
uvm_sequence_12.tar



driver.sv
Makefile
README.txt
sequence_item.sv
sequencer.sv
Current file: sequence.sv
testcase.sv



////////////////////////////////////////////////
////s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~s////
////s           www.testbench.in           s////
////s                                      s////
////s             UVM Tutorial             s////
////s           gopi@testbenh.in           s////
////s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~s////
////////////////////////////////////////////////

class seq_a extends uvm_sequence #(instruction);

  instruction req;

  function new(string name="seq_a");
    super.new(name);
  endfunction

  `uvm_sequence_utils(seq_a, instruction_sequencer)

  virtual task body();
      repeat(4) begin
         `uvm_do_with(req, { inst == PUSH_A; });
      end
  endtask

endclass

class seq_b extends uvm_sequence #(instruction);

  instruction req;

  function new(string name="seq_b");
    super.new(name);
  endfunction

  `uvm_sequence_utils(seq_b, instruction_sequencer)

  virtual task body();
      #25;
      grab();
      repeat(4) begin
         `uvm_do_with(req, { inst == PUSH_B; });
      end
      ungrab();
  endtask

endclass

class seq_c extends uvm_sequence #(instruction);

  instruction req;

  function new(string name="seq_c");
    super.new(name);
  endfunction

  `uvm_sequence_utils(seq_c, instruction_sequencer)

  virtual task body();
      repeat(4) begin
         `uvm_do_with(req, { inst == POP_C; });
      end
  endtask

endclass

class parallel_sequence extends uvm_sequence #(instruction);

  seq_a s_a;
  seq_b s_b;
  seq_c s_c;

  function new(string name="parallel_sequence");
    super.new(name);
  endfunction

  `uvm_sequence_utils(parallel_sequence, instruction_sequencer)

  virtual task body();
      fork
         `uvm_do(s_a)
         `uvm_do(s_b)
         `uvm_do(s_c)
      join
  endtask

endclass