hdl._ir: raise an error when an elaboratable is duplicated in hierarchy.
Fixes #1194.
This commit is contained in:
parent
2cf9bbf306
commit
466536efcf
3 changed files with 29 additions and 2 deletions
|
|
@ -77,6 +77,18 @@ class FragmentDriversTestCase(FHDLTestCase):
|
|||
self.assertEqual(list(f.iter_sync()), [])
|
||||
|
||||
|
||||
class DuplicateElaboratableTestCase(FHDLTestCase):
|
||||
def test_duplicate(self):
|
||||
sub = Module()
|
||||
m = Module()
|
||||
m.submodules.a = sub
|
||||
m.submodules.b = sub
|
||||
with self.assertRaisesRegex(DuplicateElaboratable,
|
||||
r"^Elaboratable .* is included twice in the hierarchy, as "
|
||||
r"top\.a and top\.b$"):
|
||||
Fragment.get(m, None).prepare()
|
||||
|
||||
|
||||
class FragmentPortsTestCase(FHDLTestCase):
|
||||
def setUp(self):
|
||||
self.s1 = Signal()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue