ArchXT_Core Class Reference

yasimavr: ArchXT_Core Class Reference
yasimavr
Loading...
Searching...
No Matches

Implementation of a core model for Mega0/Mega1 series. More...

#include <arch_xt_device.h>

Inheritance diagram for ArchXT_Core:
Core

Public Types

enum  ArchXT_NVM { NVM_EEPROM = NVM_ArchDefined , NVM_USERROW = NVM_ArchDefined + 1 }
 
- Public Types inherited from Core
enum  NVM {
  NVM_Flash , NVM_Fuses , NVM_CommonCount , NVM_ArchDefined = NVM_CommonCount ,
  NVM_GetCount = 0xFFFF
}
 

Public Member Functions

 ArchXT_Core (const ArchXT_CoreConfig &variant)
 
- Public Member Functions inherited from Core
 Core (const CoreConfiguration &config)
 
virtual ~Core ()
 
const CoreConfigurationconfig () const
 
bool init (Device &device)
 
void reset ()
 
int exec_cycle ()
 
IORegisterget_ioreg (reg_addr_t addr)
 
uint8_t ioctl_read_ioreg (reg_addr_t addr)
 
void ioctl_write_ioreg (reg_addr_t addr, bitmask_t bm, uint8_t value)
 
void start_interrupt_inhibit (unsigned int count)
 
void set_console_register (reg_addr_t addr)
 
void set_direct_LPM_enabled (bool enabled)
 
 Core (const Core &)=delete
 
Coreoperator= (const Core &)=delete
 

Protected Member Functions

virtual uint8_t cpu_read_data (mem_addr_t data_addr) override
 
virtual void cpu_write_data (mem_addr_t data_addr, uint8_t value) override
 
virtual void dbg_read_data (mem_addr_t start, uint8_t *buf, mem_addr_t len) override
 
virtual void dbg_write_data (mem_addr_t start, const uint8_t *buf, mem_addr_t len) override
 
- Protected Member Functions inherited from Core
uint8_t cpu_read_ioreg (reg_addr_t addr)
 
void cpu_write_ioreg (reg_addr_t addr, uint8_t value)
 
uint8_t cpu_read_gpreg (uint8_t reg)
 
void cpu_write_gpreg (uint8_t reg, uint8_t value)
 
int16_t cpu_read_flash (flash_addr_t pgm_addr)
 
bool use_extended_addressing () const
 
void dbg_insert_breakpoint (breakpoint_t &bp)
 
void dbg_remove_breakpoint (breakpoint_t &bp)
 

Friends

class ArchXT_Device
 

Additional Inherited Members

- Static Protected Member Functions inherited from Core
static bool data_space_map (mem_addr_t addr, mem_addr_t len, mem_addr_t blockstart, mem_addr_t blockend, mem_addr_t *bufofs, mem_addr_t *blockofs, mem_addr_t *result_len)
 
- Protected Attributes inherited from Core
const CoreConfigurationm_config
 Reference to the configuration structure, set at construction.
 
Devicem_device
 Pointer to the device, set by init()
 
uint8_t m_regs [32]
 Array of the 32 general registers.
 
std::vector< IORegister * > m_ioregs
 Array of the I/O registers.
 
uint8_t * m_sram
 Pointer to the array representing the device RAM memory.
 
NonVolatileMemory m_flash
 Non-volatile memory model for the flash.
 
NonVolatileMemory m_fuses
 Non-volatile memory model for the fuse bits.
 
flash_addr_t m_pc
 Program Counter register, expressed in bytes (unlike the actual device PC)
 
unsigned int m_int_inhib_counter
 Counter to inhibit interrupts for a given number of instructions.
 
DeviceDebugProbem_debug_probe
 Pointer to the generic debug probe.
 
MemorySectionManagerm_section_manager
 

Detailed Description

Implementation of a core model for Mega0/Mega1 series.

The model adds 2 NVM : EEPROM and USERROW It implements the data space access for the CPU, in which the FLASH and the EEPROM are accessible (read-only) at the address defined in the configuration structure.

Member Enumeration Documentation

◆ ArchXT_NVM

Enumerator
NVM_EEPROM 
NVM_USERROW 

Constructor & Destructor Documentation

◆ ArchXT_Core()

YASIMAVR_USING_NAMESPACE ArchXT_Core::ArchXT_Core ( const ArchXT_CoreConfig variant)
explicit

Member Function Documentation

◆ cpu_read_data()

uint8_t ArchXT_Core::cpu_read_data ( mem_addr_t  data_addr)
overrideprotectedvirtual

Read memory in data address space. This is a pure virtual function that architectures should implement. Implementations should ensure that, if the address is invalid, the behavior should be consistent with the option IgnoreBadCpuIO.

See also
cpu_read_ioreg()

This function is intended for CPU use only.

Parameters
data_addrMemory address (in 8-bits, data address space) to read
Returns
Content at the flash address

Implements Core.

◆ cpu_write_data()

void ArchXT_Core::cpu_write_data ( mem_addr_t  data_addr,
uint8_t  value 
)
overrideprotectedvirtual

Write memory in data address space. This is a pure virtual function that architectures should implement. Implementations should ensure that, if the address is invalid or read-only, the behavior should be consistent with the option IgnoreBadCpuIO.

See also
cpu_write_ioreg()

This function is intended for CPU use only.

Parameters
data_addrMemory address (in 8-bits, data address space) to read
valueValue to write

Implements Core.

◆ dbg_read_data()

void ArchXT_Core::dbg_read_data ( mem_addr_t  start,
uint8_t *  buf,
mem_addr_t  len 
)
overrideprotectedvirtual

Read memory in data address space. This is a pure virtual function that architectures should implement.

This function is intended for debug probe use only.

Parameters
startFirst memory address (in 8-bits, data address space) to read
bufBuffer where the memory data will be copied into
lenLength of the memory block to read

Implements Core.

◆ dbg_write_data()

void ArchXT_Core::dbg_write_data ( mem_addr_t  start,
const uint8_t *  buf,
mem_addr_t  len 
)
overrideprotectedvirtual

Write memory in data address space. This is a pure virtual function that architectures should implement.

This function is intended for debug probe use only.

Parameters
startFirst memory address (in 8-bits, data address space) to read
bufBuffer from which the memory data will be copied
lenLength of the memory block to write

Implements Core.

Friends And Related Symbol Documentation

◆ ArchXT_Device

friend class ArchXT_Device
friend

The documentation for this class was generated from the following files: