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