avrora.sim
Class FIFInterpreter

java.lang.Object
  extended byavrora.sim.BaseInterpreter
      extended byavrora.sim.FIFInterpreter
All Implemented Interfaces:
IORegisterConstants, State

public class FIFInterpreter
extends BaseInterpreter


Nested Class Summary
protected  class FIFInterpreter.FIFBuilder
           
protected static class FIFInterpreter.FIFInstr
           
protected  class FIFInterpreter.FIFInstr_ADC
           
protected  class FIFInterpreter.FIFInstr_ADD
           
protected  class FIFInterpreter.FIFInstr_ADIW
           
protected  class FIFInterpreter.FIFInstr_AND
           
protected  class FIFInterpreter.FIFInstr_ANDI
           
protected  class FIFInterpreter.FIFInstr_ASR
           
protected  class FIFInterpreter.FIFInstr_BCLR
           
protected  class FIFInterpreter.FIFInstr_BLD
           
protected  class FIFInterpreter.FIFInstr_BRBC
           
protected  class FIFInterpreter.FIFInstr_BRBS
           
protected  class FIFInterpreter.FIFInstr_BRCC
           
protected  class FIFInterpreter.FIFInstr_BRCS
           
protected  class FIFInterpreter.FIFInstr_BREAK
           
protected  class FIFInterpreter.FIFInstr_BREQ
           
protected  class FIFInterpreter.FIFInstr_BRGE
           
protected  class FIFInterpreter.FIFInstr_BRHC
           
protected  class FIFInterpreter.FIFInstr_BRHS
           
protected  class FIFInterpreter.FIFInstr_BRID
           
protected  class FIFInterpreter.FIFInstr_BRIE
           
protected  class FIFInterpreter.FIFInstr_BRLO
           
protected  class FIFInterpreter.FIFInstr_BRLT
           
protected  class FIFInterpreter.FIFInstr_BRMI
           
protected  class FIFInterpreter.FIFInstr_BRNE
           
protected  class FIFInterpreter.FIFInstr_BRPL
           
protected  class FIFInterpreter.FIFInstr_BRSH
           
protected  class FIFInterpreter.FIFInstr_BRTC
           
protected  class FIFInterpreter.FIFInstr_BRTS
           
protected  class FIFInterpreter.FIFInstr_BRVC
           
protected  class FIFInterpreter.FIFInstr_BRVS
           
protected  class FIFInterpreter.FIFInstr_BSET
           
protected  class FIFInterpreter.FIFInstr_BST
           
protected  class FIFInterpreter.FIFInstr_CALL
           
protected  class FIFInterpreter.FIFInstr_CBI
           
protected  class FIFInterpreter.FIFInstr_CBR
           
protected  class FIFInterpreter.FIFInstr_CLC
           
protected  class FIFInterpreter.FIFInstr_CLH
           
protected  class FIFInterpreter.FIFInstr_CLI
           
protected  class FIFInterpreter.FIFInstr_CLN
           
protected  class FIFInterpreter.FIFInstr_CLR
           
protected  class FIFInterpreter.FIFInstr_CLS
           
protected  class FIFInterpreter.FIFInstr_CLT
           
protected  class FIFInterpreter.FIFInstr_CLV
           
protected  class FIFInterpreter.FIFInstr_CLZ
           
protected  class FIFInterpreter.FIFInstr_COM
           
protected  class FIFInterpreter.FIFInstr_CP
           
protected  class FIFInterpreter.FIFInstr_CPC
           
protected  class FIFInterpreter.FIFInstr_CPI
           
protected  class FIFInterpreter.FIFInstr_CPSE
           
protected  class FIFInterpreter.FIFInstr_DEC
           
protected  class FIFInterpreter.FIFInstr_EICALL
           
protected  class FIFInterpreter.FIFInstr_EIJMP
           
protected  class FIFInterpreter.FIFInstr_ELPM
           
protected  class FIFInterpreter.FIFInstr_ELPMD
           
protected  class FIFInterpreter.FIFInstr_ELPMPI
           
protected  class FIFInterpreter.FIFInstr_EOR
           
protected  class FIFInterpreter.FIFInstr_FMUL
           
protected  class FIFInterpreter.FIFInstr_FMULS
           
protected  class FIFInterpreter.FIFInstr_FMULSU
           
protected  class FIFInterpreter.FIFInstr_ICALL
           
protected  class FIFInterpreter.FIFInstr_IJMP
           
protected  class FIFInterpreter.FIFInstr_IN
           
protected  class FIFInterpreter.FIFInstr_INC
           
protected  class FIFInterpreter.FIFInstr_JMP
           
protected  class FIFInterpreter.FIFInstr_LD
           
protected  class FIFInterpreter.FIFInstr_LDD
           
protected  class FIFInterpreter.FIFInstr_LDI
           
protected  class FIFInterpreter.FIFInstr_LDPD
           
protected  class FIFInterpreter.FIFInstr_LDPI
           
protected  class FIFInterpreter.FIFInstr_LDS
           
protected  class FIFInterpreter.FIFInstr_LPM
           
protected  class FIFInterpreter.FIFInstr_LPMD
           
protected  class FIFInterpreter.FIFInstr_LPMPI
           
protected  class FIFInterpreter.FIFInstr_LSL
           
protected  class FIFInterpreter.FIFInstr_LSR
           
protected  class FIFInterpreter.FIFInstr_MOV
           
protected  class FIFInterpreter.FIFInstr_MOVW
           
protected  class FIFInterpreter.FIFInstr_MUL
           
protected  class FIFInterpreter.FIFInstr_MULS
           
protected  class FIFInterpreter.FIFInstr_MULSU
           
protected  class FIFInterpreter.FIFInstr_NEG
           
protected  class FIFInterpreter.FIFInstr_NOP
           
protected  class FIFInterpreter.FIFInstr_OR
           
protected  class FIFInterpreter.FIFInstr_ORI
           
protected  class FIFInterpreter.FIFInstr_OUT
           
protected  class FIFInterpreter.FIFInstr_POP
           
protected  class FIFInterpreter.FIFInstr_PUSH
           
protected  class FIFInterpreter.FIFInstr_RCALL
           
protected  class FIFInterpreter.FIFInstr_RET
           
protected  class FIFInterpreter.FIFInstr_RETI
           
protected  class FIFInterpreter.FIFInstr_RJMP
           
protected  class FIFInterpreter.FIFInstr_ROL
           
protected  class FIFInterpreter.FIFInstr_ROR
           
protected  class FIFInterpreter.FIFInstr_SBC
           
protected  class FIFInterpreter.FIFInstr_SBCI
           
protected  class FIFInterpreter.FIFInstr_SBI
           
protected  class FIFInterpreter.FIFInstr_SBIC
           
protected  class FIFInterpreter.FIFInstr_SBIS
           
protected  class FIFInterpreter.FIFInstr_SBIW
           
protected  class FIFInterpreter.FIFInstr_SBR
           
protected  class FIFInterpreter.FIFInstr_SBRC
           
protected  class FIFInterpreter.FIFInstr_SBRS
           
protected  class FIFInterpreter.FIFInstr_SEC
           
protected  class FIFInterpreter.FIFInstr_SEH
           
protected  class FIFInterpreter.FIFInstr_SEI
           
protected  class FIFInterpreter.FIFInstr_SEN
           
protected  class FIFInterpreter.FIFInstr_SER
           
protected  class FIFInterpreter.FIFInstr_SES
           
protected  class FIFInterpreter.FIFInstr_SET
           
protected  class FIFInterpreter.FIFInstr_SEV
           
protected  class FIFInterpreter.FIFInstr_SEZ
           
protected  class FIFInterpreter.FIFInstr_SLEEP
           
protected  class FIFInterpreter.FIFInstr_SPM
           
protected  class FIFInterpreter.FIFInstr_ST
           
protected  class FIFInterpreter.FIFInstr_STD
           
protected  class FIFInterpreter.FIFInstr_STPD
           
protected  class FIFInterpreter.FIFInstr_STPI
           
protected  class FIFInterpreter.FIFInstr_STS
           
protected  class FIFInterpreter.FIFInstr_SUB
           
protected  class FIFInterpreter.FIFInstr_SUBI
           
protected  class FIFInterpreter.FIFInstr_SWAP
           
protected  class FIFInterpreter.FIFInstr_TST
           
protected  class FIFInterpreter.FIFInstr_WDR
           
 
Nested classes inherited from class avrora.sim.BaseInterpreter
BaseInterpreter.AddressOutOfBoundsException, BaseInterpreter.NoSuchInstructionException, BaseInterpreter.PCAlignmentException, BaseInterpreter.PCOutOfBoundsException
 
Nested classes inherited from class avrora.sim.State
State.IOReg, State.RWIOReg
 
Field Summary
protected  FIFInterpreter.FIFInstr curInstr
           
protected  FIFInterpreter.FIFInstr[] fifMap
           
protected  FIFInterpreter.FIFInstr nextInstr
           
static int R0
           
static int R1
           
static int RZ
           
 
Fields inherited from class avrora.sim.BaseInterpreter
C, cyclesConsumed, delayCycles, eventQueue, flash_data, flash_instr, globalProbe, H, I, innerLoop, ioregs, justReturnedFromInterrupt, N, nextPC, pc, postedInterrupts, regs, S, shouldRun, simulator, sleeping, sram, sram_max, sram_probes, sram_start, SREG_reg, T, totalCycles, V, Z
 
Fields inherited from interface avrora.sim.State
RESERVED
 
Fields inherited from interface avrora.sim.IORegisterConstants
ACSR, ADCH, ADCL, ADCSRA, ADMUX, ASSR, DDRA, DDRB, DDRC, DDRD, DDRE, DDRF, DDRG, EEARH, EEARL, EECR, EEDR, EICRA, EICRB, EIFR, EIMSK, ETIFR, ETIMSK, ICR1H, ICR1L, ICR3H, ICR3L, MCUCR, MCUCSR, NUM_REGS, OCDR, OCR0, OCR1AH, OCR1AL, OCR1BH, OCR1BL, OCR1CH, OCR1CL, OCR2, OCR3AH, OCR3AL, OCR3BH, OCR3BL, OCR3CH, OCR3CL, OSCCAL, PINA, PINB, PINC, PIND, PINE, PINF, PING, PORTA, PORTB, PORTC, PORTD, PORTE, PORTF, PORTG, RAMPZ, SFIOR, SPCR, SPDR, SPH, SPL, SPMCSR, SPSR, SREG, SREG_C, SREG_H, SREG_I, SREG_N, SREG_S, SREG_T, SREG_V, SREG_Z, TCCR0, TCCR1A, TCCR1B, TCCR1C, TCCR2, TCCR3A, TCCR3B, TCCR3C, TCNT0, TCNT1H, TCNT1L, TCNT2, TCNT3H, TCNT3L, TIFR, TIMSK, TWAR, TWBR, TWCR, TWDR, TWSR, UBRR0H, UBRR0L, UBRR1H, UBRR1L, UCSR0A, UCSR0B, UCSR0C, UCSR1A, UCSR1B, UCSR1C, UDR0, UDR1, WDTCR, XDIV, XMCRA, XMCRB
 
Constructor Summary
FIFInterpreter(Simulator s, Program p, int fs, int is, int ss)
           
 
Method Summary
 int getPC()
          The getPC() retrieves the current program counter.
protected  byte getRegisterByte(int reg)
           
protected  int getRegisterUnsigned(int reg)
           
protected  int getRegisterWord(int reg)
           
 void insertBreakPoint(int addr)
           
 void insertProbe(Simulator.Probe p)
          The insertProbe() method allows a probe to be inserted that is executed before and after every instruction that is executed by the simulator
 void insertProbe(Simulator.Probe p, int prog_addr)
           
 void removeBreakPoint(int addr)
           
 void removeProbe(Simulator.Probe p)
          The removeProbe() method removes a probe from the global probe table (the probes executed before and after every instruction).
 void removeProbe(Simulator.Probe p, int prog_addr)
           
protected  void runLoop()
           
protected  void setRegisterByte(int reg, byte val)
           
protected  void setRegisterWord(int reg, int val)
           
 
Methods inherited from class avrora.sim.BaseInterpreter
advanceCycles, delay, disableInterrupts, enableInterrupts, getCurrentInstr, getCycles, getDataByte, getFlag_C, getFlag_H, getFlag_I, getFlag_N, getFlag_S, getFlag_T, getFlag_V, getFlag_Z, getInstr, getInstrSize, getIOReg, getIORegisterByte, getPostedInterrupts, getProbedInstr, getProgramByte, getRegisterByte, getRegisterUnsigned, getRegisterWord, getSP, getSREG, getStackByte, initializeIORegs, insertWatch, isSleeping, makeImpression, popByte, postInterrupt, pushByte, removeWatch, setDataByte, setInstr, setIOReg, setIORegisterByte, setRegisterByte, setRegisterWord, setSP, setSREG, start, stop, unimplemented, unpostInterrupt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fifMap

protected FIFInterpreter.FIFInstr[] fifMap

curInstr

protected FIFInterpreter.FIFInstr curInstr

nextInstr

protected FIFInterpreter.FIFInstr nextInstr

R0

public static final int R0
See Also:
Constant Field Values

RZ

public static final int RZ
See Also:
Constant Field Values

R1

public static final int R1
See Also:
Constant Field Values
Constructor Detail

FIFInterpreter

public FIFInterpreter(Simulator s,
                      Program p,
                      int fs,
                      int is,
                      int ss)
Method Detail

insertProbe

public void insertProbe(Simulator.Probe p)
Description copied from class: BaseInterpreter
The insertProbe() method allows a probe to be inserted that is executed before and after every instruction that is executed by the simulator

Overrides:
insertProbe in class BaseInterpreter
Parameters:
p - the probe to insert

insertProbe

public void insertProbe(Simulator.Probe p,
                        int prog_addr)
Specified by:
insertProbe in class BaseInterpreter

removeProbe

public void removeProbe(Simulator.Probe p)
Description copied from class: BaseInterpreter
The removeProbe() method removes a probe from the global probe table (the probes executed before and after every instruction). The comparison used is reference equality, not .equals().

Overrides:
removeProbe in class BaseInterpreter
Parameters:
p - the probe to remove

removeProbe

public void removeProbe(Simulator.Probe p,
                        int prog_addr)
Specified by:
removeProbe in class BaseInterpreter

insertBreakPoint

public void insertBreakPoint(int addr)
Specified by:
insertBreakPoint in class BaseInterpreter

removeBreakPoint

public void removeBreakPoint(int addr)
Specified by:
removeBreakPoint in class BaseInterpreter

runLoop

protected void runLoop()
Specified by:
runLoop in class BaseInterpreter

getPC

public int getPC()
Description copied from class: BaseInterpreter
The getPC() retrieves the current program counter.

Specified by:
getPC in interface State
Overrides:
getPC in class BaseInterpreter
Returns:
the program counter as a byte address

getRegisterUnsigned

protected int getRegisterUnsigned(int reg)

getRegisterByte

protected byte getRegisterByte(int reg)

setRegisterByte

protected void setRegisterByte(int reg,
                               byte val)

getRegisterWord

protected int getRegisterWord(int reg)

setRegisterWord

protected void setRegisterWord(int reg,
                               int val)