From: whitequark Date: Wed, 3 Jul 2019 14:35:48 +0000 (+0000) Subject: hdl.rec: accept Record(src_loc_at=...). X-Git-Tag: locally_working~119 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5800f00776c8522f9c31a0c30e84d29f4320b509;p=nmigen.git hdl.rec: accept Record(src_loc_at=...). --- diff --git a/nmigen/hdl/rec.py b/nmigen/hdl/rec.py index 67c77c2..be70af2 100644 --- a/nmigen/hdl/rec.py +++ b/nmigen/hdl/rec.py @@ -86,12 +86,12 @@ class Record(Value): new_name = tracer.get_var_name(depth=2 + src_loc_at, default=None) return cls(other.layout, new_name) - def __init__(self, layout, name=None, *, fields=None): + def __init__(self, layout, name=None, src_loc_at=0, *, fields=None): if name is None: - name = tracer.get_var_name(default=None) + name = tracer.get_var_name(depth=2 + src_loc_at, default=None) self.name = name - self.src_loc = tracer.get_src_loc() + self.src_loc = tracer.get_src_loc(src_loc_at) def concat(a, b): if a is None: