Skip to content

Commit aba713d

Browse files
author
Derek Hower
committed
ISS running riscv-tests; most instructions pass, couple bugs left
1 parent 95b376f commit aba713d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+633
-234
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN apt-get install -y --no-install-recommends g++
2424
RUN apt-get install -y --no-install-recommends clang-format
2525
RUN apt-get install -y --no-install-recommends clang-tidy
2626
RUN apt-get install -y --no-install-recommends libelf-dev
27+
RUN apt-get install -y --no-install-recommends gcc-riscv64-unknown-elf
2728
RUN apt-get clean autoclean
2829
RUN apt-get autoremove -y
2930
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "ext/riscv-isa-manual"]
88
path = ext/riscv-isa-manual
99
url = https://github.com/riscv/riscv-isa-manual
10+
[submodule "ext/riscv-tests"]
11+
path = ext/riscv-tests
12+
url = https://github.com/riscv-software-src/riscv-tests.git

arch/ext/S.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@ params:
7272
extra_validation: |
7373
assert SXLEN == 32 if XLEN == 32
7474
assert (SXLEN != 32) if UXLEN != 32
75+
REPORT_VA_IN_MTVAL_ON_LOAD_PAGE_FAULT:
76+
description: |
77+
When true, `mtval` is written with the virtual address of a load when it causes a
78+
`LoadPageFault`.
79+
80+
WHen false, `mtval` is written with 0 when a load causes a `LoadPageFault`.
81+
schema:
82+
type: boolean
83+
REPORT_VA_IN_MTVAL_ON_STORE_AMO_PAGE_FAULT:
84+
description: |
85+
When true, `mtval` is written with the virtual address of a store when it causes a
86+
`StoreAmoPageFault`.
87+
88+
WHen false, `mtval` is written with 0 when a store causes a `StoreAmoPageFault`.
89+
schema:
90+
type: boolean
91+
REPORT_VA_IN_MTVAL_ON_INSTRUCTION_PAGE_FAULT:
92+
description: |
93+
When true, `mtval` is written with the virtual PC of an instructino when fetch causes an
94+
`InstructionPageFault`.
95+
96+
WHen false, `mtval` is written with 0 when an instruction fetch causes an
97+
`InstructionPageFault`.
98+
schema:
99+
type: boolean
75100
REPORT_VA_IN_STVAL_ON_BREAKPOINT:
76101
description: |
77102
When true, `stval` is written with the virtual PC of the EBREAK instruction (same information as `mepc`).

arch/ext/Sm.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -377,31 +377,6 @@ params:
377377
`InstructionAccessFault`.
378378
schema:
379379
type: boolean
380-
REPORT_VA_IN_MTVAL_ON_LOAD_PAGE_FAULT:
381-
description: |
382-
When true, `mtval` is written with the virtual address of a load when it causes a
383-
`LoadPageFault`.
384-
385-
WHen false, `mtval` is written with 0 when a load causes a `LoadPageFault`.
386-
schema:
387-
type: boolean
388-
REPORT_VA_IN_MTVAL_ON_STORE_AMO_PAGE_FAULT:
389-
description: |
390-
When true, `mtval` is written with the virtual address of a store when it causes a
391-
`StoreAmoPageFault`.
392-
393-
WHen false, `mtval` is written with 0 when a store causes a `StoreAmoPageFault`.
394-
schema:
395-
type: boolean
396-
REPORT_VA_IN_MTVAL_ON_INSTRUCTION_PAGE_FAULT:
397-
description: |
398-
When true, `mtval` is written with the virtual PC of an instructino when fetch causes an
399-
`InstructionPageFault`.
400-
401-
WHen false, `mtval` is written with 0 when an instruction fetch causes an
402-
`InstructionPageFault`.
403-
schema:
404-
type: boolean
405380
REPORT_ENCODING_IN_MTVAL_ON_ILLEGAL_INSTRUCTION:
406381
description: |
407382
When true, `mtval` is written with the encoding of an instruction that causes an

arch/inst/I/addi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ access:
2222
vs: always
2323
vu: always
2424
data_independent_timing: true
25-
operation(): X[rd] = X[rs1] + imm;
25+
operation(): X[rd] = X[rs1] + $signed(imm);
2626

2727
sail(): |
2828
{

arch/inst/I/andi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ access:
2222
vs: always
2323
vu: always
2424
data_independent_timing: true
25-
operation(): X[rd] = X[rs1] & imm;
25+
operation(): X[rd] = X[rs1] & $signed(imm);
2626

2727
sail(): |
2828
{

arch/inst/I/auipc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ access:
2323
vs: always
2424
vu: always
2525
data_independent_timing: true
26-
operation(): X[rd] = $pc + imm;
26+
operation(): X[rd] = $pc + $signed(imm);
2727

2828
sail(): |
2929
{

arch/inst/I/beq.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ operation(): |
3131
XReg rhs = X[rs2];
3232
3333
if (lhs == rhs) {
34-
jump_halfword($pc + imm);
34+
jump_halfword($pc + $signed(imm));
3535
}
3636
3737
sail(): |

arch/inst/I/bge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ operation(): |
3131
XReg rhs = X[rs2];
3232
3333
if ($signed(lhs) >= $signed(rhs)) {
34-
jump_halfword($pc + imm);
34+
jump_halfword($pc + $signed(imm));
3535
}
3636
3737
sail(): |

arch/inst/I/bgeu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ operation(): |
3131
XReg rhs = X[rs2];
3232
3333
if (lhs >= rhs) {
34-
jump_halfword($pc + imm);
34+
jump_halfword($pc + $signed(imm));
3535
}
3636
3737
sail(): |

0 commit comments

Comments
 (0)