from soc.decoder.isa.all import ISA
from soc.regfile.regfiles import FastRegs
-from soc.fu.test.common import TestCase
+from soc.fu.test.common import TestCase, ALUHelpers
from soc.fu.branch.pipeline import BranchBasePipe
from soc.fu.branch.pipe_data import BranchPipeSpec
import random
inp = yield from get_cu_inputs(dec2, sim)
- if 'cia' in inp:
- yield branch.p.data_i.cia.eq(inp['cia'])
- if 'spr1' in inp:
- yield branch.p.data_i.spr1.eq(inp['spr1'])
- if 'spr2' in inp:
- yield branch.p.data_i.spr2.eq(inp['spr2'])
- if 'cr_a' in inp:
- yield branch.p.data_i.cr.eq(inp['cr_a'])
+ yield from ALUHelpers.set_fast_cia(branch, dec2, inp)
+ yield from ALUHelpers.set_fast_spr1(branch, dec2, inp)
+ yield from ALUHelpers.set_fast_spr2(branch, dec2, inp)
+ yield from ALUHelpers.set_cr_a(branch, dec2, inp)
if __name__ == "__main__":
print ("extra inputs: so", so)
yield alu.p.data_i.xer_so.eq(so)
+ def set_fast_cia(alu, dec2, inp):
+ if 'cia' in inp:
+ yield alu.p.data_i.cia.eq(inp['cia'])
+
+ def set_fast_spr1(alu, dec2, inp):
+ if 'spr1' in inp:
+ yield alu.p.data_i.spr1.eq(inp['spr1'])
+
+ def set_fast_spr2(alu, dec2, inp):
+ if 'spr2' in inp:
+ yield alu.p.data_i.spr2.eq(inp['spr2'])
+
+ def set_cr_a(alu, dec2, inp):
+ if 'cr_a' in inp:
+ yield alu.p.data_i.cr.eq(inp['cr_a'])
+