The memory bus is the component responsible of mapping addresses to components address and transmitting the data.
More...
#include <IMemoryBus.hpp>
|
| virtual | ~IMemoryBus ()=default |
| | A virtual default destructor. More...
|
| |
| virtual uint8_t | read (uint24_t addr)=0 |
| | Read data at a global address. This form allow read to be silenced. More...
|
| |
| virtual std::optional< uint8_t > | peek (uint24_t addr)=0 |
| | This as the same purpose as a read but it does not change the open bus and won't throw an exception. More...
|
| |
| virtual uint8_t | peek_v (uint24_t addr)=0 |
| | This as the same purpose as a read but it does not change the open bus and won't throw an exception. More...
|
| |
| virtual void | write (uint24_t addr, uint8_t data)=0 |
| | Write a data to a global address. More...
|
| |
| virtual IMemory * | getAccessor (uint24_t addr)=0 |
| | Helper function to get the components that is responsible of read/write at an address. More...
|
| |
The memory bus is the component responsible of mapping addresses to components address and transmitting the data.
◆ ~IMemoryBus()
| virtual ComSquare::Memory::IMemoryBus::~IMemoryBus |
( |
| ) |
|
|
virtualdefault |
A virtual default destructor.
◆ getAccessor()
| virtual IMemory* ComSquare::Memory::IMemoryBus::getAccessor |
( |
uint24_t |
addr | ) |
|
|
pure virtual |
◆ peek()
| virtual std::optional<uint8_t> ComSquare::Memory::IMemoryBus::peek |
( |
uint24_t |
addr | ) |
|
|
pure virtual |
This as the same purpose as a read but it does not change the open bus and won't throw an exception.
- Parameters
-
| addr | The address to read from. |
- Returns
- The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.
Implemented in ComSquare::Debugger::MemoryBusDebug, and ComSquare::Memory::MemoryBus.
◆ peek_v()
| virtual uint8_t ComSquare::Memory::IMemoryBus::peek_v |
( |
uint24_t |
addr | ) |
|
|
pure virtual |
This as the same purpose as a read but it does not change the open bus and won't throw an exception.
- Parameters
-
| addr | The address to read from. |
- Returns
- The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.
- Note
- If the value address is not mapped, 0 is returned instead of nullopt.
Implemented in ComSquare::Debugger::MemoryBusDebug, and ComSquare::Memory::MemoryBus.
◆ read()
| virtual uint8_t ComSquare::Memory::IMemoryBus::read |
( |
uint24_t |
addr | ) |
|
|
pure virtual |
Read data at a global address. This form allow read to be silenced.
- Parameters
-
| addr | The address to read from. |
- Exceptions
-
| InvalidAddress | If the address is not mapped to the bus, this exception is thrown. |
- Returns
- The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.
Implemented in ComSquare::Debugger::MemoryBusDebug, and ComSquare::Memory::MemoryBus.
◆ write()
| virtual void ComSquare::Memory::IMemoryBus::write |
( |
uint24_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
pure virtual |
The documentation for this class was generated from the following file: