SpinalHDL 1.7.0 + formal example

This commit is contained in:
Dolu1990
2022-04-29 15:18:33 +02:00
parent 181684644c
commit df28313eea
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
package mylib
import spinal.core._
import spinal.core.formal._
//MyTopLevel's testbench
object MyTopLevelFormal {
def main(args: Array[String]) {
FormalConfig.withBMC(10).doVerify(new Component {
val dut = FormalDut(new MyTopLevel)
// Ensure the formal test start with a reset
assumeInitial(clockDomain.isResetActive)
// Provide some stimulus
anyseq(dut.io.cond0)
anyseq(dut.io.cond1)
// Check the state initial value and increment
assert(dut.io.state === past(dut.io.state + U(dut.io.cond0)).init(0))
})
}
}