Ver código fonte

Compress bootstrap file even more

Yentl Van Tendeloo 8 anos atrás
pai
commit
ccab31a43c

+ 1 - 28
interface/HUTN/hutn_compiler/bootstrap_visitor.py

@@ -20,8 +20,6 @@ class BootstrapVisitor(PrimitivesVisitor):
             return "%s_%s" % (self.prepend_name, name) if isinstance(name, int) else name
 
     def dump(self):
-        link_id = 0
-
         if self.main:
             call = self.value(Action("call"))
             access = self.value(Action("access"))
@@ -49,11 +47,7 @@ class BootstrapVisitor(PrimitivesVisitor):
 
                 source = self.rename(source)
                 target = self.rename(target)
-                link_id += 1
-                output.append("Dict _%s(%s, %s, %s)\n" % (link_id, source, value, target))
-                #output.append("Edge _%s_0(%s, %s)\n" % (linkname, source, target))
-                #output.append("Node _%s_2(%s)\n" % (linkname, value))
-                #output.append("Edge _%s_1(_%s_0, _%s_2)\n" % (linkname, linkname, linkname))
+                output.append("Dict (%s, %s, %s)\n" % (source, value, target))
             elif t == "E":
                 name, source, target = data
                 source = source if self.first != source else "initial_IP"
@@ -63,24 +57,3 @@ class BootstrapVisitor(PrimitivesVisitor):
                 target = self.rename(target)
                 output.append("Edge _%s(_%s, _%s)\n" % (name, source, target))
         return ''.join(output)
-
-    """
-    def visit_definition(self, tree):
-        for a in tree.get_children("ID"):
-            name = a.get_tail()[0]
-            return PrimitivesVisitor.visit_definition(self, tree)
-
-    def visit_vardecl(self, tree):
-        if len(tree.get_tail()) > 2:
-            for a in tree.get_children("ID"):
-                name = a.get_tail()[0]
-                return PrimitivesVisitor.visit_vardecl(self, tree)
-        else:
-            return PrimitivesVisitor.visit_vardecl(self, tree)
-
-    def visit_funcdecl(self, tree):
-        for a in tree.get_children("func_name"):
-            for b in a.get_children("ID"):
-                name = b.get_tail()[0]
-                return PrimitivesVisitor.visit_funcdecl(self, tree)
-    """

+ 5 - 0
models/SCCD_execute.alc

@@ -633,6 +633,11 @@ Boolean function main(model : Element):
 			output("Processed event, ready for more!")
 
 		timeout = step(model, data)
+
+		if (read_nr_out(data["classes"]) == 0):
+			// No more active classes left: terminate!
+			log("Finished SCCD execution")
+			break!
 		log("Pausing for " + cast_v2s(timeout))
 
 	// We should never get here!