Skip to content

hdl._ir: Improve driver-driver conflict message. #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions amaranth/hdl/_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,11 @@ def emit_stmt(self, module_idx: int, fragment: _ir.Fragment, domain: str,
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 ("<toplevel>",))
other_mod_name = \
Expand Down