diff options
| author | Aditya Naik | 2024-05-29 17:28:22 -0700 |
|---|---|---|
| committer | Aditya Naik | 2024-05-29 17:28:22 -0700 |
| commit | bc92bb62f9f6a090e74392993e4fcfdd1f6b0676 (patch) | |
| tree | 160eb4cc2770eaf0c189fab9442d04b2b00b7919 /core/src/main/scala/chisel3/Module.scala | |
| parent | 878d488a7c8e0d6973de58b3164022c6a102e449 (diff) | |
i got 99 errors but "firrtl not found" aint one
Diffstat (limited to 'core/src/main/scala/chisel3/Module.scala')
| -rw-r--r-- | core/src/main/scala/chisel3/Module.scala | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/core/src/main/scala/chisel3/Module.scala b/core/src/main/scala/chisel3/Module.scala index 794d1bf4..58e585ce 100644 --- a/core/src/main/scala/chisel3/Module.scala +++ b/core/src/main/scala/chisel3/Module.scala @@ -4,17 +4,16 @@ package chisel3 import scala.collection.immutable.ListMap import scala.collection.mutable.{ArrayBuffer, HashMap} -import scala.language.experimental.macros import chisel3.internal._ import chisel3.internal.Builder._ import chisel3.internal.firrtl._ -import chisel3.internal.sourceinfo.{InstTransform, SourceInfo, UnlocatableSourceInfo} +import chisel3.internal.sourceinfo.{SourceInfo, UnlocatableSourceInfo} import chisel3.experimental.BaseModule import _root_.firrtl.annotations.{IsModule, ModuleName, ModuleTarget} import _root_.firrtl.AnnotationSeq -object Module extends SourceInfoDoc { +object Module { /** A wrapper method that all Module instantiations must be wrapped in * (necessary to help Chisel track internal state). @@ -23,10 +22,7 @@ object Module extends SourceInfoDoc { * * @return the input module `m` with Chisel metadata properly set */ - def apply[T <: BaseModule](bc: => T): T = macro InstTransform.apply[T] - - /** @group SourceInfoTransformMacro */ - def do_apply[T <: BaseModule](bc: => T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = { + def apply[T <: BaseModule](bc: => T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = { if (Builder.readyForModuleConstr) { throwException( "Error: Called Module() twice without instantiating a Module." + @@ -250,7 +246,7 @@ package experimental { // Fresh Namespace because in Firrtl, Modules namespaces are disjoint with the global namespace private[chisel3] val _namespace = Namespace.empty private val _ids = ArrayBuffer[HasId]() - private[chisel3] def addId(d: HasId) { + private[chisel3] def addId(d: HasId) = { require(!_closed, "Can't write to module after module close") _ids += d } @@ -358,7 +354,7 @@ package experimental { protected def nameIds(rootClass: Class[_]): HashMap[HasId, String] = { val names = new HashMap[HasId, String]() - def name(node: HasId, name: String) { + def name(node: HasId, name: String) = { // First name takes priority, like suggestName // TODO: DRYify with suggestName if (!names.contains(node)) { @@ -397,7 +393,7 @@ package experimental { * * TODO: remove this, perhaps by removing Bindings checks in compatibility mode. */ - def _compatAutoWrapPorts() {} + def _compatAutoWrapPorts() = {} /** Chisel2 code didn't require the IO(...) wrapper and would assign a Chisel type directly to * io, then do operations on it. This binds a Chisel type in-place (mutably) as an IO. |
