Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Solver Chosen Constants for Formal Verification #664

Open
fayalalebrun opened this issue Aug 6, 2023 · 3 comments
Open

Solver Chosen Constants for Formal Verification #664

fayalalebrun opened this issue Aug 6, 2023 · 3 comments

Comments

@fayalalebrun
Copy link

In SymbiYosys, the anyconst attribute can be used in order to have the solver choose a constant for an input variable. For certain types of designs, this can make proving correctness easier.

Is there currently a way to specify such an attribute with chiseltest?

@ekiwi
Copy link
Collaborator

ekiwi commented Aug 6, 2023

An uninitialized register should essentially be able to emulate the behavior of anyconst.:

val myConst = Reg(UInt(8.W))

Registers without a reset value will start at an arbitrary constant (solver chosen in case of formal) and then, assuming you do not assign anything to them, they will retain their value.

@fayalalebrun
Copy link
Author

Would the following have the same effect?

assume(stable(input))

@ekiwi
Copy link
Collaborator

ekiwi commented Aug 6, 2023

Would the following have the same effect?

I think so. The only downside here is that to make an input you need to be in the top-level module. Registers can easily declared independent of module hierarchy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants