Package be.lmenten.avr.core
Interface CoreModel
- All Known Implementing Classes:
Core
public interface CoreModel
CoreModel is the viewer interface of the core. It exposes only the getters
for the Core objects. This is used by UI components.
- Since:
- 1.0 - 2021 / 08 / 23
- Version:
- 1.0
- Author:
- Laurent Menten
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the base address of the application section.int
Get the size of the application section.int
Get the base address of the boot loader section.int
Get the size of the boot loader section.long
Get the current clock cycles counter value.Get current device running mode.Get the current instruction (that is, the instruction pointed by the program counter).getDefaultConfig(Properties config)
Get the default configuration for this device.Get the core descriptor of this device.getEepromCell(int address)
Get a memory cell from the eeprom memory.int
Get the size of the installed external memory from the core configuration.getFlashCell(int address)
Get a memory cell from the flash program memory.Get the instruction after current instruction.getFuseByte(String name)
Get a fuses register by its name.int
getIndexRegisterValue(IRegisterIndex r, boolean ext)
Get the value of the X, Y or Z index registerint
getInstructionIndexRegisterValue(boolean ext)
Get the value of the instruction index register value.long
getInterruptCount(int vector)
Get the count of triggering that occurred for a specific interrupt vector so far.long
Get the total count of interrupts that were triggered so far.getIORegisterByAddress(int address)
Get an I/O Register by its address as passed to IN/OUT (0..63) or CBI/SBI/SBIC/SBIS (0..31) instructions.getIORegisterByPhysicalAddress(int address)
Get an I/O Register by its physical address.getLockBits(String name)
Get a lock bits register by its name.int
Get the current program counter value.Get a register.getRegister(IRegister reg)
Get a General Purpose Register (R0-R31) by it register numbergetRegister(String name)
Get a register by its name.getSramCell(int address)
Get a memory cell from the sram data memory.int
Get the current stack pointer value.Get a copy of the StatusRegister.getSymbol(CoreMemory memory, int address)
Get the symbol for an address if any exists.boolean
On-chip Debug Register.boolean
Checks if the core supports boot loader sections.boolean
Checks if the core supports external memory.boolean
supportsInstruction(InstructionSet instruction)
Checks if the core supports an instruction.
-
Method Details
-
getDescriptor
CoreDescriptor getDescriptor()Get the core descriptor of this device.- Returns:
- the core descriptor
-
getDefaultConfig
Get the default configuration for this device. If the parameter is null a new Properties object is created.- Parameters:
config
- a Properties object to receive the configuration or null- Returns:
- a Properties object containing the definition
-
supportsInstruction
Checks if the core supports an instruction. The check is made against the core version as well as the specificity of the specific device.- Parameters:
instruction
- the instruction- Returns:
- true if instruction supported
-
supportsBootLoaderSection
boolean supportsBootLoaderSection()Checks if the core supports boot loader sections.- Returns:
- true if supported
-
getApplicationSectionBase
int getApplicationSectionBase()Get the base address of the application section.- Returns:
- the base address (in bytes) of the application section
-
getApplicationSectionSize
int getApplicationSectionSize()Get the size of the application section. This is computed using the fuse's BOOTSZ bits value from the core configuration.- Returns:
- the size (in bytes) of the application section
-
getBootLoaderSectionBase
int getBootLoaderSectionBase()Get the base address of the boot loader section.- Returns:
- the base address (in bytes) of the boot loader section
-
getBootLoaderSectionSize
int getBootLoaderSectionSize()Get the size of the boot loader section. This is computed using the fuse's BOOTSZ bits value from the core configuration.- Returns:
- the size (in bytes) of the boot loader section
-
supportsExternalMemoryFeature
boolean supportsExternalMemoryFeature()Checks if the core supports external memory.- Returns:
- true if supported
-
getExternalSramSize
int getExternalSramSize()Get the size of the installed external memory from the core configuration.- Returns:
- the size (in bytes) of the external memory
-
getProgramCounter
int getProgramCounter()Get the current program counter value.- Returns:
- the program counter value
-
getCurrentInstruction
Instruction getCurrentInstruction()Get the current instruction (that is, the instruction pointed by the program counter).- Returns:
- the instruction
-
getFollowingInstruction
Instruction getFollowingInstruction()Get the instruction after current instruction.- Returns:
- the instruction
-
getClockCyclesCounter
long getClockCyclesCounter()Get the current clock cycles counter value.- Returns:
- the clock cycles counter value
-
getCoreMode
RunningMode getCoreMode()Get current device running mode.- Returns:
- the mode
-
getInterruptsCount
long getInterruptsCount()Get the total count of interrupts that were triggered so far.- Returns:
- the count
-
getInterruptCount
long getInterruptCount(int vector)Get the count of triggering that occurred for a specific interrupt vector so far.- Parameters:
vector
- the vector- Returns:
- the count
-
ioDebugRegisterDirty
boolean ioDebugRegisterDirty()On-chip Debug Register.- Returns:
-
getStatusRegisterCopy
CoreStatusRegister getStatusRegisterCopy()Get a copy of the StatusRegister.
A copy is given to allow full manipulation without any triggering of events.
- Returns:
- a copy of the StatusRegister
-
getStackPointer
int getStackPointer()Get the current stack pointer value. This method abstracts differences among devices.- Returns:
- the stack pointer value
-
getIndexRegisterValue
Get the value of the X, Y or Z index register- Parameters:
r
- the index registerext
- true for extended register- Returns:
- the value
-
getInstructionIndexRegisterValue
int getInstructionIndexRegisterValue(boolean ext)Get the value of the instruction index register value.- Parameters:
ext
- this for extended register- Returns:
- the value
-
getRegister
Get a General Purpose Register (R0-R31) by it register number- Parameters:
reg
- the register identifier- Returns:
- the register
-
getRegister
Get a register.- Parameters:
reg
- the register identifier- Returns:
- the register
-
getRegister
Get a register by its name.- Parameters:
name
- the register name- Returns:
- the register
-
getIORegisterByAddress
Get an I/O Register by its address as passed to IN/OUT (0..63) or CBI/SBI/SBIC/SBIS (0..31) instructions.- Parameters:
address
-- Returns:
- the registe
-
getIORegisterByPhysicalAddress
Get an I/O Register by its physical address.- Parameters:
address
-- Returns:
- the register
-
getLockBits
Get a lock bits register by its name.- Parameters:
name
-- Returns:
-
getFuseByte
Get a fuses register by its name.- Parameters:
name
-- Returns:
-
getFlashCell
Get a memory cell from the flash program memory.- Parameters:
address
-- Returns:
- the memory cell
-
getSramCell
Get a memory cell from the sram data memory.- Parameters:
address
-- Returns:
-
getEepromCell
Get a memory cell from the eeprom memory.- Parameters:
address
-- Returns:
-
getSymbol
Get the symbol for an address if any exists.- Parameters:
memory
- the memory zoneaddress
- the address- Returns:
- the symbol or null
-