hdl: remove deprecated get_fragment() and lower() methods.
This commit is contained in:
parent
a74cacdc69
commit
49eef77c53
|
@ -368,12 +368,6 @@ class Module(_ModuleBuilderRoot):
|
||||||
|
|
||||||
def _add_submodule(self, submodule, name=None):
|
def _add_submodule(self, submodule, name=None):
|
||||||
if not hasattr(submodule, "elaborate"):
|
if not hasattr(submodule, "elaborate"):
|
||||||
if hasattr(submodule, "get_fragment"): # :deprecated:
|
|
||||||
warnings.warn("Adding '{!r}', which implements .get_fragment() but not "
|
|
||||||
".elaborate(), as a submodule. .get_fragment() is deprecated, "
|
|
||||||
"and .elaborate() should be provided instead.".format(submodule),
|
|
||||||
DeprecationWarning, stacklevel=2)
|
|
||||||
else:
|
|
||||||
raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as "
|
raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as "
|
||||||
"a submodule".format(submodule))
|
"a submodule".format(submodule))
|
||||||
self._submodules.append((submodule, name))
|
self._submodules.append((submodule, name))
|
||||||
|
@ -385,14 +379,6 @@ class Module(_ModuleBuilderRoot):
|
||||||
while self._ctrl_stack:
|
while self._ctrl_stack:
|
||||||
self._pop_ctrl()
|
self._pop_ctrl()
|
||||||
|
|
||||||
@deprecated("`m.get_fragment(...)` is deprecated; use `m` instead")
|
|
||||||
def get_fragment(self, platform): # :deprecated:
|
|
||||||
return self.elaborate(platform)
|
|
||||||
|
|
||||||
@deprecated("`m.lower(...)` is deprecated; use `m` instead")
|
|
||||||
def lower(self, platform): # :deprecated:
|
|
||||||
return self.elaborate(platform)
|
|
||||||
|
|
||||||
def elaborate(self, platform):
|
def elaborate(self, platform):
|
||||||
self._flush()
|
self._flush()
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@ class Fragment:
|
||||||
return obj
|
return obj
|
||||||
if hasattr(obj, "elaborate"):
|
if hasattr(obj, "elaborate"):
|
||||||
frag = obj.elaborate(platform)
|
frag = obj.elaborate(platform)
|
||||||
elif hasattr(obj, "get_fragment"): # :deprecated:
|
|
||||||
frag = obj.get_fragment(platform)
|
|
||||||
else:
|
else:
|
||||||
raise AttributeError("Object '{!r}' cannot be elaborated".format(obj))
|
raise AttributeError("Object '{!r}' cannot be elaborated".format(obj))
|
||||||
return Fragment.get(frag, platform)
|
return Fragment.get(frag, platform)
|
||||||
|
|
Loading…
Reference in a new issue