-
Notifications
You must be signed in to change notification settings - Fork 0
/
sayeh.vhd
134 lines (119 loc) · 5.32 KB
/
sayeh.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
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity sayeh is
port(
input :in std_logic_vector(15 downto 0);
output :out std_logic_vector(15 downto 0);
clk,externalreset : in std_logic);
end entity;
architecture rtl of sayeh is
component datapath is
port(
clk ,
ResetPC, PCplusI, PCplus1, RplusI, Rplus0:in std_logic;
RS_On_addressUnitRside,Rd_On_addressUnitRside,
enablePc : in std_logic;
b15to0 , aandb,aorb ,notb ,aaddb ,asubb ,axorb ,acompb,shrB ,shlB,twicecompb,amulb : in std_logic;
RFLwrite,RFHwrite,
wpadd,wpreset,
irload,
srload,
address_on_databus,alu_on_databus,
ir_on_lopndbus,ir_on_hopndbus,rfright_on_opndbus,
cset,creset,zset,zreset,shiftir,
shadow: in std_logic;
databus: inout std_logic_vector (15 downto 0);
addressbus,instruction: out std_logic_vector(15 downto 0);
cout,zout :out std_logic
);
end component;
--controller
component controller IS
PORT (
externalreset, memdataready : IN std_logic;
clk, cflag, zflag : IN std_logic;
irout : IN std_logic_vector(15 DOWNTO 0);
ResetPC, PCplusI, PCplus1, RplusI, Rplus0 : OUT std_logic;
RS_On_addressUnitRside, Rd_On_addressUnitRside, enablePc : OUT std_logic;
b15to0, aandb, aorb, notb, aaddb, asubb, axorb, acompb, shrB, shlB, twicecompb,amulb : OUT std_logic;
RFLwrite, RFHwrite, wpadd, wpreset,
irload, srload,
address_on_databus, alu_on_databus, ir_on_lopndbus, ir_on_hopndbus, rfright_on_opndbus,
cset, creset, zset, zreset,readmem, writemem
,readio,writeio,shiftir: OUT std_logic;
shadow: out std_logic
);
end component;
-- memory component
component cachemem is
port(clk, readmem, writemem ,readio,writeio,reset: in std_logic;
input :in std_logic_vector (15 downto 0);
output : out std_logic_vector (15 downto 0);
addressbus: in std_logic_vector (15 downto 0);
databus : in std_logic_vector (15 downto 0);
databusout : out std_logic_vector (15 downto 0);
memdataready : out std_logic
);
end component;
--signals
--signal clk : std_logic;
signal ResetPC, PCplusI, PCplus1, RplusI, Rplus0: std_logic;
signal RS_On_addressUnitRside,Rd_On_addressUnitRside,
enablePc : std_logic;
signal b15to0 , aandb,aorb ,notb ,aaddb ,asubb ,axorb ,acompb,shrB ,shlB,twicecompb,amulb : std_logic;
signal RFLwrite,RFHwrite,
wpadd,wpreset,
irload,
srload,
address_on_databus,alu_on_databus,
ir_on_lopndbus,ir_on_hopndbus,rfright_on_opndbus,
cset,creset,zset,zreset
,readio,writeio,
shadow,shiftir: std_logic;
signal databus: std_logic_vector (15 downto 0);
signal addressbus,instruction: std_logic_vector(15 downto 0);
signal cout,zout : std_logic;
-- signal externalreset: std_logic;
signal readmem, writemem, memdataready : std_logic;
begin
output <= (others => 'Z');
controllermodule : controller port map (externalreset , memdataready,clk,cout,zout,
instruction,
ResetPC, PCplusI, PCplus1, RplusI, Rplus0,
RS_On_addressUnitRside, Rd_On_addressUnitRside,
enablePc,
b15to0, aandb, aorb, notb, aaddb, asubb,
axorb, acompb, shrB, shlB, twicecompb,amulb,
RFLwrite, RFHwrite,
wpadd, wpreset,
irload, srload,
address_on_databus, alu_on_databus, ir_on_lopndbus,
ir_on_hopndbus, rfright_on_opndbus,
cset, creset, zset, zreset,
readmem, writemem
,readio,writeio,shiftir
,shadow
);
datapathmodule : datapath port map (
clk,
ResetPC, PCplusI, PCplus1, RplusI, Rplus0,
RS_On_addressUnitRside,Rd_On_addressUnitRside,
enablePc,
b15to0 , aandb,aorb ,notb ,aaddb ,asubb
,axorb ,acompb,shrB ,shlB,
twicecompb ,
amulb,
RFLwrite,RFHwrite,
wpadd,wpreset,
irload,
srload,
address_on_databus,alu_on_databus,
ir_on_lopndbus,ir_on_hopndbus,rfright_on_opndbus,
cset,creset,zset,zreset,shiftir,
shadow,
databus,addressbus,instruction,
cout,zout);
-- memorymodule : memory port map ( clk, readmem, writemem,readio,writeio, input, output, addressbus,databus,memdataready );
memotymodule : cachemem port map(clk, readmem, writemem,readio,writeio,externalreset, input, output, addressbus,databus,databus,memdataready);
end ;