Re: Address Mapping Questions


Allen Baum
 

A bit more on that.
There are a few debug CSRs which can be accessed as both CSRs and as Debug registers, specifically for communication.
Otherwise, debug registers are in their own address space, and accessible only through the debug module.

As Nikhil says, there is also a command to enable access to all CSRs through the debug module by writing specific debug command register (Abstract Command)  which will cause the value of a CSR to be read from/written to a communication debug register  (Data0 and possibly Data1) .


On Fri, Jun 5, 2020 at 5:15 AM Nikhil Rishiyur <nikhil@...> wrote:
In re. your other question:

>    Another question: are CSRs also memory mapped? In debug mode?

No, CSRs are not specified as memory-mapped (an implementation may
choose to do so), even in Debug Mode.

The Debug Module (not the CPU) has an 'Access Register' abstract
command (see Sec. 3.6.1 "Access Register" section of the Debug Module
Spec) where it uses an Abstract Register Number to name all GPRs, FPRs
and CSRs (see Table 3.3 in the Debug Spec). 0x0000-0x0FFF are used for
CSRs, 0x1000-0x101F for GPRs, and 0x1020-103F for FPRs.  This is not a
'memory-mapping' of CSRs, just the internal Debug Module (and GDB's)
convention on how to name all registers.

Best regards,

Nikhil

Join tech-privileged@lists.riscv.org to automatically receive all group messages.