瀏覽代碼

Basically working linear algebraic loop solver

Yentl Van Tendeloo 8 年之前
父節點
當前提交
0c577db133
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      integration/code/cbd_semantics.alc

+ 5 - 1
integration/code/cbd_semantics.alc

@@ -227,7 +227,7 @@ Boolean function solve_scc(model : Element, scc : Element):
 	while (i < read_nr_out(scc)):
 		log("Creating matrix row")
 		// First element of scc
-		block = cast_v2s(list_read(scc, i))
+		block = scc[i]
 		blocktype = readType(model, block)
 
 		// First write 1 in the current block
@@ -238,6 +238,9 @@ Boolean function solve_scc(model : Element, scc : Element):
 			constant = 0.0
 		elif (blocktype == "MultiplyBlock"):
 			constant = 1.0
+
+		log("Generating matrix for " + blocktype)
+		log("Block: " + block)
 		incoming = allIncomingAssociationInstances(model, block, "Link")
 
 		Integer index_to_write_constant
@@ -307,6 +310,7 @@ Boolean function solve_scc(model : Element, scc : Element):
 		instantiate_attribute(model, block, "signal", m[i][read_nr_out(scc)])
 		log((("Solved " + block) + " to ") + cast_v2s(m[i][read_nr_out(scc)]))
 		output((("SIM_PROBE " + cast_v2s(block)) + " ") + cast_v2s(m[i][read_nr_out(scc)]))
+		i = i + 1
 
 	return True!