Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
82587cd
Add RVA23 coverage and test generators
Apr 18, 2026
66fcf07
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 18, 2026
078953b
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 21, 2026
ab035c5
Required changes in Ssuu64xl
Apr 21, 2026
4c6713b
Merge branch 'RVA23-clean' of https://github.com/Ammarahwakeel/riscv-…
Apr 21, 2026
b898ef9
Required changes in zic64bzicboz
Apr 21, 2026
fe9b349
Added required changs in za64rs
Apr 21, 2026
b362c9a
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 22, 2026
ebacd87
Required changes in S
Apr 22, 2026
98760dd
Merge branch 'RVA23-clean' of https://github.com/Ammarahwakeel/riscv-…
Apr 22, 2026
7ed0f52
Added Sm1p13 coverage and tests
Apr 22, 2026
17a22fe
Excluded Za64rs for spike and qemu metrices
Apr 22, 2026
9c2ac8d
Removed trailing space
Apr 22, 2026
17bc6b3
Excluded Za64rs from runnning on cvw matrix
Apr 22, 2026
3c01518
Added indentation in S coverage
Apr 22, 2026
2e951b1
Fixed indentations and seperated out misa_b and misa_v bits
Apr 22, 2026
6b70bbf
Added interrupt latency macro for Sm1p13
Apr 22, 2026
d94b75d
Added macro
Apr 22, 2026
de95c39
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 23, 2026
f22523d
Required changes for ss1p13
Apr 24, 2026
87af4c9
Required changes in sm1p13
Apr 24, 2026
dac2692
Required changes in Ssu64xl
Apr 24, 2026
eff5af0
Applied range for coveing offsets
Apr 24, 2026
ba16006
Fixed coverage init file
Apr 24, 2026
74e06c8
Added the read back scenerio of uxl bits in ss1p13
Apr 24, 2026
ce80f5c
Added documentation
Apr 24, 2026
77dc469
Added requested changes in coverage of ss1p13, sm1p13
Apr 24, 2026
7d36395
fixed minor typos in python generators
Apr 24, 2026
d2064ed
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 24, 2026
4e66927
Aded RVMODEL_MSIP_ADDRESS macro in config files
Apr 24, 2026
f71c313
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 25, 2026
8b04dcf
Merge branch 'act4' into RVA23-clean
Ammarahwakeel Apr 25, 2026
d34f7b9
Merge branch 'act4' into RVA23-clean
davidharrishmc Apr 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ The ACT Framework uses a selection of assembly macros to run DUT-specific code t
- `RVMODEL_MTIMECMP_ADDRESS` (can be omitted if MTIMECMP is not implemented)
- `RVMODEL_TIMER_INT_SOON_DELAY`

**MSIP Macro**: Required only for Sm version 1.13 and above. Can be omitted if machine software interrupts are not supported.

- `RVMODEL_MSIP_ADDRESS` (can be omitted if MSIP is not memory-mapped or not tested)

**Interrupt Macros**: Can be left blank if interrupts are not supported.

- `RVMODEL_SET_MEXT_INT(_R1, _R2)`
Expand Down
3 changes: 2 additions & 1 deletion config/cores/cvw/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# CI configuration for CORE-V Wally (CVW)
# Requires Verilator and the CVW repository

# TODO: remove za64rs from excluded_extensions when Sail supports UDB_LRSC_FAIL_ON_NON_EXACT_LRSC to match DUT
ci_enabled: true
exclude_extensions: "Sm,S,InterruptsU,PMPSm,ExceptionsZalrsc,ExceptionsZaamo"
exclude_extensions: "Sm,S,InterruptsU,PMPSm,ExceptionsZalrsc,ExceptionsZaamo,Za64rs"
Comment thread
Ammarahwakeel marked this conversation as resolved.
Comment thread
Ammarahwakeel marked this conversation as resolved.
apt_packages: "autoconf flex bison help2man libfl-dev ccache"
install_script: ".github/scripts/install-cvw.sh"
setup_script: ".github/scripts/setup-cvw.sh"
6 changes: 3 additions & 3 deletions config/cores/cvw/cvw-rv64gc/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@
##### Machine Interrupts #####

#define CLINT_BASE_ADDRESS 0x02000000
#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)

#define RVMODEL_SET_MEXT_INT(_R1, _R2)

#define RVMODEL_CLR_MEXT_INT(_R1, _R2)

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);

#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);

##### Supervisor Interrupts #####
Expand Down
6 changes: 3 additions & 3 deletions config/imperas/imperas-rv64-max/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@
sw zero, 0(_R2) ; /* Clear MEXT interrupt */ \


