| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-19 14:05:52 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-19 14:05:52 +0200 |
| commit | f2b7e406b8e77df22ef379a5e880f64d1e5043b9 (patch) | |
| tree | 269602e9d62971c9c81ba3e2f72c9f8f8cd07017 | |
| parent | 706f4260ef5175a1134be7764aa9640b28fa2335 (diff) | |
Fixes case/when models, regroups properties.
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | ast-to-instr/src/VHDLCSNode.java | 30 | ||||
| -rw-r--r-- | ast-to-instr/src/VHDLSSCNode.java | 32 | ||||
| -rw-r--r-- | data/property/CNE_00100.pro (renamed from data/property/cnes/CNE_00100.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01100.pro (renamed from data/property/cnes/CNE_01100.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01200.pro (renamed from data/property/cnes/CNE_01200.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01400.pro (renamed from data/property/cnes/CNE_01400.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01700.pro (renamed from data/property/cnes/CNE_01700.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01800.pro (renamed from data/property/cnes/CNE_01800.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_01900.pro (renamed from data/property/cnes/CNE_01900.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_02100.pro (renamed from data/property/cnes/CNE_02100.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_02600.pro (renamed from data/property/cnes/CNE_02600.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_04500.pro (renamed from data/property/cnes/CNE_04500.pro) | 0 | ||||
| -rw-r--r-- | data/property/CNE_05100.pro (renamed from data/property/cnes/CNE_05100.pro) | 0 | ||||
| -rw-r--r-- | data/property/STD_04800.pro (renamed from data/property/cnes/STD_04800.pro) | 0 | ||||
| -rw-r--r-- | data/test/Makefile | 13 |
16 files changed, 65 insertions, 14 deletions
@@ -1,8 +1,6 @@ ## Makefile Parameters ######################################################### LEVEL_FILES ?= $(wildcard ${CURDIR}/data/level/*.lvl) -PROPERTY_FILES ?= \ - $(wildcard ${CURDIR}/data/property/*.pro) \ - $(wildcard ${CURDIR}/data/property/cnes/*.pro) +PROPERTY_FILES ?= $(wildcard ${CURDIR}/data/property/*.pro) AST_FILE ?= ${CURDIR}/data/ast/best_chronometer_ever.xml TEMPLATE_DIR ?= ${CURDIR}/data/template/ #AST_FILE = ${CURDIR}/data/ast/pong.xml diff --git a/ast-to-instr/src/VHDLCSNode.java b/ast-to-instr/src/VHDLCSNode.java index 6682613..2eaa435 100644 --- a/ast-to-instr/src/VHDLCSNode.java +++ b/ast-to-instr/src/VHDLCSNode.java @@ -196,6 +196,22 @@ public class VHDLCSNode extends VHDLNode for (int i = 0; i < when_branches_length; ++i) { + final Node child; + final String child_xml_id; + final IDs child_local_id; + + child = when_branches.item(i); + child_xml_id = XMLManager.get_attribute(child, "id"); + child_local_id = IDs.get_id_from_xml_id(output, child_xml_id, "node"); + + Predicates.add_entry + ( + output, + "node_connect", + local_id, + child_local_id + ); + waiting_list.add ( new VHDLWNode @@ -251,6 +267,20 @@ public class VHDLCSNode extends VHDLNode } else { + final String child_xml_id; + final IDs child_local_id; + + child_xml_id = XMLManager.get_attribute(others_branch, "id"); + child_local_id = IDs.get_id_from_xml_id(output, child_xml_id, "node"); + + Predicates.add_entry + ( + output, + "node_connect", + local_id, + child_local_id + ); + waiting_list.push ( new VHDLWNode diff --git a/ast-to-instr/src/VHDLSSCNode.java b/ast-to-instr/src/VHDLSSCNode.java index 641377f..97462c9 100644 --- a/ast-to-instr/src/VHDLSSCNode.java +++ b/ast-to-instr/src/VHDLSSCNode.java @@ -40,7 +40,7 @@ public class VHDLSSCNode extends VHDLNode attributes ); - this.prev_node = prev_node; + this.prev_node = prev_node; /* null when first node of the process */ } @Override @@ -54,6 +54,7 @@ public class VHDLSSCNode extends VHDLNode final int intermediary_nodes_count; int i; + /* Find all the nodes, in order, in this instruction chain */ sub_nodes = (NodeList) XPE_FIND_SUB_NODES.evaluate ( @@ -61,13 +62,19 @@ public class VHDLSSCNode extends VHDLNode XPathConstants.NODESET ); + /* Don't handle the last node in the 'for' loop, see below. */ intermediary_nodes_count = (sub_nodes.getLength() - 1); for (i = 0; i < intermediary_nodes_count; ++i) { - final IDs next_node; - - next_node = + /* Prepare the parsing of all those nodes throufh the waiting list. + * To do so, each node needs to be informed of the ID of the node that + * follows it. + */ + final IDs next_seq_node; + + /* Get the ID for the next node in the sequence */ + next_seq_node = IDs.get_id_from_xml_id ( output, @@ -79,11 +86,21 @@ public class VHDLSSCNode extends VHDLNode "node" ); - waiting_list.push(get_vhdl_node(sub_nodes.item(i), next_node, i)); + /* + * Add to the waiting list, 'i' indicates if the attributes inherited + * by the instruction sequence node should be passed along (it's only + * the case if i == 0). + */ + waiting_list.push(get_vhdl_node(sub_nodes.item(i), next_seq_node, i)); } + /* + * The last node of the sequence takes the node following the sequence + * as 'next_node', so it's handled separatly. + */ waiting_list.push(get_vhdl_node(sub_nodes.item(i), next_node, i)); + /* Handle the connection of the first node to the previous node. */ handle_backward_connection(sub_nodes.item(0)); } @@ -193,7 +210,10 @@ public class VHDLSSCNode extends VHDLNode } else { - /* First node of the process */ + /* + * Not the first node, so have the previous node connect to this one + * (which is the first of this instruction set). + */ Predicates.add_entry ( output, diff --git a/data/property/cnes/CNE_00100.pro b/data/property/CNE_00100.pro index 1b0893e..1b0893e 100644 --- a/data/property/cnes/CNE_00100.pro +++ b/data/property/CNE_00100.pro diff --git a/data/property/cnes/CNE_01100.pro b/data/property/CNE_01100.pro index ddeb4e3..ddeb4e3 100644 --- a/data/property/cnes/CNE_01100.pro +++ b/data/property/CNE_01100.pro diff --git a/data/property/cnes/CNE_01200.pro b/data/property/CNE_01200.pro index 6649103..6649103 100644 --- a/data/property/cnes/CNE_01200.pro +++ b/data/property/CNE_01200.pro diff --git a/data/property/cnes/CNE_01400.pro b/data/property/CNE_01400.pro index 412650e..412650e 100644 --- a/data/property/cnes/CNE_01400.pro +++ b/data/property/CNE_01400.pro diff --git a/data/property/cnes/CNE_01700.pro b/data/property/CNE_01700.pro index db5e676..db5e676 100644 --- a/data/property/cnes/CNE_01700.pro +++ b/data/property/CNE_01700.pro diff --git a/data/property/cnes/CNE_01800.pro b/data/property/CNE_01800.pro index fe69841..fe69841 100644 --- a/data/property/cnes/CNE_01800.pro +++ b/data/property/CNE_01800.pro diff --git a/data/property/cnes/CNE_01900.pro b/data/property/CNE_01900.pro index 51c373f..51c373f 100644 --- a/data/property/cnes/CNE_01900.pro +++ b/data/property/CNE_01900.pro diff --git a/data/property/cnes/CNE_02100.pro b/data/property/CNE_02100.pro index 8b66f0b..8b66f0b 100644 --- a/data/property/cnes/CNE_02100.pro +++ b/data/property/CNE_02100.pro diff --git a/data/property/cnes/CNE_02600.pro b/data/property/CNE_02600.pro index f4f89ab..f4f89ab 100644 --- a/data/property/cnes/CNE_02600.pro +++ b/data/property/CNE_02600.pro diff --git a/data/property/cnes/CNE_04500.pro b/data/property/CNE_04500.pro index 383aec0..383aec0 100644 --- a/data/property/cnes/CNE_04500.pro +++ b/data/property/CNE_04500.pro diff --git a/data/property/cnes/CNE_05100.pro b/data/property/CNE_05100.pro index dd8b2c1..dd8b2c1 100644 --- a/data/property/cnes/CNE_05100.pro +++ b/data/property/CNE_05100.pro diff --git a/data/property/cnes/STD_04800.pro b/data/property/STD_04800.pro index ae8e4c9..ae8e4c9 100644 --- a/data/property/cnes/STD_04800.pro +++ b/data/property/STD_04800.pro diff --git a/data/test/Makefile b/data/test/Makefile index f38526a..eec299d 100644 --- a/data/test/Makefile +++ b/data/test/Makefile @@ -22,6 +22,9 @@ all: $(AST_FILES) $(OCL_FILES) $(VLD_FILES) $(IVLD_FILES) clean: rm -f $(AST_FILES) rm -f $(OCL_FILES) + rm -f $(VLD_FILES) + rm -f $(IVLD_FILES) + rm -rf /tmp/tabellion_{,in}valid $(AST_FILES): %.xml : %.vhd $(AST_CREATOR) $< > $@ @@ -41,9 +44,9 @@ $(VLD_FILES): %/valid.result: %/valid.ocl %/valid.xml AST_FILE=${PWD}/$(dir $@)/valid.xml \ PROPERTY_FILES=$(PROPERTY_DIR)/$(patsubst %/,%,$(dir $@)).pro \ TEMPLATE_DIR=${PWD}/$(dir $@)/ \ - NICE_MESSAGE=/tmp/tabellion/valid_test_result - cat /tmp/tabellion/valid_test_result | sed '/^\s*$$/d' | sort > $@ - diff $@ $(dir $@)/valid.ocl || true > $@ + NICE_MESSAGE=/tmp/tabellion_valid/result + cat /tmp/tabellion_valid/result | sed '/^\s*$$/d' | sort > /tmp/tabellion_valid/result_clean + -diff /tmp/tabellion_valid/result_clean $(dir $@)/valid.ocl > $@ $(IVLD_FILES): %/invalid.result: %/invalid.ocl %/invalid.xml $(MAKE) -C $(TABELLION_MAIN) \ @@ -57,5 +60,5 @@ $(IVLD_FILES): %/invalid.result: %/invalid.ocl %/invalid.xml AST_FILE=${PWD}/$(dir $@)/invalid.xml \ PROPERTY_FILES=$(PROPERTY_DIR)/$(patsubst %/,%,$(dir $@)).pro \ TEMPLATE_DIR=${PWD}/$(dir $@)/ \ - NICE_MESSAGE=${PWD}/$@ - cat $@ | sed '/^\s*$$/d' | sort > $@ + NICE_MESSAGE=/tmp/tabellion_invalid/result + cat /tmp/tabellion_invalid/result | sed '/^\s*$$/d' | sort > $@ |


