Quote from: legacy on Today at 05:34:09 AMjust a question: has anyone here happened to develop his or her own debugger for his her own softcore? I am curious
No, but it's interesting to look at historical and current designs.
Back in the z80/1802 days, you could use external logic to start a DMA cycle, which caused the cpu to relinquish the bus. Then you could have debug circuits manage the bus instead, and they could go around and look at the contents of memory, relatively unimpeded (this was pre-DRAM, too.) IIRC, interrupts worked by having the interrupt controller jam an instruction onto the databus, rather than having the CPU access memory. Usually one would insert a RST instruction or a CALL, but at least theoretically you could throw an "out DEBUGPORT, REG" on there, and examine the registers. (Huh. I don't know of any z80 debug tools that actually DID that sort of thing, but it seems it should have been possible. And perhaps useful. I wasn't debugging Z80s at the time.)
In (more) modern times, there is the Atmel AVR "debugwire" protocol, which is undocumented, but from reverse engineering (
http://www.ruemohr.org/docs/debugwire.html )seems to have been implemented along similar lines - many of the debug commands are implemented as "load an instruction onto the instruction bus, and have the results sent to the debugwire hardware (which spits it out.) This seems like a pretty powerful concept - use the CPU itself to do most of the work. Add a few address comparators for break and watchpoints, and you've got yourself the basics...