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

Implement misa CSR #743

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Implement misa CSR #743

merged 3 commits into from
Nov 12, 2024

Conversation

piotro888
Copy link
Member

Closes #561
Complete machine mode CSRs 🎉

@piotro888 piotro888 added the enhancement New feature or request label Nov 4, 2024
@piotro888 piotro888 added this to the Implement machine mode ISA milestone Nov 4, 2024
# 7 - Hypervisor, 18 - Supervisor, 23 - Custom Extensions

xml_field_mapping = {32: XlenEncoding.W32, 64: XlenEncoding.W64, 128: XlenEncoding.W128}
if gen_params.isa.xlen in xml_field_mapping:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already verify that xlen is one of 32, 64, 128 (in ISA), so this condition should be always true - and if it's not, I believe it's a bug.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

if extension in gen_params.isa.extensions:
misa_value |= 1 << bit

if gen_params.user_mode:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why user_mode is handled separately? From ISA point of view it is "U" extension.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is treated as extension only in misa. It is not present in isa strings, not defined as extension in spec, doesn't define instructions and only changes CSR behaviour (and can't be determined from FU config, so needs config flag anyway)
I think it is better to not add it to isa.extensions

@tilk tilk merged commit def471b into master Nov 12, 2024
13 checks passed
@tilk tilk deleted the piotro/misa branch November 12, 2024 09:55
github-actions bot pushed a commit that referenced this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement machine-mode CSRs
3 participants