4#include "sparta/simulation/ResourceTreeNode.hpp"
5#include "sparta/simulation/ResourceFactory.hpp"
7#include "SpartaSystemCSimulator.hpp"
8#include "sparta-target/SpartaMemory.hpp"
9#include "sparta-target/SpartaTLMTargetGasket.hpp"
14 sparta::app::Simulation(
"SpartaSystemCSimulator", sched),
15 sysc_sched_runner_(sched),
16 systemc_example_top_(
"top")
26 SpartaSystemCSimulator::~SpartaSystemCSimulator() {
39 void SpartaSystemCSimulator::buildTree_()
53 const auto total_targets = 2;
54 for(uint32_t i = 0; i < total_targets; ++i) {
57 tns_to_delete_.emplace_back
59 sparta_target::SpartaMemory::name + std::to_string(i),
60 sparta_target::SpartaMemory::name, i,
63 getResourceFactory(sparta_target::SpartaMemory::name)));
66 sparta_target::SpartaTLMTargetGasket::name + std::to_string(i),
67 sparta_target::SpartaTLMTargetGasket::name, i,
70 getResourceFactory(sparta_target::SpartaTLMTargetGasket::name)));
75 void SpartaSystemCSimulator::configureTree_() {}
81 void SpartaSystemCSimulator::bindTree_()
94 auto sparta_tlm_gasket0 =
96 auto sparta_tlm_gasket1 =
100 systemc_example_top_.m_bus.initiator_socket[0](sparta_tlm_gasket0->getMemorySocket());
101 systemc_example_top_.m_bus.initiator_socket[1](sparta_tlm_gasket1->getMemorySocket());
A simple time-based, event precedence based scheduler.
Basic Node framework in sparta device tree composite pattern.
The port interface used to bind port types together and defines a port behavior.
Templated ResourceFactoryBase implementation which can be used to trivially define Resource Factories...
TreeNode subclass representing a node in the device tree which contains a single ResourceFactory and ...
void enterTeardown()
Places this tree into TREE_TEARDOWN phase so that nodes may be deleted without errors.
A class that lets you schedule events now and in the future.
Node in a composite tree representing a sparta Tree item.
static const group_idx_type GROUP_IDX_NONE
GroupIndex indicating that a node has no group index because it belongs to no group.
static constexpr char GROUP_NAME_NONE[]
Group name indicating that a node belongs to no group.
const ConstT getChildAs(const std::string &name, bool must_exist=true) const
Retrieves a child that is castable to T with the given dotted path.
sparta::RootTreeNode * getRoot() noexcept
Returns the tree root.
sparta::ResourceSet * getResourceSet() noexcept
Returns the resource set for this Simulation.
SpartaSystemCSimulator(sparta::Scheduler *sched)
Construction of the SpartaSystemCSimulator.
Macros for handling exponential backoff.
void bind(Bus *p1, Bus *p2)
Bind two buses together.