-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add support for Zcmt extension #757
base: master
Are you sure you want to change the base?
Conversation
|
||
type target_address = bits(xlen) | ||
|
||
union FJT_Result = { |
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.
Probably just use result(target_address, unit)
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.
Could you explain a bit more about this and how I should modify the code?
|
||
function clause execute (CM_JALT(index)) = { | ||
let base : bits(xlen) = jvt.bits & ~(zero_extend(0x3F)); | ||
let index : bits(xlen) = zero_extend(index); |
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.
I believe you can delete this line.
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.
This wont compile, I get:
Failed to prove constraint: 8 == 32
But I think it makes sense, imagine shifting bits to the left. Since the bit width of index
remains the same (without extending), the two (or three) most significant bits would be lost.
Hi @Timmmm, thanks for the suggestions! I've incorporated them and left some comments about a few small issues I ran into. |
Hi everyone,
This pull request adds support for the Zcmt extension.
I’ve also included some simple tests, which can be found here.
Reading from the jump table vector requires Execute permission and supports both little and big endian formats. The current RISC-V Sail model only allows little-endian access, but I will add big-endian support after #751 is merged.
One observation: at some point, it might make sense to introduce a more general interface for
load
andstore
. Since the Zcmp (#730) extension also requires these operations, a shared implementation could help reduce code duplication.