summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/When.scala
diff options
context:
space:
mode:
authorJim Lawson2017-04-25 08:44:35 -0700
committerGitHub2017-04-25 08:44:35 -0700
commit4a6396ca5ff9dfba9019552012bce459ef3c3b1e (patch)
tree940018ca04febec6f3e18b1f03700fa3f203708e /chiselFrontend/src/main/scala/chisel3/core/When.scala
parentd439ac0144826bb170c43ae71df9782cdd0d5749 (diff)
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.
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/When.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/When.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/When.scala b/chiselFrontend/src/main/scala/chisel3/core/When.scala
index 9b646855..26f939ba 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/When.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/When.scala
@@ -27,7 +27,7 @@ object when { // scalastyle:ignore object.name
* }
* }}}
*/
- def apply(cond: Bool)(block: => Unit)(implicit sourceInfo: SourceInfo): WhenContext = {
+ def apply(cond: Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = {
new WhenContext(sourceInfo, cond, !cond, block)
}
}
@@ -43,14 +43,14 @@ final class WhenContext(sourceInfo: SourceInfo, cond: Bool, prevCond: => Bool, b
/** This block of logic gets executed if above conditions have been false
* and this condition is true.
*/
- def elsewhen (elseCond: Bool)(block: => Unit)(implicit sourceInfo: SourceInfo): WhenContext = {
+ def elsewhen (elseCond: Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = {
new WhenContext(sourceInfo, prevCond && elseCond, prevCond && !elseCond, block)
}
/** This block of logic gets executed only if the above conditions were all
* false. No additional logic blocks may be appended past the `otherwise`.
*/
- def otherwise(block: => Unit)(implicit sourceInfo: SourceInfo): Unit =
+ def otherwise(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit =
new WhenContext(sourceInfo, prevCond, null, block)
pushCommand(WhenBegin(sourceInfo, cond.ref))