From 0589aafba8b68c507d10a12e56f0f8c0f4467220 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 8 Jul 2019 10:48:07 +0000 Subject: [PATCH] back.rtlil: don't name-prefix signals connected to instance ports. This gives particularly pathological results on IO buffers, like: connect \D_OUT_0 \user_led_0_user_led_0__o Since subfragment signals are name-prefixed because this works well for signals propagated upwards across hierarchy, this is never desirable for instances. --- nmigen/back/rtlil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nmigen/back/rtlil.py b/nmigen/back/rtlil.py index 8c042c6..52ddb5c 100644 --- a/nmigen/back/rtlil.py +++ b/nmigen/back/rtlil.py @@ -772,8 +772,9 @@ def convert_fragment(builder, fragment, hierarchy): sub_ports = OrderedDict() for port, value in sub_port_map.items(): - for signal in value._rhs_signals(): - compiler_state.resolve_curr(signal, prefix=sub_name) + if not isinstance(subfragment, ir.Instance): + for signal in value._rhs_signals(): + compiler_state.resolve_curr(signal, prefix=sub_name) sub_ports[port] = rhs_compiler(value) module.cell(sub_type, name=sub_name, ports=sub_ports, params=sub_params, -- 2.30.2