sub_ports = OrderedDict()
for port, value in sub_port_map.items():
- if isinstance(value, ast.Signal):
- sigspec = compiler_state.resolve_curr(value, prefix=sub_name)
- else:
- sigspec = rhs_compiler(value)
- sub_ports[port] = sigspec
+ 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)