2#include "Preloader.hpp"
4#include "cache/preload/PreloadableIF.hpp"
12 std::cout <<
"[Preloading caches]: " << filepath_ << std::endl;
13 sparta::cache::PreloaderIF::parseYaml_(filepath_);
17 void Preloader::preloadPacket_(
const std::string& treenode,
18 sparta::cache::PreloadPkt& pkt)
24 std::vector<sparta::TreeNode*> nodes;
26 bool preloaded_atleast_one =
false;
27 for (
auto& node : nodes)
29 sparta::cache::PreloadableIF* cache =
dynamic_cast<sparta::cache::PreloadableIF*
>(node);
32 bool success = cache->preloadPkt(pkt);
33 preloaded_atleast_one |= success;
36 sparta_assert(preloaded_atleast_one,
"Failed to preload the packet to any cache");
Simulation setup base class.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
TreeNode * getContainer()
Gets the TreeNode (container) for this resource (if any)
TreeNode which represents the root ("top") of a device tree.
GlobalTreeNode * getSearchScope()
Gets the search node "parent" of this root node which is suitable for performing searches that includ...
app::Simulation * getSimulation() const
Gets the simulation (if any) associated with this tree.
uint32_t findChildren(const std::string &pattern, std::vector< TreeNode * > &results, std::vector< std::vector< std::string > > &replacements)
Finds all children starting at this node with a given pattern relative to this node by matching names...
sparta::RootTreeNode * getRoot() noexcept
Returns the tree root.