SST  12.0.0
StructuralSimulationToolkit
coreTest_ClockerComponent.h
1 // Copyright 2009-2022 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-2022, NTESS
6 // All rights reserved.
7 //
8 // Portions are copyright of other developers:
9 // See the file CONTRIBUTORS.TXT in the top level directory
10 // the distribution for more information.
11 //
12 // This file is part of the SST software package. For license
13 // information, see the LICENSE file in the top level directory of the
14 // distribution.
15 
16 #ifndef SST_CORE_CORETEST_CLOCKERCOMPONENT_H
17 #define SST_CORE_CORETEST_CLOCKERCOMPONENT_H
18 
19 #include "sst/core/component.h"
20 
21 namespace SST {
22 namespace CoreTestClockerComponent {
23 
25 {
26 public:
27  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
28  SST_ELI_REGISTER_COMPONENT(
30  "coreTestElement",
31  "coreTestClockerComponent",
32  SST_ELI_ELEMENT_VERSION(1,0,0),
33  "Clock Benchmark Component",
34  COMPONENT_CATEGORY_UNCATEGORIZED
35  )
36 
37  SST_ELI_DOCUMENT_PARAMS(
38  { "clock", "Clock frequency", "1GHz" },
39  { "clockcount", "Number of clock ticks to execute", "100000"}
40  )
41 
42  // Optional since there is nothing to document
43  SST_ELI_DOCUMENT_STATISTICS(
44  )
45 
46  // Optional since there is nothing to document
47  SST_ELI_DOCUMENT_PORTS(
48  )
49 
50  // Optional since there is nothing to document
51  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
52  )
53 
54  coreTestClockerComponent(SST::ComponentId_t id, SST::Params& params);
55  void setup() {}
56  void finish() {}
57 
58 private:
59  coreTestClockerComponent(); // for serialization only
60  coreTestClockerComponent(const coreTestClockerComponent&); // do not implement
61  void operator=(const coreTestClockerComponent&); // do not implement
62 
63  virtual bool tick(SST::Cycle_t);
64 
65  virtual bool Clock2Tick(SST::Cycle_t, uint32_t);
66  virtual bool Clock3Tick(SST::Cycle_t, uint32_t);
67 
68  virtual void Oneshot1Callback(uint32_t);
69  virtual void Oneshot2Callback();
70 
71  TimeConverter* tc;
72  Clock::HandlerBase* Clock3Handler;
73 
74  // Variables to store OneShot Callback Handlers
75  OneShot::HandlerBase* callback1Handler;
76  OneShot::HandlerBase* callback2Handler;
77 
78  std::string clock_frequency_str;
79  int clock_count;
80 };
81 
82 } // namespace CoreTestClockerComponent
83 } // namespace SST
84 
85 #endif // SST_CORE_CORETEST_CLOCKERCOMPONENT_H
Definition: ssthandler.h:100
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: coreTest_ClockerComponent.h:24
Handler with no arguments to callback from caller.
Definition: ssthandler.h:167
void setup()
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_ClockerComponent.h:55
Parameter store.
Definition: params.h:55
void finish()
Called after complete phase, but before objects are destroyed.
Definition: coreTest_ClockerComponent.h:56