-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardware single step support #127
Comments
The above description details the single step feature. What about the breakpoint feature ? |
@MJoergen Well you are right: It is a single step feature only. The breakpoints are then implemented in software: If the hardware is able to break at every instruction, your debug ISR can check, i the address equals a breakpoint and/or if some other trigger conditions are met. I renamed the issue now to Hardware single step support. |
Hi - basically, this feature can also be used for breakpoint handling in one of two ways:
:-) |
This is just a collection of implementation ideas so that we do not forget what we talked about:
RSR SPC, R0; here R0 is the destination |
Change of plan! :-) At least slightly. I suggest (after sleeping over this issue) the following:
What do you think? |
WOW! Bernd, from time to time you are showing the attributes of a true genius! This idea is brilliant: Elegant. Non-breaking. (Q)Nice! I could perfectly live with the slight inconvenience that when you want to make sure that the shadow register is exactly how it was, you always need to exchange twice ("in and out"). Compared with all the advantages I would say: Let's go for this. Up to you Bernd: Right now this must not be checked in to develop as we said V1.8. You would create a new branch "dev-v1.8" that we could use for that. OR: As a non breaking change I would have no problem having this is 1.7 again. Then Bernd could do the Emu and I would enhance the CPU. Up to you. |
You are vastly exaggerating, but I am very happy that you like the idea! :-) If you are OK with it, I will extend the documentation and emulator in the develop branch as it won't break any of our existing code. :-) |
Absolutely OK. When done please do not close this issue but assign it to me as I need to implement it in hardware. |
The assembler now understands the EXC instruction, the emulator, too, the documentation is updated, and both disassemblers (that in the emulator and the one in the monitor) also can disassemble the new instruction. Here is a sample code snippet: #include "../dist_kit/sysdef.asm" |
Hi Bernd, this issue is about the single step flag, too. Re-assigning... |
Note to myself: Before closing this one: Volker's VASM does need to support EXC, too. |
This issue is part of #67 and issue #66.
We (Mirko and I) are thinking about breakpoint and single step support in QNICE and came up with the following idea:
We will use one of the two spare bits in the SR to denote a trap-on-instruction-fetch-feature. If set this will effectively cause a software interrupt every time a new instruction is fetched. Since this will be part of the CPU it will take precedence over any other interrupt and can also happen within an ISR. This bit will be called 'S' for single step.
When an instruction fetch triggers this feature, the current SR, PC, and SP are copied to a shadow register set as usual with out interrupt processing. After that this bit will automatically be cleared so that the ISR will proceed normally. Exiting the ISR with RTI will automatically restore the aforementioned registers and thus implicitly set this control bit again.
We will extend the three existing shadow register for interrupt processing (PC, SR, SP) by a fourth shadow register which will contain the ISR address for this feature.
The control instruction group will be extended by two additional instructions: RSR (read shadow register) and WSR (write shadow register). These allow to read/write all of the existing (and future) shadow registers. The number of the shadow register being read/written is specified in the src/dst field while the destination/source register/memory cell is specified in the dst/src field.
The text was updated successfully, but these errors were encountered: