Skip to content

Commit a6196ca

Browse files
chiselbotseldridge
andauthored
[cd] Bump CIRCT from firtool-1.96.0 to firtool-1.97.1 (#4553)
* [cd] Bump CIRCT from firtool-1.96.0 to firtool-1.97.1 This is an automated commit generated by the `circt/update-circt` GitHub Action. * [test] Add Verilog test of inline emission, NFC Add an integration test of SystemVerilog generation for inline layers. This relies on new support in firtool 1.97.0 which adds support for compiling this feature. Previous versions of firtool could parse inline layers, but error when compiling them. * [test] Switch to new inline layer ABI (#4550) Change `LayerSpec` to use the new inline layer ABI. This uses '$' as a delimiter instead of '_' in order to avoid ambiguity related to layer names which may contain '_'. This now also includes the circuit name and a leading 'layer_'. * [test] Update btor2 emission test There was a change in the btor2 emission upstream. Update the test to match the new emission. I did not validate the correctness of this change. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> Co-authored-by: chiselbot <chiselbot@users.noreply.github.com>
1 parent 5871a65 commit a6196ca

File tree

3 files changed

+69
-33
lines changed

3 files changed

+69
-33
lines changed

etc/circt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "firtool-1.96.0"
2+
"version": "firtool-1.97.1"
33
}

src/test/scala/chiselTests/LayerSpec.scala

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package chiselTests
55
import chisel3._
66
import chisel3.experimental.hierarchy.core.{Definition, Instance}
77
import chisel3.experimental.hierarchy.instantiable
8+
import chisel3.ltl.AssertProperty
89
import chisel3.probe.{define, Probe, ProbeValue}
910
import chiselTests.{ChiselFlatSpec, FileCheck, Utils}
1011
import java.nio.file.{FileSystems, Paths}
@@ -380,25 +381,60 @@ class LayerSpec extends ChiselFlatSpec with Utils with FileCheck {
380381
)
381382
}
382383

383-
"Inline layers" should "generated expected FIRRTL" in {
384-
object A extends layer.Layer(layer.LayerConfig.Inline) {
385-
object B extends layer.Layer(layer.LayerConfig.Inline)
384+
"Inline layers" should "generate expected FIRRTL and SystemVerilog" in {
385+
object A extends layer.Layer(layer.LayerConfig.Extract()) {
386+
object B extends layer.Layer(layer.LayerConfig.Inline) {
387+
object C extends layer.Layer(layer.LayerConfig.Inline)
388+
}
386389
}
387390

388-
class Foo extends RawModule {
391+
class Foo extends Module {
392+
val a = IO(Input(UInt(2.W)))
393+
389394
layer.block(A) {
390-
layer.block(A.B) {}
395+
AssertProperty(a > 0.U, "foo")
396+
layer.block(A.B) {
397+
AssertProperty(a > 1.U, "bar")
398+
layer.block(A.B.C) {
399+
AssertProperty(a > 2.U, "baz")
400+
}
401+
}
391402
}
392403
}
393404

405+
info("FIRRTL okay")
394406
generateFirrtlAndFileCheck(new Foo) {
395-
"""|CHECK: layer A, inline :
407+
"""|CHECK: layer A, bind
396408
|CHECK-NEXT: layer B, inline :
409+
|CHECK-NEXT: layer C, inline :
397410
|""".stripMargin
398411
}
412+
413+
info("SystemVerilog okay")
414+
val verilog = ChiselStage.emitSystemVerilog(
415+
new Foo,
416+
firtoolOpts = Array(
417+
"-disable-all-randomization",
418+
"-enable-layers=Verification,Verification.Assert,Verification.Assume,Verification.Cover"
419+
)
420+
)
421+
fileCheckString(verilog) {
422+
"""|CHECK: module Foo(
423+
|CHECK-NOT: assert property
424+
|
425+
|CHECK: module Foo_A(
426+
|CHECK-NOT: `ifdef
427+
|CHECK: foo: assert property
428+
|CHECK: `ifdef layer_Foo$A$B
429+
|CHECK-NEXT: bar: assert property
430+
|CHECK-NEXT: `ifdef layer_Foo$A$B$C
431+
|CHECK-NEXT: baz: assert property
432+
|CHECK-NEXT: `endif
433+
|CHECK-NEXT: `endif""".stripMargin
434+
}
399435
}
400436

401-
"Inline layers" should "be ignored when choosing default output directories" in {
437+
they should "be ignored when choosing default output directories" in {
402438
object LayerWithDefaultOutputDir extends layer.Layer(layer.LayerConfig.Extract()) {
403439
object InlineSublayer extends layer.Layer(layer.LayerConfig.Inline) {
404440
object SublayerWithDefaultOutputDir extends layer.Layer(layer.LayerConfig.Extract()) {}

src/test/scala/circtTests/stage/ChiselStageSpec.scala

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,31 +1200,31 @@ class ChiselStageSpec extends AnyFunSpec with Matchers with chiselTests.Utils {
12001200
new Counter,
12011201
firtoolOpts = Array("-enable-layers=Verification,Verification.Assert,Verification.Assume,Verification.Cover")
12021202
)
1203-
btor2 should include("""1 sort bitvec 1
1204-
|2 input 1 reset
1205-
|3 sort bitvec 32
1206-
|4 state 3 count
1207-
|5 state 1 hbr
1208-
|6 constd 1 0
1209-
|7 init 1 5 6
1210-
|8 constd 3 43
1211-
|9 constd 3 1
1212-
|10 constd 3 42
1213-
|11 constd 3 0
1214-
|12 eq 1 4 10
1215-
|13 add 3 4 9
1216-
|14 ite 3 12 11 13
1217-
|15 ult 1 4 8
1218-
|16 constd 1 -1
1219-
|17 or 1 2 5
1220-
|18 xor 1 2 16
1221-
|19 and 1 5 18
1222-
|20 implies 1 19 15
1223-
|21 not 1 20
1224-
|22 bad 21
1225-
|23 ite 3 2 11 14
1226-
|24 next 3 4 23
1227-
|25 next 1 5 17""".stripMargin)
1203+
btor2 should include("""|1 sort bitvec 1
1204+
|2 input 1 reset
1205+
|3 sort bitvec 32
1206+
|4 state 3 count
1207+
|5 constd 1 0
1208+
|6 state 1 hbr
1209+
|7 init 1 6 5
1210+
|8 constd 3 43
1211+
|9 constd 3 1
1212+
|10 constd 3 42
1213+
|11 constd 3 0
1214+
|12 eq 1 4 10
1215+
|13 add 3 4 9
1216+
|14 ite 3 12 11 13
1217+
|15 ult 1 4 8
1218+
|16 constd 1 -1
1219+
|17 or 1 2 6
1220+
|18 xor 1 2 16
1221+
|19 and 1 6 18
1222+
|20 implies 1 19 15
1223+
|21 not 1 20
1224+
|22 bad 21
1225+
|23 ite 3 2 11 14
1226+
|24 next 3 4 23
1227+
|25 next 1 6 17""".stripMargin)
12281228
}
12291229

12301230
it("""should error if give a "--target-directory" option""") {

0 commit comments

Comments
 (0)