com.cmpware.cmp.models
Class Xtensa

java.lang.Object
  extended by com.cmpware.cmp.Memory
      extended by com.cmpware.cmp.Processor
          extended by com.cmpware.tools.AutoModel
              extended by com.cmpware.cmp.models.Xtensa
All Implemented Interfaces:
ReadWriteInterface
Direct Known Subclasses:
XtensaEX

public class Xtensa
extends AutoModel

This is an AutoModel implementation of the Tensilica Xtensa processor.

Copyright (c) 2006 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Nested Class Summary
(package private) static class Xtensa.SREG
          This class defines the Special Register indicies
 
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 AutoModel.Format all24
           
protected  int ar
          The value in the 'r' register
protected  int as
          The value in the 's' register
protected  int at
          The value in the 'r' register
static java.lang.String copyright
          Copyright string
protected static AutoModel.Format extui
           
protected static AutoModel.Field f_all24
           
protected static AutoModel.Field f_b
           
protected static AutoModel.Field f_b16_17
           
protected static AutoModel.Field f_b16_18
           
protected static AutoModel.Field f_b18_19
           
protected static AutoModel.Field f_b19
           
protected static AutoModel.Field f_b8
           
protected static AutoModel.Field f_b8_9
           
protected static AutoModel.Field f_bHi
           
protected static AutoModel.Field f_imm12
           
protected static AutoModel.Field f_imm12Hi
           
protected static AutoModel.Field f_imm16
           
protected static AutoModel.Field f_imm8
           
protected static AutoModel.Field f_mask
           
protected static AutoModel.Field f_nall16
           
protected static AutoModel.Field f_nimm6Hi
           
protected static AutoModel.Field f_nop0
           
protected static AutoModel.Field f_nr
           
protected static AutoModel.Field f_nrimm
           
protected static AutoModel.Field f_nrop
           
protected static AutoModel.Field f_ns
           
protected static AutoModel.Field f_nt
           
protected static AutoModel.Field f_ntimm
           
protected static AutoModel.Field f_ntimm7Hi
           
protected static AutoModel.Field f_offset
           
protected static AutoModel.Field f_op0
           
protected static AutoModel.Field f_op1
           
protected static AutoModel.Field f_op1Hi
           
protected static AutoModel.Field f_op2
           
protected static AutoModel.Field f_op2Hi
           
protected static AutoModel.Field f_r
           
protected static AutoModel.Field f_rimm
           
protected static AutoModel.Field f_rop
           
protected static AutoModel.Field f_ropHi
           
protected static AutoModel.Field f_s
           
protected static AutoModel.Field f_sHi
           
protected static AutoModel.Field f_simm
           
protected static AutoModel.Field f_simm4
           
protected static AutoModel.Field f_simm5Hi
           
protected static AutoModel.Field f_sop
           
protected static AutoModel.Field f_sr
           
protected static AutoModel.Field f_t
           
protected static AutoModel.Field f_timm
           
protected static AutoModel.Field f_timm5Hi
           
protected static AutoModel.Field f_top
           
protected static AutoModel.Format i18
           
protected  int imm8
          The zero-extended 8-bit immediate data
protected static AutoModel.Format nrsi4
           
protected static AutoModel.Format nrst
           
protected static AutoModel.Format nsi6
           
protected static AutoModel.Format nsi7
           
protected static AutoModel.Format nts
           
protected static AutoModel.Format ntsi4
           
protected static AutoModel.Format rs
           
protected static AutoModel.Format rsi5
           
protected static AutoModel.Format rst
           
protected static AutoModel.Format rt
           
protected static AutoModel.Format rti5
           
protected static AutoModel.Format rtsi4
           
protected static AutoModel.Format s
           
protected static AutoModel.Format sbi8
           
protected static AutoModel.Format si12
           
protected static AutoModel.Format si5
           
protected static AutoModel.Format sri4i8
           
protected static AutoModel.Format sti8
           
protected static AutoModel.Format ti12
           
protected static AutoModel.Format ti16
           
protected static AutoModel.Format ts
           
protected static AutoModel.Format tsi8
           
protected static AutoModel.Format tsr
           
 
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
Xtensa()
          The constructor
 
