In this project, you are required to extend the MIPS single-cycle implementation by implementing additional instructions. You will use ModelSim simulator [1] to develop and test your code. You are required to implement your assigned 6 instructions (selected from following 28 instructions). Note that your set of 6 instructions will be emailed to you or your group member.
R-format (11): balrn, balrz, sll, srl, sllv, srlv, jmadd, jmor, jmsub, jalr, jr
I-format (13): xori , andi, ori, bneal, bgez, bgezal, bgtz, blez, bltzal, bltz, jrs, jrsal, jpc
J-format (4): baln, balz, balv, jal
You must design the revised single-cycle datapath and revised control units which make a processor that executes your instructions as well as the instructions implemented already in the design. After designing the new enhanced processor, you will implement it in Verilog HDL.
Specifications of New Instructions
Instr Type Code Syntax Meaning
- xori I-type opcode=14 xori $rt, $rs, Label Put the logical XOR of register $rs and the zero- extended immediate into register $rt.
- andi I-type opcode=12 andi $rt, $rs, Label Put the logical AND of register $rs and the zero- extended immediate into register $rt.
- ori I-type opcode=13 ori $rt, $rs, Label Put the logical OR of register $rs and the zero- extended immediate into register $rt.
- bneal I-type opcode=45 bneal $rs, $rt, Target if R[rs] != R[rt], branches to PC-relative address (formed as beq & bne do), link address is stored in register 31
- bgez I-type opcode=39 bgez $rs, Label if R[rs] >= 0, branch to PC-relative address (formed
as beq & bne do)
- bgezal I-type opcode=35 bgezal $rs, Label if R[rs] >= 0, branch to PC-relative address (formed
as beq & bne do), link address is stored in register 31.
- bgtz I-type opcode=38 bgtz $rs, Label if R[rs] > 0, branch to PC-relative address (formed
as beq & bne do)
- blez I-type opcode =6 blez $rs, Label if R[rs] <= 0, branch to PC-relative address (formed
as beq & bne do)
- bltzal I-type opcode=34 bltzal $rs, Label if R[rs] < 0, branch to to PC-relative address (formed as beq & bne do), link address is stored in register 31.
- bltz I-type opcode=1 bltz $rs, $rt, Target if R[rs] < 0, branches to PC-relative address (formed as
beq & bne do)
- balrz R-type funct=22 balrz $rs, $rd if Status [Z] = 1, branches to address found in register
$rs link address is stored in $rd (which defaults to 31)
- balrn R-type funct=23 balrn $rs, $rd if Status [N] = 1, branches to address found in register
$rs link address is stored in $rd (which defaults to 31)
13. jmadd R-type funct=32 | jmadd $rs,$rt jumps to address found in memory [$rs+$rt], link address is stored in $31 |
14. jmor R-type funct=37 | jmor $rs,$rt jumps to address found in memory [$rs|$rt], link address is stored in $31 |
15. jmsub R-type funct=34 | jmsub $rs,$rt jumps to address found in memory [$rs-$rt], link address |
is stored in $31 | |
16. jalr R-type func=9 | jalr $rs, $rd Unconditionally jump to the address found in register $rs, link address is stored in $rd. |
17. jr R-type func=8 jr $rs Unconditionally jump to the address found in |
register $rs
- balv J-type opcode=33 balv Target if Status [V] = 1, branches to pseudo-direct address
(formed as jal does), link address is stored in register 31 19. balz J-type opcode=26 balz Target if Status [Z] = 1, branches to pseudo-direct address
(formed as jal does), link address is stored in register 31
- baln J-type opcode=27 baln Target if Status [N] = 1, branches to pseudo-direct address
(formed as jal does), link address is stored in register 31
- jal J-type opcode=3 jal Target jump to pseudo-direct address (formed as j does), link address is stored in register 31.
- jpc I-type opcode=30 jpc Target jumps to PC-relative address (formed as beq and bne do) link address is stored in $rt (which defaults to 31)
- jrs I-type opcode=18 jrs $rs jumps to address found in memory where the memory address is written in register $rs.
- jrsal I-type opcode=19 jrsal $rs jumps to address found in memory where the memory address is written in register $rs and link address is stored in memory (DataMemory[$rs]).
- sll R-type func=0 sll $rd, $rt, shamt shift register $rt to left by shift amount (shamt) and store the result in register $rd.
- srl R-type func=2 srl $rd, $rt, shamt shift register $rt to right by shift amount (shamt) and store the result in register $rd.
- sllv R-type func=4 sllv $rd, $rt, $rs shift register $rt to left by the value in register $rs, and store the result in register $rd.
- srlv R-type func=6 srlv $rd, $rt, $rs shift register $rt to right by the value in register $rs, and store the result in register $rd.
Status Register
Some of the conditional branches test the Z and N bits in the Status register. So the MIPS datapath will need to have a Status register, with the following 3 bits: Z (if the ALU result is zero) , N (if the ALU result is negative) or V (if the ALU result causes overflow). The Status register will be loaded with the ALU results each clock cycle.
Reviews
There are no reviews yet.