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