Lab B: Adding R-Type Instructions to the Data Path Simulator, PathSim

With the conclusion of this lab, you will extend the data path simulator so that the additional R-type instructions nor, xor, sllv, srav and srlv will execute. The assembler is already written to handle these instructions; your assignment for this lab exercise is to write java code that adds functionality to the ALU and the ALU control unit.

Files Pertaining to the Lab Project:

You will need, in addition to this document and the data path simulator PathSim, the java and archive (jar) files found in the folder PathSim\SuggestedLabExercises\LabB\Extensions.

 

Steps:

  1. Use Eclipse (or your favorite java IDE) and create a new project containing the java stubs found in the folder PathSim\SuggestedLabExercises\LabBExtensions. You must also include in your project the external jar file DataPath.jar that is provided with this lab.
  2.  Add java code to the program stubs ExtendedALUControl and ExtendedALU, working first on the execute method for the class ExtendedALUControl and then the execute method for the class ExtendedALU. You will not make any changes to the program file ExtendedControlUnit.java for this lab. Instructions on what needs to be accomplished are given as comments within the program studs. The descriptions of instructions given on the following page may also be helpful.

3.      When you have completed coding and compiling, EXPORT the three classes ExtendedALU, ExtendedALUControl and ExtendedControlUnit into a single jar file. The jar file MUST be given the name Extensions.jar. Replace the jar file Extensions.jar in the folder PathSim\DataPathSimulator with the one you have created. You can now run the data path simulator and test your implementations of the new operators by opening PathSim.html with your browser. You must also construct a test suite for testing your extensions.


Any one or more of the following instructions are to be handled by the data path simulator PathSim.

 

nor       rd, rs, rt                        nor rs with rt storing the result in rd

00

rs

rt

rd

0

0x27

Use 3 for the ALUControl signal sent to the ALU from the Alu Control Unit

 

xor       rd, rs, rt                        xor rs with rt storing the result in rd

00

rs

rt

rd

0

0x26

Use 4 for the ALUControl signal sent to the ALU from the Alu Control Unit

 

sllv       rd, rt, rs            shift left logical rt by the amount in rs storing the result in rd

00

rs

rt

rd

0

0x04

Use 5 for the ALUControl signal sent to the ALU from the Alu Control Unit

 

srav      rd, rt, rs            shift right arithmetic rt by the  amount in rs storing the result in rd

00

rs

rt

rd

0

0x07

Use 8 for the ALUControl signal sent to the ALU from the Alu Control Unit

 

srlv       rd, rt, rs            shift right logical rt by the amount in rs storing the result in rd

00

rs

rt

rd

0

0x06

Use 9 for the ALUControl signal sent to the ALU from the Alu Control Unit