@@ -102,7 +102,7 @@ def check_parameters(cls, width, access):
102102 except ValueError as e :
103103 raise ValueError (f"{ access !r} is not a valid Element.Access" ) from e
104104
105- def create (self , * , path = () ):
105+ def create (self , * , path = None , src_loc_at = 0 ):
106106 """Create a compatible interface.
107107
108108 See :meth:`wiring.Signature.create` for details.
@@ -111,7 +111,7 @@ def create(self, *, path=()):
111111 -------
112112 An :class:`Element` object using this signature.
113113 """
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 )
115115
116116 def __eq__ (self , other ):
117117 """Compare signatures.
@@ -144,8 +144,8 @@ def __repr__(self):
144144 ------
145145 See :meth:`Element.Signature.check_parameters`
146146 """
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 )
149149
150150 @property
151151 def width (self ):
@@ -254,7 +254,7 @@ def check_parameters(cls, *, addr_width, data_width):
254254 if not isinstance (data_width , int ) or data_width <= 0 :
255255 raise TypeError (f"Data width must be a positive integer, not { data_width !r} " )
256256
257- def create (self , * , path = () ):
257+ def create (self , * , path = None , src_loc_at = 0 ):
258258 """Create a compatible interface.
259259
260260 See :meth:`wiring.Signature.create` for details.
@@ -265,7 +265,7 @@ def create(self, *, path=()):
265265 """
266266 return Interface (addr_width = self .addr_width , data_width = self .data_width ,
267267 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 )
269269
270270 def __eq__ (self , other ):
271271 """Compare signatures.
@@ -313,10 +313,10 @@ class Interface(wiring.PureInterface):
313313 ------
314314 See :meth:`Signature.check_parameters`.
315315 """
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 ):
317317 sig = Signature (addr_width = addr_width , data_width = data_width )
318318 sig .memory_map = memory_map
319- super ().__init__ (sig , path = path )
319+ super ().__init__ (sig , path = path , src_loc_at = 1 + src_loc_at )
320320
321321 @property
322322 def addr_width (self ):
0 commit comments