Due Monday, October 27, 2008 at 10 PM
I have constructed a circuit for the one-cycle implmentation of the MIPS instruction subset machine described in the book and in class. Your task will be to construct three new versions of this circuit. One version adds the slti instruction (opcode 10). Another version adds the lun instruction (opcode 39). A third version adds the min instruction (opcode 0, func 1).
The slti instruction is like the slt instruction, except that it is an I-format instruction. It compares the source register (rs) value and the signed extended immediate value, and sets the destination register (rt) to 1 if the source register value is less than the sign extended immediate value, 0 otherwise.
The lun instruction allows an effective address that is not a multiple of 4. It loads into the destination register (rt) the part of the word that the effective address specifies and sets the rest of the register to 0. For example, if the effective address is 4, then the entire word at memory location 4 is loaded. If the effective address is 5, then the upper byte of the destination register is set to 0 and the lower three bytes are set to the contents of bytes 5, 6 and 7. If the effective address is 6, then the upper two bytes of the destination register are set to 0 and the lower two bytes are set to the contents of bytes 6 and 7. If the effective address is 7, then the upper three bytes of the destination register are set to 0 and the lower byte is set to the contents of byte 7. This is not a real MIPS instruction.
The min instruction sets the destination register (rd) to the smallest of the signed values in the two source registers (rs and rt). This is not a real MIPS instruction.
Each version should add just one instruction to the original circuit. Do not add two or all three instructions to the same version.
Make sure the original instructions (lw, sw, add, sub, and, or, slt, beq, j and halt) still work after you make your modifications.
You can use any elements supported by JLS that you like. It must still execute all instructions in one cycle.
The directory /classes/cs3421/common/lab4 has a working one-cycle implementation of the MIPS subset machine. It is in the files
OneCycle.jls alucontrol.jls alu.jls control.jls regfile.jls
First make a copy of these files in your own directory. Then make three copies of OneCycle.jls with the names: slti.jls, lun.jls, min.jls. Modify each circuit to add the corresponding instruction.
DO NOT change the names of the PC, IMEM, DMEM or registers R1-R31.
DO NOT change the propogation delays of any elements.
DO NOT change the initial values of the PC or registers R1-R31.
DO NOT change the file names of the initial memory files for IMEM and
DMEM.
You may have to adjust the clock cycle time. You don't have to pick the absolute smallest cycle time. On the other hand don't set it to some arbitrarily large value.
The instruction and data memory elements in the one-cycle circuit read their initial contents from the files instmem and datamem respectively. To test your circuit, you must have these two files in the same directory as the .jls circuit files, AND you must start up jls from the command line while in that same directory (because JLS reads memory initialization files from the same directory as JLS is started up in).
The directory /classes/cs3421/common/lab4/memfiles contains six memory files you can use to test. They are:
instmem.slti datamem.slti instmem.lun datamem.lun instmem.min datamem.min
To use a pair, copy them to instmem and datamem, then run your circuit.
Tests for existing instructions also exist. Most of the instructions are tested by instmem.sum and datamem.sum. The AND instruction is tested by instmem.and and datamem.and. The OR instruction is tested by instmem.or and datamem.or.
You should create some other tests too. We will when we grade your circuit.
Be sure to add your name (and your partner's if you have one) to the circuit diagram. We won't be able to give your partner a grade if his/her name is not in the circuit diagram.
Use the submit command to electronically submit your circuit files. You can submit each individually, so when you get one working, submit it and then start working on the next one.
You must submit your circuits by the due date/time in order to receive credit.