User guide

Table Of Contents
Appendix A: Avalon-ST Video Verification IP Suite A–21
Constrained Random Test
January 2013 Altera Corporation Video and Image Processing Suite
User Guide
Example A–6 shows the codes for the scoreboards.
Example A–6. Scoreboard
c_av_st_video_item ref_pkt;
c_av_st_video_item dut_pkt;
initial
begin
forever
begin
@event_constrained_random_generation
begin
// Get the reference item from the scoreboard mailbox :
m_video_items_for_scoreboard.get(ref_pkt);
// If the reference item is a video packet, then check
// for the control & video packet response :
if (ref_pkt.get_packet_type() == video_packet)
begin
m_video_items_for_sink_bfm.get(dut_pkt);
if (dut_pkt.get_packet_type() != control_packet)
$fatal(1,"SCOREBOARD ERROR”);
m_video_items_for_sink_bfm.get(dut_pkt);
if (dut_pkt.get_packet_type() != video_packet)
$fatal(1, "SCOREBOARD ERROR”);
// A video packet has been received, as expected.
// Now compare the video data itself :
dut_video_pkt = c_av_st_video_data'(dut_pkt);
if (dut_video_pkt.compare (to_grey(c_av_st_video_data'(ref_pkt))))
$display("%t Scoreboard match”);
else
$fatal(1, "SCOREBOARD ERROR : Incorrect video packet.\n");
end
-> event_dut_output_analyzed;
end
end
end
initial
#1000000 $finish;