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


Tutorials



SCOREBOARD




The expected packets are stored in scored board by driver.
When ever the receiver sends a actual packet on to score board, the score board gets the expected packet out from the storage, where the driver has stored expected packets, using the packet id.
Then both expected packet and actual packet re compared. If any mismatch ,then the test failed is reported.


CODE: scoreboard.vr


class scoreboard{
//Declare a queue of packet to store the expected packets
packet exp_pkt[$];

task add_exp_packet(packet packet_in){
exp_pkt.push_back(packet_in);
}

task checkpacket(packet packet_out){
integer i;
packet packet_sent;
packet_sent=exp_pkt.pop_front();
if (packet_sent.da==packet_out.da && packet_sent.sa==packet_out.sa && packet_sent.len==packet_out.len && packet_sent.parity==packet_out.parity){
integer i;
printf("[SCOREBOARD]Data sent = recived DA %h : %h :: SA %h : %h :: len %h :%h parity %h :%h\n ",packet_sent.da,packet_out.da,packet_sent.sa,packet_out.sa,packet_sent.len,packet_out.len, packet_sent.parity,packet_out.parity);
for (i=0;i<packet_sent.len -1 ;i++)
{
if(packet_sent.data[i]!=packet_out.data[i])
{
printf("[SCOREBOARD]ERROR data missmatch sent byte %h recived byte %h\n",packet_sent.data[i],packet_out.data[i]);
trigger(err) ;
}
else
printf("[SCOREBOARD] sent byte %h recived byte %h\n",packet_sent.data[i],packet_out.data[i]);

}
}
else
{
printf("[SCOREBOARD][ERROR]Data mismatch sent != recived DA %h : %h :: SA %h : %h :: len %h :%h parity %h :%h \n",packet_sent.da,packet_out.da,packet_sent.sa,packet_out.sa,packet_sent.len,packet_out.len, packet_sent.parity,packet_out.parity);

trigger(err);
}

}

}

Index
Dut Specification
Rtl
Top
Interface
Packet
Packet Generator
Cfg Driver
Driver
Reciever
Scoreboard
Env

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