Code Browser Pages:
Files in
uvm_sequence_8.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_mul extends uvm_sequence #(instruction);

  instruction req;

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

  `uvm_sequence_utils(seq_mul, instruction_sequencer)

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

endclass


class seq_add extends uvm_sequence #(instruction);

  instruction req;

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

  `uvm_sequence_utils(seq_add, instruction_sequencer)

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

endclass


class seq_sub extends uvm_sequence #(instruction);

  instruction req;

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

  `uvm_sequence_utils(seq_sub, instruction_sequencer)

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

endclass

class parallel_sequence extends uvm_sequence #(instruction);

  seq_add add;
  seq_sub sub;
  seq_mul mul;

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

  `uvm_sequence_utils(parallel_sequence, instruction_sequencer)

  virtual task body();
      m_sequencer.set_arbitration(SEQ_ARB_WEIGHTED);
      add = new("add");
      sub = new("sub");
      mul = new("mul");
      fork
         sub.start(m_sequencer,this,400);
         add.start(m_sequencer,this,300);
         mul.start(m_sequencer,this,200);
      join
  endtask

endclass