1
0

Support SynchronizerShiftReg(sync = 0)

This makes it easier to parameterize code where the synchronizer
might not always be needed.
This commit is contained in:
Andrew Waterman 2017-09-19 12:05:00 -07:00
parent 79dab487fc
commit dbf599f6a1

View File

@ -125,8 +125,10 @@ class SynchronizerShiftReg(w: Int = 1, sync: Int = 3) extends AbstractPipelineRe
object SynchronizerShiftReg {
def apply [T <: Chisel.Data](in: T, sync: Int = 3, name: Option[String] = None): T =
AbstractPipelineReg(new SynchronizerShiftReg(in.getWidth, sync), in, name)
def apply [T <: Chisel.Data](in: T, sync: Int = 3, name: Option[String] = None): T = {
if (sync == 0) in
else AbstractPipelineReg(new SynchronizerShiftReg(in.getWidth, sync), in, name)
}
}
class SyncResetSynchronizerShiftReg(w: Int = 1, sync: Int = 3, init: Int = 0) extends AbstractPipelineReg(w) {