parent
24c4da2b2f
commit
d83c4a1b21
|
@ -1,6 +1,7 @@
|
||||||
import io
|
import io
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
import warnings
|
||||||
|
|
||||||
from .._utils import bits_for, flatten
|
from .._utils import bits_for, flatten
|
||||||
from ..hdl import ast, ir, mem, xfrm
|
from ..hdl import ast, ir, mem, xfrm
|
||||||
|
@ -1028,7 +1029,11 @@ def convert_fragment(fragment, name="top", *, emit_src=True):
|
||||||
return str(builder), name_map
|
return str(builder), name_map
|
||||||
|
|
||||||
|
|
||||||
def convert(elaboratable, name="top", platform=None, *, emit_src=True, **kwargs):
|
def convert(elaboratable, name="top", platform=None, ports=None, *, emit_src=True, **kwargs):
|
||||||
|
# TODO(amaranth-0.4): remove
|
||||||
|
if ports is None:
|
||||||
|
warnings.warn("Implicit port determination is deprecated, specify ports explictly",
|
||||||
|
DeprecationWarning, stacklevel=2)
|
||||||
fragment = ir.Fragment.get(elaboratable, platform).prepare(**kwargs)
|
fragment = ir.Fragment.get(elaboratable, platform).prepare(**kwargs)
|
||||||
il_text, name_map = convert_fragment(fragment, name, emit_src=emit_src)
|
il_text, name_map = convert_fragment(fragment, name, emit_src=emit_src)
|
||||||
return il_text
|
return il_text
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
import warnings
|
||||||
|
|
||||||
from .._toolchain.yosys import *
|
from .._toolchain.yosys import *
|
||||||
|
from ..hdl import ir
|
||||||
from . import rtlil
|
from . import rtlil
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +42,11 @@ def convert_fragment(*args, strip_internal_attrs=False, **kwargs):
|
||||||
return _convert_rtlil_text(rtlil_text, strip_internal_attrs=strip_internal_attrs), name_map
|
return _convert_rtlil_text(rtlil_text, strip_internal_attrs=strip_internal_attrs), name_map
|
||||||
|
|
||||||
|
|
||||||
def convert(*args, strip_internal_attrs=False, **kwargs):
|
def convert(elaboratable, name="top", platform=None, ports=None, *, emit_src=True, strip_internal_attrs=False, **kwargs):
|
||||||
rtlil_text = rtlil.convert(*args, **kwargs)
|
# TODO(amaranth-0.4): remove
|
||||||
return _convert_rtlil_text(rtlil_text, strip_internal_attrs=strip_internal_attrs)
|
if ports is None:
|
||||||
|
warnings.warn("Implicit port determination is deprecated, specify ports explictly",
|
||||||
|
DeprecationWarning, stacklevel=2)
|
||||||
|
fragment = ir.Fragment.get(elaboratable, platform).prepare(**kwargs)
|
||||||
|
verilog_text, name_map = convert_fragment(fragment, name, emit_src=emit_src)
|
||||||
|
return verilog_text
|
||||||
|
|
|
@ -71,7 +71,7 @@ class FHDLTestCase(unittest.TestCase):
|
||||||
mode=mode,
|
mode=mode,
|
||||||
depth=depth,
|
depth=depth,
|
||||||
script=script,
|
script=script,
|
||||||
rtlil=rtlil.convert(Fragment.get(spec, platform="formal"))
|
rtlil=rtlil.convert(Fragment.get(spec, platform="formal"), ports=())
|
||||||
)
|
)
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
[require_tool("sby"), "-f", "-d", spec_name],
|
[require_tool("sby"), "-f", "-d", spec_name],
|
||||||
|
|
Loading…
Reference in a new issue