com.cmpware.cmp.models
Class LatticeMicro32

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.LatticeMicro32
All Implemented Interfaces:
ReadWriteInterface
Direct Known Subclasses:
LM32

public class LatticeMicro32
extends AutoModel

This is an AutoModel implementation of the LatticeMicro32 processor.

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

Author:
SAG

Nested Class Summary
(package private) static class LatticeMicro32.REG
          This class defines some Register indicies
(package private) static class LatticeMicro32.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
static java.lang.String copyright
          Copyright string
 
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
LatticeMicro32()
          The constructor
 
Method Summary
 void dasmFixup(long instrData, AutoModel.Instruction instr)
          This method can be overloaded to fix up any problems or to do any clean-up in the disassembler.
 int getPC()
          This method returns the current Program Counter.
static void main(java.lang.String[] args)
          This enables the stand-alone assembler and disassembler.
 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.
 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, decode, defineInstructions, execute, fetch, fetch, getInstruction, getInstructions, getInstructionSizes, getSymbolNames, instrMatch, main, 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
Constructor Detail

LatticeMicro32

public LatticeMicro32()
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 LatticeMicro32 -dasm or java LatticeMicro32 -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

setPC

public void setPC(int pc)
Description copied from class: Processor
This method sets the current Program Counter.

Overrides:
setPC in class AutoModel

getPC

public int getPC()
Description copied from class: Processor
This method returns the current Program Counter.

Overrides:
getPC in class AutoModel
Returns:
This method returns the current Program Counter.

dasmFixup

public void dasmFixup(long instrData,
                      AutoModel.Instruction instr)
Description copied from class: AutoModel
This method can be overloaded to fix up any problems or to do any clean-up in the disassembler. This method is called after the data from the instruction has been broken down into the fields in the instr object. Most of what is done here is to adjust the field.val values to take care of disjoint or shifted fields.

Overrides:
dasmFixup in class AutoModel
Parameters:
instrData - The instruction to be diassembled.
instr - The description of the instruction to be diassembled.