|
Message
From: cvs at opencores.org<cvs@o...>
Date: Sat Apr 22 03:41:25 CEST 2006
Subject: [cvs-checkins] MODIFIED: mdct ...
Date: 00/06/04 22:03:41 Modified: mdct/source/testbench INPIMAGE.VHD Log: performance improved by 8%, latency reduced to 94 cycles Revision Changes Path 1.2 mdct/source/testbench/INPIMAGE.VHD http://www.opencores.org/cvsweb.shtml/mdct/source/testbench/INPIMAGE.VHD.diff?r1=1.1&r2=1.2 (In the diff below, changes in quantity of whitespace are not shown.) Index: INPIMAGE.VHD =================================================================== RCS file: /cvsroot/mikel262/mdct/source/testbench/INPIMAGE.VHD,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- INPIMAGE.VHD 15 Apr 2006 12:58:23 -0000 1.1 +++ INPIMAGE.VHD 22 Apr 2006 01:41:25 -0000 1.2 @@ -70,6 +70,7 @@ INPIMAGE_PROC: process variable i : INTEGER := 0; variable j : INTEGER := 0; + variable INSERT_DELAYS : BOOLEAN := FALSE; ------------------------------------- -- wait for defined number of clock cycles @@ -161,6 +162,10 @@ while(ready = '0') loop waitposedge; end loop; + if INSERT_DELAYS = TRUE then + dv <= '0'; + waitposedge(40); + end if; end loop; end loop; @@ -261,8 +266,35 @@ ------------------------- -- test 5 ------------------------- + for i in 0 to 7 loop + for j in 0 to 7 loop + dv <= '1'; + imageo <= STD_LOGIC_VECTOR(TO_UNSIGNED(INTEGER(input_data1(i,j)),IP_W)); + waitposedge; + while(ready = '0') loop + waitposedge; + end loop; + dv <= '0'; + waitposedge(25); + end loop; + + end loop; + + dv <= '0'; + waitposedge; + ------------------------ + + ------------------------- + -- test 6 + ------------------------- read_image; + ------------------------- + -- test 7 + ------------------------- + --INSERT_DELAYS := TRUE; + --read_image; + dv <= '0'; waitposedge; ------------------------ @@ -512,10 +544,47 @@ -- test 5 ------------------------- test_inp <= 5; + -- compute reference coefficients + ref_matrix := COMPUTE_REF_DCT1D(input_data1,TRUE); + + for i in 0 to N-1 loop + j := 0; + while(true) loop + + waitposedge; + if odv1 = '1' then + dcto_matrix(j,i) := TO_INTEGER(SIGNED( dcto1 )); + j := j + 1; + end if; + + if j = N then + exit; + end if; + + end loop; + end loop; + + waitposedge; +
+ CMP_MATRIX(ref_matrix,dcto_matrix,MAX_ERROR_1D,error_matrix,error_cnt);
+ -------------------------
+
+ -------------------------
+ -- test 6
+ -------------------------
+ test_inp <= 6;
read_image_for1dct(error_cnt);
-------------------------
+ -------------------------
+ -- test 7
+ -------------------------
+ test_inp <= 7;
+
+ --read_image_for1dct(error_cnt);
+ -------------------------
+
if error_cnt = 0 then
assert false
report "No errors found in first stage of DCT"
@@ -897,12 +966,53 @@
-------------------------
-------------------------
- -- test 4
+ -- test 5
-------------------------
- test_out <= 4;
+ test_out <= 5;
+ tmp_matrix := input_data1;
+ -- compute reference coefficients
+ ref_matrix_1d := COMPUTE_REF_DCT1D(tmp_matrix,TRUE);
+ ref_matrix_2d := COMPUTE_REF_DCT1D(ref_matrix_1d,FALSE);
+
+ for i in 0 to N-1 loop
+ j := 0;
+ while(true) loop
+
+ waitposedge;
+ if odv = '1' then
+ dcto_matrix(j,i) := TO_INTEGER(SIGNED( dcto ));
+ j := j + 1;
+ end if;
+
+ if j = N then
+ exit;
+ end if;
+
+ end loop;
+ end loop;
+
+ waitposedge;
+
+ CMP_MATRIX(ref_matrix_2d,dcto_matrix,MAX_ERROR_2D,error_matrix,error_cnt);
+ idcto_matrix := COMPUTE_REF_IDCT(dcto_matrix);
+ --error_idct_matrix := CMP_MATRIX(tmp_matrix,idcto_matrix,MAX_ERROR_2D);
+ psnr := COMPUTE_PSNR(tmp_matrix,idcto_matrix);
+ -------------------------
+
+ -------------------------
+ -- test 6
+ -------------------------
+ test_out <= 6;
read_image_for2dct(error_cnt);
-------------------------
+ -------------------------
+ -- test 7
+ -------------------------
+ test_out <= 7;
+ --read_image_for2dct(error_cnt);
+ -------------------------
+
waitposedge;
testend <= TRUE;
if error_cnt = 0 then
|
 |