You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -167,13 +170,14 @@ Adding control logic for branches.
167
170
| addi | 1 | 0 | 0 | 10 | 1 | 1 | 00 |
168
171
| slti | 1 | 0 | 1 | 11 | 1 | 1 | 00 |
169
172
| jr | 0 | 0 | 0 | 10 | 0 | x | 01 |
170
-
| beq | 0 | 0 | x | xx | x | 1 | 10|
171
-
| bne | 0 | 0 | x | xx | x | 1 | 10|
173
+
| beq | 0 | 0 | x | xx | x | 1 |(*)|
174
+
| bne | 0 | 0 | x | xx | x | 1 |(*)|
172
175
| j | 0 | 0 | x | xx | x | 1 | 11 |
173
176
174
177
The branch target for the relative branches (`beq` and `bne`) is computed by a seprate adder (not by the Alu). This decision allows the Alu to compute return address for function calls in the real MIPS.
175
178
176
-
Notice, for generating the `pc_sel` signal we need to take into accunt the `eq` input (`a_data` == `b_data`).
179
+
Notice, for generating the `pc_sel` signal we need to take into accunt the *eq* input (`a_data` == `b_data`).
180
+
177
181
The `jr` instruction assumes the `rt` field to be `zero` and adds that (0) to the `rs` field. The real MIPS has a special ALU opcode for just passing the `rs` field, so here we break a bit with the MIPS specification.
178
182
179
183
The corresponding implementation is found in `src/decoder1.veryl`. A test program is found in `src/instr_mem1.veryl` allong with the top level `src/vips1.veryl`. See List of current tests, for running the model.
@@ -182,7 +186,10 @@ The corresponding implementation is found in `src/decoder1.veryl`. A test progra
182
186
183
187
## Full Vips
184
188
185
-
The Full Vips adds support for word sized access to data memory.
189
+
The Full Vips adds support for word sized access to data memory. The decoder/control unit implements the following logic.
190
+
191
+
Notice (*), for `beq` the `pc_sel` is `eq ? 10 : 00`, `bne` the `pc_sel` is `eq ? 00 : 10`, respectively.
@@ -196,12 +203,13 @@ The Full Vips adds support for word sized access to data memory.
196
203
| addi | 1 | 0 | 0 | 10 | 1 | 1 | 00 | 0 |
197
204
| slti | 1 | 0 | 1 | 11 | 1 | 1 | 00 | 0 |
198
205
| jr | 0 | 0 | 0 | 10 | 0 | x | 01 | x |
199
-
| beq | 0 | 0 | x | xx | x | 1 | 10| x |
200
-
| bne | 0 | 0 | x | xx | x | 1 | 10| x |
206
+
| beq | 0 | 0 | x | xx | x | 1 |(*)| x |
207
+
| bne | 0 | 0 | x | xx | x | 1 |(*)| x |
201
208
| j | 0 | 0 | x | xx | x | x | 11 | x |
202
209
| lw | 1 | 0 | 0 | 10 | 1 | 1 | 00 | 1 |
203
210
| sw | 0 | 0 | 0 | 10 | 1 | 1 | 00 | x |
204
211
212
+
205
213
The load and store instructions computes the effective address using the Alu (`rs` + sig_ext(`imm`)). The data to store comes from the `rt` field (`b_data`).
206
214
207
215
The corresponding implementation is found in `src/decoder.veryl`. A test program is found in `src/instr_mem.veryl` allong with the top level `src/vips1.veryl`. See List of current tests, for running the model.
0 commit comments