summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/experimental/decode/decoder.scala
diff options
context:
space:
mode:
authorZachary Yedidia2022-08-25 12:04:37 -0700
committerGitHub2022-08-25 19:04:37 +0000
commitdf5a95454ff0414d1d3ce16d06dbe27b152e3751 (patch)
tree2d8112b29ea20bd54ecffcf15818cff8fbaa4028 /src/main/scala/chisel3/util/experimental/decode/decoder.scala
parent998913f9379440db26b6aeeaa09e7a11d7615351 (diff)
Backport of eager error messages for annotations (3.5.x) (#2700) (#2705)
Diffstat (limited to 'src/main/scala/chisel3/util/experimental/decode/decoder.scala')
-rw-r--r--src/main/scala/chisel3/util/experimental/decode/decoder.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/util/experimental/decode/decoder.scala b/src/main/scala/chisel3/util/experimental/decode/decoder.scala
index 4feda672..067dd6f8 100644
--- a/src/main/scala/chisel3/util/experimental/decode/decoder.scala
+++ b/src/main/scala/chisel3/util/experimental/decode/decoder.scala
@@ -6,6 +6,7 @@ import chisel3._
import chisel3.experimental.{annotate, ChiselAnnotation}
import chisel3.util.{pla, BitPat}
import chisel3.util.experimental.{getAnnotations, BitSet}
+import chisel3.internal.Builder
import firrtl.annotations.Annotation
import logger.LazyLogging
@@ -30,6 +31,7 @@ object decoder extends LazyLogging {
val (plaInput, plaOutput) =
pla(minimizedTable.table.toSeq, BitPat(minimizedTable.default.value.U(minimizedTable.default.getWidth.W)))
+ assert(plaOutput.isSynthesizable, s"Using DecodeTableAnnotation on non-hardware value $plaOutput")
annotate(new ChiselAnnotation {
override def toFirrtl: Annotation =
DecodeTableAnnotation(plaOutput.toTarget, truthTable.toString, minimizedTable.toString)