#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);


#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);


Expand Down
3 changes: 2 additions & 1 deletion config/qemu/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

ci_enabled: true
# TODO: Priv tests mismatch due to config issues. Atomics failure still needs to be diagnosed.
exclude_extensions: "Sm,S,Zalrsc,Zacas,ZacasZabha,InterruptsSm,PMPSm,PMPmisaligned,ExceptionsZalrsc,ExceptionsZicboU,ExceptionsZicboS,Svadu,SvaduPMP,Svnapot,Svpbmt,SvZicbo,ExceptionsZaamo"
# TODO: remove za64rs from excluded_extensions when Sail supports UDB_LRSC_FAIL_ON_NON_EXACT_LRSC to match DUT
exclude_extensions: "Sm,S,Zalrsc,Zacas,ZacasZabha,InterruptsSm,PMPSm,PMPmisaligned,ExceptionsZalrsc,ExceptionsZicboU,ExceptionsZicboS,Svadu,SvaduPMP,Svnapot,Svpbmt,SvZicbo,ExceptionsZaamo,Za64rs"
install_script: ".github/scripts/install-qemu.sh"
apt_packages: "libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build"
6 changes: 3 additions & 3 deletions config/qemu/qemu-rv64-max/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@
#define RVMODEL_TIMER_INT_SOON_DELAY 100

#define CLINT_BASE_ADDRESS 0x02000000
#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)

#define RVMODEL_SET_MEXT_INT(_R1, _R2)

#define RVMODEL_CLR_MEXT_INT(_R1, _R2)

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);

#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);

##### Supervisor Interrupts #####
Expand Down
6 changes: 3 additions & 3 deletions config/sail/sail-rv64-max/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@
sw zero, 0(_R2) ; /* Clear MEXT interrupt */ \


#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);


#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);


Expand Down
3 changes: 2 additions & 1 deletion config/spike/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

ci_enabled: true
# TODO: Priv tests mismatch due to config issues. Atomics failure still needs to be diagnosed.
exclude_extensions: "Sm,ExceptionsZc,S,InterruptsSm,PMPmisaligned,ExceptionsZalrsc,Svadu,SvaduPMP,Svnapot,Svpbmt,SvZicbo,ExceptionsZaamo"
# TODO: remove za64rs from excluded_extensions when Sail supports UDB_LRSC_FAIL_ON_NON_EXACT_LRSC to match DUT
exclude_extensions: "Sm,ExceptionsZc,S,InterruptsSm,PMPmisaligned,ExceptionsZalrsc,Svadu,SvaduPMP,Svnapot,Svpbmt,SvZicbo,ExceptionsZaamo,Za64rs"
install_script: ".github/scripts/install-spike.sh"
apt_packages: "device-tree-compiler libboost-regex-dev libboost-system-dev"
6 changes: 3 additions & 3 deletions config/spike/spike-rv64-max/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@
#define RVMODEL_TIMER_INT_SOON_DELAY 100

#define CLINT_BASE_ADDRESS 0x02000000
#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)

#define RVMODEL_SET_MEXT_INT(_R1, _R2)

#define RVMODEL_CLR_MEXT_INT(_R1, _R2)

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);

#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);

##### Supervisor Interrupts #####
Expand Down
2 changes: 1 addition & 1 deletion config/whisper/whisper-rv32-max/rvtest_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define LARGEST_PROGRAM 0x00010000

#define CLINT_BASE_ADDRESS 0x02000000
#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)


#define A_SUPPORTED
Expand Down
4 changes: 2 additions & 2 deletions config/whisper/whisper-rv64-max/rvmodel_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@

#define RVMODEL_SET_MSW_INT(_R1, _R2) \
li _R1, 1; \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw _R1, 0(_R2);

#define RVMODEL_CLR_MSW_INT(_R1, _R2) \
li _R2, MSIP_ADDRESS; \
li _R2, RVMODEL_MSIP_ADDRESS; \
sw zero, 0(_R2);

##### Supervisor Interrupts #####
Expand Down
2 changes: 1 addition & 1 deletion config/whisper/whisper-rv64-max/rvtest_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define LARGEST_PROGRAM 0x00010000

#define CLINT_BASE_ADDRESS 0x02000000
#define MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)
#define RVMODEL_MSIP_ADDRESS (CLINT_BASE_ADDRESS + 0x0)


