summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Cook2015-08-05 16:44:29 -0700
committerHenry Cook2015-08-05 18:52:33 -0700
commit477606bad56df01b6f0c3a6973f274c78e94f5e6 (patch)
treeeabdf43d1c285207f9d245d78a797095b7fd97cd /src
parentb61457c40699e438095c1ca144e8cd7358a87704 (diff)
make _mod less private
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/Chisel/Core.scala8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala
index 43b189c5..e21e7f7e 100644
--- a/src/main/scala/Chisel/Core.scala
+++ b/src/main/scala/Chisel/Core.scala
@@ -306,7 +306,7 @@ object debug {
}
abstract class Data(dirArg: Direction) extends Id {
- private val _mod: Module = DynamicContext.getParentModule.getOrElse(
+ private[Chisel] val _mod: Module = DynamicContext.getParentModule.getOrElse(
throwException("Data subclasses can only be instantiated inside Modules!"))
//TODO: is this true?
@@ -315,8 +315,6 @@ abstract class Data(dirArg: Direction) extends Id {
def toType: Kind
def dir: Direction = dirVar
- def clock = _mod.clock
- def reset = _mod.reset
// Sucks this is mutable state, but cloneType doesn't take a Direction arg
private var isFlipVar = dirArg == INPUT
@@ -403,7 +401,7 @@ object Reg {
def apply[T <: Data](t: T = null, next: T = null, init: T = null): T = {
val x = makeType(t, next, init)
- pushCommand(DefRegister(x, x.toType, x.clock, x.reset)) // TODO multi-clock
+ pushCommand(DefRegister(x, x.toType, x._mod.clock, x._mod.reset)) // TODO multi-clock
if (init != null)
pushCommand(ConnectInit(x.lref, init.ref))
if (next != null)
@@ -417,7 +415,7 @@ object Mem {
def apply[T <: Data](t: T, size: Int): Mem[T] = {
val mt = t.cloneType
val mem = new Mem(mt, size)
- pushCommand(DefMemory(mt, mt.toType, size, mt.clock)) // TODO multi-clock
+ pushCommand(DefMemory(mt, mt.toType, size, mt._mod.clock)) // TODO multi-clock
mem
}
}