parent
4310254103
commit
39ca0e6fa6
|
@ -1,7 +1,7 @@
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
|
|
||||||
from ...tools import flatten, deprecated
|
from ...tools import flatten, deprecated
|
||||||
from ...hdl import dsl
|
from ...hdl import dsl, ir
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["Module", "FinalizeError"]
|
__all__ = ["Module", "FinalizeError"]
|
||||||
|
@ -94,7 +94,7 @@ class _CompatModuleClockDomains(_CompatModuleProxy):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
class CompatModule:
|
class CompatModule(ir.Elaboratable):
|
||||||
# Actually returns nmigen.fhdl.Module, not a Fragment.
|
# Actually returns nmigen.fhdl.Module, not a Fragment.
|
||||||
def get_fragment(self):
|
def get_fragment(self):
|
||||||
assert not self.get_fragment_called
|
assert not self.get_fragment_called
|
||||||
|
@ -102,6 +102,9 @@ class CompatModule:
|
||||||
self.finalize()
|
self.finalize()
|
||||||
return self._module
|
return self._module
|
||||||
|
|
||||||
|
def elaborate(self, platform):
|
||||||
|
return self.get_fragment()
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name == "comb":
|
if name == "comb":
|
||||||
return _CompatModuleComb(self)
|
return _CompatModuleComb(self)
|
||||||
|
|
9
nmigen/test/test_compat.py
Normal file
9
nmigen/test/test_compat.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
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)
|
Loading…
Reference in a new issue