diff options
| author | Andrew Waterman | 2016-01-17 17:20:49 -0800 |
|---|---|---|
| committer | Andrew Waterman | 2016-01-23 21:14:19 -0800 |
| commit | 34a1abcd81bd3b2d7d264468345572009edfad27 (patch) | |
| tree | 0dbaa05d8142d370d4df35d6999416325e1c0c99 /src/main/scala/Chisel/Reg.scala | |
| parent | 86a6c6bcdc349f40dcc31bce1931dc7c427da674 (diff) | |
Implement first draft of new FIRRTL changes
Diffstat (limited to 'src/main/scala/Chisel/Reg.scala')
| -rw-r--r-- | src/main/scala/Chisel/Reg.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/Chisel/Reg.scala b/src/main/scala/Chisel/Reg.scala index 4ebb6c68..f166c84b 100644 --- a/src/main/scala/Chisel/Reg.scala +++ b/src/main/scala/Chisel/Reg.scala @@ -45,10 +45,10 @@ object Reg { // to resolve all use cases. If the type inferencer / implicit resolution // system improves, this may be changed. val x = makeType(t, next, init) - pushCommand(DefRegister(x, Node(x._parent.get.clock), Node(x._parent.get.reset))) // TODO multi-clock - if (init != null) { - pushCommand(ConnectInit(x.lref, init.ref)) - } + val (resetEn, resetVal) = + if (init != null) (Node(x._parent.get.reset), init) + else (ULit(0, Width(1)), x) + pushCommand(DefRegister(x, Node(x._parent.get.clock), resetEn, resetVal.ref)) // TODO multi-clock if (next != null) { x := next } |
