PASM simulator / debugger?
Agent420
Posts: 439
I hesitate to post a request for what must surely have been discussed numerous times, but the terms 'simulator' and 'debugger' simply return too many threads to hunt though...
I'm having some trouble trying to determine why one of my hacked vga drivers is not functioning correctly.· I browsed through the stickies and just downloaded PASD, which I will try later at home.· I would almost prefer a simulator where I can more easily test code fragments, but a good debugger will do for this task.
I have tried Gear, but beyond being rather limited in functionality, it apparently has some quirks and does not correctly simulate some elements properly - for one, it does not seem to decrement cog system registers such as par, which is used in several of the vga drivers for a loop counter.·Also, it is a real pain single stepping through waitcnts and such.
I have also tried to use pPropellerSim, but I just can't seem to get it to work for some reason... it just keeps hanging when I start the project.
ViewPort is nice, but apprently only debugs Spin code.
So... are there any other pasm simulators / debuggers recommended to try?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Agent420) : 9/9/2009 6:55:17 PM GMT
I'm having some trouble trying to determine why one of my hacked vga drivers is not functioning correctly.· I browsed through the stickies and just downloaded PASD, which I will try later at home.· I would almost prefer a simulator where I can more easily test code fragments, but a good debugger will do for this task.
I have tried Gear, but beyond being rather limited in functionality, it apparently has some quirks and does not correctly simulate some elements properly - for one, it does not seem to decrement cog system registers such as par, which is used in several of the vga drivers for a loop counter.·Also, it is a real pain single stepping through waitcnts and such.
I have also tried to use pPropellerSim, but I just can't seem to get it to work for some reason... it just keeps hanging when I start the project.
ViewPort is nice, but apprently only debugs Spin code.
So... are there any other pasm simulators / debuggers recommended to try?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Agent420) : 9/9/2009 6:55:17 PM GMT
Comments
For the time being Ariba's PASD is probably your best bet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
- Propalyzer: Propeller PC Logic Analyzer
- BMA: An on-chip PASM Debugger
- SPUD: Spin Source Level Debugger
Post Edited (jazzed) : 9/27/2009 8:50:52 PM GMTtry this version please.
Use the option "compile to cog" from the editor. (waitvid is not implemented!, sorry)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Have you tried the version of GEAR at: http://forums.parallax.com/showthread.php?p=839483
One of the example plugins included with GEAR is a VGA Monitor - which allows testing of video drivers. The biggest ownside of GEAR is that it is very (very) slow. On my system it takes minutes to draw a single frame of video output.
As to accuracy of the simulation, I believe it is as correct as practically possible. PASM code and all the related timers and counters should be cycle accurate (as far as I know). Spin code runs faster (less clock cycles elapsed) on GEAR that in real hardware, but this is not generally a problem as you can't really write time critical code in Spin.
To single step through a waitcnt, put a breakpoint on the line (or instruction) following it.
GEAR is best at simulating snippets of code. Although having said that, I've done some fairly large simulations.
Regarding the par register issue I mentioned earlier, I'm not sure it falls under bug status as the Propeller manual does specify those registers are read only, but I note that Chip does use some of the special purpose registers as generic variables in several of his vga driver demos, and they are in fact 'writable'.· In VGA 1280x1024 Tile Driver v0.9, part of the VGA_Tile_Driver_Demo2 app included with the Prop Tool, the par register is used several times as a loop counter.· Even the most recent version of Gear does not modify that register; I created a simple test program that uses the par register as Chip does to loop 10 times, but Gear never finishes the loop and inspecting the par $1F0 address shows no changes to the value.
This was causing much confusion when I was attempting to use Gear to debug my code, which is based on these drivers.
On a side note, this is my first real foray into pasm, and though these vga drivers are rather complex they make use of a lot of cool tricks and are worth studying.
I did not get a chance yet to play with PASD, hopefully I will later tonight.
Thanks for the input.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Agent420) : 9/10/2009 1:34:05 PM GMT
Is it correct that I should have replaced the existing pPropellerSim.jar file in the \dist folder?· It did not run from where I saved it, perhaps a path issue.
Anyway, I note that the par register issue described above also fails here, resulting in a "Destination is Read Only" error.· This is probably not a big deal as the par register typically would not be used as a destination (other than Chip pulling some clever tricks in his vga code)... most programmers would probably not use these registers in that manner; it just happens that I was using his vga driver as a foundation and it contained those references.
edit -
It is also curious that the Propeller Tool compiler allows the use of par as a destination, perhaps because it in fact can be.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Agent420) : 9/10/2009 3:36:12 PM GMT
And as·I mentioned, those vga drivers are chock full of programming tricks.
I am nearly ready to post the first go around of my Prop InVGAgers app, and I'll include additional comments that describe some of these (as best I can figure them out )...· I think I've done some clever hacking of the cursor coding, and certainly his vga drivers make great templates for synchronized multi-cog apps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Agent420) : 9/10/2009 4:34:04 PM GMT