SST  15.1.0
StructuralSimulationToolkit
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 
20 
22 {
23 public:
24  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
25  SST_ELI_REGISTER_COMPONENT(
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 
55 private:
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  std::string clock_frequency_str;
72  int clock_count;
73 };
74 
75 } // namespace SST::CoreTestClockerComponent
76 
77 #endif // SST_CORE_CORETEST_CLOCKERCOMPONENT_H
Base template for handlers which take a class defined argument.
Definition: ssthandler.h:109
void finish() override
Called after complete phase, but before objects are destroyed.
Definition: coreTest_ClockerComponent.h:53
A class to convert between a component&#39;s view of time and the core&#39;s view of time.
Definition: timeConverter.h:27
Main component object for the simulation.
Definition: component.h:30
Definition: coreTest_ClockerComponent.h:21
Parameter store.
Definition: params.h:63
void setup() override
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_ClockerComponent.h:52
Definition: coreTest_ClockerComponent.cc:22