mirror of
https://github.com/SpinalHDL/SpinalTemplateSbt.git
synced 2025-10-25 08:48:45 +08:00
SpinalHDL 1.7.0 + formal example
This commit is contained in:
23
src/main/scala/mylib/MyTopLevelFormal.scala
Normal file
23
src/main/scala/mylib/MyTopLevelFormal.scala
Normal 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))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user