[Open SoC Debug] CDM-OR1K implementation
philipp.wagner at tum.de
Tue May 22 09:31:16 CEST 2018
On 05/20/2018 04:25 PM, Stafford Horne wrote:
> On Sun, May 20, 2018 at 05:11:55PM +0530, SHIVAM AGGARWAL wrote:
>> I went through all the resources again. As per my understanding, CDM works
>> by storing breakpoint addresses in the debug registers.
> I don't think you need to think about it this way. CDM just provides access
> to the CPU registers. The debugger software decides what to write to which
> registers (i.e. this target driver in gdb/openocd).
>> If a PC ever
>> matches a value in breakpoint registers, CPU raises an exception and
>> reports it to GDB. This is basically a hardware breakpoint.
>> As you mentioned above, by writing an l.trap instruction into memory we can
>> implement software breakpoint. For this part, we need access to memory.
>> Things to do now:
>> 1. To expand memory map to access a the other registers.
>> 2. To see how the existing system interface can be used to read/write
>> 3. To support software breakpoints, we need access to memory. This can be
>> achieved either by using MAM or extending CDM module.
> It should be MAM (for 2 and 3). Unless anyone objects.
> To support any debugging we need read/write access to memory.
Just as Stafford said: the MAM enables access to the (main) memory. So
part 2 and 3 are already there. So the main thing to do is (1).
The main challenge on that one will be how to cleverly map the register
address space of the mor1kx CPU to the limited register address space
available through OSD. The question is essentially: can we come up with
a core-agnostic, generic mapping, or do we need to pick certain address
ranges out of the or1k register map and place it somewhere in the OSD
register address space.
To be able to answer this question, we first need a more detailed
overview of the registers which are accessed through GDB.
Shivam, could you provide this overview, and run it by Stafford to make
sure you got everything covered? We can then in a second step discuss
how to add this information to the CDM spec.
More information about the OpenSoCDebug