Support SynchronizerShiftReg(sync = 0)
This makes it easier to parameterize code where the synchronizer might not always be needed.
This commit is contained in:
parent
79dab487fc
commit
dbf599f6a1
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user