Code Browser Pages:
Files in
uvm_tlm_1.tar



consumer.sv
env.sv
Makefile
Current file: producer.sv
README.txt
sequence_item.sv



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

  class producer extends uvm_component;

    uvm_blocking_put_port#(instruction) put_port;

    function new(string name, uvm_component p = null);
      super.new(name,p);
      put_port = new("put_port", this);
    endfunction

    task run;
      for(int i = 0; i < 10; i++)
        begin
          instruction ints;
          #10;
          ints = new();
          if(ints.randomize()) begin
          `uvm_info("producer", $sformatf("sending   ",ints.inst.name()), UVM_MEDIUM)
          put_port.put(ints);
          end
        end
    endtask

  endclass : producer