0% found this document useful (0 votes)
178 views9 pages

MipsIt Simulator Manual

This document provides an introduction to MipsIt Studio 2000 and the MIPS simulator. It describes how to download and install MipsIt Studio 2000, which is an integrated development environment for writing and compiling MIPS assembly programs. It also describes how to use the MIPS simulator to test programs by loading the compiled output and observing processor registers and memory in real time. Key features of both MipsIt Studio 2000 and the MIPS simulator are outlined, including how to create and build projects, view assembly output, and interact with memory and registers in the simulator.

Uploaded by

dragon10388
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views9 pages

MipsIt Simulator Manual

This document provides an introduction to MipsIt Studio 2000 and the MIPS simulator. It describes how to download and install MipsIt Studio 2000, which is an integrated development environment for writing and compiling MIPS assembly programs. It also describes how to use the MIPS simulator to test programs by loading the compiled output and observing processor registers and memory in real time. Key features of both MipsIt Studio 2000 and the MIPS simulator are outlined, including how to create and build projects, view assembly output, and interact with memory and registers in the simulator.

Uploaded by

dragon10388
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 9

 

 
 
 

Introduction to MipsIt Studio 2000


and the MIPS Simulator

MipsIt Studio 2000 and Simulator MIPS

Downloading and installing the program


Since MipsIt's official website, you can download the simulator MIPS for Windows. The
address is: http://www.bostream.nu/mats.brorsson/mipsit/Mipsit.zip
The file in question is compressed in ZIP format, which can be decompressed with the
compressor free WinZip smoothly. The file has to be unpacked in any directory of our hard
disk that does not contain spaces in its name and is already installed! You do not need special
permits Manager to install the software or do anything special.
In the directory where we decompressed the file will appear the following directories and
files:

Figure 1 - Folders and files that arise when decompress the file Mipsit.zip.

The bin directory ( "binaries") is the one that contains executable programs. In this
practice we will use two of them:
• MipsIt.exe → MipsIt Studio 2000 (programming environment for MIPS).
• Mips.exe → MipsSim (simulator MIPS).
It is appropriate to create two shortcuts from the Windows desktop to programs
MipsIt.exe and Mips.exe.

Figure 2 - Files contained in the bin directory.

MipsIt Studio 2000 (MipsIt.exe)

Introduction
This is the programming environment in which we will write our programs for MIPS
assembler. The graphical interface is similar to other applications such as Microsoft Developer
Studio for C + + and Borland JBuilder for Java.

Figure 3 - Appearance of MipsIt Studio 2000.


The fundamental idea in MipsIt Studio 2000 is "project" This is a set of interrelated
source files that are compiled and assembled to generate an executable file that is then taken to
the simulator MIPS (or a plate containing a MIPS processor ). In our case, a project can
contain programs written in MIPS assembler, programs written in C language and even text
files (for example documentation).
Major windows implementation:
• The window of programmes (right) shows the contents of the files.
• The window workspace (left) contains a list of all files included in the project. To open
a specific file, simply double-clicking on their names on the list.
• The output window (below) provides information during the compilation and assembly.
• The console (hidden by default) makes possible communication with a plaque
containing a MIPS processor.

In the menu "View" you can always choose which of these windows must be displayed
on screen.

Configuration
In the "File" menu, submenu "Options", we can configure MipsIt Studio 2000. In
addition to information about hardware (in case you have a plate), we can specify the directory
where the files are executable (bin), library files (lib) and header (include) the application.
You can also specify the location of the compiler (bin / xgcc.exe).

Creaction of a project
1. Select the "File" menu, submenu "New". Click on the tab "Project" if it is not selected
by default.
2. Choosing the type of project we are going to create. There are three possibilities:
Assembler → • The project files contain only assembler.
• C / Assembler → will only files in C language or files in C and assembler. We do not
recommend this option, because these programs can not be simulated with MipsSim.
• C (minimal) / Assembler → As in the previous case, but using only the basic files
library imperative. These programs do work in the simulator.

3. In "Project name" introduces the name of the project and specifies the location
( "Location"). Click OK.
Figure 4 - Window dialog creation of a project.

Add files to a new project


At this time we will have an empty project (no files associated with it). To create new
files, which remain the same steps to create a project, but this time we select the tab "File".

Figure 5 - Window dialogue to create a new file associated with the project.

Add existing files to a project


In this case, we open the "Project", submenu "Add file". We are a dialog in which we can
select the existing files you want to add to the project.
Compilation
Once written our programme, select the "Build", submenu "Build" (hot key: F7). This
will compile all files in C language and assemble and link all files of the project. The output
window (below) will be broadcast messages about how the process has done, if there are
mistakes, and so on.
If we want to recompile the whole project, select the "Build" submenu "Rebuild All".

Assembler generated for the files in C


