Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a4183eba69f6
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0df543b204f0
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 22, 2018

  1. compat: do not finalize native submodules twice.

    whitequark committed Dec 22, 2018
    Copy the full SHA
    0df543b View commit details
Showing with 4 additions and 7 deletions.
  1. +4 −7 nmigen/compat/fhdl/module.py
11 changes: 4 additions & 7 deletions nmigen/compat/fhdl/module.py
Original file line number Diff line number Diff line change
@@ -122,9 +122,6 @@ def __getattr__(self, name):
elif name == "_submodules":
self._submodules = []
return self._submodules
elif name == "_specials":
self._specials = []
return self._specials
elif name == "_clock_domains":
self._clock_domains = []
return self._clock_domains
@@ -135,22 +132,22 @@ def __getattr__(self, name):
raise AttributeError("'{}' object has no attribute '{}'"
.format(type(self).__name__, name))

def _finalize_submodules(self):
def _finalize_submodules(self, finalize_native):
for name, submodule in self._submodules:
if hasattr(submodule, "get_fragment_called"):
# Compat submodule
if not submodule.get_fragment_called:
self._module._add_submodule(submodule.get_fragment(), name)
else:
elif finalize_native:
# Native submodule
self._module._add_submodule(submodule, name)

def finalize(self, *args, **kwargs):
if not self.finalized:
self.finalized = True
self._finalize_submodules()
self._finalize_submodules(finalize_native=False)
self.do_finalize(*args, **kwargs)
self._finalize_submodules()
self._finalize_submodules(finalize_native=True)

def do_finalize(self):
pass