5#include "sparta/statistics/Counter.hpp"
6#include "sparta/functional/Register.hpp"
13 const char* regfoo_aliases[] = {
"the_foo_reg",
"reg0", 0 };
16 { 0,
"regfoo", 1,
"reg", 0,
"regfoo's description", 4, {
17 {
"field1",
"this is field 1. It is 2 bits", 0, 1 },
18 {
"field2",
"this is field 2. It is 4 bits", 0, 3 },
19 {
"field3",
"this is field 3. It is 3 bits", 1, 3 } },
27 regs_(
sparta::RegisterSet::create(node, core_reg_defs)),
28 counter_incr_event_(&unit_event_set_,
"counter_incr_event",
47 counter_incr_amount_ = p->ctr_incr_amount;
48 counter_incr_period_ = p->ctr_incr_period;
51 for(
auto c : p->contents){
64 void Core::incrementCounter_() {
65 (*fooctr_) += counter_incr_amount_;
66 counter_incr_event_.
schedule(counter_incr_period_);
#define CREATE_SPARTA_HANDLER(clname, meth)
Basic Node framework in sparta device tree composite pattern.
Parameters for Core model.
Core(sparta::TreeNode *node, const CoreParameterSet *params)
Core constructor.
@ COUNT_NORMAL
Counter counts the number of times something happens like one would expect. This is a weakly monotoni...
Represents a counter of type counter_type (uint64_t). 2 and greater than 0 with a ceiling specified....
void schedule()
Schedule this event with its pre-set delay using the pre-set Clock.
static constexpr ident_type INVALID_ID
Represents an invalid Register ID.
static const Definition DEFINITION_END
Entry indicating the end of a sparta::Register::Definition array.
CounterT & createCounter(_Args &&... __args)
Allocates a Counter which is owned by this StatisticSet and deleted at its destruction.
Node in a composite tree representing a sparta Tree item.
const Clock * getClock() override
Walks up parents (starting with self) until a parent with an associated local clock is found,...
log::MessageSource warn_logger_
Default warn logger.
sparta::StatisticSet unit_stat_set_
The Unit's statistic set.
Macros for handling exponential backoff.
Describes an architected Register.