Skip to content
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

Update test programs vs platform config #658

Open
naure opened this issue Nov 30, 2024 · 1 comment
Open

Update test programs vs platform config #658

naure opened this issue Nov 30, 2024 · 1 comment
Assignees
Labels
cleanup Refactors, simplifications, hindsight 20/20 tasks.

Comments

@naure
Copy link
Collaborator

naure commented Nov 30, 2024

For example, those two definition are different:

RAM : ORIGIN = 0x80000000, LENGTH = 1024M

ram: 0x8000_0000..0xFFFF_0000,

And other differences following recent changes in Platform.

(cc @lightsing)

@naure naure added the cleanup Refactors, simplifications, hindsight 20/20 tasks. label Nov 30, 2024
@naure naure self-assigned this Nov 30, 2024
@matthiasgoergens
Copy link
Collaborator

matthiasgoergens commented Dec 2, 2024

Some extra context: the upper limit of 0xFFFF_0000 for ram in

ram: 0x8000_0000..0xFFFF_0000,
is chosen to avoid having to deal with wraparound-overflow from the memory address offset specified in the immediate operand of memory operations.

From the spec page 19:

Load and store instructions transfer a value between the registers and memory. Loads are encoded in the I-type format and stores are S-type. The effective byte address is obtained by adding register rs1 to the sign-extended 12-bit offset. Loads copy a value from memory to register rd. Stores copy the value in register rs2 to memory.

We reserve a whole 16 bit at the end (0xFFFF), instead of just 12 bits (0x0FFF), though. I don't know why we reserve an extra 4 bits. Might be just for simplicity?

Whoever takes this issue: please verify the reasoning above, and mention it somewhere discoverable eg in a doc comment or so. (Or if the reasoning above is wrong, obviously you should correct it, and put the real reason in the doc comment. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Refactors, simplifications, hindsight 20/20 tasks.
Projects
None yet
Development

No branches or pull requests

2 participants