From: Luke Kenneth Casson Leighton Date: Fri, 10 Apr 2020 12:34:51 +0000 (+0100) Subject: add eq_from_execute1 subset function X-Git-Tag: div_pipeline~1435^2~28 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13a86991ab338a331b61a5299cc4802a45773c0a;p=soc.git add eq_from_execute1 subset function --- 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,