summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSchuyler Eldridge2020-04-23 22:07:23 -0400
committerSchuyler Eldridge2020-05-06 02:23:51 -0400
commitbfb5b3542948246a0941cdc53f48acceddfeda03 (patch)
tree5e4fad494c4aa34c3f50352f3fa777d1ee2b2d9e /src
parent23db44a44b10aaa6f34f75732266178e6c714aba (diff)
Test that Elaborate only runs once
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/stage/ChiselStageSpec.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/stage/ChiselStageSpec.scala b/src/test/scala/chiselTests/stage/ChiselStageSpec.scala
index a7a405f1..21beb48f 100644
--- a/src/test/scala/chiselTests/stage/ChiselStageSpec.scala
+++ b/src/test/scala/chiselTests/stage/ChiselStageSpec.scala
@@ -8,6 +8,8 @@ import chisel3.stage.ChiselStage
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
+import firrtl.options.Dependency
+
object ChiselStageSpec {
class Foo extends MultiIOModule {
@@ -57,4 +59,15 @@ class ChiselStageSpec extends AnyFlatSpec with Matchers {
ChiselStage.convert(new Foo)
}
+ behavior of "ChiselStage phase ordering"
+
+ it should "only run elaboration once" in new ChiselStageFixture {
+ info("Phase order is:\n" + stage.phaseManager.prettyPrint(" "))
+
+ val order = stage.phaseManager.flattenedTransformOrder.map(Dependency.fromTransform)
+
+ info("Elaborate only runs once")
+ exactly (1, order) should be (Dependency[chisel3.stage.phases.Elaborate])
+ }
+
}