Skip to content

Commit

Permalink
On a hunch, do some CSR experiments with IRQs to find failing traces …
Browse files Browse the repository at this point in the history
…(and create assumptions/masks to fix them).
  • Loading branch information
cr1901 committed Jan 14, 2025
1 parent 3932830 commit 11f970d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions tests/formal/checks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ isa rv32i
# to check assumptions), probably for little gain. Neverless, allow the
# possibility for running long tests.
full
# Group for experimenting with IRQ line. Not currently used (in particular,
# my intended use-case of "irq_cover" creates a BMC, not a cover check.)
# Group for experimenting with IRQ line. Used for any group where I've
# determined that IRQs make a difference when extending depth.
# TODO: "irq_cover", one of my intended use-cases, creates a BMC, not a cover
# check.
irq

[depth]
Expand All @@ -19,6 +21,7 @@ full_insn_sll 80
full_insn_srl 80
full_insn_sra 80
reg 15 25
# reg 5 32 # Takes a long time!
pc_fwd 10 30
pc_bwd 10 30
liveness 1 12 39
Expand All @@ -34,12 +37,19 @@ csrc_any 1 20
csrc_zero 1 20
csrc_const 1 20

irq_csrw 27
irq_csr_ill 27
irq_csrw_misa 27
irq_csrc_any 1 27
irq_csrc_zero 1 27
irq_csrc_const 1 27

[csrs]
mscratch any
mcause
mip zero_mask="32'h0000F7FF"
mie zero_mask="32'h0000F7FF"
mstatus const="32'h0001800"_mask="32'hFFFFFFF7"
mstatus const="32'h0001800"_mask="32'hFFFFFF77" # mret sets MPIE to 1!
mtvec zero_mask="32'h00000003"
mepc zero_mask="32'h00000003"
# Read-only zero registers
Expand Down Expand Up @@ -84,6 +94,13 @@ eff m rw
// external ints are disabled for checking MIP.
always @* assume((rvfi_csr_mip_rdata & 32'h00000800) == 0);
[assume !irq_csrw]
// RV formal cannot presently handle external/async interrupts, so repeat
// the logic here. When this can be removed, the !csrw_mip line should remain.
// Default csrw tests don't need this because 20 cycles isn't enough to
// start the interrupt handler.
always @* assume((rvfi_csr_mip_rdata & 32'h00000800) == 0);

[defines]
`define RISCV_FORMAL_ALIGNED_MEM

Expand Down

0 comments on commit 11f970d

Please sign in to comment.