from openpower.consts import TT
from openpower.exceptions import LDSTException
from openpower.decoder.power_svp64_rm import sv_input_record_layout
+from openpower.decoder.power_enums import asmlen
from openpower.util import log
+
class Data(Record):
def __init__(self, width, name):
RecordObject.__init__(self, name=name)
if asmcode:
- self.asmcode = Signal(8, reset_less=True) # only for simulator
+ self.asmcode = Signal(asmlen, reset_less=True) # only for simulator
self.write_reg = Data(7, name="rego")
self.write_ea = Data(7, name="ea") # for LD/ST in update mode
self.read_reg1 = Data(7, name="reg1")
RC, LdstLen, LDSTMode, CryIn,
single_bit_flags, CRInSel,
CROutSel, get_signal_name,
- default_values, insns, asmidx)
+ default_values, insns, asmidx,
+ asmlen)
from openpower.decoder.power_fields import DecodeFields
from openpower.decoder.power_fieldsn import SigDecode, SignalBitRange
from openpower.decoder.power_svp64 import SVP64RM
power_op_types = {'function_unit': Function,
'internal_op': MicrOp,
'form': Form,
- 'asmcode': 8,
+ 'asmcode': asmlen,
'SV_Etype': SVEtype,
'SV_Ptype': SVPtype,
'in1_sel': In1Sel,
insns[i] = insn
asmidx[insn] = i
+# must be long enough to cover all instructions
+asmlen = len(_insns).bit_length()
+
# Internal Operation numbering. Add new opcodes here (FPADD, FPMUL etc.)