SST 16.0.0
Structural Simulation Toolkit
coreTest_ClockerComponent.h
1// Copyright 2009-2026 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2026, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_CORETEST_CLOCKERCOMPONENT_H
13#define SST_CORE_CORETEST_CLOCKERCOMPONENT_H
14
15#include "sst/core/component.h"
16
17#include <cstdint>
18#include <string>
19
20namespace SST::CoreTestClockerComponent {
21
22class coreTestClockerComponent : public SST::Component
23{
24public:
25 // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
26 SST_ELI_REGISTER_COMPONENT(
27 coreTestClockerComponent,
28 "coreTestElement",
29 "coreTestClockerComponent",
30 SST_ELI_ELEMENT_VERSION(1,0,0),
31 "Clock Benchmark Component",
32 COMPONENT_CATEGORY_UNCATEGORIZED
33 )
34
35 SST_ELI_DOCUMENT_PARAMS(
36 { "clock", "Clock frequency", "1GHz" },
37 { "clockcount", "Number of clock ticks to execute", "100000"}
38 )
39
40 // Optional since there is nothing to document
41 SST_ELI_DOCUMENT_STATISTICS(
42 )
43
44 // Optional since there is nothing to document
45 SST_ELI_DOCUMENT_PORTS(
46 )
47
48 // Optional since there is nothing to document
49 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
50 )
51
52 coreTestClockerComponent(SST::ComponentId_t id, SST::Params& params);
53 void setup() override {}
54 void finish() override {}
55
56private:
57 coreTestClockerComponent(); // for serialization only
58 coreTestClockerComponent(const coreTestClockerComponent&) = delete; // do not implement
59 coreTestClockerComponent& operator=(const coreTestClockerComponent&) = delete; // do not implement
60
61 virtual bool tick(SST::Cycle_t);
62
63 virtual bool Clock2Tick(SST::Cycle_t, uint32_t);
64 virtual bool Clock3Tick(SST::Cycle_t, uint32_t);
65
66 virtual void Oneshot1Callback(uint32_t);
67 virtual void Oneshot2Callback();
68
70 Clock::HandlerBase* Clock3Handler;
71
72 std::string clock_frequency_str;
73 int clock_count;
74};
75
76} // namespace SST::CoreTestClockerComponent
77
78#endif // SST_CORE_CORETEST_CLOCKERCOMPONENT_H
SSTHandlerBase< bool, Cycle_t > HandlerBase
Base handler for clock functions.
Definition clock.h:44
Main component object for the simulation.
Definition component.h:32
Definition coreTest_ClockerComponent.h:23
void setup() override
Called after all components have been constructed and initialization has completed,...
Definition coreTest_ClockerComponent.h:53
void finish() override
Called after complete phase, but before objects are destroyed.
Definition coreTest_ClockerComponent.h:54
Parameter store.
Definition params.h:65
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:31