Method Summary
protected static AutoModel.Decode all24(int _all24)
          This is just a simple helper function used in decoding instructions.
static void main(java.lang.String[] args)
          This enables the stand-alone assembler and disassembler.
protected static AutoModel.Decode nall16(int _all16)
          This is just a simple helper function used in decoding 'narrow' instructions.
protected static AutoModel.Decode nop(int _nop0)
          This is just a simple helper function used in decoding 'narrow' instructions.
protected static AutoModel.Decode op(int _op0)
          This is just a simple helper function used in decoding instructions.
protected static AutoModel.Decode op(int _op0, int _op1)
          This is just a simple helper function used in decoding instructions.
protected static AutoModel.Decode op(int _op0, int _op1, int _op2)
          This is just a simple helper function used in decoding instructions.
 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 reset()
          This method resets the processor.
 
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, setPC, signExtend, signExtend, toHexString, toHexString, toLong, traceOff, traceOn
 
Methods inherited from class com.cmpware.cmp.Processor
branch, branchNoDelay, defineBranchDelay, defineBreakpoint, defineInstructionSize, defineName, defineNoop, defineOpcodeNames, defineRegisterNames, defineRegisters, defineSpecialRegisterNames, defineSpecialRegisters, get, getBreakpoint, getBreakpointData, getBreakpoints, getCycleCount, getDebugRegisters, getElf, getIdlePower, getInstructionMix, getInstructionSize, getName, getNoop, getOpcodeNames, getRegister, getRegisterNames, getRegisters, getRunningPower, getSpecialRegister, getSpecialRegisterNames, getSpecialRegisters, getStallCount, isBreakpoint, isStalled, load, postLoad, removeAllBreakpoints, removeBreakpoint, setBreakpoint, setIdlePower, setRegister, setRunningPower, setSpecialRegister, stall, statistics, step
 
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

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

at

protected int at
The value in the 'r' register


as

protected int as
The value in the 's' register


ar

protected int ar
The value in the 'r' register


imm8

protected int imm8
The zero-extended 8-bit immediate data


f_op0

protected static final AutoModel.Field f_op0

f_t

protected static final AutoModel.Field f_t

f_top

protected static final AutoModel.Field f_top

f_timm

protected static final AutoModel.Field f_timm

f_timm5Hi

protected static final AutoModel.Field f_timm5Hi

f_simm5Hi

protected static final AutoModel.Field f_simm5Hi

f_s

protected static final AutoModel.Field f_s

f_sop

protected static final AutoModel.Field f_sop

f_simm

protected static final AutoModel.Field f_simm

f_imm12Hi

protected static final AutoModel.Field f_imm12Hi

f_r

protected static final AutoModel.Field f_r

f_rimm

protected static final AutoModel.Field f_rimm

f_rop

protected static final AutoModel.Field f_rop

f_op1

protected static final AutoModel.Field f_op1

f_op2

protected static final AutoModel.Field f_op2

f_op2Hi

protected static final AutoModel.Field f_op2Hi

f_imm8

protected static final AutoModel.Field f_imm8

f_imm12

protected static final AutoModel.Field f_imm12

f_imm16

protected static final AutoModel.Field f_imm16

f_sr

protected static final AutoModel.Field f_sr

f_b

protected static final AutoModel.Field f_b

f_bHi

protected static final AutoModel.Field f_bHi

f_ropHi

protected static final AutoModel.Field f_ropHi

f_offset

protected static final AutoModel.Field f_offset

f_b18_19

protected static final AutoModel.Field f_b18_19

f_b16_17

protected static final AutoModel.Field f_b16_17

f_mask

protected static final AutoModel.Field f_mask

f_simm4

protected static final AutoModel.Field f_simm4

f_sHi

protected static final AutoModel.Field f_sHi

f_op1Hi

protected static final AutoModel.Field f_op1Hi

f_b19

protected static final AutoModel.Field f_b19

f_b16_18

protected static final AutoModel.Field f_b16_18

f_all24

protected static final AutoModel.Field f_all24

f_nop0

protected static final AutoModel.Field f_nop0

f_nr

protected static final AutoModel.Field f_nr

f_nrop

protected static final AutoModel.Field f_nrop

f_nrimm

protected static final AutoModel.Field f_nrimm

f_ns

