ComSquare
Public Member Functions | Protected Attributes | List of all members
ComSquare::APU::IPL::IPL Class Reference

#include <IPL.hpp>

Inheritance diagram for ComSquare::APU::IPL::IPL:
Collaboration diagram for ComSquare::APU::IPL::IPL:

Public Member Functions

 IPL (Component, std::string iplName)
 Create the rom with its value. More...
 
 IPL (const IPL &)=delete
 The rom can't be copied. More...
 
IPLoperator= (IPL &)=delete
 The rom can't be assigned. More...
 
 ~IPL () override=default
 A default destructor. More...
 
uint8_t read (uint24_t addr) override
 Read data from the component using the same method as the basic IMemory. More...
 
void write (uint24_t addr, uint8_t data) override
 Write data to this component using the same method as the basic IMemory. More...
 
uint8_t & operator[] (uint24_t addr)
 Retrieve the data at the address given. This can be used instead of read or write. More...
 
const uint8_t & operator[] (uint24_t addr) const
 Retrieve the data at the address given. This can be used instead of read or write. More...
 
uint24_t getSize () const override
 Get the size of the data. This size can be lower than the mapped data. More...
 
std::string getName () const override
 Get the name of this accessor (used for debug purpose) More...
 
Component getComponent () const override
 Get the component of this accessor (used for debug purpose) More...
 
std::string getValueName (uint24_t addr) const override
 Get the name of the data at the address. More...
 
- Public Member Functions inherited from ComSquare::Memory::AMemory
uint24_t getRelativeAddress (uint24_t addr) const override
 Translate an absolute address to a relative address. More...
 
void setMemoryRegion (uint24_t start, uint24_t end)
 Change starting and ending points of this mapped memory. More...
 
bool hasMemoryAt (uint24_t addr) const override
 Return true if this component has mapped the address. More...
 
 ~AMemory () override=default
 A default destructor. More...
 
- Public Member Functions inherited from ComSquare::Memory::IMemory
virtual ~IMemory ()=default
 A virtual default destructor. More...
 

Protected Attributes

std::array< uint8_t, 64 > _data
 The Rom. More...
 
size_t _size = 64
 The size of the IPL rom (in bytes). More...
 
Component _iplType
 An id identifying the type of memory this is (for the debugger) More...
 
std::string _iplName
 The name of this ram. More...
 
- Protected Attributes inherited from ComSquare::Memory::AMemory
uint24_t _start = 0
 The starting address mapped to this component. More...
 
uint24_t _end = 0
 The last continuous address mapped to this components. For shadows, see the MemoryShadow class. More...
 

Constructor & Destructor Documentation

◆ IPL() [1/2]

ComSquare::APU::IPL::IPL::IPL ( Component  type,
std::string  iplName 
)
explicit

Create the rom with its value.

◆ IPL() [2/2]

ComSquare::APU::IPL::IPL::IPL ( const IPL )
delete

The rom can't be copied.

◆ ~IPL()

ComSquare::APU::IPL::IPL::~IPL ( )
overridedefault

A default destructor.

Member Function Documentation

◆ getComponent()

Component ComSquare::APU::IPL::IPL::getComponent ( ) const
overridevirtual

Get the component of this accessor (used for debug purpose)

Implements ComSquare::Memory::IMemory.

◆ getName()

std::string ComSquare::APU::IPL::IPL::getName ( ) const
overridevirtual

Get the name of this accessor (used for debug purpose)

Implements ComSquare::Memory::IMemory.

◆ getSize()

uint24_t ComSquare::APU::IPL::IPL::getSize ( ) const
overridevirtual

Get the size of the data. This size can be lower than the mapped data.

Returns
The number of bytes inside this memory.

Implements ComSquare::Memory::IMemory.

◆ getValueName()

std::string ComSquare::APU::IPL::IPL::getValueName ( uint24_t  addr) const
overridevirtual

Get the name of the data at the address.

Parameters
addrThe address (in local space)

Implements ComSquare::Memory::IMemory.

◆ operator=()

IPL& ComSquare::APU::IPL::IPL::operator= ( IPL )
delete

The rom can't be assigned.

◆ operator[]() [1/2]

uint8_t & ComSquare::APU::IPL::IPL::operator[] ( uint24_t  addr)

Retrieve the data at the address given. This can be used instead of read or write.

Parameters
addrThe address of the data to retrieve.
Returns
The data at the address given as parameter.

◆ operator[]() [2/2]

const uint8_t & ComSquare::APU::IPL::IPL::operator[] ( uint24_t  addr) const

Retrieve the data at the address given. This can be used instead of read or write.

Parameters
addrThe address of the data to retrieve.
Returns
The data at the address given as parameter.

◆ read()

uint8_t ComSquare::APU::IPL::IPL::read ( uint24_t  addr)
overridevirtual

Read data from the component using the same method as the basic IMemory.

Parameters
addrThe global 24 bits address. This method is responsible of mapping to the component's read.
Exceptions
InvalidAddressif the address is not mapped to the component.
Returns
Return the data at the address given as parameter.

Implements ComSquare::Memory::IMemory.

◆ write()

void ComSquare::APU::IPL::IPL::write ( uint24_t  addr,
uint8_t  data 
)
overridevirtual

Write data to this component using the same method as the basic IMemory.

Parameters
addrThe global 24 bits address. This method is responsible of mapping to the component's write.
dataThe new data to write.
Exceptions
InvalidAddressif the address is not mapped to the component.

Implements ComSquare::Memory::IMemory.

Member Data Documentation

◆ _data

std::array<uint8_t, 64> ComSquare::APU::IPL::IPL::_data
protected
Initial value:
= {
0xCD, 0xEF, 0xBD, 0xE8, 0x00, 0xC6, 0x1D, 0xD0,
0xFC, 0x8F, 0xAA, 0xF4, 0x8F, 0xBB, 0xF5, 0x78,
0xCC, 0xF4, 0xD0, 0xFB, 0x2F, 0x19, 0xEB, 0xF4,
0xD0, 0xFC, 0x7E, 0xF4, 0xD0, 0x0B, 0xE4, 0xF5,
0xCB, 0xF4, 0xD7, 0x00, 0xFC, 0xD0, 0xF3, 0xAB,
0x01, 0x10, 0xEF, 0x7E, 0xF4, 0x10, 0xEB, 0xBA,
0xF6, 0xDA, 0x00, 0xBA, 0xF4, 0xC4, 0xF4, 0xDD,
0x5D, 0xD0, 0xDB, 0x1F, 0x00, 0x00, 0xC0, 0xFF
}

The Rom.

◆ _iplName

std::string ComSquare::APU::IPL::IPL::_iplName
protected

The name of this ram.

◆ _iplType

Component ComSquare::APU::IPL::IPL::_iplType
protected

An id identifying the type of memory this is (for the debugger)

◆ _size

size_t ComSquare::APU::IPL::IPL::_size = 64
protected

The size of the IPL rom (in bytes).


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