WISC Emulator

This is an emulator for the WISC architecture with some primitive debugging support.

wisc-emulator.tar.gz

Compile the emulator like so

% cd ~
% tar xvzf wisc-emulator.tar.gz
% cd wisc-emulator
% make
This will produce a binary called wisc-emulator. To run the emulator try something like
% cd 552-programs
% ~/wisc-assembler/wiscas alu.s
% ~/wisc-emulator/wisc-emulator alu.mem
% <run quicksim on alu.mem>
% ~/wisc-assembler/parseOut.pl
% diff alu.mem.out memout.parse

In the CS computer labs, you can optionally copy the wiscas and wisc-emulator binaries into the ~/bin directory.

wisc-emulator will produce a file called alu.mem.out which will be the memory dump after the program halts. The format of the .out file is identical to the output from the parseOut.pl script (contains 3 columns, the Address in hex, the data in hex, and the data in decimal). Any output from the wrint and wrch instructions are printed to standard output.
% java cmm maze.C maze.s
% ~/wisc-assembler/wiscas maze.s
% ~/wisc-emulator/wisc-emulator maze.mem
Will print the maze on standard output.

Debugging

The emulator also has simple support for debugging the assembly program. You can set breakpoints, single step through instructions, and print the contents of memory and the registers. Debugging support is enabled if you pass three arguments to wisc-emulator. The second and third arguments are the .help file generated by the assembler and the assembly source file.

Debugger commands

Note the debugger works on the assembly source level, so the "n" command will move to the next line in the input. This only matters for pseudo-instructions like "beq $t0, $t1, loop". Here the "n" command will execute both the "sub $6, $t0, $t1" and the "beqz $6, loop" instructions. Also, the "b 13" specifies a breakpoint on line 13 from the source file.

Here is an example run (alu.s from the WISC test files).
% ~/wisc-emulator/wisc-emulator alu.mem alu.help alu.s 31: main: nop > b 60 Added breakpoint 1 at line 60 > b 95 Added breakpoint 2 at line 95 > n 32: li $2, 2010 > n 33: li $3, 1106 > c Breakpoint 1 60: st $1, 6($0) > p $1 $1 = b3a6, -19546 > p $sp $0 = 0041, 65 > p 0x47 mem[71] = 0000, 0 > n 62: srl $1, $5, 11 > p 0x47 mem[71] = b3a6, -19546 > d 1 Deleted breakpoint 1 > c Breakpoint 2 95: st $1, 6($0) > p $1 $1 = dbfc, -9220 > p $sp $0 = 004c, 76 > n 97: li $6, 7 > p 0x52 mem[82] = dbfc, -9220 > c

Comments, bugs, etc can be mailed to jelenz@wisc.edu
Last updated: Oct 19, 2003