1
0

make sure SlowIO clock divider is initialized on reset

This commit is contained in:
Howard Mao 2016-06-08 10:02:21 -07:00
parent 28161cab45
commit 636a46c052

View File

@ -26,8 +26,8 @@ class SlowIO[T <: Data](val divisor_max: Int)(data: => T) extends Module
} }
io.divisor := (hold << 16) | divisor io.divisor := (hold << 16) | divisor
val count = Reg{UInt(width = log2Up(divisor_max))} val count = Reg(init = UInt(0, log2Up(divisor_max)))
val myclock = Reg{Bool()} val myclock = Reg(init = Bool(false))
count := count + UInt(1) count := count + UInt(1)
val rising = count === (divisor >> 1) val rising = count === (divisor >> 1)