SST  15.1.0
StructuralSimulationToolkit
coreTest_LookupTableComponent.h
1 // Copyright 2009-2025 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-2025, 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 #include <cstddef>
20 #include <cstdint>
21 
23 
25 {
26 public:
27  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
28  SST_ELI_REGISTER_COMPONENT(
30  "coreTestElement",
31  "coreTestLookupTableComponent",
32  SST_ELI_ELEMENT_VERSION(1,0,0),
33  "Demonstrates using a Shared Lookup Table",
34  COMPONENT_CATEGORY_UNCATEGORIZED
35  )
36 
37  SST_ELI_DOCUMENT_PARAMS(
38  { "filename", "Filename to load as the table", ""},
39  {"num_entities", "Number of entities in the sim", "1"},
40  {"myid", "ID Number (0 <= myid < num_entities)", "0"}
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  coreTestLookupTableComponent(SST::ComponentId_t id, SST::Params& params);
57 
58  virtual void init(unsigned int phase);
59  virtual void setup();
60  virtual void finish();
61 
62  bool tick(SST::Cycle_t);
63 
64 private:
65  Output out;
66  const uint8_t* table;
67  size_t tableSize;
68  SharedRegion* sregion;
69 };
70 
71 } // namespace SST::CoreTestLookupTableComponent
72 
73 #endif // SST_CORE_CORETEST_LOOKUPTABLECOMPONENT_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
Definition: coreTest_LookupTableComponent.h:24
virtual void finish()
Called after complete phase, but before objects are destroyed.
Definition: coreTest_LookupTableComponent.cc:81
Main component object for the simulation.
Definition: component.h:30
virtual void setup()
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_LookupTableComponent.cc:75
Definition: coreTest_LookupTableComponent.cc:25
Parameter store.
Definition: params.h:63