comb = m.d.comb
op = self.i.ctx.op
lk = op.lk # see PowerDecode2 as to why this is done
- nia_out, lr = self.o.nia_out, self.o.lr
+ nia_o, lr_o = self.o.nia, self.o.lr
# obtain relevant instruction fields
i_fields = self.fields.FormI
###### output next instruction address #####
- comb += nia_out.data.eq(br_addr)
- comb += nia_out.ok.eq(br_taken)
+ comb += nia_o.data.eq(br_addr)
+ comb += nia_o.ok.eq(br_taken)
###### link register - only activate on operations marked as "lk" #####
with m.If(lk):
# ctx.op.lk is the AND of the insn LK field *and* whether the
# op is to "listen" to the link field
- comb += lr.data.eq(self.i.cia + 4)
- comb += lr.ok.eq(1)
+ comb += lr_o.data.eq(self.i.cia + 4)
+ comb += lr_o.ok.eq(1)
###### and context #####
comb += self.o.ctx.eq(self.i.ctx)
sim.run()
def assert_outputs(self, branch, dec2, sim, prev_nia):
- branch_taken = yield branch.n.data_o.nia_out.ok
+ branch_taken = yield branch.n.data_o.nia.ok
sim_branch_taken = prev_nia != sim.pc.CIA
self.assertEqual(branch_taken, sim_branch_taken)
if branch_taken:
- branch_addr = yield branch.n.data_o.nia_out.data
+ branch_addr = yield branch.n.data_o.nia.data
self.assertEqual(branch_addr, sim.pc.CIA.value)
lk = yield dec2.e.lk