-
Notifications
You must be signed in to change notification settings - Fork 159
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 Svinval extension. #297
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -877,3 +877,58 @@ function clause execute SFENCE_VMA(rs1, rs2) = { | |||||||||||||||||||
|
||||||||||||||||||||
mapping clause assembly = SFENCE_VMA(rs1, rs2) | ||||||||||||||||||||
<-> "sfence.vma" ^ spc() ^ reg_name(rs1) ^ sep() ^ reg_name(rs2) | ||||||||||||||||||||
|
||||||||||||||||||||
/* ****************************************************************** */ | ||||||||||||||||||||
union clause ast = SINVAL_VMA : (regidx, regidx) | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause encdec = SINVAL_VMA(rs1, rs2) | ||||||||||||||||||||
<-> 0b0001011 @ rs2 @ rs1 @ 0b000 @ 0b00000 @ 0b1110011 | ||||||||||||||||||||
|
||||||||||||||||||||
function clause execute SINVAL_VMA(rs1, rs2) = { | ||||||||||||||||||||
execute(SFENCE_VMA(rs1, rs2)) | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause assembly = SINVAL_VMA(rs1, rs2) | ||||||||||||||||||||
<-> "sinval.vma" ^ spc() ^ reg_name(rs1) ^ sep() ^ reg_name(rs2) | ||||||||||||||||||||
|
||||||||||||||||||||
/* ****************************************************************** */ | ||||||||||||||||||||
union clause ast = SFENCE_W_INVAL : unit | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause encdec = SFENCE_W_INVAL() | ||||||||||||||||||||
<-> 0b0001100 @ 0b00000 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 | ||||||||||||||||||||
|
||||||||||||||||||||
function clause execute SFENCE_W_INVAL() = { | ||||||||||||||||||||
/* Guarantees that any previous stores already visible to the | ||||||||||||||||||||
* current RISC-V hart are ordered before subsequent SINVAL.VMA. | ||||||||||||||||||||
* Can be implemented as a no-op since all memory operations are | ||||||||||||||||||||
* visible immediately in the current model.*/ | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not true for rmem? It models memory ordering.
Comment on lines
+901
to
+904
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is the current (ugly) style. Definitely needs a space before the (ditto below) |
||||||||||||||||||||
|
||||||||||||||||||||
if cur_privilege == User | ||||||||||||||||||||
then { handle_illegal(); RETIRE_FAIL } | ||||||||||||||||||||
else { RETIRE_SUCCESS } | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause assembly = SFENCE_W_INVAL() <-> "sfence.w.inval" | ||||||||||||||||||||
|
||||||||||||||||||||
/* ****************************************************************** */ | ||||||||||||||||||||
union clause ast = SFENCE_INVAL_IR : unit | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause encdec = SFENCE_INVAL_IR() | ||||||||||||||||||||
<-> 0b0001100 @ 0b00001 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 | ||||||||||||||||||||
|
||||||||||||||||||||
function clause execute SFENCE_INVAL_IR() = { | ||||||||||||||||||||
/* Guarantees that any previous SINVAL.VMA instructions executed | ||||||||||||||||||||
* by the current hart are ordered before memory accesses from | ||||||||||||||||||||
* the current hart to the memory-management data structures. | ||||||||||||||||||||
* Can be implemented as a no-op since all memory operations are | ||||||||||||||||||||
* visible immediately in the current model. */ | ||||||||||||||||||||
|
||||||||||||||||||||
if cur_privilege == User | ||||||||||||||||||||
then { handle_illegal(); RETIRE_FAIL } | ||||||||||||||||||||
else { RETIRE_SUCCESS } | ||||||||||||||||||||
|
||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
mapping clause assembly = SFENCE_INVAL_IR() <-> "sfence.inval.ir" | ||||||||||||||||||||
|
||||||||||||||||||||
/* ****************************************************************** */ |
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.
These need to be gated on the ISA extension, and should be in their own Svinval file