SST  10.1.0
StructuralSimulationToolkit
coreTest_TracerComponent.h
1 // Copyright 2009-2020 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-2020, 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 _CORETESTTRACERCOMPONENT_H
17 #define _CORETESTTRACERCOMPONENT_H
18 
19 #include <sst/elements/memHierarchy/memEvent.h>
20 
21 using namespace std;
22 using namespace SST;
23 using namespace SST::MemHierarchy;
24 
25 namespace SST{
26 namespace CoreTestTracerComponent {
27 
29 public:
30 
31  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
32  SST_ELI_REGISTER_COMPONENT(
33  coreTestRNGComponent,
34  "coreTestElement",
35  "coreTestRNGComponent",
36  SST_ELI_ELEMENT_VERSION(1,0,0),
37  "Random number generation component",
38  COMPONENT_CATEGORY_UNCATEGORIZED)
39 
40  SST_ELI_DOCUMENT_PARAMS(
41  { "seed_w", "The seed to use for the random number generator", "7" },
42  { "seed_z", "The seed to use for the random number generator", "5" },
43  { "seed", "The seed to use for the random number generator.", "11" },
44  { "rng", "The random number generator to use (Marsaglia or Mersenne), default is Mersenne", "Mersenne"},
45  { "count", "The number of random numbers to generate, default is 1000", "1000" },
46  { "verbose", "Sets the output verbosity of the component", "0" },
47  )
48 
49  // Optional since there is nothing to document
50  SST_ELI_DOCUMENT_STATISTICS(
51  )
52 
53  // Optional since there is nothing to document
54  SST_ELI_DOCUMENT_PORTS(
55  )
56 
57  coreTestTracerComponent(SST::ComponentId_t id, Params& params);
59  void finish();
60 
61 private:
62  // Functions
63  bool clock(SST::Cycle_t);
64  void FinalStats(FILE*, unsigned int);
65  void PrintAddrHistogram(FILE*, vector<SST::MemHierarchy::Addr>);
66  void PrintAccessLatencyDistribution(FILE*, unsigned int);
67 
68  Output* out;
69  FILE* traceFile;
70  FILE* statsFile;
71 
72  // Links
73  SST::Link *northBus;
74  SST::Link *southBus;
75 
76  // Input Parameters
77  unsigned int stats;
78  unsigned int pageSize;
79  unsigned int accessLatBins;
80 
81  // Flags
82  bool writeTrace;
83  bool writeStats;
84  bool writeDebug_8;
85 
86  unsigned int nbCount;
87  unsigned int sbCount;
88  uint64_t timestamp;
89 
90  vector<SST::MemHierarchy::Addr>AddrHist; // Address Histogram
91  vector<unsigned int> AccessLatencyDist;
92 
93  map<MemEvent::id_type,uint64_t>InFlightReqQueue;
94 
95  TimeConverter* picoTimeConv;
96  TimeConverter* nanoTimeConv;
97 
98  // Serialization
99  coreTestTracerComponent(); // for serialization only
100  coreTestTracerComponent(const coreTestTracerComponent&); // do not implement
101  void operator=(const coreTestTracerComponent&); // do not implement
102 
103 
104 //static const ElementInfoParam coreTestRNGComponent_params[] = {
105 // { "seed_w", "The seed to use for the random number generator", "7" },
106 // { "seed_z", "The seed to use for the random number generator", "5" },
107 // { "seed", "The seed to use for the random number generator.", "11" },
108 // { "rng", "The random number generator to use (Marsaglia or Mersenne), default is Mersenne", "Mersenne"},
109 // { "count", "The number of random numbers to generate, default is 1000", "1000" },
110 // { "verbose", "Sets the output verbosity of the component", "0" },
111 // { NULL, NULL, NULL }
112 //};
113 
114 //static const ElementInfoComponent coreTestElementComponents[] = {
115 // { "coreTestRNGComponent", // Name
116 // "Random number generation component", // Description
117 // NULL, // PrintHelp
118 // create_coreTestRNGComponent, // Allocator
119 // coreTestRNGComponent_params, // Parameters
120 // NULL, // Ports
121 // COMPONENT_CATEGORY_UNCATEGORIZED, // Category
122 // NULL // Statistics
123 // },
124 }; // class coreTestTracerComponent
125 
126 } // namespace CoreTestTracerComponent
127 } // namespace SST
128 
129 #endif /* _CORETESTTRACERCOMPONENT_H */
130 
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
A class to convert between a component&#39;s view of time and the core&#39;s view of time.
Definition: timeConverter.h:25
Main component object for the simulation.
Definition: component.h:31
Parameter store.
Definition: params.h:44
Definition: coreTest_TracerComponent.h:28