aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/disp_vhdl.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-01-13 18:55:50 +0100
committerTristan Gingold <tgingold@free.fr>2017-01-13 18:57:25 +0100
commit26cb40f846c974ccec22bf1165e5b519bba2247c (patch)
treeabaa0c76d6ecaf0fc60c6daf449680b4f5828cf8 /src/vhdl/disp_vhdl.adb
parent5d7d8b1466c1e6fe22370e09e9db9d61cd707da0 (diff)
downloadghdl-26cb40f846c974ccec22bf1165e5b519bba2247c.tar.gz
ghdl-26cb40f846c974ccec22bf1165e5b519bba2247c.tar.bz2
ghdl-26cb40f846c974ccec22bf1165e5b519bba2247c.zip
disp_vhdl: handle psl default clock in declarative part.
Diffstat (limited to 'src/vhdl/disp_vhdl.adb')
-rw-r--r--src/vhdl/disp_vhdl.adb117
1 files changed, 62 insertions, 55 deletions
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb
index cd279ecfd..f3e8c8f37 100644
--- a/src/vhdl/disp_vhdl.adb
+++ b/src/vhdl/disp_vhdl.adb
@@ -1700,6 +1700,66 @@ package body Disp_Vhdl is
Put_Line (");");
end Disp_Group_Declaration;
+ procedure Disp_PSL_HDL_Expr (N : PSL.Nodes.HDL_Node) is
+ begin
+ Disp_Expression (Iir (N));
+ end Disp_PSL_HDL_Expr;
+
+ procedure Disp_Psl_Expression (Expr : PSL_Node) is
+ begin
+ PSL.Prints.HDL_Expr_Printer := Disp_PSL_HDL_Expr'Access;
+ PSL.Prints.Print_Property (Expr);
+ end Disp_Psl_Expression;
+
+ procedure Disp_Psl_Sequence (Expr : PSL_Node) is
+ begin
+ PSL.Prints.HDL_Expr_Printer := Disp_PSL_HDL_Expr'Access;
+ PSL.Prints.Print_Sequence (Expr);
+ end Disp_Psl_Sequence;
+
+ procedure Disp_Psl_Default_Clock (Stmt : Iir) is
+ begin
+ if Vhdl_Std < Vhdl_08 then
+ Put ("--psl ");
+ end if;
+ Put ("default clock is ");
+ Disp_Psl_Expression (Get_Psl_Boolean (Stmt));
+ Put_Line (";");
+ end Disp_Psl_Default_Clock;
+
+ procedure Disp_Psl_Declaration (Stmt : Iir)
+ is
+ use PSL.Nodes;
+ Decl : constant PSL_Node := Get_Psl_Declaration (Stmt);
+ begin
+ if Vhdl_Std < Vhdl_08 then
+ Put ("--psl ");
+ end if;
+ case Get_Kind (Decl) is
+ when N_Property_Declaration =>
+ Put ("property ");
+ Disp_Ident (Get_Identifier (Decl));
+ Put (" is ");
+ Disp_Psl_Expression (Get_Property (Decl));
+ Put_Line (";");
+ when N_Sequence_Declaration =>
+ Put ("sequence ");
+ Disp_Ident (Get_Identifier (Decl));
+ Put (" is ");
+ Disp_Psl_Sequence (Get_Sequence (Decl));
+ Put_Line (";");
+ when N_Endpoint_Declaration =>
+ Put ("endpoint ");
+ Disp_Ident (Get_Identifier (Decl));
+ Put (" is ");
+ Disp_Psl_Sequence (Get_Sequence (Decl));
+ Put_Line (";");
+ Disp_PSL_NFA (Get_PSL_NFA (Stmt));
+ when others =>
+ Error_Kind ("disp_psl_declaration", Decl);
+ end case;
+ end Disp_Psl_Declaration;
+
procedure Disp_Declaration_Chain (Parent : Iir; Indent: Count)
is
Decl: Iir;
@@ -1770,6 +1830,8 @@ package body Disp_Vhdl is
Disp_Package_Body (Decl);
when Iir_Kind_Package_Instantiation_Declaration =>
Disp_Package_Instantiation_Declaration (Decl);
+ when Iir_Kind_Psl_Default_Clock =>
+ Disp_Psl_Default_Clock (Decl);
when others =>
Error_Kind ("disp_declaration_chain", Decl);
end case;
@@ -2913,23 +2975,6 @@ package body Disp_Vhdl is
end case;
end Disp_Expression;
- procedure Disp_PSL_HDL_Expr (N : PSL.Nodes.HDL_Node) is
- begin
- Disp_Expression (Iir (N));
- end Disp_PSL_HDL_Expr;
-
- procedure Disp_Psl_Expression (Expr : PSL_Node) is
- begin
- PSL.Prints.HDL_Expr_Printer := Disp_PSL_HDL_Expr'Access;
- PSL.Prints.Print_Property (Expr);
- end Disp_Psl_Expression;
-
- procedure Disp_Psl_Sequence (Expr : PSL_Node) is
- begin
- PSL.Prints.HDL_Expr_Printer := Disp_PSL_HDL_Expr'Access;
- PSL.Prints.Print_Sequence (Expr);
- end Disp_Psl_Sequence;
-
procedure Disp_Block_Header (Header : Iir_Block_Header; Indent: Count)
is
Chain : Iir;
@@ -3095,44 +3140,6 @@ package body Disp_Vhdl is
Disp_End (Stmt, "generate");
end Disp_Case_Generate_Statement;
- procedure Disp_Psl_Default_Clock (Stmt : Iir) is
- begin
- Put ("--psl default clock is ");
- Disp_Psl_Expression (Get_Psl_Boolean (Stmt));
- Put_Line (";");
- end Disp_Psl_Default_Clock;
-
- procedure Disp_Psl_Declaration (Stmt : Iir)
- is
- use PSL.Nodes;
- Decl : constant PSL_Node := Get_Psl_Declaration (Stmt);
- begin
- Put ("--psl ");
- case Get_Kind (Decl) is
- when N_Property_Declaration =>
- Put ("property ");
- Disp_Ident (Get_Identifier (Decl));
- Put (" is ");
- Disp_Psl_Expression (Get_Property (Decl));
- Put_Line (";");
- when N_Sequence_Declaration =>
- Put ("sequence ");
- Disp_Ident (Get_Identifier (Decl));
- Put (" is ");
- Disp_Psl_Sequence (Get_Sequence (Decl));
- Put_Line (";");
- when N_Endpoint_Declaration =>
- Put ("endpoint ");
- Disp_Ident (Get_Identifier (Decl));
- Put (" is ");
- Disp_Psl_Sequence (Get_Sequence (Decl));
- Put_Line (";");
- Disp_PSL_NFA (Get_PSL_NFA (Stmt));
- when others =>
- Error_Kind ("disp_psl_declaration", Decl);
- end case;
- end Disp_Psl_Declaration;
-
procedure Disp_PSL_NFA (N : PSL.Nodes.NFA)
is
use PSL.NFAs;