Skip to content

Commit

Permalink
Update serialization to firrtl-spec 1.2.0 (#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig committed Mar 15, 2023
1 parent 4575518 commit 54c8146
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/firrtl/ir/Serializer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object Serializer {
val Indent = " "

// The version supported by the serializer.
val version = Version(1, 1, 0)
val version = Version(1, 2, 0)

/** Converts a `FirrtlNode` into its string representation with
* default indentation.
Expand Down
28 changes: 26 additions & 2 deletions src/test/scala/firrtlTests/ParserSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,30 @@ class ParserSpec extends FirrtlFlatSpec {
firrtl.Parser.parse(c.serialize)
}

"Version 1.2.0" should "be accepted" in {
val input = """
|FIRRTL version 1.2.0
|circuit Test :
| module Test :
| input in : UInt<1>
| in <= UInt(0)
""".stripMargin
val c = firrtl.Parser.parse(input)
firrtl.Parser.parse(c.serialize)
}

"Version 1.2.1" should "be accepted" in {
val input = """
|FIRRTL version 1.2.1
|circuit Test :
| module Test :
| input in : UInt<1>
| in <= UInt(0)
""".stripMargin
val c = firrtl.Parser.parse(input)
firrtl.Parser.parse(c.serialize)
}

"No version" should "be accepted" in {
val input = """
|circuit Test :
Expand All @@ -129,10 +153,10 @@ class ParserSpec extends FirrtlFlatSpec {
firrtl.Parser.parse(c.serialize)
}

"Version 1.2.0" should "be rejected" in {
"Version 1.3.0" should "be rejected" in {
an[UnsupportedVersionException] should be thrownBy {
val input = """
|FIRRTL version 1.2.0
|FIRRTL version 1.3.0
|circuit Test :
| module Test :
| input in : UInt<1>
Expand Down

0 comments on commit 54c8146

Please sign in to comment.