Skip to content

Commit fc81ff1

Browse files
wanda-phiwhitequark
authored andcommitted
hdl._ir: Improve driver-driver conflict message.
1 parent ccf87c6 commit fc81ff1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

amaranth/hdl/_ir.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,9 +990,11 @@ def emit_stmt(self, module_idx: int, fragment: _ir.Fragment, domain: str,
990990
if signal in self.drivers:
991991
driver = self.drivers[signal]
992992
if driver.domain is not cd:
993+
domain_name = cd.name if cd is not None else "comb"
994+
other_domain_name = driver.domain.name if driver.domain is not None else "comb"
993995
raise _ir.DriverConflict(
994-
f"Signal {signal} driven from domain {cd} at {stmt.src_loc} and domain "
995-
f"{driver.domain} at {driver.src_loc}")
996+
f"Signal {signal} driven from domain {domain_name} at {stmt.src_loc} and domain "
997+
f"{other_domain_name} at {driver.src_loc}")
996998
if driver.module_idx != module_idx:
997999
mod_name = ".".join(self.netlist.modules[module_idx].name or ("<toplevel>",))
9981000
other_mod_name = \

0 commit comments

Comments
 (0)