from collections.abc import Iterable
from ...tools import flatten, deprecated
-from ...hdl import dsl
+from ...hdl import dsl, ir
__all__ = ["Module", "FinalizeError"]
return self
-class CompatModule:
+class CompatModule(ir.Elaboratable):
# Actually returns nmigen.fhdl.Module, not a Fragment.
def get_fragment(self):
assert not self.get_fragment_called
self.finalize()
return self._module
+ def elaborate(self, platform):
+ return self.get_fragment()
+
def __getattr__(self, name):
if name == "comb":
return _CompatModuleComb(self)
--- /dev/null
+from ..hdl.ir import Fragment
+from ..compat import *
+from .tools import *
+
+
+class CompatTestCase(FHDLTestCase):
+ def test_fragment_get(self):
+ m = Module()
+ f = Fragment.get(m, platform=None)