Skip to content

Commit

Permalink
Fix blackbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ducky64 committed Jan 31, 2017
1 parent 8195b60 commit 8940c77
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/scala/chisel3/compatibility.scala
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,20 @@ package object Chisel { // scalastyle:ignore package.object.name
object Bool extends BoolFactory
val Mux = chisel3.core.Mux

type BlackBox = chisel3.core.BlackBox
import chisel3.core.Param
abstract class BlackBox(params: Map[String, Param] = Map.empty[String, Param]) extends chisel3.core.BlackBox(params) {
var _ioDefined = false
override protected def IO[T<:Data](iodef: T): iodef.type = {
_ioDefined = true
super.IO(iodef)
}

override def _autoWrapPorts() = {
if (!_ioDefined) {
IO(io)
}
}
}
val Mem = chisel3.core.Mem
type MemBase[T <: Data] = chisel3.core.MemBase[T]
type Mem[T <: Data] = chisel3.core.Mem[T]
Expand Down

0 comments on commit 8940c77

Please sign in to comment.