Getting Started - The basic requirement for this simulator to run is that you must have Visual BASIC 6.0 installed on your computer.
- This software requires minimum 1024x768 screen resolution.
- Download the Configurable MIPS Simulator package
- Unzip the package in a folder and click on Visual MIPS <date and version>.exe.
- In the Architecture Menu select MIPS 5-Stage Integer Pipeline. Currently this the only MIPS architecture that this simulator supports. More are currently under development.
How to Write a program? You can either write a program or you can Load an already written program.To write a program go to File menu and press write program. The simulator will ask you to enter a starting address of the program in the code memory. You can enter a number in the 32-bit range. I, for example, entered 2000. The program is initialized with 25 NOP operations. You can click on the NOP and a drop-down menu appears. Here you can scroll to select instruction from the MIPS instruction set. Branch instructions have limitation that you can only branch within the program. Once you have written your program, click assemble and program will be imported in the simulator. While in simulator, remember to save your program using Save Program Option in File Menu. The program will be given a .INT extention. Running the Simulator and Getting Help Once you assemble your program you can run it using Clock It button. You will see the first instruction entering in the IF stage. By clicking on some of the values or signals you can see a more informational Help Bar appearing at the bottom of the simulator. For example when you click on the PC value, the Help Bar print PC value in decimal, hex and 32-bit binary. Similarly when you click on the instruction, you will Help Bar explaining the instruction. Click again and you will see first instruction going in the ID stage and second instruction entering in the IF stage. At this point the simulator will ask the values of registers you need to read from the register file. If you like, you can go to Registers Menu and press Initialize to all registers will some values. This will save you from entering registers all the time. All used registers and their values appear at the top of the MIPS simulator screen. At present I will stop here to further explain the simulator. Please load the examples below to do some experiments. Sample Programs Important Note: Each time you load a new program, remember to refresh it in the program write and press Reset Button to reset the MIPS simulator.Sample Program 1: Forwarding download Load this program in the simulator. Then do the following: - First Run this program without any Forwarding or Stall Detection. You can see Data Hazards and program does NOT run properly.
- Now run this program with Stall Detection On and see how this program runs. If you are a teacher you can ask your students to draw a pipeline diagram. What they see is that there will be many ID stage stalls. Ask students to notice what happens to the stalled instruction.
- Now you can turn on the Forwarding Option and I would recommend to ask them to turn OFF the Stall Detection option. This time they notice that the program is working fine. You can write many sample programs to see data taking different forwarding path options.
Simple Program 2: Load Use Delay. download Load this program which has one Load Word Instruction followed by an instruction that uses loaded data. - Run the program with only Forwarding ON. Does this program run correctly? Try explaining that using a pipeline diagram.
- Again bring in the Stall Detection hardware and draw the pipeline diagram. Where is the stall now?
Simple Program 3: Branch Hazards download Load this program to study a simple loop instruction. Here you can learn a lot of things: - First run this program with Aggressive Branching OFF.
- Then turn ON the aggressive branching option and see the branch decision hardware moving in the ID stage, and saving two clock cycles.
Simple Program 4: Bubble Sort download Load this program to study Bubble Sort. Questions, Comments, and Bugs Please give your feedback and report all the bugs (with the program and CC #) to Muhammad Jahangir Ikram |