Преглед на файлове

Working interface at Mv side

Yentl Van Tendeloo преди 8 години
родител
ревизия
d30904ebd1
променени са 1 файла, в които са добавени 11 реда и са изтрити 6 реда
  1. 11 6
      integration/code/cbd_semantics.alc

+ 11 - 6
integration/code/cbd_semantics.alc

@@ -230,13 +230,13 @@ Void function execute_cbd(design_model : Element):
 	Element schedule_init
 	Element schedule_run
 	Element schedule
-	Boolean conforming
+	String conforming
 
 	old_runtime_model = instantiate_model(import_node("models/CausalBlockDiagrams_Runtime"))
 	runtime_model = retype_to_runtime(design_model)
 	runtime_model = sanitize(runtime_model, old_runtime_model)
 	running = False
-	conforming = value_eq(conformance_scd(design_model), "OK")
+	conforming = conformance_scd(design_model)
 
 	schedule_init = create_schedule(runtime_model, read_attribute(runtime_model, "time", "start_time"))
 	schedule_run = create_schedule(runtime_model, -1)
@@ -254,17 +254,21 @@ Void function execute_cbd(design_model : Element):
 		// Process input
 		if (cmd == "simulate"):
 			// Simulation should toggle running to True, but only if the model is conforming
-			if (conforming):
+			if (conforming == "OK"):
 				running = True
+			else:
+				output("FAIL_CONFORMANCE " + conforming)
 
 		elif (cmd == "step"):
 			// Stepping should make a single step, but first need to pick the correct schedule to use
-			if (conforming):
+			if (conforming == "OK"):
 				if (read_attribute(runtime_model, "time", "start_time") == read_attribute(runtime_model, "time", "current_time")):
 					schedule = schedule_init
 				else:
 					schedule = schedule_run
 				step_simulation(runtime_model, schedule)
+			else:
+				output("FAIL_CONFORMANCE " + conforming)
 
 		elif (cmd == "pause"):
 			// Pausing merely stops a running simulation
@@ -307,8 +311,8 @@ Void function execute_cbd(design_model : Element):
 				instantiate_link(design_model, input(), input(), input(), input())
 
 			// After changes, we check whether or not the design model conforms
-			conforming = value_eq(conformance_scd(design_model), "OK")
-			if (conforming):
+			conforming = conformance_scd(design_model)
+			if (conforming == "OK"):
 				// Conforming, so do the retyping and sanitization step
 				runtime_model = retype_to_runtime(design_model)
 				runtime_model = sanitize(runtime_model, old_runtime_model)
@@ -318,5 +322,6 @@ Void function execute_cbd(design_model : Element):
 			else:
 				// Not conforming, so stop simulation and block for input (preferably a modify to make everything consistent again)
 				running = False
+				output("FAIL_CONFORMANCE " + conforming)
 		else:
 			log("Did not understand command: " + cmd)