User guide
Table Of Contents
- Contents
- 1. About This MegaCore Function Suite
- Release Information
- Device Family Support
- Features
- Design Example
- Performance and Resource Utilization
- 2D FIR Filter
- 2D Median Filter
- Alpha Blending Mixer
- Avalon-ST Video Monitor
- Chroma Resampler
- Clipper
- Clocked Video Input
- Clocked Video Output
- Color Plane Sequencer
- Color Space Converter
- Control Synchronizer
- Deinterlacer
- Deinterlacer II
- Frame Buffer
- Gamma Corrector
- Interlacer
- Scaler
- Scaler II
- Switch
- Test Pattern Generator
- Trace System
- 2. Getting Started with Altera IP Cores
- 3. Interfaces
- Interface Types
- Avalon-ST Video Protocol
- Avalon-MM Slave Interfaces
- Avalon-MM Master Interfaces
- Buffering of Non-Image Data Packets in Memory
- 4. 2D FIR Filter MegaCore Function
- 5. 2D Median Filter MegaCore Function
- 6. Alpha Blending MegaCore Function
- 7. Avalon-ST Video Monitor MegaCore Function
- 8. Chroma Resampler MegaCore Function
- 9. Clipper MegaCore Function
- 10. Clocked Video Input MegaCore Function
- 11. Clocked Video Output MegaCore Function
- 12. Color Plane Sequencer MegaCore Function
- 13. Color Space Converter MegaCore Function
- 14. Control Synchronizer MegaCore Function
- 15. Deinterlacer MegaCore Function
- Core Overview
- Functional Description
- Parameter Settings
- Signals
- Control Register Maps
- 16. Deinterlacer II MegaCore Function
- 17. Frame Reader MegaCore Function
- 18. Frame Buffer MegaCore Function
- 19. Gamma Corrector MegaCore Function
- 20. Interlacer MegaCore Function
- 21. Scaler MegaCore Function
- 22. Scaler II MegaCore Function
- 23. Switch MegaCore Function
- 24. Test Pattern Generator MegaCore Function
- 25. Trace System MegaCore Function
- A. Avalon-ST Video Verification IP Suite
- B. Choosing the Correct Deinterlacer
- Additional Information

A–12 Appendix A: Avalon-ST Video Verification IP Suite
Video File Reader Test
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
tb_test.sv—Section 1
Example A–1 shows the first section of the code.
First, the test must define the numbers of bits per channel and channels per pixel,
because most of the classes require this information. Next, the class packages are
imported, the clock and reset defined, and the netlist itself instantiated with
connections for clock and reset in place.
1 The BFM resets are all active high. If an active low reset is required, it may be
necessary to invert the reset at the DUT input.
The final part of the this section of the code creates some objects from the class library
which are used later in the code. The parameterization is standard across all object
instances of the classes as the bits per channel and channels per pixel is constant in
any given system.
Example A–1. tb_test.sv—Section 1
`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;