From 3adc38e5fd32c4f9bd4f12422a218f172afd98cf 2020-09-30 18:05:53 From: Christopher Esterhuyse Date: 2020-09-30 18:05:53 Subject: [PATCH] more benchmarking cases. clearer PDL eval errors --- diff --git a/examples/bench_10/main.c b/examples/bench_10/main.c new file mode 100644 index 0000000000000000000000000000000000000000..1efc062fa15353317366cdeeab9f4435b576f220 --- /dev/null +++ b/examples/bench_10/main.c @@ -0,0 +1,50 @@ +#include +#include "../../reowolf.h" +#include "../utility.c" +int main(int argc, char** argv) { + int i, inside, total; + inside = atoi(argv[1]); + total = atoi(argv[2]); + printf("inside %d, total %d\n", inside, total); + unsigned char pdl[] = ""; + Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); + printf("Error str `%s`\n", reowolf_error_peek(NULL)); + char logpath[] = "./bench_10.txt"; + Connector * c = connector_new_logging(pd, logpath, sizeof(logpath)-1); + + PortId native_putter, native_getter; + char ident[] = "sync"; // defined in reowolf's stdlib + connector_add_port_pair(c, &native_putter, &native_getter); + for (i=0; i +#include "../../reowolf.h" +#include "../utility.c" +int main(int argc, char** argv) { + int i, j, forwards, num_options, correct_index; + forwards = atoi(argv[1]); + num_options = atoi(argv[2]); + correct_index = atoi(argv[3]); + printf("forwards %d, num_options %d, correct_index %d\n", + forwards, num_options, correct_index); + unsigned char pdl[] = + "primitive recv_zero(in a) { " + " while(true) synchronous {" + " msg m = get(a); " + " assert(m[0] == 0); " + " } " + "} " + ; + Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); + printf("Error str `%s`\n", reowolf_error_peek(NULL)); + char logpath[] = "./bench_11.txt"; + Connector * c = connector_new_logging(pd, logpath, sizeof(logpath)-1); + + PortId native_putter, native_getter; + connector_add_port_pair(c, &native_putter, &native_getter); + for (i=0; i +#include "../../reowolf.h" +#include "../utility.c" +int main(int argc, char** argv) { + int i, proto_components; + proto_components = atoi(argv[1]); + printf("proto_components: %d\n", proto_components); + + const unsigned char pdl[] = + "primitive presync_work() { " + " int i = 0; " + " while(true) { " + " i = 0; " + " while(i < 2) i++; " + " synchronous {} " + " } " + "} " + ; + Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); + char logpath[] = "./bench_4.txt"; + Connector * c = connector_new_logging(pd, logpath, sizeof(logpath)-1); + for (i=0; i