Propeller II Simulator
Dave Hein
Posts: 6,347
I've updated spinsim to support P2. Spinsim supports most of the core instructions, but it currently does not support instructions related to the counters, cordic engine or video hardware. I also have not implemented the hub exec mode or threads. Look at the readme.txt file in the zip file to see which instructions are supported.
The zip file contains a spinsim.exe file that runs under Cygwin, but it will need to be built for other platforms. Just type make to build it. I have a sample program called pfth.obj that can be run by typing "./spinsim -t -b pfth.obj". This will run the pfth Forth compiler under spinsim.
I've tested most of the implemented instructions, but there are many instructions that I haven't tested. Let me know if you encounter any problems, or if you want me to implement any particular instruction. I plan on adding hub execution next, and then threads.
The zip file contains a spinsim.exe file that runs under Cygwin, but it will need to be built for other platforms. Just type make to build it. I have a sample program called pfth.obj that can be run by typing "./spinsim -t -b pfth.obj". This will run the pfth Forth compiler under spinsim.
I've tested most of the implemented instructions, but there are many instructions that I haven't tested. Let me know if you encounter any problems, or if you want me to implement any particular instruction. I plan on adding hub execution next, and then threads.
Comments
ok
words
comes out as wwoorrddss
Other than that, it is running pfth just fine.
YAY!!! A new Toy!!! Thanks, Dave!!
It will allow people without access to FPGA boards to try the P2 before chips ship (excluding video)
I was wondering if you somehow had a way to output the pin states while running which led me to thinking if this can be single stepped with a display of processor state after each step....which led to to fondly remember the Sperry 1100 series mainframe simulator we had which let me load up my operating system and run it to a certain point and then examine registers, change things and single step through instructions. This was 1980/1981, so, these were very cool things to be able to sit at a terminal and do interactively with a program that was doing a simulation.
Which brings me back to spinsim - are some of these single stepping and processor state examination features lurking around in the code? If so, then this is a really great tool for learning PASM(2) also!
I think I have a solution for the double-characters. I'll try it on my other computer to see if it resolves the issue with it.
Thanks!
Is there any way we can live without conion.c functions on Windows?
Thanks.
Header termios.h and library are available in Linux, but apparently not with Msys/Mingw. I don't use Cygwin.
Great.
As you know Spinsim was used heavily in bringing up PropellerGCC the first time. I would like to include whatever you do in the P2 tools also, and Msys/MinGW are required there for Windows.
Thanks Dave.
A flag called STD_CONSOLE_INPUT is defined in conion.h that causes stub routines for kbhit() and getch() to be compiled. In this mode kbhit() always returns 0, and getch() returns the output from getchar(). debug.c also had to be changed because it waits for kbhit() to return a 1.
BTW, you can still use the -b option to get serial output from the program that is being run.
Compiles just fine.
I've also included the patch that disables using termios. termios is used by default, and the compile flag STD_CONSOLE_INPUT must be defined in conion.h to disable it.
I'm dreaming about combining something like this with a circuit simulator...