Video file reader test – Altera Video and Image Processing Suite User Manual

Page 278

Advertising
background image

To generate the

.avi

file, open a DOS command prompt from a Windows machine and run the

following convertor utility:

C:>raw2avi.exe vip_car_out.raw video.avi

You can view the

video.avi

file with a media player. The media player shows a grayscale version of the

source video file (

vip_car_0.avi

) that you can also play to see the full color video. You can view the full

sequence from which the clip is taken in the

vip_car.avi

file.

Video File Reader Test

The video file reader test is the simplest way of using the class library.
The video file reader test reads and translates the video file into

video_item

objects, streams to the DUT

using the BFM, and then retranslates video file back to video, and writes to the file again.
The test environment itself is set up through the

tb_test.v

file (found in the

example_video_files

directory),

which instantiates the Qsys generated netlist, creates the necessary classes, and sets the test running.
The test has four main features of code.

tb_test.sv

—first section of the code.

`timescale 1ns / 1ns

module tb_test;

`define CHANNELS_PER_PIXEL 3
`define BITS_PER_CHANNEL 8

import av_st_video_classes::*;
import av_st_video_file_io_class::*;

// Create clock and reset:
logic clk, reset;

initial
clk <= 1'b0;

always
#2.5 clk <= ~clk; //200 MHz

initial
begin
reset <= 1'b1;
#10 @(posedge clk) reset <= 1'b0;
end

// Instantiate "netlist" :
`define NETLIST netlist
tb `NETLIST (.reset(reset),.clk(clk));

// Create some useful objects from our defined classes :
c_av_st_video_data #(`BITS_PER_CHANNEL, `CHANNELS_PER_PIXEL)
video_data_pkt1;
c_av_st_video_control #(`BITS_PER_CHANNEL, `CHANNELS_PER_PIXEL)
video_control_pkt1;
c_av_st_video_user_packet #(`BITS_PER_CHANNEL, `CHANNELS_PER_PIXEL)
user_pkt1;

A-10

Video File Reader Test

UG-VIPSUITE

2015.05.04

Altera Corporation

Avalon-ST Video Verification IP Suite

Send Feedback

Advertising