From 13a86991ab338a331b61a5299cc4802a45773c0a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 10 Apr 2020 13:34:51 +0100 Subject: [PATCH] add eq_from_execute1 subset function --- src/soc/experiment/alu_hier.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/soc/experiment/alu_hier.py b/src/soc/experiment/alu_hier.py index 6d95290d..01726258 100644 --- a/src/soc/experiment/alu_hier.py +++ b/src/soc/experiment/alu_hier.py @@ -24,7 +24,8 @@ class CompALUOpSubset(Record): """CompALUOpSubset a copy of the relevant subset information from Decode2Execute1Type - needed for ALU operations. + needed for ALU operations. use with eq_from_execute1 (below) to + grab subsets. """ def __init__(self): layout = (('insn_type', InternalOp), @@ -65,6 +66,15 @@ class CompALUOpSubset(Record): self.byte_reverse.reset_less = True self.sign_extend.reset_less = True + def eq_from_execute1(self, other): + """ use this to copy in from Decode2Execute1Type + """ + res = [] + for fname, sig in self.fields.items(): + eqfrom = other.fields[fname] + res.append(sig.eq(eqfrom) + return res + def ports(self): return [self.insn_type, self.nia, -- 2.30.2