10#include "sparta/functional/RegisterSet.hpp"
12#include "sparta/statistics/Counter.hpp"
29 foo.addDependentValidationCallback([](std::string& s,
const sparta::TreeNode*){
return s.size() < 10;},
30 "Length must be < 10");
31 ctr_incr_period.addDependentValidationCallback([](uint64_t& v,
const sparta::TreeNode*){
return v > 0;},
32 "Counter increment period must be > 0");
33 ctr_incr_amount.addDependentValidationCallback([](uint32_t& v,
const sparta::TreeNode*){
return v > 0;},
34 "Counter incrementor must be > 0");
37 PARAMETER(std::string, foo,
"default",
"test parameter")
38 PARAMETER(uint64_t, ctr_incr_period, 1000,
"Period of each 'counter_foo' counter update. Must be > 0")
39 PARAMETER(uint32_t, ctr_incr_amount, 1,
"Value to increment the counter 'counter_foo' each counter update period. Must be > 0")
40 PARAMETER(std::vector<std::string>, contents, {},
"Content???")
44 static constexpr char name[] =
"core_example_core";
70 void incrementCounter_();
72 std::vector<Resource *> resources_;
73 std::unique_ptr<sparta::RegisterSet> regs_;
76 uint64_t counter_incr_period_;
77 uint64_t counter_incr_amount_;
File that defines the Clock class.
File that defines the Event class.
A set of sparta::Parameters per sparta::ResourceTreeNode.
#define PARAMETER(type, name, def, doc)
Parameter declaration.
Basic Node framework in sparta device tree composite pattern.
File that defines the Unit class, a common grouping of sets and loggers.
Parameters for Core model.
static constexpr char name[]
Name of this resource. Required by sparta::UnitFactory.
Represents a counter of type counter_type (uint64_t). 2 and greater than 0 with a ceiling specified....
Event is a simple class for scheduling random events on the Scheduler.
Generic container of Parameters.
Node in a composite tree representing a sparta Tree item.
The is the base class for user defined blocks in simulation.