OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /qaz_libs/trunk
    from Rev 7 to Rev 8
    Reverse comparison

Rev 7 → Rev 8

/video_frame_class/src/video_frame_class.sv
4,7 → 4,7
typedef struct
{
int pixel[];
} line_s
} line_s;
 
class video_frame_class;
60,7 → 60,7
ref video_frame_class to
);
extern virtual function void compare
extern virtual function int compare
(
input int max_mismatches,
ref video_frame_class to
171,7 → 171,7
// --------------------------------------------------------------------
//
function void video_frame_class::compare
function int video_frame_class::compare
(
input int max_mismatches,
ref video_frame_class to
181,19 → 181,19
if( to.pixels_per_line != this.pixels_per_line )
begin
$display("^^^ %16.t | to.pixels_per_line != this.pixels_per_line ", $time );
$display( "^^^ %16.t | to.pixels_per_line != this.pixels_per_line ", $time );
return( -1 );
end
if( to.lines_per_frame = this.lines_per_frame )
if( to.lines_per_frame != this.lines_per_frame )
begin
$display("^^^ %16.t | to.lines_per_frame = this.lines_per_frame ", $time );
$display( "^^^ %16.t | to.lines_per_frame != this.lines_per_frame ", $time );
return( -2 );
end
if( to.bits_per_pixel = this.bits_per_pixel )
if( to.bits_per_pixel != this.bits_per_pixel )
begin
$display("^^^ %16.t | to.bits_per_pixel =this.bits_per_pixel ", $time );
$display( "^^^ %16.t | to.bits_per_pixel != this.bits_per_pixel ", $time );
return( -3 );
end
 
206,14 → 206,16
if( max_mismatches > 0 )
mismatch_count++;
$display("^^^ %16.t | mismatch @ frame[%4h].pixel[%4h] | to == %4h | this == %4h ", $time, to.lines[l].pixel[p], this.lines[l].pixel[p] );
$display("^^^ %16.t | mismatch @ frame[%4h][%4h] | to == %4h | this == %4h ", $time, to.lines[l].pixel[p], this.lines[l].pixel[p] );
if( max_mismatches > max_mismatches )
if( mismatch_count > max_mismatches )
return( -4 );
end
end
return( mismatch_count );
endfunction: compare
/video_frame_class/sim/tests/debug/the_test.sv
15,31 → 15,31
video_frame_class f_h;
video_frame_class fc_h;
int return_code;
 
initial
begin
 
f_h = new;
 
f_h.init
(
.pixels_per_line('h100);
.lines_per_frame('h080);
.bits_per_pixel(14);
)
.pixels_per_line('h100),
.lines_per_frame('h080),
.bits_per_pixel(14)
);
 
f_h.make_random();
 
fc_h = new;
f_h.copy(fc_h);
return_code = fh.compare( 16, fc_h );
 
return_code = f_h.compare( 16, fc_h );
 
if( return_code == 0 )
$display("^^^ %16.t | f_h == fc_h", $time );
else
$display("^^^ %16.t | f_h != fc_h | mismatches = %0d", $time, return_code );
 
$display("^^^ %16.t | inserting errors @ fc_h[11][22]", $time );
fc_h.lines['h11].pixel['h22] = ~(fc_h.lines['h11].pixel['h22])
 
46,16 → 46,16
$display("^^^ %16.t | inserting errors @ fc_h[33][44]", $time );
fc_h.lines['h33].pixel['h44] = ~(fc_h.lines['h33].pixel['h44])
 
return_code = fh.compare( 16, fc_h );
return_code = f_h.compare( 16, fc_h );
 
if( return_code == 0 )
$display("^^^ %16.t | f_h == fc_h", $time );
else
$display("^^^ %16.t | f_h != fc_h | mismatches = %0d", $time, return_code );
 
end
 
 
// --------------------------------------------------------------------
//
task run_the_test;
69,7 → 69,7
$display("^^^ %16.t | Testbench begun.\n", $time);
$display("^^^---------------------------------");
 
 
repeat(1000) @(posedge tb_clk);
 
 
/tb_class/src/tb_clk.sv
2,9 → 2,7
//
// --------------------------------------------------------------------
 
`include "../../../../tb_class/src/tb_clk_class.sv"
 
 
module
tb_clk
#(
14,7 → 12,7
output clock
);
tb_clk_class tb_clk_clk_c;
tb_clk_class tb_clk_c;
tb_clk_if tb_clk_driver();
assign clock = tb_clk_driver.clk;
24,7 → 22,7
tb_clk_c = new( tb_clk_driver );
if( PERIOD != 0 )
tb_clk_clk_c.init_basic_clock( PERIOD );
tb_clk_c.init_basic_clock( PERIOD );
end
/tb_class/src/tb_base.sv
2,7 → 2,7
//
// --------------------------------------------------------------------
 
`include "../../../../tb_class/src/tb_clk_class.sv"
`timescale 1ps/1ps
 
 
module
12,7 → 12,8
parameter ASSERT_TIME = 0
)
(
output clock,
output clock,
output reg reset
);
 
// --------------------------------------------------------------------
19,23 → 20,23
//
task assert_reset
(
input time assert_reset
input time reset_assert
);
reset = 1;
$display("^^^ %16.t | %m | Reset asserted!.", $time );
$display( "-#- %16.t | %m | reset asserted!", $time );
#assert_reset;
#reset_assert;
reset = 0;
$display("^^^ %16.t | %m | Reset deasserted!.", $time );
$display( "-#- %16.t | %m | reset deasserted!", $time );
endmodule
endtask
 
 
// --------------------------------------------------------------------
//
tb_clk_class tb_clk_clk_c;
tb_clk_class tb_clk_c;
tb_clk_if tb_clk_driver();
assign clock = tb_clk_driver.clk;
time reset_assert = (PERIOD * 5) + (PERIOD / 3);
49,12 → 50,12
tb_clk_c = new( tb_clk_driver );
if( PERIOD != 0 )
tb_clk_clk_c.init_basic_clock( PERIOD );
tb_clk_c.init_basic_clock( PERIOD );
if( ASSERT_TIME != 0 )
reset_assert( ASSERT_TIME );
assert_reset( ASSERT_TIME );
else if( reset_assert != 0 )
reset_assert( reset_assert );
assert_reset( reset_assert );
init_done = 1;
/tb_class/src/tb_clk_class.sv
6,7 → 6,7
 
// --------------------------------------------------------------------
//
interface tb_clk_if
interface tb_clk_if;
logic clk = 0;
logic enable = 0;
time period;
41,16 → 41,16
 
// --------------------------------------------------------------------
//
function
task
init_basic_clock
(
time period
);
this.period = period;
this.enable = 1;
tb.period = period;
tb.enable = 1;
$display("^^^ %16.t | %m | Starting clock with period %t.", $time, period );
$display( "^^^ %16.t | %m | Starting clock with period %t.", $time, period );
fork
forever
63,7 → 63,7
end
join_none
endfunction: init_basic_clock
endtask: init_basic_clock
// --------------------------------------------------------------------
76,7 → 76,7
tb.enable = enable;
$display("^^^ %16.t | %m | Clock Enable = %h.", $time, enable );
$display( "^^^ %16.t | %m | Clock Enable = %h.", $time, enable );
endtask: enable_clock

powered by: WebSVN 2.1.0

© copyright 1999-2021 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.