If we have files written in C in our project, we can see what is the equivalent program in
assembler generated by MipsIt. To do so, having the compiler project, we open the file in C
and select the "Build" submenu "View Assembler."
Note: The file assembler generated data is stored in the hard disk.

MipsSim: MIPS Simulador (Mips.exe)


As we do not have any board with a MIPS processor, we need a simulator to test our
programs MIPS assembler. This is a graphical environment that allows you to view at all times
the memory status, records of the CPU, console output, and so on. as it is running our program,
which simulates the behavior that would have a real MIPS processor.
By double-clicking the file Mips.exe, a window appears as follows:

Figure 6 - Graphical interface of MIPS simulator.


Description of the simulated modules
On display are six modules:
• CPU → View / modify the contents of the records of the CPU, including the program counter
(PC), registers multiplications and divisions HI and LO (which here are called mdhi and mdlo,
respectively), as well as records coprocessor 0 (namely: ADB VA, STATUS, causes, EPC).
• RAM → View / modify the contents of the report. See below.
• → Console provides an entry / exit standard for the programs.
• I / O → Simula unit input / output of 8 bits. Includes 8 switches (tickets) and 8 LEDs
(departures).
• Cache D / I → cache to cache memories for instructions and data, respectively.
• Interrupt → Simula unit interruptions, with two buttons K1 and K2, and the clock.

We can open each of these modules simply by clicking on them. For example, if we open the
CPU, this is what we see:

Figure 7- Window that shows the values of registers of the CPU.

Loading a program in assembler in the simulator


Taking open at once MipsIt Studio 2000 and MipsSim, compiled a draft. If there are no
mistakes, we can transfer our program in assembler of MipsIt Studio 2000 to simulator. To do
so, in MipsIt Studio 2000 click on the "Build" submenu "Upload" option "To Simulator". If the
simulator is off to perform this operation, a window with the error message "Failed to upload
to simulator."
Another way to do this is to, from the simulator, select the "File" menu, submenu
"Open". We must select a file with a. SREC or. MipsIt out that Studio 2000 will be created in
the compilation and assembly phase of the project.

RAM Memory
Recall that MIPS has an address space of 32 bits, or what is the same, a total of 232
positions 1 byte of memory each, amounting in total to 4 gigabytes.
By clicking on "RAM, you'll see a window with the contents of the report ordered by
rows. Each one carries an address specified ( "Address"), beside which appears the memory at
that position (both expressed in hexadecimal notation compact). If there is a label that
identifies such instruction, it appears in the column "Label". Lastly is the equivalent assembler
of such instruction

Figure 8 - Example of the contents of RAM.

Precisely the assembly instructions that appear on the memory need not coincide exactly
with whom we have introduced in MipsIt Studio 2000. This is true, for example, if we used
pseudoinstrucciones reorders or if the assembly instructions for the purpose of optimizing the
code and management delays in jumps.
The positions that have no memory allocated data show content with queries (??).
Move along the memory using the arrows on the window or the scroll bar can be very
frustrating, because the memory includes 4 GB and these controls are not very manageable. It
is better to use the context menu that appears by clicking the right mouse button.

Figure 9 - Context menu that appears by clicking the right mouse button in the window of RAM.
The content of this menu is divided into four sections:
• The first lets you select between showing memory addresses virtual or physical.
Overall, the virtual addresses are those that concern us most.
• The second allows you to choose how to translate the contents of memory every
command. By default, we will use "Assembler" to see the equivalent assembler code machine,
but we can also choose between interpreting bit like whole numbers, integers unsigned, with
floating point precision as if they were single or ASCII characters.

• The third section, the most interesting, allows us to move easily along the memory:
or "Track Computer" keep the instruction indicated by the accountant's PC at the center of the
window. This allows always know what instruction is being implemented.
or "Jump to PC" jumps to the position of memory pointed by the PC, without track ( "track")
as the previous option.
or "SP Jump to" jump to the position memory indicated by the stack pointer SP.
or "Jump to Symbol" jumps to the position memory indicated by a label or symbol.
• The fourth and final section of this menu allows you to modify the value of the
counter program to specify what will be the next instruction to be executed ( "Set Next
Statement") and allows us to establish a breaking point for debugging tasks of the programme (
"Set Breakpoint"). It also can be placed directly break points by double-clicking on the
instruction of interest (which will be marked with a circle to the left of it).

Simulation
With a program loaded into RAM as we can simulate. To do this we have three buttons
that allow us to monitor the performance:
• The green arrow to the right causes the program simulating from start to finish (or
until the first point of rupture). Should have stopped the program with the pause button or
through a breaking point, allowing resumption of execution.
• The two vertical bars yellow allow a pause in the execution.
• Finally, the button with a blue and an arrow rectangulito allow execute instructions in
machine code from one to one.

Figure 10- Buttons control the simulation.

You might also like