1
0

correctly initialize the active flag

This commit is contained in:
Yunsup Lee 2016-10-03 16:38:33 -07:00 committed by Yunsup Lee
parent 6ec2e7c5bd
commit 62954d543e

View File

@ -45,7 +45,7 @@ class SimpleTimer(initCount: Int) extends Module {
} }
val countdown = Reg(UInt(width = log2Up(initCount))) val countdown = Reg(UInt(width = log2Up(initCount)))
val active = Reg(Bool()) val active = Reg(init = Bool(false))
when (active) { countdown := countdown - UInt(1) } when (active) { countdown := countdown - UInt(1) }