SST  12.0.1
StructuralSimulationToolkit
coreTest_Links.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_LINKS_H
17 #define SST_CORE_CORETEST_LINKS_H
18 
19 #include "sst/core/component.h"
20 #include "sst/core/link.h"
21 #include "sst/core/rng/marsaglia.h"
22 
23 namespace SST {
24 namespace CoreTestComponent {
25 
27 {
28 public:
29  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
30  SST_ELI_REGISTER_COMPONENT(
32  "coreTestElement",
33  "coreTestLinks",
34  SST_ELI_ELEMENT_VERSION(1,0,0),
35  "CoreTest Test Links",
36  COMPONENT_CATEGORY_UNCATEGORIZED
37  )
38 
39  SST_ELI_DOCUMENT_PARAMS(
40  { "id", "ID of component", "" },
41  { "added_send_latency", "Additional output latency to add to sends", "0ns"},
42  { "added_recv_latency", "Additional input latency to add to incoming events", "0ns"},
43  { "link_time_base", "Timebase for links", "1ns" }
44  )
45 
46  // Optional since there is nothing to document
47  SST_ELI_DOCUMENT_STATISTICS()
48 
49  SST_ELI_DOCUMENT_PORTS(
50  {"Elink", "Link to the East", { "NullEvent", "" } },
51  {"Wlink", "Link to the West", { "NullEvent", "" } }
52  )
53 
54  // Optional since there is nothing to document
55  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
56  )
57 
58  coreTestLinks(SST::ComponentId_t id, SST::Params& params);
59  ~coreTestLinks();
60 
61  void setup() {}
62  void finish() {}
63 
64 private:
65  int my_id;
66  int recv_count;
67 
68  void handleEvent(SST::Event* ev, std::string from);
69  virtual bool clockTic(SST::Cycle_t);
70 
71  SST::Link* E;
72  SST::Link* W;
73 };
74 
75 } // namespace CoreTestComponent
76 } // namespace SST
77 
78 #endif // SST_CORE_CORETEST_LINKS_H
Main component object for the simulation.
Definition: component.h:30
Parameter store.
Definition: params.h:55
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:34