@@ -88,7 +88,7 @@ def add_ports(self, ports: Iterable[BasePort]):
8888 if is_export :
8989 (ext_port , int_port ) = is_export
9090 if ext_port ._get_initializers ([]):
91- raise UnconnectableError (f"Connected boundary port { ext_port ._name_from (self .parent )} may not have initializers" )
91+ raise UnconnectableError (f"Connected boundary port { ext_port ._name_from (self .parent , allow_unknown = True )} may not have initializers" )
9292 return # is an export, not a connection
9393
9494 # otherwise, is a link-mediated connection
@@ -111,19 +111,19 @@ def add_ports(self, ports: Iterable[BasePort]):
111111 if isinstance (self .parent , Block ): # check if bridge is needed
112112 if port ._block_parent () is self .parent :
113113 if port ._get_initializers ([]):
114- raise UnconnectableError (f"Connected boundary port { port ._name_from (self .parent )} may not have initializers" )
114+ raise UnconnectableError (f"Connected boundary port { port ._name_from (self .parent , allow_unknown = True )} may not have initializers" )
115115 if not isinstance (port , Port ):
116- raise UnconnectableError (f"Can't generate bridge for non-Port { port ._name_from (self .parent )} " )
116+ raise UnconnectableError (f"Can't generate bridge for non-Port { port ._name_from (self .parent , allow_unknown = True )} " )
117117
118118 bridge = port ._bridge ()
119119 if bridge is None :
120- raise UnconnectableError (f"No bridge for { port ._name_from (self .parent )} " )
120+ raise UnconnectableError (f"No bridge for { port ._name_from (self .parent , allow_unknown = True )} " )
121121 link_facing_port = self .bridged_ports [port ] = bridge .inner_link
122122 else :
123123 link_facing_port = port
124124 elif isinstance (self .parent , Link ): # links don't bridge, all ports are treated as internal
125125 if port ._block_parent () is not self .parent :
126- raise UnconnectableError (f"Port { port ._name_from (self .parent )} not in containing link" )
126+ raise UnconnectableError (f"Port { port ._name_from (self .parent , allow_unknown = True )} not in containing link" )
127127 link_facing_port = port
128128 else :
129129 raise ValueError (f"unknown parent { self .parent } " )
@@ -134,13 +134,13 @@ def add_ports(self, ports: Iterable[BasePort]):
134134
135135 # allocate the connection
136136 if self ._baseport_leaf_type (link_facing_port ).link_type is not type (link ):
137- raise UnconnectableError (f"Can't connect { port ._name_from (self .parent )} to link of type { type (link )} " )
137+ raise UnconnectableError (f"Can't connect { port ._name_from (self .parent , allow_unknown = True )} to link of type { type (link )} " )
138138 port_type = type (self ._baseport_leaf_type (link_facing_port ))
139139 allocatable_link_ports = self .available_link_ports_by_type .get (port_type , None )
140140 if allocatable_link_ports is None :
141- raise UnconnectableError (f"No link port for { port ._name_from (self .parent )} of type { port_type } " )
141+ raise UnconnectableError (f"No link port for { port ._name_from (self .parent , allow_unknown = True )} of type { port_type } " )
142142 if not allocatable_link_ports :
143- raise UnconnectableError (f"No remaining link ports to { port ._name_from (self .parent )} " )
143+ raise UnconnectableError (f"No remaining link ports to { port ._name_from (self .parent , allow_unknown = True )} " )
144144
145145 allocated_link_port = allocatable_link_ports [0 ]
146146 if isinstance (allocated_link_port , BaseVector ): # array on link side, can connected multiple ports
0 commit comments