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


Tutorials



SCOREBOARD




When the packet comes from reciever, the scoreboard gets the expected packet from drv2sb channel and compare them.



CODE:scoreboard.sv
`ifndef SB_CLASS
`define SB_CLASS

class scoreboard extends avm_verification_component;

packet exp_pkt,drv_pkt;
packet exp_que[$];
packet rcv_pkt;

integer no_drv_pkt;
integer no_rcv_pkt;
string msg;
tlm_blocking_get_if#(packet) drv_port;
tlm_blocking_get_if#(packet) rcv_port;

function new( );
super.new("Scoreboard");

no_drv_pkt = 0;
no_rcv_pkt = 0;

avm_report_message("sb","Scoreboard created");
endfunction


task run();

avm_report_message("sb"," STARTED main task ");
fork
forever
begin
drv_port.get(drv_pkt);
this.no_drv_pkt++;
$swrite(msg,"Recieved packet no from driver %d size of queue%d\n",no_rcv_pkt,exp_que.size());
avm_report_message("sb",msg);
exp_que.push_front(drv_pkt);


end
join_none
forever
begin
rcv_port.get(rcv_pkt);
this.no_rcv_pkt++;
exp_pkt = exp_que.pop_back();

$swrite(msg,"Recieved packet no %d\n",no_rcv_pkt);
avm_report_message("sb",msg);
if(rcv_pkt.comp(rcv_pkt,exp_pkt))
avm_report_message("sb"," Packet matched ");
else
avm_report_error("sb"," Packet mismatch ");

end
endtask

endclass


`endif













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