you are here: TCNJ :: mic1 :: Step
mic1 simulator - Step-by-step user guide
[also see mic1's detailed User Guide http://www.ontko.com/mic1/user_guide.html]
jump to: UNIX Windows Notes
UNIX [you need a GUI (e.g. Xwindows) to run the
simulator]
- download the .tar file from http://www.ontko.com/mic1/ . This includes all
.classes, documentation, source, and samples.
- unzip and untar the distribution into its own folder:
# gunzip mic1.tar.gz
# tar xvf mic1.tar
- make sure your shell knows where the java executable is:
# which java
java is in /usr/bin/java, and /usr/bin should already be in your PATH. If for some reason
it is not (or your on a system that has java in a different location):
bash: # PATH=$PATH:/path/to/java
bash: # export PATH
csh: > set PATH=($PATH /path/to/java)
- next, the classes.zip from the distribution must be in your CLASSPATH:
bash: # CLASSPATH=$CLASSPATH:/my/home/dir/mic1/classes.zip
bash: # export $CLASSPATH
csh: > setenv CLASSPATH=($CLASSPATH /full/path/to/classes.zip)
- you can now run the simulator:
# java mic1sim
then you can load a micro and macro program through the GUI
or # java mic1sim mic1ijvm.mic1 ijvmtest.ijvm
if you want to specify micro and macro programs on the command line.
- get the m.jas, m2.jas and m3.jas programs (.jas= "Java
ASsembler") from my website ( http://www.tcnj.edu/~boehnke2/cmsc499
)
assemble them to .ijvm (integer java virtual machine) code:
# java ijvmasm m.jas m.ijvm
then load them in the simulator and run/trace them
# java mic1sim mic1ijvm.mic1 m.ijvm
^ back to top
WINDOWS
You will also need the Java Development Kit (I have 1.2, older 1.1
versions should work, too.). http://sun.java.com. BIG!
- download the self-extracting ZIP
archive from http://www.ontko.com/mic1/ .
- run the mic1win.exe in its own folder, this will extract all necessary files.
- Open the env.bat file from the distribution in notepad, and comment
("rem") out the four lines as described in the file.
Also, set the PATH and CLASSPATH as described in the file.
- from the DOS prompt, change to you mic1 directory (where you installed the simulator)
- use the batch files to start compiler and simulator:
> mic1sim
starts the simulator (GUI)
- get the m.jas, m2.jas and m3.jas programs (.jas= "Java
ASsembler") from my website ( http://www.tcnj.edu/~boehnke2/cmsc499
)
assemble them to .ijvm (integer java virtual machine) code:
> ijvmasm
starts the assembler. load m.jas as the input file. you can leave the output file
blank, it will become m.ijvm by default (same name, .ijvm extension)
then run load them in the simulator and run/trace them
> mic1sim
load the mic1ijvm.mic1 microcode, load the m.ijvm macroprogram,
then run and trace it.
^ back to top
NOTES
- to get started, have the .jas program open (as a printout or in an editor) when your
tracing.
- also, have pp. 234 (Tanenbaum SCO Ch 4) open, to see the microinstructions your
macroprogram translates to.
- keep track of the stack
- open the debug window (File...) in the simulator. This way you see everything that's
going on in each cycle and can keep track of it, because you cannot go a step back in the
simulator, only start over (reset)
- the register content (LLV, SP, etc) will not be updated when you run a program (it will
if you STEP through) until you stop it.
- the Microinstruction shown has already been executed. note that the MPC already contains
the location of the GOTO statement. the NextMicroinstruction is executed when you click
step.
^ back to top