summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/internal/Builder.scala
diff options
context:
space:
mode:
authorjackkoenig2016-09-22 22:38:33 -0700
committerjackkoenig2016-11-18 11:05:33 -0800
commit822160cc8e76e70643fb56707bb39f6f7526b6fd (patch)
tree50b9e132c6e7d2d5113195683ef3cc3fc5fc1113 /chiselFrontend/src/main/scala/chisel3/internal/Builder.scala
parent6929ca0fc64b562f4852a49df617a1836e083563 (diff)
Add support for parameterized BlackBoxes
Also restrict black boxes to not allow hardware inside of them since it was being silently dropped anyway. Resolves #289
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/internal/Builder.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/internal/Builder.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/internal/Builder.scala b/chiselFrontend/src/main/scala/chisel3/internal/Builder.scala
index 028ce628..60ce6d5d 100644
--- a/chiselFrontend/src/main/scala/chisel3/internal/Builder.scala
+++ b/chiselFrontend/src/main/scala/chisel3/internal/Builder.scala
@@ -181,7 +181,10 @@ private[chisel3] object Builder {
// TODO(twigg): Ideally, binding checks and new bindings would all occur here
// However, rest of frontend can't support this yet.
def pushCommand[T <: Command](c: T): T = {
- forcedModule._commands += c
+ forcedModule match {
+ case _: BlackBox => throwException("Cannot add hardware to a BlackBox")
+ case m => m._commands += c
+ }
c
}
def pushOp[T <: Data](cmd: DefPrim[T]): T = {