com.cmpware.cmp.models
Class MicroBlaze

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.MicroBlaze
All Implemented Interfaces:
ReadWriteInterface

public class MicroBlaze
extends AutoModel

This implements the Xilinx Microblaze according to the specification: "MicroBlaze Processor Reference Guide", Embedded Development Kit EDK 9.1.i (UG081 9/15/2006)

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

Author:
SAG

Nested Class Summary
 
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  int a
          The local value of the 'a' register index
protected  int b
          The local value of the 'b' register index
static int BE
           
static int BIP
           
static int BTR
           
static int C
           
static java.lang.String copyright
          Copyright string
protected  int d
          The local value of the 'd' register index
static int DCE
           
static int DZ
           
static int EAR
           
static int EE
           
static int EIP
           
static int ESR
           
static int FSL
           
protected  int[] fslIn
          The FSL memory mapped address inputs
protected  int[] fslOut
          The FSL memory mapped address outputs
static int ICE
           
static int IE
           
protected  boolean immFlag
          A flag to indicate that the IMM instruction was just executed
protected  int immTmp
          A temporary value to hold IMM until the next cycle
protected  AutoModel.Instruction[] instructions
           
static int MSR
           
static int PC
           
protected  int simm32
          The 32-bit sign extended imm16 field
 
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
MicroBlaze()
          The constructor
 
Method Summary
static void main(java.lang.String[] args)
          This enables the stand-alone assembler and disassembler.
protected static AutoModel.Decode op(int a)
          This is just a simple helper function used in decoding basic TypeB instructions.
protected static AutoModel.Decode op(int a, int b)
          This is just a simple helper function used in decoding basic Type A instructions.
protected static AutoModel.Decode opGet(int a, int b)
          This is just a simple helper function used in decoding get instructions.
protected static AutoModel.Decode opPut(int a, int b)
          This is just a simple helper function used in decoding put 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.
 void setFslIn(int i, int mmioAddr)
          This method is used to set the FSL inputs.
 void setFslOut(int i, int mmioAddr)
          This method is used to set the FSL outputs.
 
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

PC

public static final int PC
See Also:
Constant Field Values

MSR

public static final int MSR
See Also:
Constant Field Values

EAR

public static final int EAR
See Also:
Constant Field Values

ESR

public static final int ESR
See Also:
Constant Field Values

BTR

public static final int BTR
See Also:
Constant Field Values

BE

public static final int BE
See Also:
Constant Field Values

IE

public static final int IE
See Also:
Constant Field Values

C

public static final int C
See Also:
Constant Field Values

BIP

public static final int BIP
See Also:
Constant Field Values

FSL

public static final int FSL
See Also:
Constant Field Values

ICE

public static final int ICE
See Also:
Constant Field Values

DZ

public static final int DZ
See Also:
Constant Field Values

DCE

public static final int DCE
See Also:
Constant Field Values

EE

public static final int EE
See Also:
Constant Field Values

EIP

public static final int EIP
See Also:
Constant Field Values

a

protected int a
The local value of the 'a' register index


b

protected int b
The local value of the 'b' register index


d

protected int d
The local value of the 'd' register index


simm32

protected int simm32
The 32-bit sign extended imm16 field


immTmp

protected int immTmp
A temporary value to hold IMM until the next cycle


immFlag

protected boolean immFlag
A flag to indicate that the IMM instruction was just executed


fslIn

protected int[] fslIn
The FSL memory mapped address inputs


fslOut

protected int[] fslOut
The FSL memory mapped address outputs


instructions

protected final AutoModel.Instruction[] instructions
Constructor Detail

MicroBlaze

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

Parameters:
args - the command line arguments.

reset

public void reset()
This method resets the processor. Note that super.reset() must be 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

setFslIn

public void setFslIn(int i,
                     int mmioAddr)
This method is used to set the FSL inputs.

Parameters:
i - The FSL input number (0 - 7)
mmioAddr - the Memory Mapped IO address.

setFslOut

public void setFslOut(int i,
                      int mmioAddr)
This method is used to set the FSL outputs.

Parameters:
i - The FSL output number (0 - 7)
mmioAddr - the Memory Mapped IO address.

op

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

Parameters:
a - The code for the opcode field.
Returns:
This method returns a decode array for an instruction.

op

protected static AutoModel.Decode op(int a,
                                     int b)
This is just a simple helper function used in decoding basic Type A instructions. It mostly just makes the Instructiontable easier to read.

Parameters:
a - The code for the primary opcode field.
b - The code for the secondary opcode field.
Returns:
This method returns a decode array for an instruction.

opGet

protected static AutoModel.Decode opGet(int a,
                                        int b)
This is just a simple helper function used in decoding get instructions. It mostly just makes the Instructiontable easier to read.

Parameters:
a - The code for the Ra opcode field.
b - The code for the secondary opcode field.
Returns:
This method returns a decode array for an instruction.

opPut

protected static AutoModel.Decode opPut(int a,
                                        int b)
This is just a simple helper function used in decoding put instructions. It mostly just makes the Instructiontable easier to read.

Parameters:
a - The code for the Rd opcode field.
b - The code for the secondary opcode field.
Returns:
This method returns a decode array for an instruction.