-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterface.txt
242 lines (203 loc) · 4.26 KB
/
Interface.txt
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
In: 58-bits
3-bit: (CF- NF- ZF)
16-bit: In port
16-bit: Rdst
4-bit: Jump signals (JMP - JC - JN - JZ )
16-bit: Address to jump on from in port
2-bit: Control signals WHAT??????
1-bit: PC increment stall signal
-------------------------------------------------
Out: 64-bits
16-bit: In port
32-bit: Address of next instruction
16-bit: Instruction
*/
fetch_stage(In, Out, Clk, Rst);
/****************************************************************************/
//Decode Stage
/*
writeback: 21-bits
1-bit: feedback LDM
1-bit: WB signal
16-bit: Writeback value
3-bit: Writeback Address
--------------------------------------------------
In: 69-bits
16-bit: In port
32-bit: Address of next instruction
16-bit: Instruction
1-bit: Interrupt signal
//For the LUCU
1-bit: Memory read signal
3-bit: Rdst Address
--------------------------------------------------
Out: (135)-bits
1-bit: decodeBufferDisable
1-bit :MOV
1-bit :JC
1-bit :JN
1-bit :jz
1-bit : interrupt control signal(for roumi)
1-bit stall
1-bit: second iteration
1-bit : flush
16-bit: In port
32-bit: Address of next instruction
16-bit: Rsrc value
16-bit: Rdst value
3-bit: Rsrc Address
3-bit: Rdst Address
16-bit: Imm value
1-bit: ALU_enable
7-bit: ALU-Control
1-bit ldm
1-bit: Immediate value or single-op instructions except CALL
1-bit: STD
1-bit: JMP
1-bit: Flags Protection
1-bit: PUSH
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: CALL
1-bit: Memory read
1-bit: Memory write
1-bit: WB signal
*/
decode_stage (In, Out, writeback, Rst, Clk);
/****************************************************************************/
//Execute stage
/*
In: (102)-bits
1-bit :JC
1-bit :JN
1-bit :jz
16-bit: In port
32-bit: Address of next instruction
16-bit: Rsrc value
16-bit: Rdst value
3-bit: Rsrc Address
3-bit: Rdst Address
16-bit: Imm value
-----------------------------------------------
Ctrl: 25-bits
1-bit: ScndIteration
1-bit: ALU_enable
7-bit: ALU-Control
1-bit: LDM
1-bit: Immediate value or single-op instructions except CALL
1-bit: STD
1-bit: JMP
1-bit: Flags Protection
1-bit: PUSH
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: CALL
1-bit: Memory read
1-bit: Memory write
1-bit: WB signal
----------------------------------------------
Fwd: 40-bits (These are inputs)
1-bit: Execute Rdst WB
3-bit: Execute Rdst Address
16-bit: Execute Rdst value
1-bit: Memory Rdst WB
3-bit: Memory Rdst Address
16-bit: Memory Rdst value
----------------------------------------------
Out: 106-bits
7-bit: Jump signals ( CF- NF-ZF - JMP - JC - JN - JZ )
16-bit: In port
32-bit: Address of next instruction
16-bit: Rsrc value
16-bit: ALU output
3-bit: Rsrc Address
3-bit: Rdst Address
1-bit: Previous stack op
1-bit: PUSH
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: second iteration
1-bit: CALL
1-bit: Memory read
1-bit: Memory write
1-bit: WB signal
*/
execute_stage (In, Ctrl, Fwd, Out, Reset, CLK);
/****************************************************************************/
//Memory stage
/*
MemoryInput: 86-bits
16-bit: In port
32-bit: Address of next instruction
16-bit: Rsrc value
16-bit: ALU output
3-bit: Rsrc Address
3-bit: Rdst Address
----------------------------------------------
Ctrl: 13-bits
1-bit: Previous stack op
1-bit: PUSH
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: second iteration
1-bit: CALL
1-bit: Memory read
1-bit: Memory write
1-bit: WB signal
-----------------------------------------------
MemoryOutput: 60-bits
1-bit: Prev Stack Op
1-bit: Memory Read
16-bit: In port
16-bit: Memory data out
16-bit: ALU output
3-bit: Rdst Address
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: WB signal
*/
memory_stage (MemoryInput, Ctrl, MemoryOutput);
/****************************************************************************/
//Writeback stage
/*
In: 58-bits
16-bit: In port
16-bit: Memory data out
16-bit: ALU output
3-bit: Rdst Address
1-bit: POP
1-bit: RET
1-bit: RTI
1-bit: LDD
1-bit: IN
1-bit: OUT
1-bit: WB signal
--------------------------------------------
Out: 36-bits
16-bit: Output Port
16-bit: Writeback value
3-bit: Rdst Address
1-bit: WB signal
*/
writeback_stage(In, Out);