SST  13.1.0
Structural Simulation Toolkit
coreTest_LookupTableComponent.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_LOOKUPTABLECOMPONENT_H
13 #define SST_CORE_CORETEST_LOOKUPTABLECOMPONENT_H
14 
15 #include "sst/core/component.h"
16 #include "sst/core/output.h"
17 #include "sst/core/sharedRegion.h"
18 
19 namespace SST {
20 namespace CoreTestLookupTableComponent {
21 
23 {
24 public:
25  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
26  SST_ELI_REGISTER_COMPONENT(
28  "coreTestElement",
29  "coreTestLookupTableComponent",
30  SST_ELI_ELEMENT_VERSION(1,0,0),
31  "Demonstrates using a Shared Lookup Table",
32  COMPONENT_CATEGORY_UNCATEGORIZED
33  )
34 
35  SST_ELI_DOCUMENT_PARAMS(
36  { "filename", "Filename to load as the table", ""},
37  {"num_entities", "Number of entities in the sim", "1"},
38  {"myid", "ID Number (0 <= myid < num_entities)", "0"}
39  )
40 
41  // Optional since there is nothing to document
42  SST_ELI_DOCUMENT_STATISTICS(
43  )
44 
45  // Optional since there is nothing to document
46  SST_ELI_DOCUMENT_PORTS(
47  )
48 
49  // Optional since there is nothing to document
50  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
51  )
52 
53  coreTestLookupTableComponent(SST::ComponentId_t id, SST::Params& params);
55 
56  virtual void init(unsigned int phase);
57  virtual void setup();
58  virtual void finish();
59 
60  bool tick(SST::Cycle_t);
61 
62 private:
63  Output out;
64  const uint8_t* table;
65  size_t tableSize;
66  SharedRegion* sregion;
67 };
68 
69 } // namespace CoreTestLookupTableComponent
70 } // namespace SST
71 
72 #endif // SST_CORE_CORETEST_LOOKUPTABLECOMPONENT_H
Main component object for the simulation.
Definition: component.h:31
Definition: coreTest_LookupTableComponent.h:23
virtual void finish()
Called after complete phase, but before objects are destroyed.
Definition: coreTest_LookupTableComponent.cc:81
virtual void setup()
Called after all components have been constructed and initialization has completed,...
Definition: coreTest_LookupTableComponent.cc:75
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition: output.h:52
Parameter store.
Definition: params.h:56