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 12 to Rev 11
    Reverse comparison

Rev 12 → Rev 11

/video_frame_class/src/video_frame_class.sv
65,13 → 65,6
input int max_mismatches,
ref video_frame_class to
);
extern virtual function void print_line
(
input int line,
input int pixel,
input int count
);
 
endclass: video_frame_class
 
84,15 → 77,9
input int lines_per_frame,
input int bits_per_pixel
);
$display("^^^ %16.t | %m", $time);
this.pixels_per_line = pixels_per_line;
this.lines_per_frame = lines_per_frame;
this.bits_per_pixel = bits_per_pixel;
this.make_constant( 0 );
endfunction: init
 
 
102,8 → 89,6
(
input int pixel
);
$display("^^^ %16.t | %m", $time);
 
this.lines = new[lines_per_frame];
 
123,8 → 108,6
// --------------------------------------------------------------------
//
function void video_frame_class::make_counting();
$display("^^^ %16.t | %m", $time);
 
this.lines = new[lines_per_frame];
 
144,8 → 127,6
// --------------------------------------------------------------------
//
function void video_frame_class::make_random();
$display("^^^ %16.t | %m", $time);
 
this.lines = new[lines_per_frame];
 
168,8 → 149,6
(
ref video_frame_class to
);
$display("^^^ %16.t | %m", $time);
 
to.frame_id = this.frame_id;
to.pixels_per_line = this.pixels_per_line;
198,64 → 177,45
ref video_frame_class to
);
 
int mismatch_count = 0;
$display("^^^ %16.t | %m", $time);
int mismatch_count = 0;
 
if( to.pixels_per_line != this.pixels_per_line )
begin
$display( "^^^ %16.t | to.pixels_per_line != this.pixels_per_line", $time );
return( -1 );
end
if( to.pixels_per_line != this.pixels_per_line )
begin
$display( "^^^ %16.t | to.pixels_per_line != this.pixels_per_line", $time );
return( -1 );
end
 
if( to.lines_per_frame != this.lines_per_frame )
begin
$display( "^^^ %16.t | to.lines_per_frame != this.lines_per_frame", $time );
return( -2 );
end
if( to.lines_per_frame != this.lines_per_frame )
begin
$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 );
return( -3 );
end
 
foreach( this.lines[l] )
begin
$display( "^^^ %16.t | to.bits_per_pixel != this.bits_per_pixel", $time );
return( -3 );
end
foreach( this.lines[l].pixel[p] )
if( to.lines[l].pixel[p] != this.lines[l].pixel[p] )
begin
 
foreach( this.lines[l] )
begin
foreach( this.lines[l].pixel[p] )
if( to.lines[l].pixel[p] != this.lines[l].pixel[p] )
begin
if( max_mismatches > 0 )
mismatch_count++;
 
if( max_mismatches > 0 )
mismatch_count++;
$display( "^^^ %16.t | mismatch @ frame[%4h][%4h] | to == %4h | this == %4h ", $time, l, p, to.lines[l].pixel[p], this.lines[l].pixel[p] );
 
$display( "^^^ %16.t | mismatch @ frame[%4h][%4h] | to == %4h | this == %4h ", $time, l, p, to.lines[l].pixel[p], this.lines[l].pixel[p] );
if( mismatch_count > max_mismatches )
return( -4 );
 
if( mismatch_count > max_mismatches )
return( mismatch_count );
end
end
 
end
end
return( mismatch_count );
 
return( mismatch_count );
 
endfunction: compare
 
 
// --------------------------------------------------------------------
//
function void video_frame_class::print_line
(
input int line,
input int pixel,
input int count
);
 
$display("^^^ %16.t | %m", $time);
for( int i = 0; i < count; i++ )
$display( "^^^ %16.t | %4h @ frame[%4h][%4h]", $time, this.lines[line].pixel[(pixel + i)], line, pixel );
 
