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: 3448953f61a7
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: 621dddebfd93
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Dec 22, 2018

  1. Copy the full SHA
    621ddde View commit details
Showing with 16 additions and 0 deletions.
  1. +2 −0 nmigen/hdl/xfrm.py
  2. +14 −0 nmigen/test/test_hdl_xfrm.py
2 changes: 2 additions & 0 deletions nmigen/hdl/xfrm.py
Original file line number Diff line number Diff line change
@@ -298,6 +298,8 @@ def unify(self, root, *leaves):
root_group = self.find(root)
for leaf in leaves:
leaf_group = self.find(leaf)
if root_group == leaf_group:
continue
self.unions[leaf_group] = root_group

def groups(self):
14 changes: 14 additions & 0 deletions nmigen/test/test_hdl_xfrm.py
Original file line number Diff line number Diff line change
@@ -186,6 +186,20 @@ def test_group_related(self):
SignalSet((a, b)),
])

def test_no_loops(self):
a = Signal()
b = Signal()
stmts = [
a.eq(0),
Cat(a, b).eq(0),
Cat(a, b).eq(0),
]

groups = LHSGroupAnalyzer()(stmts)
self.assertEqual(list(groups.values()), [
SignalSet((a, b)),
])

def test_switch(self):
a = Signal()
b = Signal()