@@ -10,6 +10,8 @@ import chisel3.layers
10
10
import chisel3 .util .circt .IfElseFatalIntrinsic
11
11
import chisel3 .internal .Builder .pushCommand
12
12
import chisel3 .internal ._
13
+ import chisel3 .ltl ._
14
+ import chisel3 .ltl .Sequence .BoolSequence
13
15
14
16
import scala .language .experimental .macros
15
17
import scala .reflect .macros .blackbox
@@ -42,6 +44,17 @@ object VerifStmtMacrosCompat {
42
44
(p.source.file.name, p.line): @ nowarn // suppress, there's no clear replacement
43
45
}
44
46
47
+ private [chisel3] def resetToDisableMigrationChecks (label : String )(implicit sourceInfo : SourceInfo ) = {
48
+ val disable = Module .disable.value
49
+ withDisable(Disable .Never ) {
50
+ AssertProperty (
51
+ prop = ltl.Property .eventually(! disable),
52
+ label = Some (s " ${label}_never_enabled " )
53
+ )
54
+ CoverProperty (! disable, s " ${label}_enabled " )
55
+ }
56
+ }
57
+
45
58
object assert {
46
59
47
60
/** @group VerifPrintMacros */
@@ -117,6 +130,7 @@ object VerifStmtMacrosCompat {
117
130
): chisel3.assert.Assert = {
118
131
block(layers.Verification .Assert , skipIfAlreadyInBlock = true , skipIfLayersEnabled = true ) {
119
132
val id = Builder .forcedUserModule // It should be safe since we push commands anyway.
133
+ resetToDisableMigrationChecks(" assertion" )
120
134
IfElseFatalIntrinsic (id, format, " chisel3_builtin" , clock, predicate, enable, format.unpackArgs: _* )(sourceInfo)
121
135
}
122
136
new chisel3.assert.Assert ()
@@ -186,6 +200,7 @@ object VerifStmtMacrosCompat {
186
200
val id = new chisel3.assume.Assume ()
187
201
block(layers.Verification .Assume , skipIfAlreadyInBlock = true , skipIfLayersEnabled = true ) {
188
202
message.foreach(Printable .checkScope(_))
203
+ resetToDisableMigrationChecks(" assumption" )
189
204
when(! Module .reset.asBool) {
190
205
val formattedMsg = formatFailureMessage(" Assumption" , line, cond, message)
191
206
Builder .pushCommand(Verification (id, Formal .Assume , sourceInfo, Module .clock.ref, cond.ref, formattedMsg))
@@ -230,6 +245,7 @@ object VerifStmtMacrosCompat {
230
245
): chisel3.cover.Cover = {
231
246
val id = new chisel3.cover.Cover ()
232
247
block(layers.Verification .Cover , skipIfAlreadyInBlock = true , skipIfLayersEnabled = true ) {
248
+ resetToDisableMigrationChecks(" cover" )
233
249
when(! Module .reset.asBool) {
234
250
Builder .pushCommand(Verification (id, Formal .Cover , sourceInfo, Module .clock.ref, cond.ref, " " ))
235
251
}
0 commit comments