class PC:
def __init__(self, pc_init=0):
self.CIA = SelectableInt(pc_init, 64)
class PC:
def __init__(self, pc_init=0):
self.CIA = SelectableInt(pc_init, 64)
- self.NIA = self.CIA + SelectableInt(4, 64)
+ self.NIA = self.CIA + SelectableInt(4, 64) # only true for v3.0B!
+
+ def update_nia(self, is_svp64):
+ increment = 8 if is_svp64 else 4
+ self.NIA = self.CIA + SelectableInt(increment, 64)
def update(self, namespace, is_svp64):
"""updates the program counter (PC) by 4 if v3.0B mode or 8 if SVP64
"""
def update(self, namespace, is_svp64):
"""updates the program counter (PC) by 4 if v3.0B mode or 8 if SVP64
"""
self.is_svp64_mode = ((major == 0b000001) and
pfx.insn[7].value == 0b1 and
pfx.insn[9].value == 0b1)
self.is_svp64_mode = ((major == 0b000001) and
pfx.insn[7].value == 0b1 and
pfx.insn[9].value == 0b1)
dest_cr, src_cr, src_byname, dest_byname = False, False, {}, {}
print ("sv rm", sv_rm, dest_cr, src_cr, src_byname, dest_byname)
dest_cr, src_cr, src_byname, dest_byname = False, False, {}, {}
print ("sv rm", sv_rm, dest_cr, src_cr, src_byname, dest_byname)
# doing this is not part of svp64, it's because output
# registers, to be modified, need to be in the namespace.
regnum, is_vec = yield from get_pdecode_idx_out(self.dec2, name)
# doing this is not part of svp64, it's because output
# registers, to be modified, need to be in the namespace.
regnum, is_vec = yield from get_pdecode_idx_out(self.dec2, name)
# in case getting the register number is needed, _RA, _RB
regname = "_" + name
self.namespace[regname] = regnum
# in case getting the register number is needed, _RA, _RB
regname = "_" + name
self.namespace[regname] = regnum
# any modified return results?
if info.write_regs:
for name, output in zip(output_names, results):
# any modified return results?
if info.write_regs:
for name, output in zip(output_names, results):
# temporary hack for not having 2nd output
regnum = yield getattr(self.decoder, name)
is_vec = False
# temporary hack for not having 2nd output
regnum = yield getattr(self.decoder, name)
is_vec = False
print('writing reg %d %s' % (regnum, str(output)), is_vec)
if output.bits > 64:
output = SelectableInt(output.value, 64)
self.gpr[regnum] = output
print('writing reg %d %s' % (regnum, str(output)), is_vec)
if output.bits > 64:
output = SelectableInt(output.value, 64)
self.gpr[regnum] = output
# check if it is the SVSTATE.src/dest step that needs incrementing
# this is our Sub-Program-Counter loop from 0 to VL-1
if self.is_svp64_mode:
# check if it is the SVSTATE.src/dest step that needs incrementing
# this is our Sub-Program-Counter loop from 0 to VL-1
if self.is_svp64_mode:
print (" svstate.vl", vl)
print (" svstate.mvl", mvl)
print (" svstate.srcstep", srcstep)
print (" svstate.vl", vl)
print (" svstate.mvl", mvl)
print (" svstate.srcstep", srcstep)
return # DO NOT allow PC to update whilst Sub-PC loop running
# reset to zero
self.svstate.srcstep[0:7] = 0
print (" svstate.srcstep loop end (PC to update)")
return # DO NOT allow PC to update whilst Sub-PC loop running
# reset to zero
self.svstate.srcstep[0:7] = 0
print (" svstate.srcstep loop end (PC to update)")