URL
https://opencores.org/ocsvn/pltbutils/pltbutils/trunk
Subversion Repositories pltbutils
Compare Revisions
- This comparison shows the changes necessary to convert path
/pltbutils/trunk/bench
- from Rev 101 to Rev 107
- ↔ Reverse comparison
Rev 101 → Rev 107
/testfiles/bintestfile_correct.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
testfiles/bintestfile_correct.bin
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: testfiles/bintestfile_error.bin
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: testfiles/bintestfile_error.bin
===================================================================
--- testfiles/bintestfile_error.bin (nonexistent)
+++ testfiles/bintestfile_error.bin (revision 107)
testfiles/bintestfile_error.bin
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: testfiles/bintestfile_longer.bin
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: testfiles/bintestfile_longer.bin
===================================================================
--- testfiles/bintestfile_longer.bin (nonexistent)
+++ testfiles/bintestfile_longer.bin (revision 107)
testfiles/bintestfile_longer.bin
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: testfiles/bintestfile_reference.bin
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: testfiles/bintestfile_reference.bin
===================================================================
--- testfiles/bintestfile_reference.bin (nonexistent)
+++ testfiles/bintestfile_reference.bin (revision 107)
testfiles/bintestfile_reference.bin
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: testfiles/bintestfile_shorter.bin
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: testfiles/bintestfile_shorter.bin
===================================================================
--- testfiles/bintestfile_shorter.bin (nonexistent)
+++ testfiles/bintestfile_shorter.bin (revision 107)
testfiles/bintestfile_shorter.bin
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: testfiles/dattestfile_correct.dat
===================================================================
--- testfiles/dattestfile_correct.dat (nonexistent)
+++ testfiles/dattestfile_correct.dat (revision 107)
@@ -0,0 +1,10 @@
+# Dattestfile (modified comments and whitespaces, but it shouldn't matter)
+1 2
+3
+4 5 6
+7 8 9
+ ABC DEF
+GHI
+ JKL MNO PQR
+# Modified Comment
+STUVW XYZ
Index: testfiles/dattestfile_error.dat
===================================================================
--- testfiles/dattestfile_error.dat (nonexistent)
+++ testfiles/dattestfile_error.dat (revision 107)
@@ -0,0 +1,9 @@
+# Dattestfile Error
+1
+2
+7
+4 5 6
+7 8 9
+ ABC DEF GHI
+ JqL MNO PQR # Comment2
+STUVW XYZ
Index: testfiles/dattestfile_longer.dat
===================================================================
--- testfiles/dattestfile_longer.dat (nonexistent)
+++ testfiles/dattestfile_longer.dat (revision 107)
@@ -0,0 +1,9 @@
+# Dattestfile
+1
+2
+3
+4 5 6
+7 8 9
+ ABC DEF GHI
+ JKL MNO PQR # Comment
+STUVW XYZ WOW
Index: testfiles/dattestfile_reference.dat
===================================================================
--- testfiles/dattestfile_reference.dat (nonexistent)
+++ testfiles/dattestfile_reference.dat (revision 107)
@@ -0,0 +1,9 @@
+# Dattestfile
+1
+2
+3
+4 5 6
+7 8 9
+ ABC DEF GHI
+ JKL MNO PQR # Comment
+STUVW XYZ
Index: testfiles/dattestfile_shorter.dat
===================================================================
--- testfiles/dattestfile_shorter.dat (nonexistent)
+++ testfiles/dattestfile_shorter.dat (revision 107)
@@ -0,0 +1,9 @@
+# Dattestfile
+1
+2
+3
+4 5 6
+7 8 9
+ ABC DEF GHI
+ JKL MNO PQR # Comment
+STUVW
Index: testfiles/texttestfile_correct.txt
===================================================================
--- testfiles/texttestfile_correct.txt (nonexistent)
+++ testfiles/texttestfile_correct.txt (revision 107)
@@ -0,0 +1,3 @@
+Texttestfile line 1
+line 2
+line 3
Index: testfiles/texttestfile_error.txt
===================================================================
--- testfiles/texttestfile_error.txt (nonexistent)
+++ testfiles/texttestfile_error.txt (revision 107)
@@ -0,0 +1,3 @@
+Texttestfile lone 1
+line 2
+line 3
Index: testfiles/texttestfile_longer.txt
===================================================================
--- testfiles/texttestfile_longer.txt (nonexistent)
+++ testfiles/texttestfile_longer.txt (revision 107)
@@ -0,0 +1,4 @@
+Texttestfile line 1
+line 2
+line 3
+l
\ No newline at end of file
Index: testfiles/texttestfile_reference.txt
===================================================================
--- testfiles/texttestfile_reference.txt (nonexistent)
+++ testfiles/texttestfile_reference.txt (revision 107)
@@ -0,0 +1,3 @@
+Texttestfile line 1
+line 2
+line 3
Index: testfiles/texttestfile_shorter.txt
===================================================================
--- testfiles/texttestfile_shorter.txt (nonexistent)
+++ testfiles/texttestfile_shorter.txt (revision 107)
@@ -0,0 +1,3 @@
+Texttestfile line 1
+line 2
+line
\ No newline at end of file
Index: vhdl/tb_pltbutils.vhd
===================================================================
--- vhdl/tb_pltbutils.vhd (revision 101)
+++ vhdl/tb_pltbutils.vhd (revision 107)
@@ -27,7 +27,7 @@
---- ----
----------------------------------------------------------------------
---- ----
----- Copyright (C) 2013-2014 Authors and OPENCORES.ORG ----
+---- Copyright (C) 2013-2020 Authors and OPENCORES.ORG ----
---- ----
---- This source file may be used and distributed without ----
---- restriction provided that this copyright statement is not ----
@@ -61,15 +61,33 @@
entity tb_pltbutils is
generic (
- G_SKIPTESTS : std_logic_vector := (
- '0', -- Dummy
- '0', -- Test 1
- '0', -- Test 2
- '0', -- Test 3
- '0', -- Test 4: NonSkipTest
- '1' -- Test 5: SkipTest
- );
- G_CLK_PERIOD : time := 10 ns
+ G_SKIPTESTS : std_logic_vector := (
+ '0', -- Dummy
+ '0', -- Test 1
+ '0', -- Test 2
+ '0', -- Test 3
+ '0', -- Test 4: NonSkipTest
+ '1' -- Test 5: SkipTest
+ );
+ G_CLK_PERIOD : time := 10 ns;
+ G_CHECKFILE_VERBOSITY : integer := 10;
+ G_BINTESTFILE_HEADER : string := "Bintestfile R ";
+ G_BINTESTFILE_LEN : integer := 528;
+ G_BINTESTFILE_REFERENCE : string := "../../../bench/testfiles/bintestfile_reference.bin";
+ G_BINTESTFILE_CORRECT : string := "../../../bench/testfiles/bintestfile_correct.bin";
+ G_BINTESTFILE_ERROR : string := "../../../bench/testfiles/bintestfile_error.bin";
+ G_BINTESTFILE_SHORTER : string := "../../../bench/testfiles/bintestfile_shorter.bin";
+ G_BINTESTFILE_LONGER : string := "../../../bench/testfiles/bintestfile_longer.txt";
+ G_TEXTTESTFILE_REFERENCE : string := "../../../bench/testfiles/texttestfile_reference.txt";
+ G_TEXTTESTFILE_CORRECT : string := "../../../bench/testfiles/texttestfile_correct.txt";
+ G_TEXTTESTFILE_ERROR : string := "../../../bench/testfiles/texttestfile_error.txt";
+ G_TEXTTESTFILE_SHORTER : string := "../../../bench/testfiles/texttestfile_shorter.txt";
+ G_TEXTTESTFILE_LONGER : string := "../../../bench/testfiles/texttestfile_longer.txt";
+ G_DATTESTFILE_REFERENCE : string := "../../../bench/testfiles/dattestfile_reference.dat";
+ G_DATTESTFILE_CORRECT : string := "../../../bench/testfiles/dattestfile_correct.dat";
+ G_DATTESTFILE_ERROR : string := "../../../bench/testfiles/dattestfile_error.dat";
+ G_DATTESTFILE_SHORTER : string := "../../../bench/testfiles/dattestfile_shorter.dat";
+ G_DATTESTFILE_LONGER : string := "../../../bench/testfiles/dattestfile_longer.dat"
);
end entity tb_pltbutils;
@@ -101,7 +119,27 @@
signal s_str1 : string(1 to 44);
signal s_str2 : string(1 to 44);
signal s_str3 : string(1 to 43);
- signal s_str4 : string(1 to 45);
+ signal s_str4 : string(1 to 45);
+
+
+ constant C_EXPECTED_SUCCESS : boolean := false;
+ constant C_EXPECTED_FAIL : boolean := true;
+
+ procedure check_cnt (
+ constant C_EXPECT_FAIL : boolean;
+ variable v_checks_cnt : inout integer;
+ variable v_errors_cnt : inout integer;
+ signal checks_cnt : out integer;
+ signal errors_cnt : out integer
+ ) is
+ begin
+ v_checks_cnt := v_checks_cnt + 1;
+ if C_EXPECT_FAIL then
+ v_errors_cnt := v_errors_cnt + 1;
+ end if;
+ checks_cnt <= v_checks_cnt;
+ errors_cnt <= v_errors_cnt;
+ end procedure check_cnt;
begin
@@ -132,9 +170,17 @@
variable v_expected_skiptests_cnt : integer := 0;
variable v_expected_checks_cnt : integer := 0;
variable v_expected_errors_cnt : integer := 0;
+ variable v_expected_data : integer;
+ variable v_actual_data : integer;
+ variable f_status : file_open_status;
+ type charfile is file of character;
+ file binfile : charfile;
+ variable c : character;
+ variable i : integer;
+ variable v_errcnt : integer;
begin
- print("");
+ print(lf & "");
startsim("tc1", G_SKIPTESTS, pltbv, pltbs);
wait until rising_edge(clk);
assert (pltbv.test_num = 0) and (pltbs.test_num = 0)
@@ -142,7 +188,7 @@
severity error;
print("