From: whitequark Date: Sat, 26 Jan 2019 18:24:12 +0000 (+0000) Subject: compat.genlib.resetsync: add shim for AsyncResetSynchronizer. X-Git-Tag: working~35 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cd9f7db1937cb34b946368ebfaa3c0021713da9;p=nmigen.git compat.genlib.resetsync: add shim for AsyncResetSynchronizer. --- diff --git a/doc/COMPAT_SUMMARY.md b/doc/COMPAT_SUMMARY.md index 0b2eb4a..8b1ed53 100644 --- a/doc/COMPAT_SUMMARY.md +++ b/doc/COMPAT_SUMMARY.md @@ -173,8 +173,8 @@ Compatibility summary - (−) `layout_get` **brk** - (−) `layout_partial` **brk** - (−) `Record` id - - (−) `resetsync` ? - - (−) `AsyncResetSynchronizer` ? + - (+) `resetsync` ? + - (+) `AsyncResetSynchronizer` **obs** → `.lib.cdc.ResetSynchronizer` - (−) `roundrobin` ? - (−) `SP_WITHDRAW`/`SP_CE` ? - (−) `RoundRobin` ? diff --git a/nmigen/compat/genlib/resetsync.py b/nmigen/compat/genlib/resetsync.py new file mode 100644 index 0000000..218dc8a --- /dev/null +++ b/nmigen/compat/genlib/resetsync.py @@ -0,0 +1,16 @@ +from ...tools import deprecated +from ...lib.cdc import ResetSynchronizer as NativeResetSynchronizer + + +__all__ = ["AsyncResetSynchronizer"] + + +@deprecated("instead of `migen.genlib.resetsync.AsyncResetSynchronizer`, " + "use `nmigen.lib.cdc.ResetSynchronizer`; note that ResetSynchronizer accepts " + "a clock domain name as an argument, not a clock domain object") +class CompatResetSynchronizer(NativeResetSynchronizer): + def __init__(self, cd, async_reset): + super().__init__(async_reset, cd.name) + + +AsyncResetSynchronizer = CompatResetSynchronizer