CPU32 Simulator
- Create a new directory (e.g. sim68k).
- Download sim68k.tgz.
- Unpack sim68k.tgz into the new directory.
- Download oscl-v1.2.tgz.
- Unpack oscl-v1.2.tgz into the src subdirectory of the new directory. (e.g. sim68k/src)
- Change to the project/mnm/native/sim68k/simsrc directory under the new directory.
- Type "make" to build the simulator.
- The resulting sim68k executable can be invoked with a -h option to get some limited help.
- Once launched, the simulator also has a limited help by typing ... help
As an example of usage, the following is a script that I use to launch a
simulation. The simulator is launched using the -f
option to
load an srecord file.
The script also opens three xterm windows.
- One
m68k-elf-gdb
debugging window that connects via socket GDBPORT.
- Two "dumbterm" windows which connect to the simulated UART devices via sockets SERPORT1 and SERPORT2.
#!/bin/bash
PORT=9990
if [ $1 ]; then
PORT=$1
fi
GDBPORT=$PORT
SERPORT1=$((PORT+1))
SERPORT2=$((PORT+2))
sim68k -f ooosx.srec -p ${GDBPORT} -i 0xc00000 &
echo "sim68k started"
echo $SERPORT1 > SERPORT1
echo $SERPORT2 > SERPORT2
echo "creating xgdbinit ${GDBPORT}"
echo "target est localhost:${GDBPORT}" > xgdbinit
echo "starting gdb"
xterm -e m68k-elf-gdb --command xgdbinit ooosx &
sleep 1
xterm -e dumbterm -h localhost -p ${SERPORT1} &
xterm -e dumbterm -h localhost -p ${SERPORT2} &
The remaining details are left as an exercise to the student ;-)