SST 15.0
Structural Simulation Toolkit
coreTest_ClockerComponent.h
1// Copyright 2009-2025 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-2025, 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 <string>
18
19namespace SST::CoreTestClockerComponent {
20
21class coreTestClockerComponent : public SST::Component
22{
23public:
24 // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
25 SST_ELI_REGISTER_COMPONENT(
26 coreTestClockerComponent,
27 "coreTestElement",
28 "coreTestClockerComponent",
29 SST_ELI_ELEMENT_VERSION(1,0,0),
30 "Clock Benchmark Component",
31 COMPONENT_CATEGORY_UNCATEGORIZED
32 )
33
34 SST_ELI_DOCUMENT_PARAMS(
35 { "clock", "Clock frequency", "1GHz" },
36 { "clockcount", "Number of clock ticks to execute", "100000"}
37 )
38
39 // Optional since there is nothing to document
40 SST_ELI_DOCUMENT_STATISTICS(
41 )
42
43 // Optional since there is nothing to document
44 SST_ELI_DOCUMENT_PORTS(
45 )
46
47 // Optional since there is nothing to document
48 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
49 )
50
51 coreTestClockerComponent(SST::ComponentId_t id, SST::Params& params);
52 void setup() override {}
53 void finish() override {}
54
55private:
56 coreTestClockerComponent(); // for serialization only
57 coreTestClockerComponent(const coreTestClockerComponent&) = delete; // do not implement
58 coreTestClockerComponent& operator=(const coreTestClockerComponent&) = delete; // do not implement
59
60 virtual bool tick(SST::Cycle_t);
61
62 virtual bool Clock2Tick(SST::Cycle_t, uint32_t);
63 virtual bool Clock3Tick(SST::Cycle_t, uint32_t);
64
65 virtual void Oneshot1Callback(uint32_t);
66 virtual void Oneshot2Callback();
67
68 TimeConverter* tc;
69 Clock::HandlerBase* Clock3Handler;
70
71 // Variables to store OneShot Callback Handlers
72 OneShot::HandlerBase* callback1Handler;
73 OneShot::HandlerBase* callback2Handler;
74
75 std::string clock_frequency_str;
76 int clock_count;
77};
78
79} // namespace SST::CoreTestClockerComponent
80
81#endif // SST_CORE_CORETEST_CLOCKERCOMPONENT_H
SSTHandlerBase< bool, Cycle_t > HandlerBase
Base handler for clock functions.
Definition clock.h:43
Main component object for the simulation.
Definition component.h:31
Definition coreTest_ClockerComponent.h:22
void setup() override
Called after all components have been constructed and initialization has completed,...
Definition coreTest_ClockerComponent.h:52
void finish() override
Called after complete phase, but before objects are destroyed.
Definition coreTest_ClockerComponent.h:53
SSTHandlerBaseNoArgs< void > HandlerBase
Base handler for OneShot callbacks.
Definition oneshot.h:41
Parameter store.
Definition params.h:58
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:28