Skip to content

Commit d08633d

Browse files
committed
WIP [formal] Exclude u-mode counters from formal verification
1 parent 2dd7cf8 commit d08633d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

dv/formal/check/top.sv

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ NotDebug: assume property (!ibex_top_i.u_ibex_core.debug_mode & !debug_req_i);
163163
ConstantBoot: assume property (boot_addr_i == $past(boot_addr_i));
164164
// 3. Always fetch enable
165165
FetchEnable: assume property (fetch_enable_i == IbexMuBiOn);
166-
// 4. Never try to sleep if we couldn't ever wake up
166+
// 4. Always have mcounteren writable
167+
McounterenWritable: assume property (mcounteren_writable_i == IbexMuBiOn);
168+
// 5. Never try to sleep if we couldn't ever wake up
167169
WFIStart: assume property (`IDC.ctrl_fsm_cs == SLEEP |-> (
168170
`CSR.mie_q.irq_software |
169171
`CSR.mie_q.irq_timer |
@@ -442,18 +444,25 @@ logic ex_is_checkable_csr;
442444
assign ex_is_checkable_csr = ~(
443445
((CSR_MHPMCOUNTER3H <= `CSR_ADDR) && (`CSR_ADDR <= CSR_MHPMCOUNTER31H)) |
444446
((CSR_MHPMCOUNTER3 <= `CSR_ADDR) && (`CSR_ADDR <= CSR_MHPMCOUNTER31)) |
447+
((CSR_HPMCOUNTER3H <= `CSR_ADDR) && (`CSR_ADDR <= CSR_HPMCOUNTER31H)) |
448+
((CSR_HPMCOUNTER3 <= `CSR_ADDR) && (`CSR_ADDR <= CSR_HPMCOUNTER31)) |
445449
((CSR_MHPMEVENT3 <= `CSR_ADDR) && (`CSR_ADDR <= CSR_MHPMEVENT31)) |
446450
(`CSR_ADDR == CSR_CPUCTRLSTS) | (`CSR_ADDR == CSR_SECURESEED) |
447451
(`CSR_ADDR == CSR_MIE) |
448452
(`CSR_ADDR == CSR_MCYCLE) | (`CSR_ADDR == CSR_MCYCLEH) |
453+
(`CSR_ADDR == CSR_CYCLE) | (`CSR_ADDR == CSR_CYCLEH) |
449454

450455
// TODO:
451456
(`CSR_ADDR == CSR_MINSTRET) | (`CSR_ADDR == CSR_MINSTRETH) |
457+
(`CSR_ADDR == CSR_INSTRET) | (`CSR_ADDR == CSR_INSTRETH) |
452458
(`CSR_ADDR == CSR_MCOUNTINHIBIT)
453459
);
454460

455461
`undef INSTR
456462

463+
// Force mcounteren to always be zero to match the current Sail model.
464+
McounterenStubbedZero: assume property (`CSR.mcounteren_q == 32'h0);
465+
457466
////////////////////// Decompression Invariant Defs //////////////////////
458467
// These will be used to show that the decompressed instruction stored is in fact the decompressed version of the compressed instruction.
459468

0 commit comments

Comments
 (0)