Changeset 108945 in vbox
- Timestamp:
- Apr 11, 2025 9:18:48 AM (9 days ago)
- svn:sync-xref-src-repo-rev:
- 168456
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/target-armv8/bsd-spec-analyze.py
r108942 r108945 1213 1213 1214 1214 1215 def parseInstructions(o Parent, aoJson, ddAsmRules):1215 def parseInstructions(oInstrSet, oParent, aoJson, ddAsmRules): 1216 1216 for oJson in aoJson: 1217 1217 sType = oJson['_type']; 1218 1218 if sType == 'Instruction.InstructionSet': 1219 1219 if oParent: raise Exception("InstructionSet shouldn't have a parent!"); 1220 assert not oInstrSet; 1220 1221 oInstrSet = ArmInstructionSet.fromJson(oJson); 1221 1222 assert oInstrSet.sName not in g_dArmInstructionSets; … … 1223 1224 g_aoArmInstructionSets.append(oInstrSet); 1224 1225 1225 parseInstructions(oInstrSet, o Json['children'], ddAsmRules);1226 parseInstructions(oInstrSet, oInstrSet, oJson['children'], ddAsmRules); 1226 1227 1227 1228 elif sType == 'Instruction.InstructionGroup': … … 1240 1241 oParent.aoGroups.append(oInstrGroup); 1241 1242 1242 parseInstructions(oInstr Group, oJson['children'], ddAsmRules);1243 parseInstructions(oInstrSet, oInstrGroup, oJson['children'], ddAsmRules); 1243 1244 1244 1245 elif sType == "Instruction.Instruction": … … 1250 1251 sInstrNm = oJson['name']; 1251 1252 1253 oCondition = ArmAstBase.fromJson(oJson['condition']); 1254 1252 1255 (aoFields, fFields) = ArmEncodesetField.encodesetFromJson(oJson['encoding']); 1253 oCondition = ArmAstBase.fromJson(oJson['condition']);1254 1255 1256 for oUp in oParent.getUpIterator(): 1256 1257 if oUp.fFields & ~fFields: … … 1258 1259 if not oUp.oCondition.isBoolAndTrue(): 1259 1260 oCondition = ArmAstBinaryOp(oCondition, '&&', oUp.oCondition.clone()); 1261 if fFields != (1 << oInstrSet.cBitsWidth) - 1: 1262 raise Exception('Instruction %s has an incomplete encodingset: fFields=%#010x (missing %#010x)' 1263 % (sInstrNm, fFields, fFields ^ ((1 << oInstrSet.cBitsWidth) - 1),)) 1260 1264 1261 1265 #sCondBefore = oCondition.toString(); 1262 1266 #print('debug transfer: %s: org: %s' % (sInstrNm, sCondBefore)); 1263 ## @todo fFields isn't updated here!1264 1267 (oCondition, fMod) = transferConditionsToEncoding(oCondition, aoFields, collections.defaultdict(list), sInstrNm); 1265 1268 #if fMod: … … 1482 1485 global g_oArmInstructionVerInfo; 1483 1486 g_oArmInstructionVerInfo = dRawInstructions['_meta']['version']; 1484 parseInstructions( [], dRawInstructions['instructions'], dRawInstructions['assembly_rules']);1487 parseInstructions(None, None, dRawInstructions['instructions'], dRawInstructions['assembly_rules']); 1485 1488 1486 1489 # Sort the instruction array by name. … … 2242 2245 return (sName, oField.cBitsWidth); 2243 2246 # Look for the field in groups and sets and generate a name that extracts it from uOpcode: 2244 ## @todo eliminate conditions checks from the parent on parent fields that are fixed in the given instr.2245 2247 for oParent in oInstr.oParent.getUpIterator(): 2246 2248 oField = oParent.getFieldByName(sName, False); 2247 2249 if oField: 2250 fFieldOpMask = oField.getShiftedMask(); 2251 if (oInstr.fFixedMask & fFieldOpMask) == fFieldOpMask: 2252 return ('%#x /*%s@%u*/' 2253 % ((oInstr.fFixedValue & fFieldOpMask) >> oField.iFirstBit, sName, oField.iFirstBit), 2254 oField.cBitsWidth); 2248 2255 return ('((uOpcode >> %u) & %#x)' % (oField.iFirstBit, oField.getMask()), oField.cBitsWidth); 2249 2256 raise Exception('Field %s was not found for instruction %s' % (sName, oInstr.sName,)); … … 2259 2266 sCpumFeature = g_dSpecFeatToCpumFeat.get(sFeatureNm, None); 2260 2267 if sCpumFeature is None: 2261 print('warning: IsFeatureImplemented parameter not known: %s (see g_dSpecFeatToCpumFeat)' % (sFeatureNm)); 2262 #raise Exception('IsFeatureImplemented parameter not known: %s (see g_dSpecFeatToCpumFeat)' 2263 # % (sFeatureNm)); 2268 raise Exception('Unknown IsFeatureImplemented parameter: %s (see g_dSpecFeatToCpumFeat)' % (sFeatureNm)); 2264 2269 if not isinstance(sCpumFeature, str): 2265 2270 return 'false /** @todo IEM_GET_GUEST_CPU_FEATURES(pVCpu)->%s*/' % (sFeatureNm,); … … 2326 2331 '%s LogFlow(("%%010x: %s%s\\n",%s));' % (sIndent, sCName, sLogFmt, ', '.join(['uOpcode',] + asArgs),), 2327 2332 '#ifdef IEM_INSTR_IMPL_%s__%s' % (sInstrSet, sCName,), 2328 '%s IEM_INSTR_IMPL_%s__%s(%s);' % (sIn strSet, sIndent, sCName, ', '.join(asArgs),),2333 '%s IEM_INSTR_IMPL_%s__%s(%s);' % (sIndent, sInstrSet, sCName, ', '.join(asArgs),), 2329 2334 '#else', 2330 2335 '%s RT_NOREF(%s);' % (sIndent, ', '.join(asArgs + ['pVCpu', 'uOpcode',]),),
Note:
See TracChangeset
for help on using the changeset viewer.