-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement misa
CSR
#743
Conversation
coreblocks/priv/csr/csr_instances.py
Outdated
# 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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Closes #561
Complete machine mode CSRs 🎉