P2 Debugging Questions.
__red__
Posts: 470
in Propeller 2
- Can you single-step the P2? (as in flip the clock bit). (although I assume that if you do then stuff like the serial smart-pins aren't going to work anymore at the proper speed).
- Failing that, would it be possible to 'single-step' instructions by forcing a debugging interrupt to fire after every instruction, copy cog state (ie, PC, content of current PC register, C & Z flags) to an area of memory (HUB probably) for spooling out to instrumentation by another cog?
- Is there a better way of achieving this kind of functionality?
- C & Z flags
- Contents of PC
- Contents of PTRA & B
- State of DIRA&B / INA&B
... as well as provide an interface to allow random peeking / poking at HUB & cog memory.
Feeling viewport'esque (for those that remember that).
Currently kicking this design around... (apologies for the serious overexposure).
(Can you tell I visited a vintage electronics component supplier last week) ;-)
Comments
.. but you are correct that in practical terms, a single clock edge does not show you much...
That is more how Debug is intended to work in P2.
There are already Alpha/Beta debuggers around for P2, and IIRC the ROM also has some monitor support.
It has full disassembler,single step, breakpoints and watch functions,etc..
I'm a bit tied up with real P2 silicon testing at the moment.
Hope to have something to post soon.
That's great to hear, and seeing what you've got going on you're clearly busy
Related, I've mostly finished my disassembler and now have implemented two opcodes in my simulator - NOP and JMP.
I can now compile from PASM2 to eeprom, load into my simulator, cogstart it and run my amazing "Hello World" application that looks like this:
It's very exciting ;-)
I went looking for an updated version and the latest I was able to find was v16a_1_8 (March 2017).
Did you post anything later that I may have missed?
Thanks,
Red
Anyhow the new debugger is completely different and has moved all the heavy lifting to the PC end so only a small code snippet is attached to the test code.
I've just got to finish some more P2 silicon tests and I can get pack to the debugger.
It would be nice to have it ready for the eval boards.
I've been trying to prioritize which opcodes to implement in my emulator - attacking those which you use in your debug shim first makes a whole lot of sense.
Then in theory, try and replicate the functionality of your PC-side in the UI portion of the emulator so that the debugging process will be identical in my emulator vs real silicon (at least that's the hope).