From 5ae87916ecbf88a169ea654d0f7198bb82c062a9 Mon Sep 17 00:00:00 2001 From: awygle Date: Sat, 15 Feb 2020 23:01:44 -0800 Subject: [PATCH] nmigen.compat.genlib.cdc: add PulseSynchronizer. --- nmigen/compat/genlib/cdc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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): -- 2.30.2