1 // See LICENSE for license details.
2 package sifive.blocks.util
6 //Allows us to specify a different clock for a shift register
7 // and to force input to be high for > 1 cycle.
8 class DeglitchShiftRegister(shift: Int) extends Module {
13 val sync = ShiftRegister(io.d, shift)
14 val last = ShiftRegister(sync, 1)
18 object DeglitchShiftRegister {
19 def apply (shift: Int, d: Bool, clock: Clock,
20 name: Option[String] = None): Bool = {
21 val deglitch = Module (new DeglitchShiftRegister(shift))
22 name.foreach(deglitch.suggestName(_))
23 deglitch.clock := clock
24 deglitch.reset := Bool(false)