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: 81ee2db1636a
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: 3c95299c4e3b
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 25, 2019

  1. hdl.rec: separate record and signal name with __, not _.

    This makes names of signals within records less ambiguous, in case
    they themselves have underscores within them.
    anuejn authored and whitequark committed Mar 25, 2019
    Copy the full SHA
    3c95299 View commit details
Showing with 4 additions and 4 deletions.
  1. +1 −1 nmigen/hdl/rec.py
  2. +3 −3 nmigen/test/test_hdl_rec.py
2 changes: 1 addition & 1 deletion nmigen/hdl/rec.py
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ def __init__(self, layout, name=None):
def concat(a, b):
if a is None:
return b
return "{}_{}".format(a, b)
return "{}__{}".format(a, b)

self.layout = Layout.wrap(layout)
self.fields = OrderedDict()
6 changes: 3 additions & 3 deletions nmigen/test/test_hdl_rec.py
Original file line number Diff line number Diff line change
@@ -65,11 +65,11 @@ def test_basic(self):
])
])

self.assertEqual(repr(r), "(rec r stb data (rec r_info a b))")
self.assertEqual(repr(r), "(rec r stb data (rec r__info a b))")
self.assertEqual(len(r), 35)
self.assertIsInstance(r.stb, Signal)
self.assertEqual(r.stb.name, "r_stb")
self.assertEqual(r["stb"].name, "r_stb")
self.assertEqual(r.stb.name, "r__stb")
self.assertEqual(r["stb"].name, "r__stb")

def test_unnamed(self):
r = [Record([