@@ -98,6 +98,9 @@ def __init__(self, *, addr_width, shape, granularity=None):
98
98
"en" : wiring .In (en_width ),
99
99
})
100
100
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
+
101
104
@property
102
105
def addr_width (self ):
103
106
return self ._addr_width
@@ -121,7 +124,7 @@ def __repr__(self):
121
124
return f"WritePort.Signature(addr_width={ self .addr_width } , shape={ self .shape } { granularity } )"
122
125
123
126
124
- def __init__ (self , signature , * , memory , domain ):
127
+ def __init__ (self , signature , * , memory , domain , path = None , src_loc_at = 0 ):
125
128
if not isinstance (signature , WritePort .Signature ):
126
129
raise TypeError (f"Expected `WritePort.Signature`, not { signature !r} " )
127
130
if memory is not None :
@@ -138,7 +141,7 @@ def __init__(self, signature, *, memory, domain):
138
141
self ._signature = signature
139
142
self ._memory = memory
140
143
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 ))
142
145
if memory is not None :
143
146
memory ._w_ports .append (self )
144
147
@@ -211,6 +214,9 @@ def __init__(self, *, addr_width, shape):
211
214
"en" : wiring .In (1 , init = 1 ),
212
215
})
213
216
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
+
214
220
@property
215
221
def addr_width (self ):
216
222
return self ._addr_width
@@ -228,7 +234,7 @@ def __repr__(self):
228
234
return f"ReadPort.Signature(addr_width={ self .addr_width } , shape={ self .shape } )"
229
235
230
236
231
- def __init__ (self , signature , * , memory , domain , transparent_for = ()):
237
+ def __init__ (self , signature , * , memory , domain , transparent_for = (), path = None , src_loc_at = 0 ):
232
238
if not isinstance (signature , ReadPort .Signature ):
233
239
raise TypeError (f"Expected `ReadPort.Signature`, not { signature !r} " )
234
240
if memory is not None :
@@ -252,7 +258,7 @@ def __init__(self, signature, *, memory, domain, transparent_for=()):
252
258
self ._memory = memory
253
259
self ._domain = domain
254
260
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 ))
256
262
if domain == "comb" :
257
263
self .en = Const (1 )
258
264
if memory is not None :
0 commit comments