summaryrefslogtreecommitdiff
path: root/chiselFrontend/src
diff options
context:
space:
mode:
authorJack Koenig2019-04-24 13:07:14 -0700
committerGitHub2019-04-24 13:07:14 -0700
commit5e4c3be862bf53ad34315e635d89816729550c01 (patch)
treefb19247f089cc17f8aeb4e779fa4839ef0596110 /chiselFrontend/src
parent9bef2461e55c724354f20bce0d32c7f5e6ac45ff (diff)
Add back Int forms of Mem do_apply methods (#1082)
This is necessary to support code that imports an implicit conversion from Int to UInt
Diffstat (limited to 'chiselFrontend/src')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Mem.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Mem.scala b/chiselFrontend/src/main/scala/chisel3/core/Mem.scala
index d9fab09a..d44178ad 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Mem.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Mem.scala
@@ -45,6 +45,10 @@ object Mem {
pushCommand(DefMemory(sourceInfo, mem, mt, size))
mem
}
+
+ /** @group SourceInfoTransformMacro */
+ def do_apply[T <: Data](size: Int, t: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Mem[T] =
+ do_apply(BigInt(size), t)(sourceInfo, compileOptions)
}
sealed abstract class MemBase[T <: Data](t: T, val length: BigInt) extends HasId with NamedComponent with SourceInfoDoc {
@@ -66,6 +70,10 @@ sealed abstract class MemBase[T <: Data](t: T, val length: BigInt) extends HasId
apply(idx.asUInt)
}
+ /** @group SourceInfoTransformMacro */
+ def do_apply(idx: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T =
+ do_apply(BigInt(idx))(sourceInfo, compileOptions)
+
/** Creates a read/write accessor into the memory with dynamic addressing.
* See the class documentation of the memory for more detailed information.
*/
@@ -175,6 +183,10 @@ object SyncReadMem {
pushCommand(DefSeqMemory(sourceInfo, mem, mt, size))
mem
}
+
+ /** @group SourceInfoTransformMacro */
+ def do_apply[T <: Data](size: Int, t: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): SyncReadMem[T] =
+ do_apply(BigInt(size), t)(sourceInfo, compileOptions)
}
/** A sequential/synchronous-read, sequential/synchronous-write memory.