Skip to content

Commit a28af7b

Browse files
Merge branch 'dev' into m_interrupts
Signed-off-by: Umer Shahid <[email protected]>
2 parents 0a45f55 + 16638c7 commit a28af7b

File tree

1,114 files changed

+7474543
-6679648
lines changed

Some content is hidden

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

1,114 files changed

+7474543
-6679648
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
uses: actions/cache/restore@v4
109109
with:
110110
path: ${{ github.workspace }}/sail
111-
key: sail-${{ env.SAIL_HASH }}-RV${{ matrix.xlen }}
111+
key: sail-${{ env.SAIL_HASH }}
112112

113113
- name: Install Sail
114114
if: steps.cache-sail-restore.outputs.cache-hit != 'true'
@@ -120,7 +120,7 @@ jobs:
120120
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
121121
cmake --build build
122122
mkdir -p $GITHUB_WORKSPACE/sail
123-
mv build/c_emulator/riscv_sim_rv${{ matrix.xlen }}d $GITHUB_WORKSPACE/sail/riscv_sim_rv${{ matrix.xlen }}d
123+
mv build/c_emulator/sail_riscv_sim $GITHUB_WORKSPACE/sail/sail_riscv_sim
124124
125125
- name: Save cached Sail
126126
if: steps.cache-sail-restore.outputs.cache-hit != 'true'

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
uses: actions/cache/restore@v4
118118
with:
119119
path: ${{ github.workspace }}/sail
120-
key: sail-${{ env.SAIL_HASH }}-RV${{ matrix.xlen }}
120+
key: sail-${{ env.SAIL_HASH }}
121121

122122
- name: Install Sail
123123
if: steps.cache-sail-restore.outputs.cache-hit != 'true'
@@ -129,7 +129,7 @@ jobs:
129129
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
130130
cmake --build build
131131
mkdir -p $GITHUB_WORKSPACE/sail
132-
mv build/c_emulator/riscv_sim_rv${{ matrix.xlen }}d $GITHUB_WORKSPACE/sail/riscv_sim_rv${{ matrix.xlen }}d
132+
mv build/c_emulator/sail_riscv_sim $GITHUB_WORKSPACE/sail/sail_riscv_sim
133133
134134
- name: Save cached Sail
135135
if: steps.cache-sail-restore.outputs.cache-hit != 'true'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ Then build the RISC-V Sail Model:
220220
```bash
221221
$ git clone https://github.com/riscv/sail-riscv.git
222222
$ cd sail-riscv
223-
$ ./build-simulators.sh
223+
$ ./build_simulators.sh
224224
```
225225

226-
This will create a C simulator in `build/c_emulator/riscv_sim_rv64d` and `build/c_emulator/riscv_sim_rv32d`. You will need to add this path to your `$PATH` or create an alias to execute them from the command line.
226+
This will create a C simulator in `build/c_emulator/sail_riscv_sim`. You will need to add this path to your `$PATH` or create an alias to execute it from the command line.
227227

228228

229229
## Necessary Env Files

coverage/b/rv32i_b.cgf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ zext.h_32:
9090
mnemonics:
9191
zext.h: 0
9292
base_op: pack
93-
p_op_cond: rs2 == x0
93+
p_op_cond: rs2 == "x0"
9494
rs1:
9595
<<: *all_regs
9696
rd:

coverage/b/rv64i_b.cgf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ zext.h_64:
191191
mnemonics:
192192
zext.h: 0
193193
base_op: packw
194-
p_op_cond: rs2 == x0
194+
p_op_cond: rs2 == "x0"
195195
rs1:
196196
<<: *all_regs
197197
rd:

coverage/c/rv32ic.cgf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,6 @@ cjr:
401401
c.jr: 0
402402
rs1:
403403
<<: *all_regs_mx0
404-
op_comb:
405-
<<: *sfmt_op_comb
406-
val_comb:
407-
<<: *base_rs1val_sgn_rs2val_zero
408-
abstract_comb:
409-
'sp_dataset(xlen)': 0
410-
<<: *rs1val_walking
411404

412405
cmv:
413406
config:
@@ -451,13 +444,6 @@ cjalr:
451444
c.jalr: 0
452445
rs1:
453446
<<: *all_regs_mx0
454-
op_comb:
455-
<<: *sfmt_op_comb
456-
val_comb:
457-
<<: *base_rs1val_sgn_rs2val_zero
458-
abstract_comb:
459-
'sp_dataset(xlen)': 0
460-
<<: *rs1val_walking
461447

462448
cswsp:
463449
config:

coverage/c/rv64ic.cgf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,6 @@ cjr:
493493
c.jr: 0
494494
rs1:
495495
<<: *all_regs_mx0
496-
op_comb:
497-
<<: *sfmt_op_comb
498-
val_comb:
499-
<<: *base_rs1val_sgn_rs2val_zero
500-
abstract_comb:
501-
'sp_dataset(xlen)': 0
502-
<<: *rs1val_walking
503496

504497
cmv:
505498
config:
@@ -543,13 +536,6 @@ cjalr:
543536
c.jalr: 0
544537
rs1:
545538
<<: *all_regs_mx0
546-
op_comb:
547-
<<: *sfmt_op_comb
548-
val_comb:
549-
<<: *base_rs1val_sgn_rs2val_zero
550-
abstract_comb:
551-
'sp_dataset(xlen)': 0
552-
<<: *rs1val_walking
553539

554540
cswsp:
555541
config:

coverage/header_file.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,24 @@ common:
916916
RISCV_PGSIZE: (1 << RISCV_PGSHIFT)
917917

