aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_platform.sail
diff options
context:
space:
mode:
authorAlasdair Armstrong <alasdair.armstrong@cl.cam.ac.uk>2019-08-19 18:49:23 +0100
committerAlasdair Armstrong <alasdair.armstrong@cl.cam.ac.uk>2019-08-19 18:53:00 +0100
commita381a832bb39bb7571725f75c27dc257762cd693 (patch)
tree29c1d4210ffa91e372f94f2567e3f3275b466b4e /model/riscv_platform.sail
parentc0c70effa02100c16870251b2a27b79a1cab7331 (diff)
downloadsail-riscv-a381a832bb39bb7571725f75c27dc257762cd693.zip
sail-riscv-a381a832bb39bb7571725f75c27dc257762cd693.tar.gz
sail-riscv-a381a832bb39bb7571725f75c27dc257762cd693.tar.bz2
RISC-V spec, without implicit casts
Diffstat (limited to 'model/riscv_platform.sail')
-rw-r--r--model/riscv_platform.sail8
1 files changed, 4 insertions, 4 deletions
diff --git a/model/riscv_platform.sail b/model/riscv_platform.sail
index 52511a9..9639592 100644
--- a/model/riscv_platform.sail
+++ b/model/riscv_platform.sail
@@ -201,11 +201,11 @@ function clint_load(addr, width) = {
function clint_dispatch() -> unit = {
if get_config_print_platform()
then print_platform("clint::tick mtime <- " ^ BitStr(mtime));
- mip->MTI() = false;
+ mip->MTI() = 0b0;
if mtimecmp <=_u mtime then {
if get_config_print_platform()
then print_platform(" clint timer pending at mtime " ^ BitStr(mtime));
- mip->MTI() = true
+ mip->MTI() = 0b1
}
}
@@ -216,7 +216,7 @@ function clint_store(addr, width, data) = {
if addr == MSIP_BASE & ('n == 8 | 'n == 4) then {
if get_config_print_platform()
then print_platform("clint[" ^ BitStr(addr) ^ "] <- " ^ BitStr(data) ^ " (mip.MSI <- " ^ BitStr(data[0]) ^ ")");
- mip->MSI() = data[0] == 0b1;
+ mip->MSI() = [data[0]];
clint_dispatch();
MemValue(true)
} else if addr == MTIMECMP_BASE & 'n == 8 then {
@@ -308,7 +308,7 @@ function htif_store(addr, width, data) = {
0x00 => { /* syscall-proxy */
if get_config_print_platform()
then print_platform("htif-syscall-proxy cmd: " ^ BitStr(cmd.payload()));
- if cmd.payload()[0] == 0b1
+ if cmd.payload()[0] == bitone
then {
htif_done = true;
htif_exit_code = (sail_zero_extend(cmd.payload(), 64) >> 1)