12 #ifndef SST_CORE_CORETEST_PORTMODULE_H 13 #define SST_CORE_CORETEST_PORTMODULE_H 15 #include "sst/core/component.h" 16 #include "sst/core/event.h" 17 #include "sst/core/subcomponent.h" 21 class PortSubComponent;
28 bool modified =
false;
33 Event::serialize_order(ser);
55 SST_ELI_REGISTER_PORTMODULE(
59 SST_ELI_ELEMENT_VERSION(0, 1, 0),
60 "PortModule used for testing port module functionality")
62 SST_ELI_DOCUMENT_PARAMS(
63 {
"modify",
"Set to true to have PortModule mark event as modfied. NOTE: only 1 of modify, drop or replace can be set to true.",
"false" },
64 {
"drop",
"Set to true to have PortModule drop events. NOTE: only 1 of modify, drop, or replace can be set to true.",
"false" },
65 {
"replace",
"Set to true to have PortModule drop events and deliver an Ack event instead. NOTE: only 1 of modify, drop or replace can be set to true.",
"false" },
66 {
"install_on_send",
"Controls whether the PortModule is installed on the send or receive side. Set to true to register on send and false to register on recieve.",
"false" },
69 SST_ELI_DOCUMENT_STATISTICS(
70 {
"events_intercepted",
"How many events were intercepted by the module",
"count", 4 },
71 {
"not_enabled",
"A statistic that isn't enabled in tests to ensure that stat level is respected",
"none", 7 }
74 SST_ELI_IS_CHECKPOINTABLE()
89 bool install_on_send_ =
false;
92 bool replace_ =
false;
99 SST::PortModule::serialize_order(ser);
100 SST_SER(install_on_send_);
114 SST_ELI_REGISTER_COMPONENT(
117 "coreTestPortModuleComponent",
118 SST_ELI_ELEMENT_VERSION(1,0,0),
119 "Component to test PortModule functionality",
120 COMPONENT_CATEGORY_UNCATEGORIZED
123 SST_ELI_DOCUMENT_PORTS(
124 {
"left",
"Link to the left. Will only receive on left port. If nothing is attached to the left port, the component will send sendcount events.", {
"" } },
125 {
"right",
"Link to the right. Will only send on right port. If nothing is connect to the right port, the component will check the types of the events recieved.", {
"" } }
128 SST_ELI_DOCUMENT_PARAMS(
129 {
"sendcount",
"Events to send if send is set to true",
"20"},
130 {
"use_subcomponent",
"Set to true to use a subcomponent to hook up the ports",
"false"},
131 {
"repeat_last",
"When set to true, will keep sending \"last\" events until the simulation terminates. This is to support test of the RandomDropPortModule which doesn't check event types or values so will not automatically pass through the event marked last.",
"false" },
134 SST_ELI_DOCUMENT_STATISTICS(
135 {
"handle_modified_event",
"How many modified events were handled",
"events", 1 },
136 {
"handle_ack_event",
"How many ack events were handled",
"events", 1 },
137 {
"handle_unmodified_event",
"How many unmodified events were handled",
"events", 1 },
141 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
142 {
"port_slot",
"Slot for loading subcomponent to test shared ports",
"" }
145 SST_ELI_IS_CHECKPOINTABLE()
151 SST::Component::serialize_order(ser);
154 SST_SER(repeat_last_);
157 SST_SER(stat_mod_event_);
158 SST_SER(stat_unmod_event_);
159 SST_SER(stat_ack_event_);
165 bool repeat_last_ =
false;
180 bool tick(SST::Cycle_t);
190 SST_ELI_REGISTER_SUBCOMPONENT(
194 SST_ELI_ELEMENT_VERSION(1,0,0),
195 "Subcomponent used to test putting PortModules on shared ports",
199 SST_ELI_IS_CHECKPOINTABLE()
205 Link* getLeft() {
return left_; }
206 Link* getRight() {
return right_; }
216 SST::SubComponent::serialize_order(ser);
225 #endif // SST_CORE_CORETEST_PORTMODULE_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Definition: coreTest_PortModule.h:25
Main component object for the simulation.
Definition: component.h:30
Definition: coreTest_PortModule.h:185
bool installOnReceive() override
Called to determine if the PortModule should be installed on receives.
Definition: coreTest_PortModule.h:85
Definition: coreTest_PortModule.h:52
void eventSent(uintptr_t key, Event *&ev) override
Function that will be called when an event is sent on a link with registered PortModules.
Definition: coreTest_PortModule.cc:48
void interceptHandler(uintptr_t key, Event *&data, bool &cancel) override
Function that will be called before the event handler to let the attach point intercept the data...
Definition: coreTest_PortModule.cc:82
Definition: coreTest_PortModule.h:110
Definition: coreTest_PortModule.h:43
Parameter store.
Definition: params.h:63
Definition: coreTest_PortModule.h:19
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:40
bool installOnSend() override
Called to determine if the PortModule should be installed on sends.
Definition: coreTest_PortModule.h:86
PortModules are modules that can be attached to the send and/or receive side of ports.
Definition: portModule.h:50
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:28
Link between two components.
Definition: link.h:56