From: awygle Date: Sun, 16 Feb 2020 07:01:44 +0000 (-0800) Subject: nmigen.compat.genlib.cdc: add PulseSynchronizer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=073eaed0100276923cecb961eb233914726c7820;p=nmigen.git nmigen.compat.genlib.cdc: add PulseSynchronizer. --- diff --git a/nmigen/compat/genlib/cdc.py b/nmigen/compat/genlib/cdc.py index 3bdddb1..9da98bd 100644 --- a/nmigen/compat/genlib/cdc.py +++ b/nmigen/compat/genlib/cdc.py @@ -2,12 +2,13 @@ import warnings from ..._utils import deprecated from ...lib.cdc import FFSynchronizer as NativeFFSynchronizer +from ...lib.cdc import PulseSynchronizer as NativePulseSynchronizer from ...hdl.ast import * from ..fhdl.module import CompatModule from ..fhdl.structure import If -__all__ = ["MultiReg", "GrayCounter", "GrayDecoder"] +__all__ = ["MultiReg", "PulseSynchronizer", "GrayCounter", "GrayDecoder"] class MultiReg(NativeFFSynchronizer): @@ -27,6 +28,12 @@ class MultiReg(NativeFFSynchronizer): self.odomain = odomain +@deprecated("instead of `migen.genlib.cdc.PulseSynchronizer`, use `nmigen.lib.cdc.PulseSynchronizer`") +class PulseSynchronizer(NativePulseSynchronizer): + def __init__(self, idomain, odomain): + super().__init__(i_domain=idomain, o_domain=odomain) + + @deprecated("instead of `migen.genlib.cdc.GrayCounter`, use `nmigen.lib.coding.GrayEncoder`") class GrayCounter(CompatModule): def __init__(self, width):