|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



PACKET GENERATOR




Use a class to build packet generator. Make an instance of this class. Packet generator generator generates packets and sends to driver using gen2drv channel. gen2drv is used to connect the packet generator and driver. Packet generator generates the packet and randomizes the packet. Then the packet is put into gen2drv channel. Always check whether the randomization is sucessful and display a message.



CODE: gen.sv
class generator extends avm_verification_component;

// define tml interface for communication
tlm_blocking_put_if#(packet) put_port;

task run;

packet pkt;

for(int i = 0; i < 10; i++)
begin
pkt = new();

if(!pkt.randomize())
avm_report_error("genarator"," randomiation failed\n");
else
avm_report_message("generator"," randomization done\n");
put_port.put(pkt);
end
endtask

endclass

Index
Avm Introduction
Dut Specification
Rtl
Top
Interface
Environment
Packet
Packet Generator
Configuration
Driver
Reciever
Scoreboard

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright 2007-2017 :: all rights reserved www.testbench.in::Disclaimer