aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/transforms/LegalizeClocks.scala
diff options
context:
space:
mode:
authorDavid Biancolin2020-08-21 23:22:24 -0700
committerGitHub2020-08-22 06:22:24 +0000
commit72d3983b313fb20b819c2555a13a627cbb9d63c3 (patch)
tree16093716a5a8b2d41fa83032982577450b389e28 /src/test/scala/firrtlTests/transforms/LegalizeClocks.scala
parent266ac5fc32865d001409194f426b4126f5d9001b (diff)
Async reset tieoff bug (#1854)
* Elide emission of literals for async reset in sensitivity lists * Deprecate LegalizeClocksTransform Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/test/scala/firrtlTests/transforms/LegalizeClocks.scala')
-rw-r--r--src/test/scala/firrtlTests/transforms/LegalizeClocks.scala67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/test/scala/firrtlTests/transforms/LegalizeClocks.scala b/src/test/scala/firrtlTests/transforms/LegalizeClocks.scala
deleted file mode 100644
index 6ee0f5a0..00000000
--- a/src/test/scala/firrtlTests/transforms/LegalizeClocks.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-// See LICENSE for license details.
-
-package firrtlTests.transforms
-
-import firrtl._
-import firrtl.testutils._
-import firrtl.testutils.FirrtlCheckers.containLine
-
-class LegalizeClocksTransformSpec extends FirrtlFlatSpec {
- def compile(input: String): CircuitState =
- (new MinimumVerilogCompiler).compileAndEmit(CircuitState(parse(input), ChirrtlForm), Nil)
-
- behavior.of("LegalizeClocksTransform")
-
- it should "not emit @(posedge 1'h0) for stop" in {
- val input =
- """circuit test :
- | module test :
- | stop(asClock(UInt(1)), UInt(1), 1)
- |""".stripMargin
- val result = compile(input)
- result should containLine(s"always @(posedge _GEN_0) begin")
- result.getEmittedCircuit.value shouldNot include("always @(posedge 1")
- }
-
- it should "not emit @(posedge 1'h0) for printf" in {
- val input =
- """circuit test :
- | module test :
- | printf(asClock(UInt(1)), UInt(1), "hi")
- |""".stripMargin
- val result = compile(input)
- result should containLine(s"always @(posedge _GEN_0) begin")
- result.getEmittedCircuit.value shouldNot include("always @(posedge 1")
- }
-
- it should "not emit @(posedge 1'h0) for reg" in {
- val input =
- """circuit test :
- | module test :
- | output out : UInt<8>
- | input in : UInt<8>
- | reg r : UInt<8>, asClock(UInt(0))
- | r <= in
- | out <= r
- |""".stripMargin
- val result = compile(input)
- result should containLine(s"always @(posedge _GEN_0) begin")
- result.getEmittedCircuit.value shouldNot include("always @(posedge 1")
- }
-
- it should "deduplicate injected nodes for literal clocks" in {
- val input =
- """circuit test :
- | module test :
- | printf(asClock(UInt(1)), UInt(1), "hi")
- | stop(asClock(UInt(1)), UInt(1), 1)
- |""".stripMargin
- val result = compile(input)
- result should containLine(s"wire _GEN_0 = 1'h1;")
- // Check that there's only 1 _GEN_0 instantiation
- val verilog = result.getEmittedCircuit.value
- val matches = "wire\\s+_GEN_0\\s+=\\s+1'h1".r.findAllIn(verilog)
- matches.size should be(1)
-
- }
-}