|
||||||||||
| 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.SPU
public class SPU
This is an AutoModel implementation of the Synergistic Processing Unit (SPU) used by the Cell broadband Engine. The information used to creat this model was taken from the IBM document: "The Synergistic Processing Unit Instruction Set Architecture", Version 1.1 (January 30, 2005).
Copyright (c) 2007 Cmpware, Inc. All Rights Reserved.
| Nested Class Summary | |
|---|---|
static class |
SPU.ADDR_OFFSET
The Channel memory map address offsets |
static class |
SPU.CHANNEL
The Channel port numbers |
| 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 | |
|---|---|
protected static byte[] |
BREAKPOINT_INSTRUCTION
The Breakpoint code |
protected static int |
BYTES_PER_REG
The number of bytes per register |
protected int[] |
channelAlias
The channel alias address |
protected static int[] |
computeMask
The compute mask |
static java.lang.String |
copyright
Copyright string |
protected boolean |
externalEvent
The Exernal Event flag |
protected boolean |
halt
The Halt flag |
protected int |
imm10
The 10-bit immediate data |
protected int |
imm26
The 26-bit immediate data |
protected static byte[] |
NOOP_INSTRUCTION
The NOOP instruction |
protected int |
ra
The value in the 'ra' register |
protected int |
rb
The value in the 'rb' register |
protected int |
rc
The value in the 'rc' register |
protected java.nio.ByteBuffer |
regBb
The Byte Buffer wrapper of the register data |
protected byte[] |
regData
The register data as a byte array |
protected static int |
REGS
The number of registers |
protected int[] |
regShadow
The register shadow (to return to the IDE) |
protected int |
rt
The value in the 'rt' register |
protected int |
rt2
The value in the 'rt' register for RRR instructions |
| 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 | |
|---|---|
SPU()
The constructor |
|
| Method Summary | |
|---|---|
protected java.lang.String |
channelName(int c)
This method returns the string associated with a channel. |
protected int |
clz(byte b)
This method returns the number of leading zeros in a byte. |
protected int |
clz(int a)
This method returns the number of leading zeros in a 32 bit integer. |
int[] |
getDebugRegisters()
This method returns the current values of all of the general purpose registers as they are used by a debugger. |
int |
getPC()
This method returns the current Program Counter. |
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. |
protected int |
ones(byte b)
This method returns the number of '1' bits in a byte. |
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. |
protected byte |
rByte(int reg,
int i)
This method returns a byte from the register file. |
protected int |
rByteu(int reg,
int i)
This method returns a byte from the register file represented as an unsigned in 32 bit integer format. |
protected double |
rDouble(int reg,
int i)
This method returns a double from the register file. |
void |
reset()
This method resets the processor. |
protected float |
rFloat(int reg,
int i)
This method returns a float from the register file. |
protected short |
rHalf(int reg,
int i)
This method returns a half word from the register file. |
protected int |
rHalfu(int reg,
int i)
This method returns a half word from the register file represented as an unsigned in 32 bit integer format. |
protected int |
rInt(int reg,
int i)
This method returns an integer from the register file. |
protected long |
rIntu(int reg,
int i)
This method returns a half word from the register file represented as an unsigned in 64 bit long integer format. |
protected long |
rLong(int reg,
int i)
This method returns a long word from the register file. |
protected int |
rotate(int a,
int i)
This method left rotates an integer. |
protected short |
rotate(short a,
int i)
This method left rotates a half integer. |
protected void |
setByte(int reg,
int i,
byte a)
This method sets a byte in the register file. |
void |
setChannelAlias(int c,
int addr)
This method is used to keep a list of the channel alias addresses. |
protected void |
setDouble(int reg,
int i,
double a)
This method sets a double int the register file. |
protected void |
setFloat(int reg,
int i,
float a)
This method sets a float int the register file. |
protected void |
setHalf(int reg,
int i,
short a)
This method sets a half word in the register file. |
protected void |
setInt(int reg,
int i,
int a)
This method sets an integer in the register file. |
protected void |
setLong(int reg,
int i,
long a)
This method sets a long in the register file. |
void |
setPC(int pc)
This method sets the current Program Counter. |
| Methods inherited from class com.cmpware.tools.AutoModel |
|---|
advancePC, asmFixup, bitsToBytes, concatenate, dasm, dasm, dasmFixup, decode, defineInstructions, execute, fetch, fetch, getInstruction, getInstructions, getInstructionSizes, getSymbolNames, instrMatch, main, postExecute, 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
protected static final int BYTES_PER_REG
protected static final int REGS
protected byte[] regData
protected java.nio.ByteBuffer regBb
protected int[] regShadow
protected int ra
protected int rb
protected int rc
protected int rt
protected int rt2
protected int imm10
protected int imm26
protected boolean halt
protected boolean externalEvent
protected static final int[] computeMask
protected static final byte[] NOOP_INSTRUCTION
protected static final byte[] BREAKPOINT_INSTRUCTION
protected int[] channelAlias
| Constructor Detail |
|---|
public SPU()
| 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 int[] getDebugRegisters()
Processor
getDebugRegisters in class Processorpublic void preExecute(int instr)
AutoModel
preExecute in class AutoModelinstr - The instructionpublic void setPC(int pc)
Processor
setPC in class AutoModelpublic int getPC()
Processor
getPC in class AutoModel
protected byte rByte(int reg,
int i)
reg - the index of the 128-bit registeri - the byte index (should be 0 - 15)
protected int rByteu(int reg,
int i)
reg - the index of the 128-bit registeri - the byte index (should be 0 - 15)
protected short rHalf(int reg,
int i)
reg - the index of the 128-bit registeri - the half word index (should be 0 - 7)
protected int rHalfu(int reg,
int i)
reg - the index of the 128-bit registeri - the half word index (should be 0 - 7)
protected int rInt(int reg,
int i)
reg - the index of the 128-bit registeri - the integer word index (should be 0 - 3)
protected long rLong(int reg,
int i)
reg - the index of the 128-bit registeri - the long word index (should be 0 - 1)
protected long rIntu(int reg,
int i)
reg - the index of the 128-bit registeri - the half word index (should be 0 - 7)
protected float rFloat(int reg,
int i)
reg - the index of the 128-bit registeri - the float index (should be 0 - 3)
protected double rDouble(int reg,
int i)
reg - the index of the 128-bit registeri - the double index (should be 0 - 1)
protected void setByte(int reg,
int i,
byte a)
reg - the index of the 128-bit registeri - the byte index (should be 0 - 15)a - the byte value.
protected void setHalf(int reg,
int i,
short a)
reg - the index of the 128-bit registeri - the half word index (should be 0 - 7)a - the half word value.
protected void setInt(int reg,
int i,
int a)
reg - the index of the 128-bit registeri - the integer index (should be 0 - 3)a - the integer value.
protected void setLong(int reg,
int i,
long a)
reg - the index of the 128-bit registeri - the long index (should be 0 - 1)a - the long value.
protected void setFloat(int reg,
int i,
float a)
reg - the index of the 128-bit registeri - the float index (should be 0 - 4)a - the float value.
protected void setDouble(int reg,
int i,
double a)
reg - the index of the 128-bit registeri - the double index (should be 0 - 4)a - the double value.protected int clz(byte b)
b - the byte value.
protected int clz(int a)
a - the integer value.
protected int ones(byte b)
b - the byte value.
protected short rotate(short a,
int i)
a - the half value to be left rotated.i - the amount to be left rotated.
protected int rotate(int a,
int i)
a - the integer value to be left rotated.i - the amount to be left rotated.
public void setChannelAlias(int c,
int addr)
c - the channel numberaddr - the address alias of the channel.protected java.lang.String channelName(int c)
c - the channel number.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||