#define A_SUPPORTED
Expand Down
12 changes: 12 additions & 0 deletions coverpoints/coverage/RISCV_coverage_base_init.svh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@
`cover_info("// SsstrictV - Enabled");
`include "SsstrictV_coverage_init.svh"
`endif
`ifdef COVER_SSU64XL
`cover_info("// Ssu64xl - Enabled");
`include "Ssu64xl_coverage_init.svh"
`endif
`ifdef COVER_SV
`cover_info("// Sv - Enabled");
`include "Sv_coverage_init.svh"
Expand Down Expand Up @@ -326,6 +330,10 @@
`cover_info("// Vx8 - Enabled");
`include "Vx8_coverage_init.svh"
`endif
`ifdef COVER_ZA64RS
`cover_info("// Za64rs - Enabled");
`include "Za64rs_coverage_init.svh"
`endif
`ifdef COVER_ZAAMO
`cover_info("// Zaamo - Enabled");
`include "Zaamo_coverage_init.svh"
Expand Down Expand Up @@ -446,6 +454,10 @@
`cover_info("// ZfhminD - Enabled");
`include "ZfhminD_coverage_init.svh"
`endif
`ifdef COVER_ZIC64BZICBOZ
`cover_info("// Zic64bzicboz - Enabled");
`include "Zic64bzicboz_coverage_init.svh"
`endif
`ifdef COVER_ZICBOM
`cover_info("// Zicbom - Enabled");
`include "Zicbom_coverage_init.svh"
Expand Down
9 changes: 9 additions & 0 deletions coverpoints/coverage/RISCV_coverage_base_sample.svh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
`ifdef COVER_SSSTRICTV
ssstrictv_sample(hart, issue, ins);
`endif
`ifdef COVER_SSU64XL
ssu64xl_sample(hart, issue, ins);
`endif
`ifdef COVER_SV
sv_sample(hart, issue, ins);
`endif
Expand Down Expand Up @@ -247,6 +250,9 @@
`ifdef COVER_VX8
vx8_sample(hart, issue, ins);
`endif
`ifdef COVER_ZA64RS
za64rs_sample(hart, issue, ins);
`endif
`ifdef COVER_ZAAMO
zaamo_sample(hart, issue, ins);
`endif
Expand Down Expand Up @@ -337,6 +343,9 @@
`ifdef COVER_ZFHMIND
zfhmind_sample(hart, issue, ins);
`endif
`ifdef COVER_ZIC64BZICBOZ
zic64bzicboz_sample(hart, issue, ins);
`endif
`ifdef COVER_ZICBOM
zicbom_sample(hart, issue, ins);
`endif
Expand Down
9 changes: 9 additions & 0 deletions coverpoints/coverage/RISCV_coverage_config.svh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
`ifdef SSSTRICTV_COVERAGE
`include "SsstrictV_coverage.svh"
`endif
`ifdef SSU64XL_COVERAGE
`include "Ssu64xl_coverage.svh"
`endif
`ifdef SV_COVERAGE
`include "Sv_coverage.svh"
`endif
Expand Down Expand Up @@ -248,6 +251,9 @@
`ifdef VX8_COVERAGE
`include "Vx8_coverage.svh"
`endif
`ifdef ZA64RS_COVERAGE
`include "Za64rs_coverage.svh"
`endif
`ifdef ZAAMO_COVERAGE
`include "Zaamo_coverage.svh"
`endif
Expand Down Expand Up @@ -338,6 +344,9 @@
`ifdef ZFHMIND_COVERAGE
`include "ZfhminD_coverage.svh"
`endif
`ifdef ZIC64BZICBOZ_COVERAGE
`include "Zic64bzicboz_coverage.svh"
`endif
`ifdef ZICBOM_COVERAGE
`include "Zicbom_coverage.svh"
`endif
Expand Down
15 changes: 15 additions & 0 deletions coverpoints/priv/S_coverage.svh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ covergroup S_scause_cg with function sample(ins_t ins);
// main coverpoints
cp_scause_write_exception: cross priv_mode_s, csrrw, scause, scause_exception_values, scause_exception; // CSR write of scause in S mode with interesting values
cp_scause_write_interrupt: cross priv_mode_s, csrrw, scause, scause_interrupt_values, scause_interrupt; // CSR write of scause in S mode with interesting values

endgroup


Expand All @@ -104,6 +105,20 @@ covergroup S_sstatus_cg with function sample(ins_t ins);
// main coverpoints
cp_sstatus_sd_write: cross priv_mode_s, csrrw, sstatus, cp_sstatus_sd, cp_sstatus_fs, cp_sstatus_vs, cp_sstatus_xs;

`ifdef SS1P13_SUPPORTED
Comment thread
Ammarahwakeel marked this conversation as resolved.
`ifdef XLEN64
uxl_write_attempt: coverpoint ins.current.rs1_val[33:32] {
bins attempt_1 = {2'b01};
bins attempt_2 = {2'b10};
}
csrop: coverpoint ins.current.insn {
wildcard bins csrrw = {CSRRW};
}
// main coverpoints
cp_sxlen_ge_uxlen: cross priv_mode_s, csrop, sstatus, uxl_write_attempt;
`endif // XLEN64
`endif // SS1P13_SUPPORTED

endgroup

covergroup S_sprivinst_cg with function sample(ins_t ins);
Expand Down
37 changes: 37 additions & 0 deletions coverpoints/priv/Sm_coverage.svh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ covergroup Sm_mcause_cg with function sample(ins_t ins);
// This is Sm machine-mode testing, so all coverpoints are in Machine mode.
cp_mcause_write_exception: cross priv_mode_m, csrrw, mcause, mcause_exception_values, mcause_exception; // CSR write of mcause in M mode with interesting values
cp_mcause_write_interrupt: cross priv_mode_m, csrrw, mcause, mcause_interrupt_values, mcause_interrupt; // CSR write of mcause in M mode with interesting values

endgroup


Expand Down Expand Up @@ -413,6 +414,42 @@ covergroup Sm_mcsr_cg with function sample(ins_t ins);
cp_mtimeh_write : cross priv_mode_m, csrr, timeh_csr; // assumes mtimeh has been written
`endif
`endif

`ifdef SM1P13_SUPPORTED
misa_b_bit: coverpoint ins.current.rs1_val[1] {
bins b_set = {1'b1};
bins b_clear = {1'b0};
}
misa_v_bit: coverpoint ins.current.rs1_val[21] {
bins v_set = {1'b1};
bins v_clear = {1'b0};
}

cp_misa_b: cross priv_mode_m, misa, csrop, misa_b_bit;
cp_misa_v: cross priv_mode_m, misa, csrop, misa_v_bit;


`ifdef RVMODEL_MSIP_ADDRESS
msip_address: coverpoint ins.current.rs1_val {
bin msip = {`RVMODEL_MSIP_ADDRESS};
}
msip_val: coverpoint ins.current.rs2_val {
bin zero = {0};
bin one = {1};
}
cp_msip: cross priv_mode_m, sw, msip_address, msip_val;
`endif // RVMODEL_MSIP_ADDRESS

`ifdef XLEN32
medelegh: coverpoint ins.current.insn[31:20] {
bins medelegh = {CSR_MEDELEGH};
}

cp_medelegh: cross priv_mode_m, csrrw, medelegh, rs1_ones; // RV32 only: write all 1s to medelegh and read back
`endif // XLEN32
`endif // SM1P13_SUPPORTED


endgroup

function void sm_sample(int hart, int issue, ins_t ins);
Expand Down
37 changes: 37 additions & 0 deletions coverpoints/priv/Ssu64xl_coverage.svh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
///////////////////////////////////////////////
// RISC-V Architectural Functional Coverage Covergroups
//
// Written: Ammarah Wakeel email:ammarahwakeel9@gmail.com (UET, April 2026)
//
// Copyright (C) : 2026 Harvey Mudd College, 10x Engineers, UET Lahore, Habib University
// SPDX-License-Identifier: Apache-2.0
//
// Description: Coverage for RVA23 profile - Ssu64xl extension
//
///////////////////////////////////////////////

`define COVER_SSU64XL

covergroup Ssu64xl_cg with function sample(ins_t ins);
option.per_instance = 0;

Comment thread
Ammarahwakeel marked this conversation as resolved.
`include "general/RISCV_coverage_standard_coverpoints.svh"

`ifdef XLEN64

sstatus_uxl_after: coverpoint get_csr_val(ins.hart, ins.issue, `SAMPLE_AFTER, "sstatus", "uxl") {
bins uxl_is_10 = {2'b10};
}
gpr_bit63: coverpoint ins.current.rd_val[63] {
bins bit63_set = {1'b1};
}

cp_ssu64xl: cross priv_mode_u, sstatus_uxl_after, gpr_bit63;

`endif

endgroup

function void ssu64xl_sample(int hart, int issue, ins_t ins);
Ssu64xl_cg.sample(ins);
endfunction
Loading
Loading