Advertisement
Sidsh

sequence.sv

Oct 29th, 2022 (edited)
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class our_sequence extends uvm_sequence;
  2.     `uvm_component_utils(our_sequence)
  3.     our_packet pkt;         //instantiated the packet class
  4.  
  5. function new(string name="our_sequence");
  6.     super.new(name);
  7. endfunction
  8.  
  9. task body();
  10.     pkt = our_packet :: type_id ::create ("our_packet");    //created memory, i.e. object for packet
  11.  
  12.     repeat(10)
  13.     begin
  14.         start_item(pkt);        //to start generating stimulus from tha sequence(packet) class pkt
  15.         pkt.randomize();        //will assign random values to variables having rand keyword
  16.         finish_itrm(pkt);       //to stop generating the stimulus
  17.     end
  18.  
  19. endtask
  20.  
  21. endclass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement