Program memory cache

This commit is contained in:
Nav
2023-09-22 17:52:28 +01:00
parent 24ce9aeacb
commit b38872e837
7 changed files with 277 additions and 5 deletions

View File

@@ -62,6 +62,7 @@
#include "src/Targets/Targets.hpp"
#include "src/Targets/TargetRegister.hpp"
#include "src/Targets/TargetMemory.hpp"
#include "src/Targets/TargetMemoryCache.hpp"
#include "src/EventManager/EventManager.hpp"
#include "src/EventManager/EventListener.hpp"
@@ -168,6 +169,16 @@ namespace TargetController
std::map<Targets::TargetMemoryAddress, Targets::TargetBreakpoint> softwareBreakpointsByAddress;
std::map<Targets::TargetMemoryAddress, Targets::TargetBreakpoint> hardwareBreakpointsByAddress;
/**
* The target's program memory cache.
*
* If program caching is enabled, all program memory reads will be serviced by the cache, if we have the data.
*
* We use std::unique_ptr here due to delayed construction (we construct this after activating the target
* and obtaining the target descriptor).
*/
std::unique_ptr<Targets::TargetMemoryCache> programMemoryCache = nullptr;
/**
* Registers a handler function for a particular command type.
* Only one handler function can be registered per command type.