From fc81ff17f79a183dc9d0424f0f6694f4d66285d3 Mon Sep 17 00:00:00 2001 From: Wanda Date: Tue, 27 Feb 2024 04:26:56 +0100 Subject: [PATCH] hdl._ir: Improve driver-driver conflict message. --- amaranth/hdl/_ir.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amaranth/hdl/_ir.py b/amaranth/hdl/_ir.py index c491725..da58fda 100644 --- a/amaranth/hdl/_ir.py +++ b/amaranth/hdl/_ir.py @@ -990,9 +990,11 @@ class NetlistEmitter: if signal in self.drivers: driver = self.drivers[signal] if driver.domain is not cd: + domain_name = cd.name if cd is not None else "comb" + other_domain_name = driver.domain.name if driver.domain is not None else "comb" raise _ir.DriverConflict( - f"Signal {signal} driven from domain {cd} at {stmt.src_loc} and domain " - f"{driver.domain} at {driver.src_loc}") + f"Signal {signal} driven from domain {domain_name} at {stmt.src_loc} and domain " + f"{other_domain_name} at {driver.src_loc}") if driver.module_idx != module_idx: mod_name = ".".join(self.netlist.modules[module_idx].name or ("",)) other_mod_name = \