forked from AndrewMcClelland/RISC_Computer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcon_ff_logic_tb.vhd.bak
More file actions
97 lines (72 loc) · 1.79 KB
/
Copy pathcon_ff_logic_tb.vhd.bak
File metadata and controls
97 lines (72 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
library IEEE;
use ieee.std_logic_1164.all;
ENTITY select_encode_logic_sel_tb IS
END;
ARCHITECTURE select_encode_logic_sel_tb_arch of select_encode_logic_sel_tb IS
SIGNAL IR_in_tb : std_logic_vector(31 downto 0);
SIGNAL Gra_tb, Grb_tb, Grc_tb, Rin_tb, Rout_tb, BAout_tb : std_logic;
SIGNAL C_sign_extended_tb : std_logic_vector(31 downto 0);
SIGNAL Reg_in_tb, Reg_out_tb : std_logic_vector(15 downto 0);
COMPONENT select_encode_logic_sel
PORT (
IR_in : in std_logic_vector(31 downto 0);
Gra, Grb, Grc, Rin, Rout, BAout : in std_logic;
C_sign_extended : out std_logic_vector(31 downto 0);
Reg_in, Reg_out : out std_logic_vector(15 downto 0)
);
END COMPONENT select_encode_logic_sel;
BEGIN
DUT1 : select_encode_logic_sel
PORT MAP (
IR_in => IR_in_tb,
Gra => Gra_tb,
Grb => Grb_tb,
Grc => Grc_tb,
Rin => Rin_tb,
Rout => Rout_tb,
BAout => BAout_tb,
C_sign_extended => C_sign_extended_tb,
Reg_in => Reg_in_tb,
Reg_out => Reg_out_tb
);
sim_process: process
begin
wait for 0 ns; -- testing Ra
IR_in_tb <= b"00000_1111_0101_1010_000000000000000";
Gra_tb <= '1';
Grb_tb <= '0';
Grc_tb <= '0';
Rin_tb <= '1';
Rout_tb <= '1';
BAout_tb <= '0';
wait for 20 ns; -- testing Rb
Gra_tb <= '0';
Grb_tb <= '1';
Grc_tb <= '0';
Rin_tb <= '1';
Rout_tb <= '1';
BAout_tb <= '0';
wait for 20 ns; -- testing Rc
Gra_tb <= '0';
Grb_tb <= '0';
Grc_tb <= '1';
Rin_tb <= '1';
Rout_tb <= '1';
BAout_tb <= '0';
wait for 20 ns; -- testing when Rin enable is 0
Gra_tb <= '1';
Grb_tb <= '0';
Grc_tb <= '0';
Rin_tb <= '0';
Rout_tb <= '1';
BAout_tb <= '0';
wait for 20 ns; -- testing when Rout enable is 0
Gra_tb <= '1';
Grb_tb <= '0';
Grc_tb <= '0';
Rin_tb <= '1';
Rout_tb <= '0';
BAout_tb <= '0';
wait;
end process sim_process;
end;