|
||||||||||
| 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.AutoModelVLIW
public abstract class AutoModelVLIW
WARNING: This class contains experimental software for architectures with instructrion words greater than 32 bits. Contact Cmpware, Inc. for more information on the proper use of this class.
Copyright (c) 2006 Cmpware, Inc. All Rights Reserved.
| Nested Class Summary | |
|---|---|
static class |
AutoModelVLIW.Decode
The Decode class describes a field / value pair used to decode an instruction. |
static class |
AutoModelVLIW.Field
This class defines an instruction field. |
static class |
AutoModelVLIW.Format
The format class describes an instruction format. |
static interface |
AutoModelVLIW.Function
This class defines the function of an operation. |
static class |
AutoModelVLIW.Instruction
The instruction class describes an instruction in the processor. |
static class |
AutoModelVLIW.Symbol
This class defines a symbol. |
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
| 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 | |
|---|---|
AutoModelVLIW()
|
|
| Method Summary | |
|---|---|
void |
asmFixup(java.lang.String[] tokens,
AutoModelVLIW.Field[] fields,
java.math.BigInteger[] values)
This method permits one last chance to manipulate the instruction word before the bits are written out to a file in AsmTool. |
static int |
bitsToBytes(int a)
This routine converts a bit count to a byte count, where the byte count is the minimum number of bytes to hold this many bits. |
java.lang.String |
dasm(java.math.BigInteger instrData,
AutoModelVLIW.Instruction instr)
This method disassembles an instruction. |
java.lang.String |
dasm(byte[] instr)
This method disassembles an instruction. |
int |
decode(int instr)
A unique code identifying the instruction is returned by this method. |
void |
execute(int instr)
This method is called after the fetch() and decode() and represents the execution phase of the instruction. |
void |
fetch()
This method fetches an instruction from memory and updates the currentInstr and prevInstr. |
byte[] |
getInstruction(int addr)
This method fetches an instruction from memory. |
static java.lang.String[] |
getInstructionNames(AutoModelVLIW.Instruction[] instructions)
This method takes in a instruction table and returns an array of strings. |
abstract AutoModelVLIW.Instruction[] |
getInstructions()
This method returns an array of Instruction objects, defining all of the instructions in the instruction set. |
int[] |
getInstructionSizes()
This method returns an array of integers containing the different instruction sizes in the model. |
int |
getPC()
This method returns the current Program Counter. |
static java.lang.String[] |
getSymbolNames(AutoModelVLIW.Symbol[] symbols)
This method takes in a symbol table and returns an array of strings. |
AutoModelVLIW.Instruction |
instrMatch(java.math.BigInteger instr,
int bits)
This method returns the instruction object from the instruction table associated with a given instruction. |
static void |
main(AutoModelVLIW am,
java.lang.String[] args)
This is the main program which is used to assemble / disassemble from the command line. |
void |
postExecute(int instr)
This method is called immediately after execution and may be overloaded to do things like save instruction field values to locals. |
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 |
setInstructions(AutoModelVLIW.Instruction[] instructions)
This method is used to pass the instruction data tables to the AutoModel. |
void |
setPC(int i)
This method sets the current Program Counter. |
static int |
signExtend(int a,
int bits)
This method is used to take a value 'a' of bit length 'bits' and sign extend it, making it a proper signed integer value. |
static java.lang.String |
toHexString(byte[] b)
This method converts a byte array to a hexaecimal string. |
static java.lang.String |
toHexString(byte[] b,
int offset,
int byteCount)
This method returns a string representation of a portion of a byte array in hexadecimal. |
| 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
| Constructor Detail |
|---|
public AutoModelVLIW()
| Method Detail |
|---|
public static void main(AutoModelVLIW am,
java.lang.String[] args)
args - The command line args. Should be a flag
("-asm" of "-dasm") followed by an input filename
and an output filename (three strings).public void setInstructions(AutoModelVLIW.Instruction[] instructions)
instructions - the instruction data tables.public abstract AutoModelVLIW.Instruction[] getInstructions()
public int decode(int instr)
throws IllegalOpcodeException
Processor
decode in class Processorinstr - The instruction to be decoded.
IllegalOpcodeException - if an illegal opcode
is encountered.
public void execute(int instr)
throws MemoryAccessException,
IllegalRegisterException,
IllegalOpcodeException
Processor
execute in class Processorinstr - The instruction to be executed.
MemoryAccessException - A Memory Access
Exception is thrown is an illegal memory
access is attempted.
IllegalRegisterException - if an attempt is made
to access a register illegally.
IllegalOpcodeException - is added for models
which may combine decode and execute in the
same method (such as AutoModel).public void setPC(int i)
Processor
setPC in class Processorpublic int getPC()
Processor
getPC in class Processorpublic java.lang.String dasm(byte[] instr)
Processor
dasm in class Processorinstr - The instruction to be disassembled.
public void fetch()
throws MemoryAccessException
Processor
fetch in class ProcessorMemoryAccessException
public byte[] getInstruction(int addr)
throws MemoryAccessException
Processor
getInstruction in class Processoraddr - The address at which to fetch the
instruction.
MemoryAccessException
public java.lang.String dasm(java.math.BigInteger instrData,
AutoModelVLIW.Instruction instr)
instrData - The instruction to be diassembled.instr - The description of the instruction to
be diassembled.
public void asmFixup(java.lang.String[] tokens,
AutoModelVLIW.Field[] fields,
java.math.BigInteger[] values)
tokens - The original string tokens from the instruction.fields - The fields associated with each token.values - The numeric values for each field.public void preExecute(int instr)
instr - The instructionpublic void postExecute(int instr)
instr - The instruction
public AutoModelVLIW.Instruction instrMatch(java.math.BigInteger instr,
int bits)
instr - the instruction data.bits - the number of bits in the instruction.
public int[] getInstructionSizes()
public static java.lang.String[] getSymbolNames(AutoModelVLIW.Symbol[] symbols)
symbols - An array of Symbols.
public static java.lang.String[] getInstructionNames(AutoModelVLIW.Instruction[] instructions)
instructions - An array of Instructions.
public static int signExtend(int a,
int bits)
a - The value to be sign extended.bits - the number of bits in the input value.
public static int bitsToBytes(int a)
a - The number of bits.
public static java.lang.String toHexString(byte[] b)
b - the byte array
public static java.lang.String toHexString(byte[] b,
int offset,
int byteCount)
b - The byte arrayoffset - The offset into the byte array of
the start of data.byteCount - The number of bytes to be returned as
a hexidecimal string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||