@@ -102,7 +102,7 @@ def check_parameters(cls, width, access):
102
102
except ValueError as e :
103
103
raise ValueError (f"{ access !r} is not a valid Element.Access" ) from e
104
104
105
- def create (self , * , path = () ):
105
+ def create (self , * , path = None , src_loc_at = 0 ):
106
106
"""Create a compatible interface.
107
107
108
108
See :meth:`wiring.Signature.create` for details.
@@ -111,7 +111,7 @@ def create(self, *, path=()):
111
111
-------
112
112
An :class:`Element` object using this signature.
113
113
"""
114
- return Element (self .width , self .access , path = path )
114
+ return Element (self .width , self .access , path = path , src_loc_at = 1 + src_loc_at )
115
115
116
116
def __eq__ (self , other ):
117
117
"""Compare signatures.
@@ -144,8 +144,8 @@ def __repr__(self):
144
144
------
145
145
See :meth:`Element.Signature.check_parameters`
146
146
"""
147
- def __init__ (self , width , access , * , path = () ):
148
- super ().__init__ (Element .Signature (width = width , access = access ), path = path )
147
+ def __init__ (self , width , access , * , path = None , src_loc_at = 0 ):
148
+ super ().__init__ (Element .Signature (width = width , access = access ), path = path , src_loc_at = 1 + src_loc_at )
149
149
150
150
@property
151
151
def width (self ):
@@ -254,7 +254,7 @@ def check_parameters(cls, *, addr_width, data_width):
254
254
if not isinstance (data_width , int ) or data_width <= 0 :
255
255
raise TypeError (f"Data width must be a positive integer, not { data_width !r} " )
256
256
257
- def create (self , * , path = () ):
257
+ def create (self , * , path = None , src_loc_at = 0 ):
258
258
"""Create a compatible interface.
259
259
260
260
See :meth:`wiring.Signature.create` for details.
@@ -265,7 +265,7 @@ def create(self, *, path=()):
265
265
"""
266
266
return Interface (addr_width = self .addr_width , data_width = self .data_width ,
267
267
memory_map = self ._memory_map , # if None, do not raise an exception
268
- path = path )
268
+ path = path , src_loc_at = 1 + src_loc_at )
269
269
270
270
def __eq__ (self , other ):
271
271
"""Compare signatures.
@@ -313,10 +313,10 @@ class Interface(wiring.PureInterface):
313
313
------
314
314
See :meth:`Signature.check_parameters`.
315
315
"""
316
- def __init__ (self , * , addr_width , data_width , memory_map = None , path = () ):
316
+ def __init__ (self , * , addr_width , data_width , memory_map = None , path = None , src_loc_at = 0 ):
317
317
sig = Signature (addr_width = addr_width , data_width = data_width )
318
318
sig .memory_map = memory_map
319
- super ().__init__ (sig , path = path )
319
+ super ().__init__ (sig , path = path , src_loc_at = 1 + src_loc_at )
320
320
321
321
@property
322
322
def addr_width (self ):
0 commit comments