Skip to content

Commit b99392b

Browse files
committed
readme
1 parent 55b8dc0 commit b99392b

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed

README.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,74 @@ The Alu has the `sub` and `op` inputs defined as follows:
136136

137137
### Decoder
138138

139-
The VIPS support a subset of the MIPS32 ISA:
140-
141-
| Operation | `rf_we` | `wb_reg` | `sub` | `op` | `alu_src` | `sign_ext` |
142-
| --------- | :-----: | :------: | :---: | :---: | :-------: | :--------: |
143-
| and | 1 | 1 | 0 | 00 | 0 | x |
144-
| or | 1 | 1 | 0 | 01 | 0 | x |
145-
| add | 1 | 1 | 0 | 10 | 0 | x |
146-
| sub | 1 | 1 | 1 | 10 | 0 | x |
147-
| slt | 1 | 1 | 1 | 11 | 0 | x |
148-
| andi | 1 | 0 | 0 | 00 | 1 | 0 |
149-
| ori | 1 | 0 | 0 | 01 | 1 | 0 |
150-
| addi | 1 | 0 | 0 | 10 | 1 | 1 |
151-
| slti | 1 | 0 | 1 | 11 | 1 | 1 |
139+
The VIPS support a subset of the MIPS32 ISA. We can capture the control logic for the supported arithmetic operations in the below table:
140+
141+
| Operation | `rf_we` | `w_reg_sel` | `sub` | `op` | `alu_b_sel` | `sign_ext` |
142+
| --------- | :-----: | :---------: | :---: | :---: | :---------: | :--------: |
143+
| and | 1 | 1 | 0 | 00 | 0 | x |
144+
| or | 1 | 1 | 0 | 01 | 0 | x |
145+
| add | 1 | 1 | 0 | 10 | 0 | x |
146+
| sub | 1 | 1 | 1 | 10 | 0 | x |
147+
| slt | 1 | 1 | 1 | 11 | 0 | x |
148+
| andi | 1 | 0 | 0 | 00 | 1 | 0 |
149+
| ori | 1 | 0 | 0 | 01 | 1 | 0 |
150+
| addi | 1 | 0 | 0 | 10 | 1 | 1 |
151+
| slti | 1 | 0 | 1 | 11 | 1 | 1 |
152+
152153

153154
![image](images/vips_no_branch.svg)
154155

155156
## Simple Vips
156157

158+
Adding control logic for branches.
159+
160+
| Operation | `rf_we` | `w_reg_sel` | `sub` | `op` | `alu_b_sel` | `sign_ext` | `pc_sel` |
161+
| --------- | :-----: | :---------: | :---: | :---: | :---------: | :--------: | :------: |
162+
| and | 1 | 1 | 0 | 00 | 0 | x | 00 |
163+
| or | 1 | 1 | 0 | 01 | 0 | x | 00 |
164+
| add | 1 | 1 | 0 | 10 | 0 | x | 00 |
165+
| sub | 1 | 1 | 1 | 10 | 0 | x | 00 |
166+
| slt | 1 | 1 | 1 | 11 | 0 | x | 00 |
167+
| andi | 1 | 0 | 0 | 00 | 1 | 0 | 00 |
168+
| ori | 1 | 0 | 0 | 01 | 1 | 0 | 00 |
169+
| addi | 1 | 0 | 0 | 10 | 1 | 1 | 00 |
170+
| slti | 1 | 0 | 1 | 11 | 1 | 1 | 00 |
171+
| jr | 0 | 0 | 0 | 10 | 0 | x | 01 |
172+
| beq | 0 | 0 | x | xx | x | 1 | 10 |
173+
| bne | 0 | 0 | x | xx | x | 1 | 10 |
174+
| j | 0 | 0 | x | xx | x | 1 | 11 |
175+
176+
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.
177+
178+
Notice, for generating the `pc_sel` signal we need to take into accunt the `eq` input (`a_data` == `b_data`).
179+
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.
180+
157181
![image](images/vips_simple.svg)
158182

159183
## Full Vips
160184

185+
The Full Vips adds support for word sized access to data memory.
186+
187+
| Operation | `rf_we` | `w_reg_sel` | `sub` | `op` | `alu_b_sel` | `sign_ext` | `pc_sel` | `d_sel` |
188+
| --------- | :-----: | :---------: | :---: | :---: | :---------: | :--------: | :------: | :-----: |
189+
| and | 1 | 1 | 0 | 00 | 0 | x | 00 | 0 |
190+
| or | 1 | 1 | 0 | 01 | 0 | x | 00 | 0 |
191+
| add | 1 | 1 | 0 | 10 | 0 | x | 00 | 0 |
192+
| sub | 1 | 1 | 1 | 10 | 0 | x | 00 | 0 |
193+
| slt | 1 | 1 | 1 | 11 | 0 | x | 00 | 0 |
194+
| andi | 1 | 0 | 0 | 00 | 1 | 0 | 00 | 0 |
195+
| ori | 1 | 0 | 0 | 01 | 1 | 0 | 00 | 0 |
196+
| addi | 1 | 0 | 0 | 10 | 1 | 1 | 00 | 0 |
197+
| slti | 1 | 0 | 1 | 11 | 1 | 1 | 00 | 0 |
198+
| 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 |
201+
| j | 0 | 0 | x | xx | x | x | 11 | x |
202+
| lw | 1 | 0 | 0 | 10 | 1 | 1 | 00 | 1 |
203+
| sw | 0 | 0 | 0 | 10 | 1 | 1 | 00 | x |
204+
205+
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+
161207
![image](images/vips_full.svg)
162208

163209

0 commit comments

Comments
 (0)