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

Appendix A: Avalon-ST Video Verification IP Suite A–7
Types of Example Test Environment
January 2013 Altera Corporation Video and Image Processing Suite
User Guide
Figure A–3 shows the solution to the Avalon-ST BFM API function.
Types of Example Test Environment
There are two types of example test environment:
■ Video File Reader Test
■ 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. For more
information, refer to “Constrained Random Test” on page A–18.
This section describes how you can run the test and the prerequisites before running
the test. You can run both tests in a similar way, unless specified otherwise.
Figure A–3. How the Class Library interfaces to the Avalon-ST BFM
…
`define BITS_PER_CHANNEL 8
`define CHANNELS_PER_PIXEL 3
// Instantiate "netlist" :
`define NETLIST netlist
tb `NETLIST (.reset_reset_n(resetn),.clk_clk(clk));
// This names MUST match the instance name of the source in tb.v :
`define SOURCE st_source_bfm_0
`define SOURCE_HIERARCHY_NAME `NETLIST.`SOURCE
`include "av_st_video_source_bfm_class.sv"
// Create an object of name `SOURCE of class av_st_video_source_bfm_`SOURCE :
`define CLASSNAME c_av_st_video_source_bfm_`SOURCE
`CLASSNAME `SOURCE;
`undef CLASSNAME
...
// The following must be defined before including this class :
// `BITS_PER_CHANNEL
// `CHANNELS_PER_PIXEL
// `SOURCE
// `SOURCE_HIERARCHY_NAME
`define CLASSNAME c_av_st_video_source_bfm_`SOURCE
class `CLASSNAME extends c_av_st_video_source_sink_base;
...
pixel_data = new();
// Pull a video item out of the mailbox :
this.m_video_items.get(item_data);
`SOURCE_HIERARCHY_NAME.set_transaction_sop(1'b1);
`SOURCE_HIERARCHY_NAME.set_transaction_eop(1'b0);
...
module tb (
input wire reset_reset_n,
input wire clk_clk
);
wire st_source_bfm_0_src_endofpacket;
wire st_source_bfm_0_src_valid;
wire st_source_bfm_0_src_startofpacket;
wire [7:0] st_source_bfm_0_src_data;
wire st_source_bfm_0_src_ready;
wire rst_controller_reset_out_reset;
altera_avalon_st_source_bfm #(
.USE_PACKET (1),
.USE_CHANNEL (0),
.USE_ERROR (0),
...
.ST_READY_LATENCY (1),
.ST_BEATSPERCYCLE (1),
.ST_MAX_CHANNELS (0)
) st_source_bfm_0 (
.clk (clk_clk),
.reset (rst_controller_reset_out_reset),
.src_data (st_source_bfm_0_src_data),
.src_valid (st_source_bfm_0_src_valid),
.src_ready (st_source_bfm_0_src_ready),
.src_startofpacket (st_source_bfm_0_src_startofpacket),
.src_endofpacket (st_source_bfm_0_src_endofpacket)
);
...
tb_test.sv
tb.v
av_st_video_source_bfm_class.sv
The test harness , creates the `defines , then `includes
av_st_video_source_bfm_class.sv prior to then creating an object of
that class.
The av_st_video_source_bfm_class. sv file declares a
class with a unique name which accesses the Avalon-ST
BFM API calls such as set_transaction _sop() via its
hierarchical path in the netlist .
.
S
T
_
M
A
X
_
C
H
A
)
s
t
_
s
o
u
r
c
e
_
b
f
m
_
0
(
.
c
l
k
_
v
i
d
e
o
_
i
t
e
m
s
.
g
e
t
(
i
t
e
m
_
d
a
t
a
)
;
`
S
O
U
R
C
E
_
H
I
E
R
A
R
R
R
C
H
Y
_
N
A
M
A
A
E
.
s
e
t
_
t
r
a
n
s
a
c
t
i
o
n
_
s
o
p
(
1
'
b
1
)
;
`
S
O
U
R
C
E
_
H
I
E
R
A
R
R
R
C
H
Y
_
N
A
M
A
A
E
.
s
e
t
_
t
r
a
n
s
a
c
t
i
o
n
_
e
op
(
1
'
b
0
)
;