12 #ifndef SST_CORE_WATCHPOINT_H 13 #define SST_CORE_WATCHPOINT_H 15 #include "sst/core/clock.h" 16 #include "sst/core/event.h" 17 #include "sst/core/serialization/objectMap.h" 18 #include "sst/core/stringize.h" 30 static const uint32_t VMASK = 0x10;
39 virtual bool check() = 0;
40 virtual ~
Logic() =
default;
51 virtual std::string actionToString() = 0;
53 inline void setVerbosity(uint32_t v) { verbosity = v; }
56 uint32_t verbosity = 0;
57 inline void msg(
const std::string& msg)
59 if ( WatchPoint::VMASK & verbosity ) std::cout << msg << std::endl;
68 inline std::string actionToString()
override {
return "interactive"; }
77 inline std::string actionToString()
override {
return "printTrace"; }
86 inline std::string actionToString()
override {
return "checkpoint"; }
95 inline std::string actionToString()
override {
return "printStatus"; }
108 inline std::string actionToString()
override {
return "set " + name_ +
" " + valStr_; }
112 std::string name_ =
"";
114 std::string valStr_ =
"";
122 inline std::string actionToString()
override {
return "shutdown"; }
135 void beforeHandler(uintptr_t UNUSED(key),
const Event* UNUSED(ev))
override;
136 void afterHandler(uintptr_t UNUSED(key))
override;
139 void beforeHandler(uintptr_t UNUSED(key),
const Cycle_t& UNUSED(cycle))
override;
140 void afterHandler(uintptr_t UNUSED(key),
const bool& UNUSED(ret))
override;
143 inline std::string getName() {
return name_; }
144 size_t getBufferSize();
145 void printTriggerRecord();
148 enum HANDLER :
unsigned {
159 inline void setVerbosity(uint32_t v)
162 wpAction->setVerbosity(v);
164 inline void msg(
const std::string& msg)
166 if ( VMASK & verbosity ) std::cout << msg << std::endl;
168 void setHandler(
unsigned handlerType);
169 std::string handlerToString(HANDLER h);
171 void printWatchpoint();
172 void resetTraceBuffer();
173 inline bool checkReset() {
return reset_; }
175 void addTraceBuffer(Core::Serialization::TraceBuffer* tb);
176 void addObjectBuffer(Core::Serialization::ObjectBuffer* ob);
177 void addComparison(Core::Serialization::ObjectMapComparison* cmp);
179 enum LogicOp :
unsigned {
184 inline void addLogicOp(LogicOp op) { logicOps_.push_back(op); }
185 inline void setAction(WPAction* action) { wpAction = action; }
188 bool getInteractive();
189 void setEnterInteractive();
190 void setInteractiveMsg(
const std::string& msg);
191 SimTime_t getCurrentSimCycle();
192 void setCheckpoint();
195 void simulationShutdown();
198 size_t numCmpObj_ = 0;
199 std::vector<Core::Serialization::ObjectMapComparison*> cmpObjects_;
200 std::vector<LogicOp> logicOps_;
202 Core::Serialization::TraceBuffer* tb_ =
nullptr;
204 HANDLER handler = ALL;
205 bool trigger =
false;
206 HANDLER triggerHandler = HANDLER::NONE;
210 void setBufferReset();
212 uint32_t verbosity = 0;
221 #endif // SST_CORE_WATCHPOINT_H Base class for interacting with data from ObjectMap.
Definition: objectMap.h:85
Definition: watchPoint.h:117
WatchPoint Action Inner Classes.
Definition: watchPoint.h:46
Definition: watchPoint.h:63
Base class for objects created by the serializer mapping mode used to map the variables for objects...
Definition: objectMap.h:158
Definition: watchPoint.h:72
Definition: watchPoint.h:81
Base class for performing comparisons and logic operations for determining when the WatchPoint trigge...
Definition: watchPoint.h:36
Attach Point to get notified when a handler starts and stops.
Definition: ssthandler.h:117
Definition: watchPoint.h:90
Class that can attach to Clock and Event Handlers to monitor the state of variables.
Definition: watchPoint.h:27
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:40
Definition: watchPoint.h:99