|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.sim.util.MemoryCounter
The MemoryCounter is the simplest example of memory profiling functionality. When inserted as
a watch at a particular memory location, it will simply count the number of reads and writes to that memory
location. It is analagous to the Counter probe which is used to count the execution frequency
of a particular instruction.
Simulator.Watch,
Counter| Field Summary | |
long |
rcount
The rcount field stores the number of reads encountered for this memory location. |
long |
wcount
The wcount field stores the number of writes encountered for this memory location. |
| Constructor Summary | |
MemoryCounter()
|
|
| Method Summary | |
void |
fireAfterRead(Instr i,
int address,
State state,
int data_addr,
byte value)
The fireAfterRead() method is called after the data address is read by the program. |
void |
fireAfterWrite(Instr i,
int address,
State state,
int data_addr,
byte value)
The fireAfterWrite() method is called after the data address is written by the program. |
void |
fireBeforeRead(Instr i,
int address,
State state,
int data_addr,
byte value)
The fireBeforeRead() method is called before the data address is read by the program. |
void |
fireBeforeWrite(Instr i,
int address,
State state,
int data_addr,
byte value)
The fireBeforeWrite() method is called before the data address is written by the program.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public long rcount
rcount field stores the number of reads encountered for this memory location.
public long wcount
wcount field stores the number of writes encountered for this memory location.
| Constructor Detail |
public MemoryCounter()
| Method Detail |
public void fireBeforeRead(Instr i,
int address,
State state,
int data_addr,
byte value)
fireBeforeRead() method is called before the data address is read by the program. In
the implementation of MemoryCounter, it simply increments the count of reads by one.
fireBeforeRead in interface Simulator.Watchi - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulationdata_addr - the address of the data being referencedvalue - the value of the memory location being read
public void fireBeforeWrite(Instr i,
int address,
State state,
int data_addr,
byte value)
fireBeforeWrite() method is called before the data address is written by the program.
In the implementation of MemoryCounter, it simply increments the count of writes by one.
fireBeforeWrite in interface Simulator.Watchi - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulationdata_addr - the address of the data being referencedvalue - the value being written to the memory location
public void fireAfterRead(Instr i,
int address,
State state,
int data_addr,
byte value)
fireAfterRead() method is called after the data address is read by the program. In the
implementation of MemoryCounter, it does nothing.
fireAfterRead in interface Simulator.Watchi - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulationdata_addr - the address of the data being referencedvalue - the value of the memory location being read
public void fireAfterWrite(Instr i,
int address,
State state,
int data_addr,
byte value)
fireAfterWrite() method is called after the data address is written by the program. In
the implementation of MemoryCounter, it does nothing.
fireAfterWrite in interface Simulator.Watchi - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulationdata_addr - the address of the data being referencedvalue - the value being written to the memory location
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||