Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Dec 6, 2022
1 parent c5a6e31 commit e6bbe0d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/main/scala/chiseltest/formal/StutteringClockTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package chiseltest.formal

import firrtl._
import firrtl.{options, _}
import firrtl.annotations._
import firrtl.backends.experimental.smt.FirrtlToTransitionSystem
import firrtl.options.Dependency
Expand Down Expand Up @@ -51,8 +51,12 @@ object StutteringClockTransform extends Transform with DependencyAPIMigration {
Dependency[firrtl.transforms.PropagatePresetAnnotations]
override def invalidates(a: Transform): Boolean = false

// this pass needs to run *before* converting to a transition system
override def optionalPrerequisiteOf: Seq[TransformDependency] = Seq(Dependency(FirrtlToTransitionSystem))
override def optionalPrerequisiteOf: Seq[TransformDependency] = Seq(
// this pass needs to run *before* converting to a transition system
Dependency(FirrtlToTransitionSystem),
// this pass also needs to run before inlining as it assumes the standard module structure
Dependency[firrtl.passes.InlineInstances]
)
// we need to be able to identify registers that are "preset"
override def optionalPrerequisites: Seq[TransformDependency] = Seq(
Dependency[PropagatePresetAnnotations]
Expand Down
11 changes: 8 additions & 3 deletions src/test/scala/chiseltest/formal/multiclock/AsyncFifoTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import chisel3.util._
import chiseltest._
import chiseltest.experimental.observe
import chiseltest.formal._
import logger.{LogLevel, LogLevelAnnotation}
import org.scalatest.flatspec.AnyFlatSpec

class AsyncFifoTests extends AnyFlatSpec with ChiselScalatestTester with Formal with FormalBackendOption {
behavior of "AsyncFifo"

// TODO: find out why wire persist when running stuttering clock transform
it should "pass a formal integrity test" taggedAs FormalTag ignore {
verify(new FifoTestWrapper(new AsyncFifo(UInt(8.W), 4)), Seq(BoundedCheck(4), DefaultBackend, EnableMultiClock))
it should "pass a formal integrity test" taggedAs FormalTag in {
verify(new FifoTestWrapper(new AsyncFifo(UInt(8.W), 4)), Seq(
BoundedCheck(4), DefaultBackend, EnableMultiClock,
// TODO: we currently do not model undef since the DefRandToRegisterPass doesn't deal well with multi-clock
DoNotModelUndef,
LogLevelAnnotation(LogLevel.Info)
))
}
}

Expand Down

0 comments on commit e6bbe0d

Please sign in to comment.