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