# op requests inversion of the output
o = Signal.like(self.i.o)
with m.If(op.invert_out):
- comb += o.eq(~self.i.o)
+ comb += o.eq(~self.i.o.data)
with m.Else():
- comb += o.eq(self.i.o)
+ comb += o.eq(self.i.o.data)
# target register if 32-bit is only the 32 LSBs
target = Signal(64, reset_less=True)
comb += cr0.eq(self.i.cr0)
# copy out [inverted] cr0, output, and context out
- comb += self.o.o.eq(o)
+ comb += self.o.o.data.eq(o)
+ comb += self.o.o.ok.eq(self.i.o.ok)
comb += self.o.cr0.data.eq(cr0)
comb += self.o.cr0.ok.eq(op.rc.rc & op.rc.rc_ok) # CR0 to be set
comb += self.o.ctx.eq(self.i.ctx)
m = Module()
comb = m.d.comb
op = self.i.ctx.op
+ o = self.o.o
# obtain me and mb fields from instruction.
m_fields = self.fields.instrs['M']
rotator.arith.eq(op.is_signed),
]
+ comb += o.ok.eq(1) # defaults to enabled
+
# instruction rotate type
mode = Signal(3, reset_less=True)
with m.Switch(op.insn_type):
with m.Case(InternalOp.OP_RLC): comb += mode.eq(0b110) # clear LR
with m.Case(InternalOp.OP_RLCL): comb += mode.eq(0b010) # clear L
with m.Case(InternalOp.OP_RLCR): comb += mode.eq(0b100) # clear R
+ with m.Default():
+ comb += o.ok.eq(0) # otherwise disable
comb += Cat(rotator.right_shift,
rotator.clear_left,
# outputs from the microwatt rotator module
# XXX TODO: carry32
- comb += [self.o.o.eq(rotator.result_o),
+ comb += [o.data.eq(rotator.result_o),
self.o.xer_ca[0].eq(rotator.carry_out_o)]
###### sticky overflow and context, both pass-through #####
yield
vld = yield alu.n.valid_o
yield
- alu_out = yield alu.n.data_o.o
+ alu_out = yield alu.n.data_o.o.data
out_reg_valid = yield pdecode2.e.write_reg.ok
if out_reg_valid:
write_reg_idx = yield pdecode2.e.write_reg.data
self.assertEqual(expected, alu_out, msg)
yield from self.check_extra_alu_outputs(alu, pdecode2,
simulator)
+ break
sim.add_sync_process(process)
with sim.write_vcd("simulator.vcd", "simulator.gtkw",