aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-05-15 09:36:28 +0100
committerTim Hutt <timothy.hutt@codasip.com>2024-05-15 09:36:28 +0100
commit6c758e9b8ff00ededb11d4cffe4983d69bd47a91 (patch)
treeea675073f5aadbe2f907e86d6336b2d5644f5bde
parente1242d851d6b27b357bfb31d46c8f08e18fb768b (diff)
downloadsail-riscv-6c758e9b8ff00ededb11d4cffe4983d69bd47a91.zip
sail-riscv-6c758e9b8ff00ededb11d4cffe4983d69bd47a91.tar.gz
sail-riscv-6c758e9b8ff00ededb11d4cffe4983d69bd47a91.tar.bz2
Minor style fixes
* Remove unnecessary `f` variable * Remove redundant type delcaration for `fetch`. * Indentation
-rw-r--r--model/riscv_fetch.sail1
-rw-r--r--model/riscv_step.sail7
2 files changed, 3 insertions, 5 deletions
diff --git a/model/riscv_fetch.sail b/model/riscv_fetch.sail
index 9c9e06a..6fd6691 100644
--- a/model/riscv_fetch.sail
+++ b/model/riscv_fetch.sail
@@ -12,7 +12,6 @@
function isRVC(h : half) -> bool = not(h[1 .. 0] == 0b11)
-val fetch : unit -> FetchResult
function fetch() -> FetchResult =
/* fetch PC check for extensions: extensions return a transformed PC to fetch,
* but any exceptions use the untransformed PC.
diff --git a/model/riscv_step.sail b/model/riscv_step.sail
index 012f63b..649ddec 100644
--- a/model/riscv_step.sail
+++ b/model/riscv_step.sail
@@ -33,8 +33,7 @@ function step(step_no : int) -> bool = {
},
None() => {
/* the extension hook interposes on the fetch result */
- let f : FetchResult = ext_fetch_hook(fetch());
- match f {
+ match ext_fetch_hook(fetch()) {
/* extension error */
F_Ext_Error(e) => {
ext_handle_fetch_check_error(e);
@@ -57,10 +56,10 @@ function step(step_no : int) -> bool = {
if haveRVC() then {
nextPC = PC + 2;
(execute(ast), true)
- } else {
+ } else {
handle_illegal();
(RETIRE_FAIL, true)
- }
+ }
},
F_Base(w) => {
instbits = zero_extend(w);