From 5800f00776c8522f9c31a0c30e84d29f4320b509 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 3 Jul 2019 14:35:48 +0000 Subject: [PATCH] hdl.rec: accept Record(src_loc_at=...). --- nmigen/hdl/rec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: -- 2.30.2