aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-02-07 07:29:38 +0100
committerTristan Gingold <tgingold@free.fr>2016-02-09 20:25:02 +0100
commit5ddefe0ca2f02afdb7a10717b9feb77a42fbc901 (patch)
tree6203c06742e2e00b75ccdc40b56945c5305c738a
parentf5130442c175e7308e26b092dcebd0c6901e4881 (diff)
downloadghdl-5ddefe0ca2f02afdb7a10717b9feb77a42fbc901.tar.gz
ghdl-5ddefe0ca2f02afdb7a10717b9feb77a42fbc901.tar.bz2
ghdl-5ddefe0ca2f02afdb7a10717b9feb77a42fbc901.zip
Improve mixed dump of PSL and VHDL nodes.
-rw-r--r--src/psl/psl-dump_tree.adb21
-rw-r--r--src/psl/psl-dump_tree.ads5
-rw-r--r--src/vhdl/disp_tree.adb24
-rw-r--r--src/vhdl/disp_tree.ads6
4 files changed, 24 insertions, 32 deletions
diff --git a/src/psl/psl-dump_tree.adb b/src/psl/psl-dump_tree.adb
index 93a407138..700c120d3 100644
--- a/src/psl/psl-dump_tree.adb
+++ b/src/psl/psl-dump_tree.adb
@@ -65,13 +65,14 @@ package body PSL.Dump_Tree is
end if;
end Image_Boolean;
- procedure Disp_HDL_Node (Val : HDL_Node)
- is
+ procedure Disp_HDL_Node
+ (Val : HDL_Node; Indent : Natural; Depth : Natural) is
begin
if Dump_Hdl_Node /= null then
- Dump_Hdl_Node.all (Val);
+ Dump_Hdl_Node.all (Val, Indent, Depth);
else
Disp_Int32 (Val);
+ New_Line;
end if;
end Disp_HDL_Node;
@@ -143,8 +144,6 @@ package body PSL.Dump_Tree is
New_Line;
end Disp_Header;
- procedure Disp_Tree (N : Node; Indent : Natural; Depth : Natural);
-
procedure Disp_Chain (Tree_Chain: Node; Indent: Natural; Depth : Natural)
is
El: Node;
@@ -206,8 +205,7 @@ package body PSL.Dump_Tree is
when Type_Name_Id =>
Put_Line (Name_Table.Image (Get_Name_Id (N, F)));
when Type_HDL_Node =>
- Disp_HDL_Node (Get_HDL_Node (N, F));
- New_Line;
+ Disp_HDL_Node (Get_HDL_Node (N, F), Sub_Indent, Depth - 1);
when Type_NFA =>
Disp_NFA (Get_NFA (N, F));
New_Line;
@@ -219,13 +217,4 @@ package body PSL.Dump_Tree is
end;
end Disp_Tree;
- procedure Dump_Tree (N : Node; Full : Boolean := False) is
- begin
- if Full then
- Disp_Tree (N, 0, 20);
- else
- Disp_Tree (N, 0, 0);
- end if;
- end Dump_Tree;
-
end PSL.Dump_Tree;
diff --git a/src/psl/psl-dump_tree.ads b/src/psl/psl-dump_tree.ads
index bf412d0dd..0b849ac54 100644
--- a/src/psl/psl-dump_tree.ads
+++ b/src/psl/psl-dump_tree.ads
@@ -19,9 +19,10 @@
with PSL.Nodes; use PSL.Nodes;
package PSL.Dump_Tree is
- procedure Dump_Tree (N : Node; Full : Boolean := False);
+ procedure Disp_Tree (N : Node; Indent : Natural; Depth : Natural);
-- Procedure to dump an HDL node.
- type Dump_Hdl_Node_Acc is access procedure (N : HDL_Node);
+ type Dump_Hdl_Node_Acc is
+ access procedure (N : HDL_Node; Indent : Natural; Depth : Natural);
Dump_Hdl_Node : Dump_Hdl_Node_Acc := null;
end PSL.Dump_Tree;
diff --git a/src/vhdl/disp_tree.adb b/src/vhdl/disp_tree.adb
index a56198ac9..d506ae23f 100644
--- a/src/vhdl/disp_tree.adb
+++ b/src/vhdl/disp_tree.adb
@@ -290,15 +290,15 @@ package body Disp_Tree is
return Iir_Predefined_Functions'Image (F);
end Image_Iir_Predefined_Functions;
- procedure Disp_PSL_Node (N : PSL_Node; Indent : Natural) is
- begin
- Put_Indent (Indent);
- PSL.Dump_Tree.Dump_Tree (N, True);
- end Disp_PSL_Node;
-
- procedure Disp_PSL_NFA (N : PSL_NFA; Indent : Natural) is
+ procedure Disp_PSL_NFA (N : PSL_NFA; Indent : Natural)
+ is
+ pragma Unreferenced (Indent);
begin
- null;
+ if N = 0 then
+ Put_Line ("*null*");
+ else
+ Put_Line ("*??*");
+ end if;
end Disp_PSL_NFA;
function Image_Location_Type (Loc : Location_Type) return String is
@@ -421,7 +421,8 @@ package body Disp_Tree is
when Type_String8_Id =>
Put_Line ("<string8>");
when Type_PSL_Node =>
- Disp_PSL_Node (Get_PSL_Node (N, F), Sub_Indent);
+ PSL.Dump_Tree.Disp_Tree
+ (Get_PSL_Node (N, F), Sub_Indent, Depth - 1);
when Type_Source_Ptr =>
Put_Line (Source_Ptr'Image (Get_Source_Ptr (N, F)));
when Type_Date_Type =>
@@ -491,9 +492,10 @@ package body Disp_Tree is
end;
end Disp_Iir;
- procedure Disp_Tree_For_Psl (N : Int32) is
+ procedure Disp_Tree_For_Psl
+ (N : Int32; Indent : Natural; Depth : Natural) is
begin
- Disp_Iir (Iir (N), 1, 0);
+ Disp_Iir (Iir (N), Indent, Depth);
end Disp_Tree_For_Psl;
procedure Disp_Tree (Tree : Iir;
diff --git a/src/vhdl/disp_tree.ads b/src/vhdl/disp_tree.ads
index 94b1d29e3..f30c6278f 100644
--- a/src/vhdl/disp_tree.ads
+++ b/src/vhdl/disp_tree.ads
@@ -20,8 +20,8 @@ with Iirs; use Iirs;
package Disp_Tree is
-- Disp TREE recursively.
- procedure Disp_Tree (Tree : Iir;
- Flat : Boolean := False);
+ procedure Disp_Tree (Tree : Iir; Flat : Boolean := False);
- procedure Disp_Tree_For_Psl (N : Int32);
+ procedure Disp_Tree_For_Psl
+ (N : Int32; Indent : Natural; Depth : Natural);
end Disp_Tree;