From 4a6396ca5ff9dfba9019552012bce459ef3c3b1e Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Tue, 25 Apr 2017 08:44:35 -0700 Subject: Remove explicit import of NotStrict - fixes #492 (#494) * Remove explicit import of NotStrict - fixes #492 * Provide macro for MemBase.apply(). * Provide macro for MemBase.apply(). Since a macro cannot override an abstract method, provide a concrete apply method n VecLike() that we can override with a macro. * Remove concrete apply() in VecLike. Since MemBase no longer extends the trait VecLike, we do not require a concrete method to which we can apply a macro to extract the appropriate CompileOptions. --- chiselFrontend/src/main/scala/chisel3/core/Printf.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Printf.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Printf.scala b/chiselFrontend/src/main/scala/chisel3/core/Printf.scala index 2052e95a..d6e2c8de 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Printf.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Printf.scala @@ -40,7 +40,7 @@ object printf { // scalastyle:ignore object.name * @param fmt printf format string * @param data format string varargs containing data to print */ - def apply(fmt: String, data: Bits*)(implicit sourceInfo: SourceInfo): Unit = + def apply(fmt: String, data: Bits*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = apply(Printable.pack(fmt, data:_*)) /** Prints a message in simulation. * @@ -54,17 +54,16 @@ object printf { // scalastyle:ignore object.name * * @param pable [[Printable]] to print */ - def apply(pable: Printable)(implicit sourceInfo: SourceInfo): Unit = { + def apply(pable: Printable)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = { when (!Builder.forcedReset) { printfWithoutReset(pable) } } - private[chisel3] def printfWithoutReset(pable: Printable)(implicit sourceInfo: SourceInfo): Unit = { + private[chisel3] def printfWithoutReset(pable: Printable)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = { val clock = Builder.forcedClock pushCommand(Printf(sourceInfo, Node(clock), pable)) } - - private[chisel3] def printfWithoutReset(fmt: String, data: Bits*)(implicit sourceInfo: SourceInfo): Unit = + private[chisel3] def printfWithoutReset(fmt: String, data: Bits*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = printfWithoutReset(Printable.pack(fmt, data:_*)) } -- cgit v1.2.3