Propeller simulator in java
Ale
Posts: 2,363
Hallo everyone,
I was working in a Propeller Simulator and as it sort of works, I decided to share it with you all (I was going to share it with you anyways ).
It needs java (re or sdk) v1.5 to run. I tested it under linux, it should work under other oses also, ykmv.
I know that GEAR exists, but sadly It needs m$ soft and It is unusable under Mono (after you install a sh*t load of libraries), and has plenty of bugs, and the dissasembler needs a bit of work (The rest is good!).
Why another simulator ?, why not ?, my goal is an assembler development tool, compiling/downloading/testing with the real hardware, is a bit too inconvenient. A *good* simulator helps a lot.
Have fun.
Comments (avoid trashing comments, please), patches and suggestions (constructive ones) are welcome.
NOTE: It has bugs, it is not finished, it makes no coffee, I hope it does not leaks memory.
Gru
I was working in a Propeller Simulator and as it sort of works, I decided to share it with you all (I was going to share it with you anyways ).
It needs java (re or sdk) v1.5 to run. I tested it under linux, it should work under other oses also, ykmv.
I know that GEAR exists, but sadly It needs m$ soft and It is unusable under Mono (after you install a sh*t load of libraries), and has plenty of bugs, and the dissasembler needs a bit of work (The rest is good!).
Why another simulator ?, why not ?, my goal is an assembler development tool, compiling/downloading/testing with the real hardware, is a bit too inconvenient. A *good* simulator helps a lot.
Have fun.
Comments (avoid trashing comments, please), patches and suggestions (constructive ones) are welcome.
NOTE: It has bugs, it is not finished, it makes no coffee, I hope it does not leaks memory.
Gru
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
you have to compile the file and create a .binary from the Hex view in the Propeller Tool. Spin code is discarded and only a DAT section is loaded. (In my laptop, pentium M 1.7, with 1G RAM runs ok).
Open target file to be simulated.
Hit f8, then bonk on the "show hex" button.
The screen will get wider.
The function you need is on the right, "save binary file".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
I found a bug. I'll PM Ale about it, with some suggestions.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
as promised, another update:
Built-in Editor (no syntax highlight) with load/save.
Built-in Compiler (use compile button), (does not save compiled code, but it saves source as text files)
Binary files can be transferred to the editor, use the "copy to editor" item from the Edit menu.
Labels are placed for jumps/calls/data
Dxxx : data label
Lxxx : control transfer label
Multiple bug fix, compiler/disassembler/simulator.
Have fun
ps: Is anybody testing this ?
edit: to reflect new additions
Post Edited (Ale) : 8/1/2007 12:06:07 PM GMT
another update:
- Memory dump.
- Plain binary load/save (only the first 496 longs)
- Symbols in assembler view, editor, memory dump
A compiled file (in assembler view) can be transferred to the editor, appropriate symbols will be created for Data and Labels (as described previously), this edited, later compiled file can now be saved as a plain binary file (not a Propeller Tool compiled file, i.e. with header and a bit of Spin built in), and reloaded.
I Attempted to do syntax highlight, but sadly I did not succeed yet. Javax.swing is IMHO sometimes utterly complicated, the rest is plain complicated.
Well, have fun.
Post Edited (Ale) : 8/3/2007 12:37:19 PM GMT
brad@bkmac:~/pPropellerSim/dist$ /usr/lib/jvm/java-1.5.0-sun/bin/java -jar "pPropellerSim.jar"
Exception in thread "main" java.lang.NullPointerException
at javax.swing.text.StyleConstants.setForeground(StyleConstants.java:544)
at ppropellersim.AsmEditor.<init>(AsmEditor.java:46)
at ppropellersim.PropellerFrame.<init>(PropellerFrame.java:80)
at ppropellersim.Main.main(Main.java:42)
Did I mention I have absolutely zero experience with Java? I have just installed netbeans also as I thought I might be able to open the
project dir in that and sort it out myself, but alas I appear to be incapable of getting it going [noparse]:([/noparse]
I know I'm doing something dumb. Care to smack me with a clue-bat ?
the build was broken. You can either compile it with the IDE, so load the project, set it as main project and use the option "Clean and Build main project" from the Build menu.
The project is on "/home/pacito/prg/projects/pPropellerSim" on my dev machine. You may need to "resolve references".
or
You can download it again, I rebuilt it and uploaded it again.
Sorry for the inconvenience
Ale
Have you considered hosting the project on a place like SourceForge or Berlios? It takes about 2-3 days to apply for project space on SF. I have no experience with starting a new project at Berlios, I've only ever worked on someone else's project there.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| What the world needs is more geniuses with humility, there are so few of us left.
| "Wait...if that was a compliment, why is my fist of death tingling?"
| - Alice from Dilbert
brad@bklaptop2:~$ wget http://www.geocities.com/hppacito/ppropellersim/pPropellerSim-0.4.zip
--12:41:36-- http://www.geocities.com/hppacito/ppropellersim/pPropellerSim-0.4.zip
=> `pPropellerSim-0.4.zip'
Resolving www.geocities.com... 66.218.77.68
Connecting to www.geocities.com|66.218.77.68|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
12:41:41 ERROR 404: Not Found.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
seems that somehow, geocities ate my file, it said "uploaded successfully" but the file was not there !, very strange.
The link at the top of the thread points to the latest version, I tested and works (ykmv).
Migthor, I haven't thought about that yet -), I'll see what can I do, good suggestion.
Post Edited (Ale) : 8/5/2007 12:09:55 PM GMT
waitcnt does not wait for the appropriate CNT value (or warp it which would be just as good).
If the sim hits an rdlong it goes off into never never land for a while (100% cpu)
A problem I have with gear also, it'd be lovely to be able to externally set bits in the INA register to simulate inputs.
I could also see uses for being able to alter the COG memory values on the fly, so you can tweak values in loops while they are
running and fun stuff like that. Maybe even change the processor state between steps (well, state of C and Z perhaps, this proc does
not really *have* a lot of state)
Other than that, I think I'm going to find this quite a bit of fun to play with.
rdlong goes to nirvana ? I'll see that also.
I did not implement it yet, but in the memory dump view, the contents could be modified.
I was thinking also on some way to modify the state of inputs, maybe some descriptive file of waveforms like this PIC simulator i saw once or the WebISE by XIlinx. I'm still thinking how to implement it, but something for sure will come
I have also to improve the debugger, with breakpoints usw.
thanks
Post Edited (Ale) : 8/5/2007 3:36:42 PM GMT
Symbols in the Assembler view, for labels (not only data). The symbols in the editor now are used in the assembler view.
Memory Dump, contents of the memory can be changed on-the-fly, with Hexa numbers (without $), or with an assembly instruction ! (I wanted to do that for a long time).
In this later case, symbols can be used but not defined:
my_sym add data1,data2
will generate the code 80bc0604, but the newly defined symbol my_sym is going to be ignored. If someone wants it, just ask, can be easily added.
RDxx/WRxx were fixed, and WAITCNT is now implemented. Some bug fixes for instructions were also done.
Breakpoints are implemented and (I believe) functional, just not available, because of some strange behaviour of pop-up-menus !, I'll fix that soon.
some more descriptions are in available in /pPropellerSim/doc/readme.txt
(did I tell you that the keyboard of the Macbook drives me nuts ?, the lack of useful keys and the unfamiliar key-combinations...)
Have fun
Ale
Another release of pPropellerSim (v0.6)
This release adds/fixes:
- Breakpoints (Read/Write/execute)
- Run, runto, stepover
- jump instructions
- dissasembler
- Symbols in assembler view
- conditions are displayed in a shortened version of (I believe) my creation, to save space for the labels
Now, as the project is hosted by Sourceforge, as kindly suggested by Mightor, it can be accessed at:
http://sourceforge.net/projects/ppropellersim
And I can be contacted at ale500 (
Grats on the SourceForge project approval! I hope you didn't have to wait too long to get it. I think it might be a good idea to mention on the SF main page of your project that it requires Java v1.5 to run. I know you mention it in the OP, but you never know if people are going to link to that page from outside these forums [noparse]:)[/noparse]
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
They approved it in two or three days, but took me a while little longer to add something useful to the release . I mention the requirement of Java 1.5 in the readme file, maybe I should also in the Release notes that can be seen in the download page. Do anybody read that ? , Now a home page for the project should be made... well, more to do. I hope people would find it useful... I do .
Next release will contain:
Hub memory inspector, with the possibility to modify the contents (and load/save), and more importantly: expressions in the assembler. Now only numbers or symbols are handled, so add 3+4,5 will not work. That is going to be a big leap forward. And last, will come syntax highlight, if I ever discover how to make it work.
Thanks again
Ale
I got syntax highlight working. Is not the great addition, but it works
I will add:
cog memory dump and load/save.
configuration (last position, lat used files).
Expressions in the assembler
Ale
- Cog memory dump with load/save/fill/search function (in separate frame).
- Configuration, last used files, last used directories, position, colors (can only be modified, for the time being, in the .conf file).
- Compiler/editor bug fixes
- Better documentation
Enjoy !
It tends not to stand up well to general UI abuse.
Example..
If i click the run button twice I lose the ability to stop it, step it or trace it.
Love the ability to edit the registers on the fly, 'specially the ina reg in cog memory. Very useful.
It's shaping up very nicely! Great work!
I'll see to the "UI" abuse. I tend to ignore it, because... I treat it with respect !, I should also just press all keys together to see what happens... that would be fun
thanks
Generally when I've broken and fixed as much as I can, I give it to a friend of mine who is a software QA dude, and he breaks even more things [noparse]:)[/noparse]
I made some enhancements to the simulator, usabiliy enhancements. And corrected a couple of bugs. Descriptions are as usual in the Changelog and readme.txt files in the doc directory. The release notes explain how to run it. Well it did not change
Most notable:
Breakpoints are now set in the Asm view instead of the Cog memory dump.
It now says where the cursor is, useful to see where the errors are once compiled.
CNT returns the right value when read
A Long constant now can have values greater than 511
The source for the programmer are also included, but disabled, because so far I did not make them work :-(, java io is a bit ... flacky :-(
Have fun.
Ale
Registers window to small.
Se attachment
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
· How do I run the java program on a windows xp platform? The only experience I have with java is running a· page that is java enabled. Might be a good idea to put basic windows install txt?
· Also, I couldn't get the newer version to download. I notice there were 0 downloads on the sourceforge page.
· I am currently using GEAR and am looking for something a little faster for video and T.V.
Don
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mosquito: An animal which buzzes in your ear and never stops. He may byte you, he may nibble you, but you will know you were bit.