aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlbert Magyar2019-08-07 16:33:45 -0700
committermergify[bot]2019-08-07 23:33:45 +0000
commitc6c509d623e5e64e021fa311018b8ace2f3f8969 (patch)
treee1f81ce7cfaf6842f3edbb4778839cc2da3d8fc1 /src/test
parent23a104d3409385718a960427f1576f508e3f473b (diff)
Check mems for legal latencies; ban zero write latency. (#1147)
* Check mems for legal latencies; ban zero write latency. * Trigger
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/CheckSpec.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/CheckSpec.scala b/src/test/scala/firrtlTests/CheckSpec.scala
index 93bc2cab..54dc60ab 100644
--- a/src/test/scala/firrtlTests/CheckSpec.scala
+++ b/src/test/scala/firrtlTests/CheckSpec.scala
@@ -41,6 +41,25 @@ class CheckSpec extends FlatSpec with Matchers {
}
}
+ "Memories with zero write latency" should "throw an exception" in {
+ val passes = Seq(
+ ToWorkingIR,
+ CheckHighForm)
+ val input =
+ """circuit Unit :
+ | module Unit :
+ | mem m :
+ | data-type => UInt<32>
+ | depth => 32
+ | read-latency => 0
+ | write-latency => 0""".stripMargin
+ intercept[CheckHighForm.IllegalMemLatencyException] {
+ passes.foldLeft(Parser.parse(input.split("\n").toIterator)) {
+ (c: Circuit, p: Pass) => p.run(c)
+ }
+ }
+ }
+
"Registers with flip in the type" should "throw an exception" in {
val input =
"""circuit Unit :