Esempio n. 1
0
    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
Esempio n. 2
0
 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')
Esempio n. 3
0
 def extra_constraints(self, data, bitstream):
     if data['s'] != '00010':
         raise ParseError("Destination must be 2 for this instruction")
     return data
Esempio n. 4
0
 def extra_constraints(self, data, bitstream):
     if (data['i'] != self.func7):
         raise ParseError("The func7 did not match")
     return data
Esempio n. 5
0
 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")
Esempio n. 6
0
 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
Esempio n. 7
0
 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")
Esempio n. 8
0
 def extra_constraints(self, data, bitstream):
     if data['i'] == '00000000':
         raise ParseError("Immediate can not be 0")
     return data
Esempio n. 9
0
 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
Esempio n. 10
0
 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
Esempio n. 11
0
 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
Esempio n. 12
0
 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