918918
PMP_MACROS:
919+
PMPCFG_BIT_SET: 1
920+
PMPCFG_BIT_NOT_SET: 0
921+
PMPCFG_ONLY_R_SET: 0x01
922+
PMPCFG_ONLY_X_SET: 0x04
923+
PMPCFG_ONLY_RW_SET: 0x03
924+
PMPCFG_ONLY_RX_SET: 0x05
925+
PMPCFG_ONLY_RWX_SET: 0x07
926+
PMPCFG_OFF_MODE: 0x00
927+
PMPCFG_TOR_MODE: 0x08
928+
PMPCFG_NA4_MODE: 0x10
929+
PMPCFG_NAPOT_MODE: 0x18
930+
PMPCFG_R_BIT: 0x01
931+
PMPCFG_W_BIT: 0x02
932+
PMPCFG_X_BIT: 0x04
933+
PMPCFG_RWX_BIT: 0x07
934+
PMPCFG_A_BIT: 0x18
935+
PMPCFG_RW_BIT: 0x60
936+
PMPCFG_L_BIT: 0x80
919937
PMP0_CFG_SHIFT: 0
920938
PMP1_CFG_SHIFT: 8
921939
PMP2_CFG_SHIFT: 16

coverage/pmp/rv32_pmp.cgf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pmp_cfg_locked_write_unrelated:
77
"{csrrs, csrrw}" : 0
88
csr_comb:
99
# (Lock bit set) and (req) and (old_value_pmpcfg != 0)
10-
(pmpcfg{{0 ... 15} >> 2} >> {0, 8, 16, 24}{[$2%4]} & 0x80 == 0x80) and (((old("pmpcfg$2") ^ pmpcfg$2) >> $3 & 0xFF) == 0x00) and old("pmpcfg$2") != 0: 0
11-
(pmpcfg{{0 ... 15} >> 2} >> {0, 8, 16, 24}{[$1%4]} & 0x80 == 0x80) and (old("pmpaddr$1") == (pmpaddr$1)) and (pmpcfg$2 != 0): 0
10+
(pmpcfg{{0 ... 15} >> 2} >> {0, 8, 16, 24}{[$2%4]} & 0x80 == 0x80) and (((old_csr_val("pmpcfg$2") ^ pmpcfg$2) >> $3 & 0xFF) == 0x00) and old_csr_val("pmpcfg$2") != 0: 0
11+
(pmpcfg{{0 ... 15} >> 2} >> {0, 8, 16, 24}{[$1%4]} & 0x80 == 0x80) and (old_csr_val("pmpaddr$1") == (pmpaddr$1)) and (pmpcfg$2 != 0): 0
1212

1313
#This coverpoint checks the coverage of pmp-CSR-access.cgf (PMP CSRs accesses in different modes)
1414
#Checks pmpcgf and pmpaddr are only accessible in M mode and gets fault in S and U mode when accessed.
@@ -19,9 +19,9 @@ PMP_access_permission:
1919
"{csrrs, csrrw}" : 0
2020
csr_comb:
2121
#Check successful update for pmpcfg in M Mode
22-
mode == 'M' and ((old("pmpcfg{0 ... 3}") != (pmpcfg$1)) and pmpcfg$1 != 0x0): 0
22+
mode == 'M' and ((old_csr_val("pmpcfg{0 ... 3}") != (pmpcfg$1)) and pmpcfg$1 != 0x0): 0
2323
#Check successful update for pmpaddr in M Mode
24-
mode == 'M' and ((old("pmpaddr{0 ... 15}") != (pmpaddr$1)) and pmpaddr$1 != 0x0): 0 #pmpaddr successfully updated in M mode
24+
mode == 'M' and ((old_csr_val("pmpaddr{0 ... 15}") != (pmpaddr$1)) and pmpaddr$1 != 0x0): 0 #pmpaddr successfully updated in M mode
2525
#Check for fault for pmpcfg, pmpaddr in S, U Mode
2626
mode == {'S', 'U'} and mcause == ${CAUSE_ILLEGAL_INSTRUCTION}: 0 #check for illegal instruction fault
2727

coverage/pmp/rv64_pmp.cgf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ PMP_access_permission:
210210
"{csrrs, csrrw}" : 0
211211
csr_comb:
212212
#Check successful update for pmpcfg in M Mode
213-
mode == 'M' and (((old("pmpcfg{0 , 2}") ^ (pmpcfg$1)) != 0x00) and pmpcfg$1 != 0x0): 0 #pmpcfg successfully updated in M mode
213+
mode == 'M' and (((old_csr_val("pmpcfg{0 , 2}") ^ (pmpcfg$1)) != 0x00) and pmpcfg$1 != 0x0): 0 #pmpcfg successfully updated in M mode
214214
#Check successful update for pmpaddr in M Mode
215-
mode == 'M' and (((old("pmpaddr{0 ... 15}") ^ (pmpaddr$1)) != 0x00) and pmpaddr$1 != 0x0): 0 #pmpaddr successfully updated in M mode
215+
mode == 'M' and (((old_csr_val("pmpaddr{0 ... 15}") ^ (pmpaddr$1)) != 0x00) and pmpaddr$1 != 0x0): 0 #pmpaddr successfully updated in M mode
216216
#Check for fault for pmpcfg, pmpaddr in S, U Mode
217217
mode == {'S', 'U'} and mcause == ${CAUSE_ILLEGAL_INSTRUCTION}: 0 #check for illegal instruction fault

0 commit comments

Comments
 (0)