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