Example test environment – Altera Video and Image Processing Suite User Manual
Page 281

do
begin
video_file_writer.wait_for_and_write_video_packet_to_file();
end
while ( video_file_writer.get_video_packets_handled() < fields_read );
video_file_writer.close_file();
$finish;
end
The final section of the code is a three parallel blocks. The first and second blocks call the start methods
for the source and sink video BFMs. After started, the source waits for an entry into its mailbox to appear,
and the sink waits for a transaction from the Avalon-ST sink BFM to appear. The third block constructs
the file reader object, which is connected to the video source BFM’s mailbox by its constructor. Then,
method calls are made to name the reader, open a video file, read the file, and close the file. After the file
has been read and closed, a final method call returns the number of fields read.
The use of mailboxes allows you to set up events without concern as to whether a particular source or sink
is ready. This allows you to issue all the commands to the file reader before constructing the file writer.
The writer is constructed, named, and an output file specified.
wait_for_and_write_video_packets_to_file
method is then called. This method call handles one
video packet at a time. Therefore, this method is called once for every field of video that the reader reads.
After every field has been read, the output file is closed and the test finishes.
Example Test Environment
The Avalon-ST Video Verification IP Suite offers two types of example test environment: video file reader
test and constrained random test.
The video file reader test is useful for checking the video functionality of the DUT for any video types.
However, this test is not suitable to test the DUT with a variety of differently-sized and formatted video
fields. Altera recommends a constrained random approach that is easily accomplished using the class
library.
UG-VIPSUITE
2015.05.04
Example Test Environment
A-13
Avalon-ST Video Verification IP Suite
Altera Corporation