Skip to content

Commit 40e1b77

Browse files
committed
Removed Testcontroller package for PoC.arith.div.
1 parent fa34323 commit 40e1b77

File tree

6 files changed

+31
-76
lines changed

6 files changed

+31
-76
lines changed

tb/arith/addw/arith_addw_TestController_pkg.vhdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ package arith_addw_TestController_pkg is
4141

4242
constant N : positive := 9;
4343
constant K : positive := 2;
44-
44+
4545
subtype tArch_test is tArch;
4646
subtype tSkip_test is tSkipping;
47-
47+
4848
subtype word is std_logic_vector(N-1 downto 0);
4949
type word_vector is array(tArch_test, tSkip_test, boolean) of word;
5050
type carry_vector is array(tArch_test, tSkip_test, boolean) of std_logic;
5151

52-
end package arith_addw_TestController_pkg;
52+
end package;

tb/arith/div/RunAllTests.pro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# =============================================================================
2-
# Authors:
2+
# Authors:
33
# Gustavo Martin
44
# License:
55
# =============================================================================
@@ -18,7 +18,6 @@
1818
# limitations under the License.
1919
# =============================================================================
2020

21-
analyze arith_div_TestController_pkg.vhdl
2221
analyze arith_div_TestController.vhdl
2322
analyze arith_div_TestHarness.vhdl
2423

tb/arith/div/arith_div_Simple.vhdl

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ use PoC.strings.all;
4242
library osvvm;
4343
context osvvm.OsvvmContext;
4444

45-
library tb_arith;
46-
use tb_arith.arith_div_TestController_pkg.all;
47-
4845
architecture Simple of arith_div_TestController is
4946
signal TestDone : integer_barrier := 1;
5047
constant TCID : AlertLogIDType := NewID("AddWTest");
@@ -87,12 +84,12 @@ begin
8784
variable Random : RandomPType;
8885

8986
procedure test(aval, dval : in integer) is
90-
variable QQ : T_SLVV(1 to 2*MAX_POW)(A_BITS-1 downto 0);
91-
variable RR : T_SLVV(1 to 2*MAX_POW)(D_BITS-1 downto 0);
92-
variable ZZ : std_logic_vector(1 to 2*MAX_POW);
87+
variable QQ : T_SLVV(Z'range)(A'range);
88+
variable RR : T_SLVV(Z'range)(D'range);
89+
variable ZZ : std_logic_vector(Z'range);
9390

9491
type boolean_vector is array(positive range<>) of boolean;
95-
variable done : boolean_vector(1 to 2*MAX_POW);
92+
variable done : boolean_vector(Ready'range);
9693
variable all_done : boolean;
9794
begin
9895
-- Start
@@ -106,7 +103,7 @@ begin
106103
A <= (others => '-');
107104
D <= (others => '-');
108105
done := (others => false);
109-
106+
110107
loop
111108
all_done := true;
112109
for i in done'range loop
@@ -131,7 +128,7 @@ begin
131128
else
132129
AffirmIf(ZZ(i) = '0', "INST=" & integer'image(i) & " Zero flag check failed: " & integer'image(aval) & "/" & integer'image(dval));
133130
AffirmIf(to_integer(unsigned(QQ(i)))*dval + to_integer(unsigned(RR(i))) = aval,
134-
"INST=" & integer'image(i) & " Result check failed: " & integer'image(aval) & "/" & integer'image(dval) &
131+
"INST=" & integer'image(i) & " Result check failed: " & integer'image(aval) & "/" & integer'image(dval) &
135132
" /= " & integer'image(to_integer(unsigned(QQ(i)))) & " R " & integer'image(to_integer(unsigned(RR(i)))));
136133
end if;
137134
end loop;
@@ -147,19 +144,19 @@ begin
147144

148145
-- Reset
149146
wait until Reset = '0';
150-
147+
151148
-- Boundary Conditions
152149
test(0, 0);
153-
test(0, 2**D_BITS-1);
150+
test(0, 2**D'length - 1);
154151
test(0, 1);
155152
test(1, 0);
156153
test(2, 0);
157-
test(2**A_BITS-1, 0);
158-
test(2**A_BITS-1, 2**D_BITS-1);
154+
test(2**A'length - 1, 0);
155+
test(2**A'length - 1, 2**D'length - 1);
159156

160157
-- Run Random Tests
161158
for i in 0 to 1023 loop
162-
test(Random.Uniform(0, 2**A_BITS-1), Random.Uniform(0, 2**D_BITS-1));
159+
test(Random.Uniform(0, 2**A'length - 1), Random.Uniform(0, 2**D'length - 1));
163160
end loop;
164161

165162
-- End of Test

tb/arith/div/arith_div_TestController.vhdl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,18 @@ use PoC.strings.all;
4242
library osvvm;
4343
context osvvm.OsvvmContext;
4444

45-
library tb_arith;
46-
use tb_arith.arith_div_TestController_pkg.all;
4745

4846
entity arith_div_TestController is
4947
port (
5048
Clock : in std_logic;
5149
Reset : in std_logic;
5250

5351
Start : out std_logic;
54-
Ready : in std_logic_vector(1 to 2*MAX_POW);
55-
A : out std_logic_vector(A_BITS-1 downto 0);
56-
D : out std_logic_vector(D_BITS-1 downto 0);
57-
Q : in T_SLVV(1 to 2*MAX_POW)(A_BITS-1 downto 0);
58-
R : in T_SLVV(1 to 2*MAX_POW)(D_BITS-1 downto 0);
59-
Z : in std_logic_vector(1 to 2*MAX_POW)
52+
Ready : in std_logic_vector;
53+
A : out std_logic_vector;
54+
D : out std_logic_vector;
55+
Q : in T_SLVV;
56+
R : in T_SLVV;
57+
Z : in std_logic_vector
6058
);
6159
end entity;

tb/arith/div/arith_div_TestController_pkg.vhdl

Lines changed: 0 additions & 40 deletions
This file was deleted.

tb/arith/div/arith_div_TestHarness.vhdl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ use PoC.physical.all;
4343
library osvvm;
4444
context osvvm.OsvvmContext;
4545

46-
library tb_arith;
47-
use tb_arith.arith_div_TestController_pkg.all;
48-
4946
entity arith_div_TestHarness is
5047
end entity;
5148

5249
architecture tb of arith_div_TestHarness is
5350
constant CLOCK_PERIOD : time := 10 ns;
5451

52+
constant A_BITS : positive := 13;
53+
constant D_BITS : positive := 4;
54+
constant MAX_POW : positive := 3;
55+
5556
signal Clock : std_logic;
5657
signal Reset : std_logic;
5758

@@ -68,12 +69,12 @@ architecture tb of arith_div_TestHarness is
6869
Clock : in std_logic;
6970
Reset : in std_logic;
7071
Start : out std_logic;
71-
Ready : in std_logic_vector(1 to 2*MAX_POW);
72-
A : out std_logic_vector(A_BITS-1 downto 0);
73-
D : out std_logic_vector(D_BITS-1 downto 0);
74-
Q : in T_SLVV(1 to 2*MAX_POW)(A_BITS-1 downto 0);
75-
R : in T_SLVV(1 to 2*MAX_POW)(D_BITS-1 downto 0);
76-
Z : in std_logic_vector(1 to 2*MAX_POW)
72+
Ready : in std_logic_vector;
73+
A : out std_logic_vector;
74+
D : out std_logic_vector;
75+
Q : in T_SLVV;
76+
R : in T_SLVV;
77+
Z : in std_logic_vector
7778
);
7879
end component;
7980

0 commit comments

Comments
 (0)