@@ -98,6 +98,9 @@ def __init__(self, *, addr_width, shape, granularity=None):
9898 "en" : wiring .In (en_width ),
9999 })
100100
101+ def create (self , * , path = None , src_loc_at = 0 ):
102+ return WritePort (self , memory = None , domain = "sync" , path = path , src_loc_at = 1 + src_loc_at )
103+
101104 @property
102105 def addr_width (self ):
103106 return self ._addr_width
@@ -121,7 +124,7 @@ def __repr__(self):
121124 return f"WritePort.Signature(addr_width={ self .addr_width } , shape={ self .shape } { granularity } )"
122125
123126
124- def __init__ (self , signature , * , memory , domain ):
127+ def __init__ (self , signature , * , memory , domain , path = None , src_loc_at = 0 ):
125128 if not isinstance (signature , WritePort .Signature ):
126129 raise TypeError (f"Expected `WritePort.Signature`, not { signature !r} " )
127130 if memory is not None :
@@ -138,7 +141,7 @@ def __init__(self, signature, *, memory, domain):
138141 self ._signature = signature
139142 self ._memory = memory
140143 self ._domain = domain
141- self .__dict__ .update (signature .members .create ())
144+ self .__dict__ .update (signature .members .create (path = path , src_loc_at = 1 + src_loc_at ))
142145 if memory is not None :
143146 memory ._w_ports .append (self )
144147
@@ -211,6 +214,9 @@ def __init__(self, *, addr_width, shape):
211214 "en" : wiring .In (1 , init = 1 ),
212215 })
213216
217+ def create (self , * , path = None , src_loc_at = 0 ):
218+ return ReadPort (self , memory = None , domain = "sync" , path = path , src_loc_at = 1 + src_loc_at )
219+
214220 @property
215221 def addr_width (self ):
216222 return self ._addr_width
@@ -228,7 +234,7 @@ def __repr__(self):
228234 return f"ReadPort.Signature(addr_width={ self .addr_width } , shape={ self .shape } )"
229235
230236
231- def __init__ (self , signature , * , memory , domain , transparent_for = ()):
237+ def __init__ (self , signature , * , memory , domain , transparent_for = (), path = None , src_loc_at = 0 ):
232238 if not isinstance (signature , ReadPort .Signature ):
233239 raise TypeError (f"Expected `ReadPort.Signature`, not { signature !r} " )
234240 if memory is not None :
@@ -252,7 +258,7 @@ def __init__(self, signature, *, memory, domain, transparent_for=()):
252258 self ._memory = memory
253259 self ._domain = domain
254260 self ._transparent_for = transparent_for
255- self .__dict__ .update (signature .members .create ())
261+ self .__dict__ .update (signature .members .create (path = path , src_loc_at = 1 + src_loc_at ))
256262 if domain == "comb" :
257263 self .en = Const (1 )
258264 if memory is not None :
0 commit comments