summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ast-to-instr/src')
-rw-r--r--ast-to-instr/src/VHDLCSNode.java30
-rw-r--r--ast-to-instr/src/VHDLSSCNode.java32
2 files changed, 56 insertions, 6 deletions
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,