|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.cmp.Memory
com.cmpware.cmp.Processor
com.cmpware.tools.AutoModel
com.cmpware.cmp.models.PowerPC
public class PowerPC
This is an AutoModel implementation of the PowerPC processor. It implements all of the standard PowerPC Instruction Set Architecture. In particular, no extensions such as floating point, embedded or the non-portable extensions are implemented in this version, although they can be added fairly easily to this model. The large number of special registers and the unusual addressing are perhaps the biggest complication in the PowerPC model. Only the registers actually used in the implemented instructions are implemented, all others are ignored. This information is taken from the IBM document "PPC405Fx Embedded Processor Core: User's Manual (Preliminary)", IBM Document Number SA14-2764-00, January 28, 2005. Implementation notes: The document specifies Big Endian, but uses bit 0 as the MSB. Field numbers in this model will be (31-n) compared to the IBM document. BCA and BCL decodes swapped. Fixed 4/23/2008 Added missing MULHWU instruction 4/23/2008 AND instruction decoding incorrectly. Fixed 4/23/2008 AND, ANDC, ANDI, ANDIS and NAND implemented incorrectly. Fixed 4/24/2008. Added proper disassembly for ANDI, ANDIS, ORI, ORIS, XORI, XORIC. Fixed 4/24/2008. Added proper disassembly for AND, ANDC, NAND, NOR, OR, ORC, XOR. Fixed 4/24/2008. Fixed MFSPR and MTSPR instructions. Fixed 4/24/2008.
Copyright (c) 2006 Cmpware, Inc. All Rights Reserved.
| Nested Class Summary | |
|---|---|
static class |
PowerPC.CR0
This class defines the fields in the CR Special Register |
static class |
PowerPC.MSR
This class defines the fields in the MSR Special Register |
static class |
PowerPC.SR
This class defines the Special Register indicies |
static class |
PowerPC.XER
This class defines the fields in the XER Special Register |
| Nested classes/interfaces inherited from class com.cmpware.tools.AutoModel |
|---|
AutoModel.Asm, AutoModel.Decode, AutoModel.Field, AutoModel.Format, AutoModel.Function, AutoModel.Instruction, AutoModel.Symbol |
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
static PowerPC_fp |
fp
The floating point instructions |
static AutoModel.Symbol[] |
regSymbols
The General Purpose Register Symbols |
(package private) boolean |
reserve
The reserve semaphore for lwarx / stwcx instructions |
static AutoModel.Symbol[] |
sregSymbols
The Special Purpose Register Symbols |
| Fields inherited from class com.cmpware.tools.AutoModel |
|---|
currentInstr, currentInstrType, instructionSizes, TRACE |
| Fields inherited from class com.cmpware.cmp.Processor |
|---|
bkpt, branchAddr, branchDelay, breakpointHit, currentBranchDelay, currentInstrCode, cycleCount, elf, idlePower, iMix, instructionSize, name, noop, opcodeName, pc, prevInstr, prevInstrCode, r, regName, runningPower, sr, sregName, stall, stallCount |
| Fields inherited from class com.cmpware.cmp.Memory |
|---|
BIG, LITTLE |
| Constructor Summary | |
|---|---|
PowerPC()
The constructor |
|
| Method Summary | |
|---|---|
static int |
addCarry(int result,
int src1,
int src2)
This method is used to determine if an add carry has occurred. |
static int |
addOverflow(int result,
int src1,
int src2)
This method is used to determine if an add overflow has occurred. |
int[] |
getRegisters()
This method returns the current values of all of the general purpose registers. |
static void |
main(java.lang.String[] args)
This enables the stand-alone assembler and disassembler. |
void |
preExecute(int instr)
This method is called immediately before execution and may be overloaded to do things like save instruction field values to locals. |
void |
reset()
This method resets the processor. |
static int |
rotateLeft(int a,
int r)
This method rotates the value a left by r. |
static int |
sign(int a)
This method returns the sign bit for 32 bit value. |
static int |
subCarry(int result,
int src1,
int src2)
This method is used to determine if a sub carry has occurred. |
static int |
subOverflow(int result,
int src1,
int src2)
This method is used to determine if a sub overflow has occurred. |
| Methods inherited from class com.cmpware.tools.AutoModel |
|---|
advancePC, asmFixup, bitsToBytes, concatenate, dasm, dasm, dasmFixup, decode, defineInstructions, execute, fetch, fetch, getInstruction, getInstructions, getInstructionSizes, getPC, getSymbolNames, instrMatch, main, postExecute, setPC, signExtend, signExtend, toHexString, toHexString, toLong, traceOff, traceOn |
| Methods inherited from class com.cmpware.cmp.Memory |
|---|
addInput, addMemory, addOutput, getEndian, getLocalMemory, getMemoryManager, getMmio, getProfile, hexDump, hexDump, isReadable, isValidAddress, isWriteable, profile, read, read, read16, read24, read32, read64, removeMemory, resize, setEndian, size, toInt, toShort, write, write, write16, write24, write32, write64 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String copyright
public static final PowerPC_fp fp
boolean reserve
public static final AutoModel.Symbol[] regSymbols
public static final AutoModel.Symbol[] sregSymbols
| Constructor Detail |
|---|
public PowerPC()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - the command line arguments.public void reset()
reset in class Processorpublic int[] getRegisters()
Processor
getRegisters in class Processorpublic void preExecute(int instr)
AutoModel
preExecute in class AutoModelinstr - The instruction
public static int addOverflow(int result,
int src1,
int src2)
result - The result of the operation on
the src1 and src2 parameters.src1 - The first source operand.src2 - The second source operand.
public static int subOverflow(int result,
int src1,
int src2)
result - The result of the operation on
the src1 and src2 parameters.src1 - The first source operand.src2 - The second source operand.
public static int addCarry(int result,
int src1,
int src2)
result - The result of the operation on
the src1 and src2 parameters.src1 - The first source operand.src2 - The second source operand.
public static int subCarry(int result,
int src1,
int src2)
result - The result of the operation on
the src1 and src2 parameters.src1 - The first source operand.src2 - The second source operand.
public static int sign(int a)
a - The 32 bit value.
public static int rotateLeft(int a,
int r)
a - the value to be rotated left.r - The number of bits to left rotate.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||