-
Notifications
You must be signed in to change notification settings - Fork 0
/
components.vhd
181 lines (172 loc) · 4.41 KB
/
components.vhd
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
library IEEE;
use IEEE.std_logic_1164.all;
entity components is
port(
clk : in std_logic;
external_reset : in std_logic;
mem_data_ready : in std_logic;
databus: inout std_logic_vector(15 downto 0);
ir_out : out std_logic_vector(15 downto 0);
read_mem : out std_logic;
write_mem : out std_logic;
read_io : out std_logic;
write_io : out std_logic
);
end components;
architecture rtl of components is
component controller
port (
-- databus : inout std_logic_vector(15 DOWNTO 0);
--au
ResetPC,
PCplusI,
PCplus1 ,
RplusI,
Rplus0,
EnablePC,
--ir
ir_load,
--wp
wp_add ,
wp_reset,
--flags
c_set ,
c_reset ,
z_set ,
z_reset ,
sr_load,
--tristates
rd_on_AddressUnitRSide ,
rs_on_AddressUnitRSide ,
address_on_databus ,
aluout_on_databus ,
--rf
rfl_write,
rfh_write ,
Shadow : out std_logic;
--alu
alu_opcode : out std_logic_vector(3 downto 0);
--mem
memAddress : out std_logic_vector(15 DOWNTO 0);
--outputs
readmem,
writemem : out std_logic;
clk,
zin ,
cin,
rst : in std_logic;
ir_in : in std_logic_vector(15 downto 0)
);
end component;
component datapath
port (
databus : inout std_logic_vector(15 DOWNTO 0);
--au
ResetPC,
PCplusI,
PCplus1,
RplusI,
Rplus0,
EnablePC,
clk,
--ir
ir_load,
--wp
wp_add,
wp_reset,
--flags
c_set,
c_reset,
z_set,
z_reset,
sr_load,
--tristates
rd_on_AddressUnitRSide,
rs_on_AddressUnitRSide,
address_on_databus,
aluout_on_databus,
--rf
rfl_write,
rfh_write,
Shadow : IN std_logic;
--alu
alu_opcode : in std_logic_vector(3 downto 0);
--mem
memAddress : OUT std_logic_vector(15 DOWNTO 0);
--outputs
Zout,
Cout : OUT std_logic;
ir_out_dp : OUT std_logic_vector(15 downto 0)
);
end component;
signal c_set_signal, readmem_signal,writemem_signal,zout_signal , cout_signal , c_reset_signal, z_set_signal, z_reset_signal,sr_load_signal, ResetPC_signal, PCplusI_signal, PCplus1_signal, RplusI_signal, Rplus0_signal, EnablePC_signal,
ir_load_signal,rst_signal, wp_add_signal, wp_reset_signal, rfl_write_signal ,rd_on_AddressUnitRSide_signal , rs_on_AddressUnitRSide_signal , address_on_databus_signal , aluout_on_databus_signal, rfh_write_signal , Shadow_signal : std_logic;
signal ir_signal, memAddress_signal : std_logic_vector(15 downto 0);
signal alu_opcode_signal : std_logic_vector(3 downto 0);
begin
controller_module : controller port map (
ResetPC_signal,
PCplusI_signal,
PCplus1_signal ,
RplusI_signal,
Rplus0_signal,
EnablePC_signal,
ir_load_signal,
wp_add_signal ,
wp_reset_signal,
c_set_signal ,
c_reset_signal ,
z_set_signal ,
z_reset_signal ,
sr_load_signal,
rd_on_AddressUnitRSide_signal ,
rs_on_AddressUnitRSide_signal ,
address_on_databus_signal ,
aluout_on_databus_signal ,
rfl_write_signal ,
rfh_write_signal ,
Shadow_signal,
alu_opcode_signal,
memAddress_signal,
readmem_signal,
writemem_signal,
clk,
zout_signal ,
cout_signal,
rst_signal,
ir_signal
);
datapath_module : datapath port map (
databus,
ResetPC_signal,
PCplusI_signal,
PCplus1_signal ,
RplusI_signal,
Rplus0_signal,
EnablePC_signal ,
clk,
ir_load_signal,
wp_add_signal,
wp_reset_signal,
c_set_signal ,
c_reset_signal ,
z_set_signal ,
z_reset_signal ,
sr_load_signal,
rd_on_AddressUnitRSide_signal ,
rs_on_AddressUnitRSide_signal ,
address_on_databus_signal ,
aluout_on_databus_signal ,
rfl_write_signal ,
rfh_write_signal ,
Shadow_signal,
alu_opcode_signal,
memAddress_signal ,
Zout_signal ,
Cout_signal,
ir_signal
);
read_mem <= readmem_signal;
write_mem <= writemem_signal;
ir_out <= ir_signal;
end rtl;