Browse Source

Change SCCD's default memory protocol semantics to SMALL_STEP. Rust skips tests with non-SMALL_STEP memory protocol semantics

Joeri Exelmans 4 years ago
parent
commit
c8090246b7

+ 8 - 2
code_generation.txt

@@ -131,8 +131,8 @@ Roadmap
 
   Milestone n+1: "TODO"
 
-    - Syntactic output events
-    - Event parameters
+    - (DONE) Syntactic output events
+    - (DONE) Event parameters
     - Memory Protocol semantics
     - Concurrency semantics
 
@@ -152,6 +152,12 @@ Performance over time
 
 for test semantics/big_step_maximality/test_ortho_takemany.xml
 
+commit 91a048eedb6eaf224df3567b506cbda07d664781 - Dec 28, 2020 - implemented event parameters, use tuple structs for event types
+
+binary size, opt-level=3:                       3244920 bytes
+instruction count (perf stat) (opt-level=3):    562.600 instructions:u
+
+
 commit 950fcc1e7eed1e3b3c5eda75b896078e53eb71c4 - Dec 26, 2020 - syntactic output events (enums instead of strings), re-implemented event queue (entries allocated on heap, 'canceled' flag)
 
 binary size, no opt:                            3833544 bytes <- not sure what caused this sudden drop in unoptimized binary size

+ 7 - 2
python/sccd/statechart/codegen/rust.py

@@ -334,6 +334,13 @@ class StatechartRustGenerator(ActionLangRustGenerator):
         self.state_stack.pop()
 
     def visit_Statechart(self, sc):
+        if sc.semantics.concurrency == Concurrency.MANY:
+            raise UnsupportedFeature("concurrency")
+
+        if sc.semantics.enabledness_memory_protocol != MemoryProtocol.SMALL_STEP or sc.semantics.assignment_memory_protocol != MemoryProtocol.SMALL_STEP:
+            raise UnsupportedFeature("Memory protocol semantics")
+
+
         self.scope.push(sc.scope)
 
         self.w.writeln("use std::ops::Deref;")
@@ -346,8 +353,6 @@ class StatechartRustGenerator(ActionLangRustGenerator):
         self.w.writeln("use sccd::statechart::EventLifeline;")
         self.w.writeln();
 
-        if sc.semantics.concurrency == Concurrency.MANY:
-            raise UnsupportedFeature("concurrency")
 
         priority_ordered_transitions = priority.priority_and_concurrency(sc) # may raise error
 

+ 2 - 2
python/sccd/statechart/static/semantic_configuration.py

@@ -90,8 +90,8 @@ class SemanticConfiguration:
   combo_step_maximality: SemanticChoice[Maximality] = Maximality.TAKE_ONE
   internal_event_lifeline: SemanticChoice[InternalEventLifeline] = InternalEventLifeline.NEXT_COMBO_STEP
   input_event_lifeline: SemanticChoice[InputEventLifeline] = InputEventLifeline.FIRST_COMBO_STEP
-  enabledness_memory_protocol: SemanticChoice[MemoryProtocol] = MemoryProtocol.COMBO_STEP
-  assignment_memory_protocol: SemanticChoice[MemoryProtocol] = MemoryProtocol.COMBO_STEP
+  enabledness_memory_protocol: SemanticChoice[MemoryProtocol] = MemoryProtocol.SMALL_STEP
+  assignment_memory_protocol: SemanticChoice[MemoryProtocol] = MemoryProtocol.SMALL_STEP
 
   hierarchical_priority: SemanticChoice[HierarchicalPriority] = HierarchicalPriority.SOURCE_PARENT
   orthogonal_priority: SemanticChoice[OrthogonalPriority] = OrthogonalPriority.EXPLICIT