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: e18385b61315
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: 7cb3095334f7
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 17, 2020

  1. hdl.xfrm: transform drivers as well in DomainRenamer.

    This is necessary because drivers may be late bound.
    
    Fixes #304.
    whitequark committed Jan 17, 2020
    Copy the full SHA
    7cb3095 View commit details
Showing with 20 additions and 1 deletion.
  1. +1 −1 nmigen/hdl/xfrm.py
  2. +19 −0 nmigen/test/test_hdl_ir.py
2 changes: 1 addition & 1 deletion nmigen/hdl/xfrm.py
Original file line number Diff line number Diff line change
@@ -482,7 +482,7 @@ def map_drivers(self, fragment, new_fragment):
if domain in self.domain_map:
domain = self.domain_map[domain]
for signal in signals:
new_fragment.add_driver(signal, domain)
new_fragment.add_driver(self.on_value(signal), domain)


class DomainLowerer(FragmentTransformer, ValueTransformer, StatementTransformer):
19 changes: 19 additions & 0 deletions nmigen/test/test_hdl_ir.py
Original file line number Diff line number Diff line change
@@ -389,6 +389,25 @@ def test_domain_conflict_name(self):
"domains explicitly, or give distinct names to subfragments"):
f._propagate_domains_up()

def test_domain_conflict_rename_drivers(self):
cda = ClockDomain("sync")
cdb = ClockDomain("sync")

fa = Fragment()
fa.add_domains(cda)
fb = Fragment()
fb.add_domains(cdb)
fb.add_driver(ResetSignal("sync"), None)
f = Fragment()
f.add_subfragment(fa, "a")
f.add_subfragment(fb, "b")

f._propagate_domains_up()
fb_new, _ = f.subfragments[1]
self.assertEqual(fb_new.drivers, OrderedDict({
None: SignalSet((ResetSignal("b_sync"),))
}))

def test_propagate_down(self):
cd = ClockDomain()