Line 28... |
Line 28... |
class s_avf_api
|
class s_avf_api
|
extends uvm_sequence #(avf_sequence_item);
|
extends uvm_sequence #(avf_sequence_item);
|
`uvm_object_utils(s_avf_api)
|
`uvm_object_utils(s_avf_api)
|
|
|
avf_sequence_item item;
|
avf_sequence_item item;
|
|
|
// --------------------------------------------------------------------
|
|
mailbox #(video_frame_class) frame_buffer;
|
mailbox #(video_frame_class) frame_buffer;
|
int pixels_per_line;
|
|
int lines_per_frame;
|
|
int bits_per_pixel;
|
|
int bytes_per_pixel;
|
|
int pixels_per_clk;
|
|
|
|
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
function void init( int pixels_per_line
|
video_frame_config c_h;
|
, int lines_per_frame
|
|
, int bits_per_pixel
|
function void init(video_frame_config c_h);
|
, int pixels_per_clk
|
this.c_h = c_h;
|
);
|
|
this.pixels_per_line = pixels_per_line;
|
|
this.lines_per_frame = lines_per_frame;
|
|
this.bits_per_pixel = bits_per_pixel;
|
|
this.bytes_per_pixel = (bits_per_pixel % 8 == 0)
|
|
? (bits_per_pixel / 8)
|
|
: (bits_per_pixel / 8) + 1;
|
|
this.pixels_per_clk = pixels_per_clk;
|
|
endfunction : init
|
endfunction : init
|
|
|
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
task automatic put_frame(string pattern, int pixel = 0);
|
task automatic put_frame(string pattern, int pixel = 0);
|
video_frame_class f_h = new;
|
video_frame_class f_h = new;
|
f_h.init( pixels_per_line
|
f_h.init( c_h.pixels_per_line
|
, lines_per_frame
|
, c_h.lines_per_frame
|
, bits_per_pixel
|
, c_h.bits_per_pixel
|
, pixels_per_clk
|
, c_h.pixels_per_clk
|
);
|
);
|
case(pattern.tolower)
|
case(pattern.tolower)
|
"constant": f_h.make_constant(pixel);
|
"constant": f_h.make_constant(pixel);
|
"counting": f_h.make_counting();
|
"counting": f_h.make_counting();
|
"horizontal": f_h.make_horizontal();
|
"horizontal": f_h.make_horizontal();
|