summaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorKevin Laeufer2021-04-29 11:52:20 -0700
committerGitHub2021-04-29 18:52:20 +0000
commit4d8fed00225d15221cf32177ea9147b20d0b91f7 (patch)
treeb2696fe705f118865733bdd4e7e281a57208fae6 /core/src/main
parent992a0a69e7a064abfeef737fcfff22cb96ec8b65 (diff)
verification: guard statements with module reset (#1891)
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/scala/chisel3/experimental/verification/package.scala24
1 files changed, 13 insertions, 11 deletions
diff --git a/core/src/main/scala/chisel3/experimental/verification/package.scala b/core/src/main/scala/chisel3/experimental/verification/package.scala
index 5c71bd5f..816299a3 100644
--- a/core/src/main/scala/chisel3/experimental/verification/package.scala
+++ b/core/src/main/scala/chisel3/experimental/verification/package.scala
@@ -2,9 +2,8 @@
package chisel3.experimental
-import chisel3.{Bool, CompileOptions}
+import chisel3._
import chisel3.internal.Builder
-import chisel3.internal.Builder.pushCommand
import chisel3.internal.firrtl.{Formal, Verification}
import chisel3.internal.sourceinfo.SourceInfo
@@ -13,9 +12,10 @@ package object verification {
def apply(predicate: Bool, msg: String = "")(
implicit sourceInfo: SourceInfo,
compileOptions: CompileOptions): Unit = {
- val clock = Builder.forcedClock
- pushCommand(Verification(Formal.Assert, sourceInfo, clock.ref,
- predicate.ref, msg))
+ when (!Module.reset.asBool) {
+ val clock = Module.clock
+ Builder.pushCommand(Verification(Formal.Assert, sourceInfo, clock.ref, predicate.ref, msg))
+ }
}
}
@@ -23,9 +23,10 @@ package object verification {
def apply(predicate: Bool, msg: String = "")(
implicit sourceInfo: SourceInfo,
compileOptions: CompileOptions): Unit = {
- val clock = Builder.forcedClock
- pushCommand(Verification(Formal.Assume, sourceInfo, clock.ref,
- predicate.ref, msg))
+ when (!Module.reset.asBool) {
+ val clock = Module.clock
+ Builder.pushCommand(Verification(Formal.Assume, sourceInfo, clock.ref, predicate.ref, msg))
+ }
}
}
@@ -33,9 +34,10 @@ package object verification {
def apply(predicate: Bool, msg: String = "")(
implicit sourceInfo: SourceInfo,
compileOptions: CompileOptions): Unit = {
- val clock = Builder.forcedClock
- pushCommand(Verification(Formal.Cover, sourceInfo, clock.ref,
- predicate.ref, msg))
+ val clock = Module.clock
+ when (!Module.reset.asBool) {
+ Builder.pushCommand(Verification(Formal.Cover, sourceInfo, clock.ref, predicate.ref, msg))
+ }
}
}
}