diff options
| author | Andrew Waterman | 2015-07-28 14:16:15 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2015-07-28 14:16:15 -0700 |
| commit | 444cd42a99cbee0746331827c34a176ce721a236 (patch) | |
| tree | 44465f1c46ba45cadc3e1070d3d412fbc3d2f509 /src | |
| parent | 58aa74818e4bf82d0ab34eeed7648370c1d02d81 (diff) | |
clean up when a little bit
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/Chisel/Core.scala | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala index f839b8c8..dd58bf9d 100644 --- a/src/main/scala/Chisel/Core.scala +++ b/src/main/scala/Chisel/Core.scala @@ -1065,7 +1065,7 @@ abstract class BlackBox(private[Chisel] _reset: Bool = null) extends Module(_res } object when { - def execBlock(block: => Unit): Command = { + private[Chisel] def execBlock(block: => Unit): Command = { pushScope pushCommands block @@ -1078,8 +1078,6 @@ object when { } } -import when._ - class when(cond: => Bool)(block: => Unit) { def elsewhen (cond: => Bool)(block: => Unit): when = { pushCommands @@ -1089,14 +1087,14 @@ class when(cond: => Bool)(block: => Unit) { } def otherwise (block: => Unit) { - this.cmd.alt = execBlock(block) + this.cmd.alt = when.execBlock(block) } // Capture any commands we need to set up the conditional test. pushCommands val pred = cond.ref val prep = popCommands - val conseq = execBlock(block) + val conseq = when.execBlock(block) // Assume we have an empty alternate clause. // elsewhen and otherwise will update it if that isn't the case. val cmd = Conditionally(prep, pred, conseq, EmptyCommand()) |
