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