-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! fixup! Add Svinval extension.
- Loading branch information
1 parent
db931c4
commit fc618e6
Showing
3 changed files
with
54 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/*=======================================================================================*/ | ||
/* This Sail RISC-V architecture model, comprising all files and */ | ||
/* directories except where otherwise noted is subject the BSD */ | ||
/* two-clause license in the LICENSE file. */ | ||
/* */ | ||
/* SPDX-License-Identifier: BSD-2-Clause */ | ||
/*=======================================================================================*/ | ||
|
||
union clause ast = SINVAL_VMA : (regidx, regidx) | ||
|
||
mapping clause encdec = | ||
SINVAL_VMA(rs1, rs2) if haveSvinval() | ||
<-> 0b0001011 @ rs2 : regidx @ rs1 : regidx @ 0b000 @ 0b00000 @ 0b1110011 if haveSvinval() | ||
|
||
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() if haveSvinval() | ||
<-> 0b0001100 @ 0b00000 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 if haveSvinval() | ||
|
||
function clause execute SFENCE_W_INVAL() = { | ||
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() if haveSvinval() | ||
<-> 0b0001100 @ 0b00001 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 if haveSvinval() | ||
|
||
function clause execute SFENCE_INVAL_IR() = { | ||
if cur_privilege == User | ||
then { handle_illegal(); RETIRE_FAIL } | ||
else { RETIRE_SUCCESS } | ||
} | ||
|
||
mapping clause assembly = SFENCE_INVAL_IR() <-> "sfence.inval.ir" |