Software
- Download the file mmips.zip
(15 MB) from this page.
- Extract the archive to the root of your d drive 'd:\'. You may
choose another location if desired.
- Execute the file 'install.bat' from the directory 'd:\mmips'.
This will install the software needed for the mMIPS. Note that in
all setup programs you should use the default or normal
installation. For information on the installation of Cygwin look
here.
The following programs are installed:
- HDD Hex Editor, a freeware hexeditor.
- WinWave, a waveform viewer.
- SystemC, the SystemC library ported to borland
- Cygwin, a unix emulator for windows.
- LCC, a protable compiler for the mini-MIPS
- The pipelined mini-MIPS in a synthesizable and
non-synthesizable version.
The Hexeditor and Cygwin are the only programs for which a
setup program must be run. The other programs are ready to use
when the archive is extracted (already done in step 2).
- To compile the SystemC mini-mini MIPS, you will also need
Borland C++Builder version 6. You can download it from the NUS
web
shopping page.
- In the web shopping page, you will find the Borland C++
Builder version 6 from the category of Language and compilers.
Getting startedThis short gestting started guide describes
how you can compile and simulate the mini MIPS (mMIPS) SystemC
model. In the guide we refer to <installdir>, this refers to
the directory to which you extracted the archive (e.g. 'd:\mmips'
for a typical setup).
1) Load the mMIPS source code into C++Builder. Do this by
double-clicking on the Borland project file for the mMIPS. This file
('pipelined_nonsyn.bpr') can be found in the directory
'mips\pipelined_nonsyn' of your installation. This directory
contains also the source code of the mMIPS.
2) If you click on the project file, C++Builder opens and loads
the project. The mMIPS can now be compiled and simulated by
selecting the option 'Run' from the 'Run' menu. Borland will first
compile all source code (and produce 3 warning messages, which can
be ignored) and then link and run the mMIPS.
3) At the start of the simulation, the mMIPS load the content of
the file 'mips_ram.bin' into the data memory. The content of the
file 'mips_rom.bin' is loaded into the instruction memory. The
default program used is the following: nop
subu a2,a2,a2
lw at,0(zero)
lw v0,4(zero)
lw v1,8(zero)
lw a0,12(zero)
lw a1,16(zero)
lb t1,0(a2)
nop
andi t1,t1,0xff
sll t2,t1,0x8
sll t3,t2,0x8
sll a3,t3,0x8
lb t1,1(a2)
nop
andi t1,t1,0xff
sll t2,t1,0x8
sll t3,t2,0x8
or a3,a3,t3
lb t1,2(a2)
nop
andi t1,t1,0xff
sll t2,t1,0x8
or a3,a3,t2
lb t1,3(a2)
nop
andi t1,t1,0xff
or a3,a3,t1
subu a3,a3,v1
and a3,a3,a0
xor a3,a3,a1
sw a3,4(a2)
add a2,a2,v0
slt t0,at,a2
beqz t0,0x1c
nop
b 0x90
This program is stored in binary format in the mips_rom.bin
file. You can view it using the hexeditor. You can use the hexeditor
also to code your own programs. To do this, you simple rewrite the
desired assembler instruction from the textual format shown in the
above program to its corresponding binary code. This code must then
be inserted into the binary.
5) After simulating the mMIPS, you get a file 'mips_ram.dump'.
This contains the data-memory at the end of the simulation (program
run). The simulation produces also a file 'mips.vcd'. This file
contains a trace of all signals inside the system during the
simulation. It can be viewed using the winwave viewer
('<installdir>\gtkwave\winwave.exe').
|