changeset 897:70016b1cd1e2

goto mcMeta
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2021 15:45:50 +0900
parents f978f88ada11
children 04edc3e392bc
files src/parallel_execution/ModelChecking/MCWorker.cbc src/parallel_execution/examples/DPPMC/PhilsImpl.cbc src/parallel_execution/examples/DPPMC/meta.pm src/parallel_execution/generate_stub.pl
diffstat 4 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/ModelChecking/MCWorker.cbc	Tue Jan 26 15:10:43 2021 +0900
+++ b/src/parallel_execution/ModelChecking/MCWorker.cbc	Tue Jan 26 15:45:50 2021 +0900
@@ -57,7 +57,10 @@
     goto meta(ncontext, ncontext->next);
 }
 
-__code mcMeta(struct Context* context, enum Code next) {
+#define __ncode __code
+
+
+__ncode mcMeta(struct Context* context, enum Code next) {
     struct MCWorker* mcworker =  (struct MCWorker*) context->worker->worker;
     context->next = next;
     goto meta(mcworker->context, mcworker->nextStep);
--- a/src/parallel_execution/examples/DPPMC/PhilsImpl.cbc	Tue Jan 26 15:10:43 2021 +0900
+++ b/src/parallel_execution/examples/DPPMC/PhilsImpl.cbc	Tue Jan 26 15:45:50 2021 +0900
@@ -6,6 +6,7 @@
 #interface "AtomicT_int.h"
 #interface "TaskManager.h"
 
+extern __code mcMeta(struct Context*, enum Code);
 
 // ----
 // typedef struct PhilsImpl <Self, Isa> impl Phils {
--- a/src/parallel_execution/examples/DPPMC/meta.pm	Tue Jan 26 15:10:43 2021 +0900
+++ b/src/parallel_execution/examples/DPPMC/meta.pm	Tue Jan 26 15:45:50 2021 +0900
@@ -13,7 +13,7 @@
 
 sub generateMcMeta {
   my ($context, $next) = @_;
-  return "goto mcMeta($context, $next);\n";
+  return "goto mcMeta($context, $next);";
 }
 
 1;
--- a/src/parallel_execution/generate_stub.pl	Tue Jan 26 15:10:43 2021 +0900
+++ b/src/parallel_execution/generate_stub.pl	Tue Jan 26 15:45:50 2021 +0900
@@ -907,7 +907,7 @@
                 };
                 print $fd generateInterfaceGearef($_, $currentCodeGearName, $filename, $parsed, \%filename2EachCodeGearArgs, \%localVarType, $context_name);
                 my $next = "$parsed->{next}->$parsed->{method}";
-                print $fd $parsed->{prev},$generateMeta->($currentCodeGearName, $context_name, $next);
+                print $fd $parsed->{prev},$generateMeta->($currentCodeGearName, $context_name, $next), "\n";
                 next;
             } elsif(/^(.*)par goto (\w+)\((.*)\);/) {
                 debug_print("generateDataGear",__LINE__, $_) if $opt_debug;
@@ -1007,9 +1007,9 @@
                     if ($hasParGoto) {
                         print $fd "${prev}Gearef(${arg_context}, TaskManager)->taskList = ${arg_context}->taskList;\n";
                         print $fd "${prev}Gearef(${arg_context}, TaskManager)->next1 = C_$next;\n";
-                        print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, "C_$next");
+                        print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, "C_$next"), "\n";
                     } else {
-                        print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, $next);
+                        print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, $next), "\n";
                     }
                     next;
                 }
@@ -1022,7 +1022,7 @@
                     print $fd $_;
                     next;
                 } else {
-                    print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, "C_$next");
+                    print $fd ${prev},$generateMeta->($currentCodeGearName, ${arg_context}, "C_$next"), "\n";
                     next;
                 }
             } elsif(/^.*(struct|union)?\s([\w<>]+)\*\s(\w+)\s?[=;]/) { # TODO: FIX!! # see also comment local val collent
@@ -1337,7 +1337,7 @@
 
 sub generateDefaultgotoMeta {
   my (undef, $context, $next) = @_;
-  return "goto meta($context, $next);\n";
+  return "goto meta($context, $next);";
 }
 
 sub createGotoMetaFunction {