int_op = yield self.dec2.dec.op.internal_op
# sigh reconstruct the assembly instruction name
- ov_en = yield self.dec2.e.do.oe.oe
- ov_ok = yield self.dec2.e.do.oe.ok
- rc_en = yield self.dec2.e.do.rc.rc
- rc_ok = yield self.dec2.e.do.rc.ok
+ if hasattr(self.dec2.e.do, "oe"):
+ ov_en = yield self.dec2.e.do.oe.oe
+ ov_ok = yield self.dec2.e.do.oe.ok
+ else:
+ ov_en = False
+ ov_ok = False
+ if hasattr(self.dec2.e.do, "rc"):
+ rc_en = yield self.dec2.e.do.rc.rc
+ rc_ok = yield self.dec2.e.do.rc.ok
+ else:
+ rc_en = False
+ rc_ok = False
# grrrr have to special-case MUL op (see DecodeOE)
print("ov %d en %d rc %d en %d op %d" % \
(ov_ok, ov_en, rc_ok, rc_en, int_op))
already_done |= 2
print("carry already done?", bin(already_done))
- carry_en = yield self.dec2.e.do.output_carry
+ if hasattr(self.dec2.e.do, "outout_carry"):
+ carry_en = yield self.dec2.e.do.output_carry
+ else:
+ carry_en = False
if carry_en:
yield from self.handle_carry_(inputs, results, already_done)
if name == 'overflow':
overflow = output
- ov_en = yield self.dec2.e.do.oe.oe
- ov_ok = yield self.dec2.e.do.oe.ok
+ if hasattr(self.dec2.e.do, "oe"):
+ ov_en = yield self.dec2.e.do.oe.oe
+ ov_ok = yield self.dec2.e.do.oe.ok
+ else:
+ ov_en = False
+ ov_ok = False
print("internal overflow", overflow, ov_en, ov_ok)
if ov_en & ov_ok:
yield from self.handle_overflow(inputs, results, overflow)
- rc_en = yield self.dec2.e.do.rc.rc
+ if hasattr(self.dec2.e.do, "rc"):
+ rc_en = yield self.dec2.e.do.rc.rc
+ else:
+ rc_en = False
if rc_en:
self.handle_comparison(results)
"""naming (res) must conform to CRFunctionUnit input regspec
"""
res = {}
- full_reg = yield dec2.e.do.read_cr_whole.data
- full_reg_ok = yield dec2.e.do.read_cr_whole.ok
+ full_reg = yield dec2.dec_cr_in.whole_reg.data
+ full_reg_ok = yield dec2.dec_cr_in.whole_reg.ok
full_cr_mask = mask_extend(full_reg, 8, 4)
# full CR
yield from ALUHelpers.set_int_rb(alu, dec2, inp)
def assert_outputs(self, alu, dec2, simulator, code):
- whole_reg_ok = yield dec2.e.do.write_cr_whole.ok
- whole_reg_data = yield dec2.e.do.write_cr_whole.data
+ whole_reg_ok = yield dec2.dec_cr_out.whole_reg.ok
+ whole_reg_data = yield dec2.dec_cr_out.whole_reg.data
full_cr_mask = mask_extend(whole_reg_data, 8, 4)
cr_en = yield dec2.e.write_cr.ok
comb = m.d.comb
instruction = Signal(32)
- pdecode = create_pdecode()
+ fn_name = "CR"
+ opkls = CRPipeSpec.opsubsetkls
- m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
+ m.submodules.pdecode2 = pdecode2 = PowerDecode2(None, opkls, fn_name)
+ pdecode = pdecode2.dec
pspec = CRPipeSpec(id_wid=2)
m.submodules.alu = alu = CRBasePipe(pspec)
yield alu.p.data_i.rb.eq(0)
if 'rb' in inp:
yield alu.p.data_i.rb.eq(inp['rb'])
+ if not hasattr(dec2.e.do, "imm_data"):
+ return
# If there's an immediate, set the B operand to that
imm_ok = yield dec2.e.do.imm_data.ok
if imm_ok:
def set_full_cr(alu, dec2, inp):
if 'full_cr' in inp:
- full_reg = yield dec2.e.do.read_cr_whole.data
- full_reg_ok = yield dec2.e.do.read_cr_whole.ok
+ full_reg = yield dec2.dec_cr_in.whole_reg.data
+ full_reg_ok = yield dec2.dec_cr_in.whole_reg.ok
full_cr_mask = mask_extend(full_reg, 8, 4)
yield alu.p.data_i.full_cr.eq(inp['full_cr'] & full_cr_mask)
else: