|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.stack.AbstractState avrora.stack.MutableState
The MutableState
class represents an abstract state of the processor that is mutable. This is
used in computation of next states, but is not used in the state space.
AbstractArithmetic
,
StateCache
Field Summary |
Fields inherited from class avrora.stack.AbstractState |
av_EIMSK, av_REGISTERS, av_SREG, av_TIMSK, pc, primes |
Fields inherited from interface avrora.stack.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 | |
MutableState()
The constructor of the MutableState class builds the default values of each of the
registers and each IO register that is being modelled. |
|
MutableState(int npc,
char nSREG,
char nEIMSK,
char nTIMSK,
char[] nregs)
|
Method Summary | |
boolean |
equals(java.lang.Object o)
The equals() method implements the standard java.lang.Object equality testing
contract. |
int |
hashCode()
The hashCode() method computes an integer hash code for this state. |
MutableState |
merge(MutableState s)
The merge() method merges this abstract state with another abstract state and returns a
new copy. |
void |
setFlag_C(char val)
The setFlag_C() method updates the abstract value of the C flag. |
void |
setFlag_H(char val)
The setFlag_H() method updates the abstract value of the H flag. |
void |
setFlag_I(char val)
The setFlag_I() method updates the abstract value of the I flag. |
void |
setFlag_N(char val)
The setFlag_N() method updates the abstract value of the N flag. |
void |
setFlag_S(char val)
The setFlag_S() method updates the abstract value of the S flag. |
void |
setFlag_T(char val)
The setFlag_T() method updates the abstract value of the T flag. |
void |
setFlag_V(char val)
The setFlag_V() method updates the abstract value of the V flag. |
void |
setFlag_Z(char val)
The setFlag_Z() method updates the abstract value of the Z flag. |
void |
setIORegisterAV(int num,
char val)
The setIORegisterAV() method writes the abstract value of an IO register. |
void |
setPC(int npc)
The setPC() method updates the concrete value of the program counter. |
void |
setRegisterAV(Register r,
char val)
The setRegisterAV() method writes the abstract value of a register in the abstract state |
void |
setSREG_bit(int bit,
char val)
The writeSREG method updates one bit of the abstract value of the status register. |
void |
writeSREG(char val)
The writeSREG method updates the abstract value of the status register. |
Methods inherited from class avrora.stack.AbstractState |
computeHashCode, copy, deepCompare, getFlag_C, getFlag_H, getFlag_I, getFlag_N, getFlag_S, getFlag_T, getFlag_V, getFlag_Z, getIORegisterAV, getPC, getRegisterAV, getRegisterAV, getSREG, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MutableState()
MutableState
class builds the default values of each of the
registers and each IO register that is being modelled. The default is that all registers are known
zero, all IO registers are known zero, and the program counter is zero.
public MutableState(int npc, char nSREG, char nEIMSK, char nTIMSK, char[] nregs)
Method Detail |
public MutableState merge(MutableState s)
merge()
method merges this abstract state with another abstract state and returns a
new copy. This abstract state is not updated. The operation is a simple pointwise merging operation:
each value is merged with its corresponding abstract value in the other abstract state.
s
- the abstract state to merge with
AbstractArithmetic
public int hashCode()
hashCode()
method computes an integer hash code for this state. A good hash code is
needed to make hashtables in StateSpace
efficient.
hashCode
in class AbstractState
Avrora.InternalError
public boolean equals(java.lang.Object o)
equals()
method implements the standard java.lang.Object
equality testing
contract.
equals
in class AbstractState
o
- the object to test equality against.
Avrora.InternalError
public void setPC(int npc)
setPC()
method updates the concrete value of the program counter. The program counter
is known in ever abstract state.
npc
- the new concrete value of the program counterpublic void writeSREG(char val)
writeSREG
method updates the abstract value of the status register.
val
- the new abstract value to write to the status register.public void setSREG_bit(int bit, char val)
writeSREG
method updates one bit of the abstract value of the status register.
val
- the new abstract value of the bitpublic void setFlag_I(char val)
setFlag_I()
method updates the abstract value of the I flag.
val
- the new abstract bit of the flagpublic void setFlag_T(char val)
setFlag_T()
method updates the abstract value of the T flag.
val
- the new abstract bit of the flagpublic void setFlag_H(char val)
setFlag_H()
method updates the abstract value of the H flag.
val
- the new abstract bit of the flagpublic void setFlag_S(char val)
setFlag_S()
method updates the abstract value of the S flag.
val
- the new abstract bit of the flagpublic void setFlag_V(char val)
setFlag_V()
method updates the abstract value of the V flag.
val
- the new abstract bit of the flagpublic void setFlag_N(char val)
setFlag_N()
method updates the abstract value of the N flag.
val
- the new abstract bit of the flagpublic void setFlag_Z(char val)
setFlag_Z()
method updates the abstract value of the Z flag.
val
- the new abstract bit of the flagpublic void setFlag_C(char val)
setFlag_C()
method updates the abstract value of the C flag.
val
- the new abstract bit of the flagpublic void setIORegisterAV(int num, char val)
setIORegisterAV()
method writes the abstract value of an IO register. If the register
is being modelled, then its value will be updated. Otherwise, the write will be ignored.
num
- the IO register number to be updatedval
- the new abstract value of the IO registerpublic void setRegisterAV(Register r, char val)
setRegisterAV()
method writes the abstract value of a register in the abstract state
r
- the register to writeval
- the new abstract value of the register
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |