compat.genlib.fsm: add migration warning.
authorwhitequark <cz@m-labs.hk>
Sat, 12 Oct 2019 22:48:08 +0000 (22:48 +0000)
committerwhitequark <cz@m-labs.hk>
Sat, 12 Oct 2019 22:48:08 +0000 (22:48 +0000)
nmigen/compat/genlib/fsm.py

index 63f0872532476c32f6ba418ddb2606eab6c7bf19..68b1d0a57bae00f16a0be454e7b339b23d50f0c4 100644 (file)
@@ -1,6 +1,6 @@
 from collections import OrderedDict
 
-from ..._tools import _ignore_deprecated
+from ..._tools import deprecated, _ignore_deprecated
 from ...hdl.xfrm import ValueTransformer, StatementTransformer
 from ...hdl.ast import *
 from ..fhdl.module import CompatModule, CompatFinalizeError
@@ -89,6 +89,8 @@ class _LowerNext(ValueTransformer, StatementTransformer):
             return node
 
 
+@deprecated("instead of `migen.genlib.fsm.FSM()`, use `with m.FSM():`; note that there is no "
+            "replacement for `{before,after}_{entering,leaving}` and `delayed_enter` methods")
 class FSM(CompatModule):
     def __init__(self, reset_state=None):
         self.actions = OrderedDict()