endfunction: print_line
 
 
/video_frame_class/sim/scripts/sim_procs.do
3,14 → 3,13
# ------------------------------------
 
 
# ------------------------------------
#
proc sim_compile_all { target } {
 
global env
# sim_make_version
 
set env(ROOT_DIR) ../../../..
set env(PROJECT_DIR) ../../..
set env(SIM_TARGET) $target
 
if {[file exists work/_info]} {
22,41 → 21,21
vlib work
}
 
if { [file exists ../../libs/altera_sim.f] } {
vlog -O0 -f ../../libs/altera_sim.f
} elseif {[file exists ../../libs/xilinx_sim.f]} {
vlog -O0 -f ../../libs/xilinx_sim.f
}
vlog -O0 -f ../../libs/sim_files.txt
 
foreach filename [glob -nocomplain -directory ../../libs/FPGA_verilog/ *.f] {
echo "INFO: compiling $filename"
vlog -O0 -f $filename
if {[file exists ../../libs/libs_files.txt]} {
vlog -O0 -f ../../libs/libs_files.txt
}
foreach filename [glob -nocomplain -directory ../../libs/FPGA_VHDL/ *.f] {
echo "INFO: compiling $filename"
vcom -explicit -O0 -f $filename
if {[file exists ../../libs/opencores_files.txt]} {
vlog -O0 -f ../../libs/opencores_files.txt
}
foreach filename [glob -nocomplain -directory ../../libs/sim_verilog/ *.f] {
echo "INFO: compiling $filename"
vlog -O0 -f $filename
}
foreach filename [glob -nocomplain -directory ../../libs/sim_VHDL/ *.f] {
echo "INFO: compiling $filename"
vcom -explicit -O0 -f $filename
}
 
switch $target {
 
"rtl" {
echo "INFO: compiling FPGA rtl"
foreach filename [glob -nocomplain -directory ../../libs/FPGA/ *.f] {
echo "INFO: compiling $filename"
# vlog -O0 -f $filename
vcom -93 -explicit -O0 -f $filename
}
vlog -O0 -f ../../libs/fpga_files.txt
}
 
default {
67,28 → 46,6
}
 
 
# ------------------------------------
#
proc sim_run_sim { } {
 
if {[file exists ./sim.do]} {
do ./sim.do
} elseif {[file exists ../../libs/sim.do]} {
do ../../libs/sim.do
} elseif {[file exists ../../libs/altera_sim.f]} {
vsim -novopt -f ../../libs/altera_sim.f -l transcript.txt work.tb_top
} elseif {[file exists ../../libs/xilinx_sim.f]} {
vsim -novopt -f ../../libs/xilinx_sim.f -l transcript.txt work.tb_top work.glbl
}
if { [file exists ./wave.do] } {
do ./wave.do
}
}
 
 
# ------------------------------------
#
proc sim_run_test { } {
 
global env
99,6 → 56,8
vlib work
}
 
vlog ./the_test.sv
 
# unique setup
if { [file exists ./setup_test.do] } {
do ./setup_test.do
109,36 → 68,44
vlog +define+MAKEFILE_TEST_RUN ../../src/tb_top.v
 
} else {
vlog ../../src/tb_top.v
 
sim_run_sim
vsim -novopt -t 1ps -f ../../libs/altera_sim_files.txt -l transcript.txt work.tb_top
 
if { [file exists ./wave.do] } {
do ./wave.do
}
}
 
radix -hexadecimal
 
run -all
 
}
 
 
# ------------------------------------
#
proc sim_restart { } {
 
global env
 
# work in progress files to compile
# unique setup
if { [file exists ./setup_test.do] } {
do ./setup_test.do
}
if { [file exists ./wip.do] } {
echo "INFO: found ./wip.do"
do ./wip.do
} else {
 
# sim_make_version
sim_compile_all $::env(SIM_TARGET)
vlog ./the_test.sv
vlog ../../src/tb_top.v
}
restart -force
if { [string equal nodesign [runStatus]] } {
sim_run_sim
} else {
restart -force
}
 
run -all
 
}
/video_frame_class/sim/scripts/sim_debug_init.do
8,11 → 8,9
 
set env(SIM_TARGET) rtl
 
 
radix -hexadecimal
 
# do ./setup_test.do
# sim_compile_all rtl
sim_compile_all rtl
sim_run_test
 
 

powered by: WebSVN 2.1.0

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