protected static final AutoModel.Field f_ns

f_nt

protected static final AutoModel.Field f_nt

f_ntimm7Hi

protected static final AutoModel.Field f_ntimm7Hi

f_ntimm

protected static final AutoModel.Field f_ntimm

f_b8_9

protected static final AutoModel.Field f_b8_9

f_b8

protected static final AutoModel.Field f_b8

f_nimm6Hi

protected static final AutoModel.Field f_nimm6Hi

f_nall16

protected static final AutoModel.Field f_nall16

rt

protected static final AutoModel.Format rt

rst

protected static final AutoModel.Format rst

ts

protected static final AutoModel.Format ts

rs

protected static final AutoModel.Format rs

tsi8

protected static final AutoModel.Format tsi8

sbi8

protected static final AutoModel.Format sbi8

sti8

protected static final AutoModel.Format sti8

sri4i8

protected static final AutoModel.Format sri4i8

si12

protected static final AutoModel.Format si12

i18

protected static final AutoModel.Format i18

extui

protected static final AutoModel.Format extui

s

protected static final AutoModel.Format s

all24

protected static final AutoModel.Format all24

ti16

protected static final AutoModel.Format ti16

ti12

protected static final AutoModel.Format ti12

tsr

protected static final AutoModel.Format tsr

rsi5

protected static final AutoModel.Format rsi5

rti5

protected static final AutoModel.Format rti5

rtsi4

protected static final AutoModel.Format rtsi4

si5

protected static final AutoModel.Format si5

nrst

protected static final AutoModel.Format nrst

nrsi4

protected static final AutoModel.Format nrsi4

ntsi4

protected static final AutoModel.Format ntsi4

nsi6

protected static final AutoModel.Format nsi6

nts

protected static final AutoModel.Format nts

nsi7

protected static final AutoModel.Format nsi7
Constructor Detail

Xtensa

public Xtensa()
The constructor

Method Detail

main

public static void main(java.lang.String[] args)
This enables the stand-alone assembler and disassembler. The command line should be either: java Xtensa -dasm or java Xtensa -asm

Parameters:
args - the command line arguments.

reset

public void reset()
This method resets the processor. Note that super.reset() must me called to completely intialize the processor.

Overrides:
reset in class Processor

preExecute

public void preExecute(int instr)
Description copied from class: AutoModel
This method is called immediately before execution and may be overloaded to do things like save instruction field values to locals.

Overrides:
preExecute in class AutoModel
Parameters:
instr - The instruction

postExecute

public void postExecute(int instr)
Description copied from class: AutoModel
This method is called immediately after execution and may be overloaded to do things like save instruction field values to locals.

Overrides:
postExecute in class AutoModel
Parameters:
instr - The instruction

op

protected static AutoModel.Decode op(int _op0)
This is just a simple helper function used in decoding instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_op0 - The op0 opcode.
Returns:
This method returns a decoder for a one opcode instruction.

op

protected static AutoModel.Decode op(int _op0,
                                     int _op1)
This is just a simple helper function used in decoding instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_op0 - The op0 opcode.
_op1 - The op1 opcode.
Returns:
This method returns a decoder for a two opcode instruction.

op

protected static AutoModel.Decode op(int _op0,
                                     int _op1,
                                     int _op2)
This is just a simple helper function used in decoding instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_op0 - The op0 opcode.
_op1 - The op1 opcode.
_op2 - The op2 opcode.
Returns:
This method returns a decoder for a three opcode instruction.

all24

protected static AutoModel.Decode all24(int _all24)
This is just a simple helper function used in decoding instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_all24 - The 24 bit opcode.
Returns:
This method returns a decoder for a 24-bit instruction.

nop

protected static AutoModel.Decode nop(int _nop0)
This is just a simple helper function used in decoding 'narrow' instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_nop0 - The narrow op0 opcode.
Returns:
This method returns a decoder for a one opcode 'narrow' instruction.

nall16

protected static AutoModel.Decode nall16(int _all16)
This is just a simple helper function used in decoding 'narrow' instructions. It mostly just makes the Instruction table easier to read.

Parameters:
_all16 - The 16 bit opcode.
Returns:
This method returns a decoder for a 'narrow' 16-bit instruction.