def extra_constraints(self, data, bitstream): if data['i'] == '00000' and data['I'] == '0': raise ParseError("Immediate can not be 0") if data['s'] == '00000': raise ParseError("Destination can not be 0") return data
def extra_constraints(self, data, bitstream): if data['s'] == '00000': raise ParseError("Destination is not allowed to be 0") if data['I'] == '0' and data['i'] == '00000': raise ParseError('Immediate is not allowed to be 0')
def extra_constraints(self, data, bitstream): if data['s'] != '00010': raise ParseError("Destination must be 2 for this instruction") return data
def extra_constraints(self, data, bitstream): if (data['i'] != self.func7): raise ParseError("The func7 did not match") return data
def extra_constraints(self, data, bitstream): if data['I'] != '011': raise ParseError("Extra parsing did not meet the specs of CXOR") if data['i'] != '01': raise ParseError("Extra parsing did not meet the specs of CXOR")
def extra_constraints(self, data, bitstream): if data['I'] != '110' and data['I'] != '010': raise ParseError("Couldn't parse it for this instruction") return data
def extra_constraints(self, data, bitstream): if data['I'][1:3] != '01': raise ParseError("Couldn't parse it for this instruction") if data['O'] == '000' and data['I'][0] == '0': raise ParseError("Shift amount should be non zero")
def extra_constraints(self, data, bitstream): if data['i'] == '00000000': raise ParseError("Immediate can not be 0") return data
def extra_constraints(self, data, bitstream): if data['d'] != '00000': raise ParseError('Expected dst to be 0') if data['s'] != '00000': raise ParseError('Expected src1 to be 0') return data
def extra_constraints(self, data, bitstream): if data['d'] == '00000': raise ParseError('Expected destination to be non zero') if data['s'] == '00000': raise ParseError('Expected source to be non zero') return data
def extra_constraints(self, data, bitstream): if data['s'] != '00000': raise ParseError('Expected field src1 to be 0') if data['d'] == '00000': raise ParseError('Expected src2 to be non zero') return data
def match_instruction(self, data, bitstrm): # NOTE: The matching behavior for instructions is a "try-them-all-until-it-fits" approach. # Static bits are already checked, so we just look for the opcode. if data['o'] != self.opcode: raise ParseError("Invalid opcode, expected %s, got %s" % (self.opcode, data['o'])) return True