MMIO register support #9008
SCSR-is-too-short-username
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the only way I could find to define MMIO registers is to define a memory region and add labels to the correct addresses. I would find it useful to have a proper feature added for this. Here are some details on what I would consider useful parts of the feature:
Ability to define the address and size of the register and name it. Values that match the address that are written to or read from are replaced by the name (either directly in the instruction or a separate value that is loaded into a register). If multiple registers are accessed with same operation (eg. if two adjacent 16-bit registers are accessed by one 32-bit read/write operation), this would be shown. One options is something like this:
LDR r1, [r0, #0x00]=>REG_NAME_A, REG_NAME_B.The registers definition would additionally have description field that could display longer, more descriptive name (eg. "SIO_CTRL" could have the following description: "Serial I/O Control").
Ability to add definition for register usage, like writable/readable and what the value written/read contains (this should be separated for both, since some registers have different read and write behaviors). This could be implemented as marking the bit ranges that is used for specific purposes and then ability to give them a description and possibly an enum to describe the values that range can have. A bit shift could also be applied, so some bits that are used to select base addresses and sizes can be shifted to display the proper address and size the bit value would correspond to. All of this defined information could be displayed if you hover over the register name, so it is a handy reference for the register usage. These should be something that can be saved, so if you have multiple projects for the same environment, you can use the same MMIO register definition across multiple projects.
Constants that are written to a register and constants that are applied to a value written to or read from a register with a bitwise operation (eg. AND and OR) can be marked and display a info box when hovered over. Values directly written would display the settings that would be applied to the register based on the definition. Values that are applied with bitwise operation would show what properties are set or cleared based on the operation type. If the register value is not written back to the register, but is compared against after bitwise AND, it could show that it is used to check a specific property read from the register. One example is that a register has a "busy" flag, you can have a while loop that checks this flag until it is not set to wait before accessing a register that contains a result for something the code is waiting for.
Beta Was this translation helpful? Give feedback.
All reactions