Initial commit
This commit is contained in:
Executable
+42
@@ -0,0 +1,42 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\telements1Count: " << sin->elements1Count.getValue() << std::endl
|
||||
<< "\telement1in: " << sin->element1in.getValue() << std::endl
|
||||
<< "\tloopPort1: " << sin->loopPort1.getValue() << std::endl
|
||||
<< "\telements2Count: " << sin->elements2Count.getValue() << std::endl
|
||||
<< "\telement2in: " << sin->element2in.getValue() << std::endl
|
||||
<< "\tloopPort2: " << sin->loopPort2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter == 0 && sin->elements1Count.getValue() != sin->loopPort1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal telements1Count [" << sin->elements1Count.getValue() << "] during first iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && myiter != sin->loopPort1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->elements2Count.getValue() != sin->loopPort2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal telements2Count [" << sin->elements2Count.getValue() << "] during first iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && myiter != sin->loopPort2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if ( myiter+1 != sin->element1in.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: element1in value [" << sin->element1in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if ( myiter+1 != sin->element2in.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: element2in value [" << sin->element2in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->element1.setValue(sin->element1in.getValue());
|
||||
sout->element2.setValue(sin->element2in.getValue());
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+164
@@ -0,0 +1,164 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\telements1Count: " << sin->elements1Count.getValue() << std::endl
|
||||
<< "\telements2Count: " << sin->elements2Count.getValue() << std::endl
|
||||
<< "\tloopPort1: " << sin->loopPort1.getValue() << std::endl
|
||||
<< "\tloopPort2: " << sin->loopPort2.getValue() << std::endl
|
||||
<< "\toutPort1: " << sin->outPort1.getValue() << std::endl
|
||||
<< "\toutPort2: " << sin->outPort2.getValue() << std::endl
|
||||
<< "\toutLoopPort1: " << sin->outLoopPort1.getValue() << std::endl
|
||||
<< "\toutLoopPort2: " << sin->outLoopPort2.getValue() << std::endl;
|
||||
#include <algorithm>
|
||||
auto elemMin = std::min(sin->elements1Count.getValue(), sin->elements2Count.getValue());
|
||||
if (elemMin <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elemMin [" << elemMin << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->loopPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 [" << sin->loopPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->loopPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 [" << sin->loopPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPort1 [" << sin->outPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPort2 [" << sin->outPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outLoopPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outLoopPort1 [" << sin->outLoopPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outLoopPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outLoopPort2 [" << sin->outLoopPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->elements1orig.getSize() != sin->elements1Count.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1orig collection size [" << sin->elements1orig.getSize() << "] is not equal elements1Count [" << sin->elements1Count.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1orig: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements1orig.getSize(); t++) {
|
||||
if (sin->elements1orig.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1orig collection value index [" << t << "] does not have correct value [" << sin->elements1orig.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements1orig.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements2orig.getSize() != sin->elements2Count.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2orig collection size [" << sin->elements2orig.getSize() << "] is not equal elements2Count [" << sin->elements2Count.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2orig: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements2orig.getSize(); t++) {
|
||||
if (sin->elements2orig.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2orig collection value index [" << t << "] does not have correct value [" << sin->elements2orig.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements2orig.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements1in.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1in collection size [" << sin->elements1in.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1in: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements1in.getSize(); t++) {
|
||||
if (sin->elements1in.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1in collection value index [" << t << "] does not have correct value [" << sin->elements1in.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements1in.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements2in.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2in collection size [" << sin->elements2in.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2in: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements2in.getSize(); t++) {
|
||||
if (sin->elements2in.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2in collection value index [" << t << "] does not have correct value [" << sin->elements2in.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements2in.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->isOkUnion1.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection size [" << sin->isOkUnion1.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tisOkUnion1: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->isOkUnion1.getSize(); t++) {
|
||||
if (!sin->isOkUnion1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection value index [" << t << "] does not have correct value [" << sin->isOkUnion1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->isOkUnion1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->elements1 = sin->elements1in;
|
||||
sout->elements2 = sin->elements2in;
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements1;
|
||||
elements1.init(4);
|
||||
elements1.setEntryValue(0, 1);
|
||||
elements1.setEntryValue(1, 2);
|
||||
elements1.setEntryValue(2, 3);
|
||||
elements1.setEntryValue(3, 4);
|
||||
elements1.setFinalised(true);
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements2;
|
||||
elements2.init(5);
|
||||
elements2.setEntryValue(0, 1);
|
||||
elements2.setEntryValue(1, 2);
|
||||
elements2.setEntryValue(2, 3);
|
||||
elements2.setEntryValue(3, 4);
|
||||
elements2.setEntryValue(4, 5);
|
||||
elements2.setFinalised(true);
|
||||
wfInput.elements1Count.setValue(elements1.getSize());
|
||||
wfInput.gelements1 = elements1;
|
||||
wfInput.elements2Count.setValue(elements2.getSize());
|
||||
wfInput.gelements2 = elements2;
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOk: " << wfOutput.isOK.getValue() << std::endl;
|
||||
if (!wfOutput.isOK.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOk [" << wfOutput.isOK.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
#include <algorithm>
|
||||
auto elemMin = std::min(wfInput.elements1Count.getValue(), wfInput.elements2Count.getValue());
|
||||
if (elemMin <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elemMin [" << elemMin << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfOutput.elements1.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1 collection size [" << wfOutput.elements1.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.elements1.getSize(); t++) {
|
||||
if (wfOutput.elements1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1 collection value index [" << t << "] does not have correct value [" << wfOutput.elements1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.elements1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (wfOutput.elements2.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2 collection size [" << wfOutput.elements2.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.elements2.getSize(); t++) {
|
||||
if (wfOutput.elements2.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2 collection value index [" << t << "] does not have correct value [" << wfOutput.elements2.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.elements2.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Reference in New Issue
Block a user