Complete class reference, C_av_st_video_control – Altera Video and Image Processing Suite User Manual
Page 287
grey = new ();
grey.packet_type = video_packet;
do
begin
grey_pixel = new();
rgb_pixel = rgb.pop_pixel();
// Turn RGB into greyscale :
grey_value = ( red_factor * rgb_pixel.get_data(2) +
green_factor * rgb_pixel.get_data(1) +
blue_factor * rgb_pixel.get_data(0));
grey_pixel.set_data(2, grey_value[15:8]);
grey_pixel.set_data(1, grey_value[15:8]);
grey_pixel.set_data(0, grey_value[15:8]);
grey.push_pixel(grey_pixel);
end
while (rgb.get_length()>0);
return grey;
endfunction
The
to_grey
function reads each pixel in turn from the RGB
video_packet
object, calculates the
grayscale value, writes the value to each channel of the outgoing pixel, and pushes that on to the returned
video_packet
object, gray.
A complete test would set up functional coverpoints in the DUT code and use the SystemVerilog’s
get_coverage()
call to run the test until the required amount of coverage has been seen.
Complete Class Reference
c_av_st_video_control
The declaration for the c_av_st_video_control class:
class c_av_st_video_control #(parameter BITS_PER_CHANNEL = 8,
CHANNELS_PER_PIXEL = 3) extends c_av_st_video_item;
Table A-4: Method Calls for c_av_st_video_control Class
Method Call
Description
function new();
The PHY RX and TX latency numbers for
different PCS options.
function bit compare (c_av_st_video_control r)
;
Compares this instance to object r. Returns 1 if
identical, 0 if otherwise.
function bit [15:0] get_width ();
—
function bit [15:0] get_height ();
—
function bit [3:0] get_interlacing ();
—
UG-VIPSUITE
2015.05.04
Complete Class Reference
A-19
Avalon-ST Video Verification IP Suite
Altera Corporation