aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ortho/debug/ortho_debug-disp.adb5
-rw-r--r--src/vhdl/canon.adb5
-rw-r--r--src/vhdl/parse.adb2
-rw-r--r--src/vhdl/parse_psl.adb55
-rw-r--r--src/vhdl/parse_psl.ads2
-rw-r--r--src/vhdl/translate/trans-chap9.adb9
6 files changed, 64 insertions, 14 deletions
diff --git a/src/ortho/debug/ortho_debug-disp.adb b/src/ortho/debug/ortho_debug-disp.adb
index a45bceca9..e2e5793f9 100644
--- a/src/ortho/debug/ortho_debug-disp.adb
+++ b/src/ortho/debug/ortho_debug-disp.adb
@@ -1108,7 +1108,10 @@ package body Ortho_Debug.Disp is
Disp_Loop_Name (Stmt);
Put_Line (":");
Add_Tab;
- Disp_Snode (Stmt.Next, Stmt.Loop_Last);
+ if Stmt.Loop_Last /= Stmt then
+ -- Only if the loop is not empty.
+ Disp_Snode (Stmt.Next, Stmt.Loop_Last);
+ end if;
Stmt := Stmt.Loop_Last;
Rem_Tab;
Put_Keyword ("end");
diff --git a/src/vhdl/canon.adb b/src/vhdl/canon.adb
index 5d7755faf..bf6e7562a 100644
--- a/src/vhdl/canon.adb
+++ b/src/vhdl/canon.adb
@@ -258,8 +258,9 @@ package body Canon is
end;
when Iir_Kind_Object_Alias_Declaration =>
- Canon_Extract_Sensitivity
- (Get_Name (Expr), Sensitivity_List, Is_Target);
+ if not Is_Target and then Is_Signal_Object (Expr) then
+ Add_Element (Sensitivity_List, Expr);
+ end if;
when Iir_Kind_Constant_Declaration
| Iir_Kind_Interface_Constant_Declaration
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index dc2d24bcd..b9e46f0fd 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -8109,7 +8109,7 @@ package body Parse is
-- Skip 'cover'
Scan;
- Set_Psl_Sequence (Res, Parse_Psl.Parse_Psl_Sequence);
+ Set_Psl_Sequence (Res, Parse_Psl.Parse_Psl_Sequence (True));
-- No more PSL tokens after the property.
Scanner.Flag_Psl := False;
diff --git a/src/vhdl/parse_psl.adb b/src/vhdl/parse_psl.adb
index 6a0e906e4..9b66b444e 100644
--- a/src/vhdl/parse_psl.adb
+++ b/src/vhdl/parse_psl.adb
@@ -92,9 +92,46 @@ package body Parse_Psl is
function Parse_Parenthesis_Boolean return Node;
function Parse_Boolean (Parent_Prio : Priority) return Node;
- function Parse_Unary_Boolean return Node is
+ function Parse_Unary_Boolean (Full_Hdl_Expr : Boolean) return Node
+ is
+ use Parse;
+ use Iirs;
+ Left, Expr : Iir;
+ Op : Iir_Kind;
begin
- return Vhdl_To_Psl (Parse.Parse_Expression);
+ if Full_Hdl_Expr then
+ Expr := Parse_Expression;
+ else
+ -- Boolean operators must be parse, *except* and/or that could be at
+ -- upper layers (FL).
+ Expr := Parse_Expression (Prio_Relation);
+ loop
+ case Current_Token is
+ when Tok_Xor =>
+ Op := Iir_Kind_Xor_Operator;
+ when Tok_Nand =>
+ Op := Iir_Kind_Nand_Operator;
+ when Tok_Nor =>
+ Op := Iir_Kind_Nor_Operator;
+ when Tok_Xnor =>
+ Op := Iir_Kind_Xnor_Operator;
+ when others =>
+ exit;
+ end case;
+
+ Left := Expr;
+ Expr := Create_Iir (Op);
+ Set_Location (Expr, Get_Token_Location);
+ Set_Left (Expr, Left);
+
+ -- Skip operator.
+ Scan;
+
+ Set_Right (Expr, Parse_Expression (Prio_Relation));
+ end loop;
+ end if;
+
+ return Vhdl_To_Psl (Expr);
end Parse_Unary_Boolean;
function Parse_Boolean_Rhs (Parent_Prio : Priority; Left : Node) return Node
@@ -131,7 +168,7 @@ package body Parse_Psl is
function Parse_Boolean (Parent_Prio : Priority) return Node
is
begin
- return Parse_Boolean_Rhs (Parent_Prio, Parse_Unary_Boolean);
+ return Parse_Boolean_Rhs (Parent_Prio, Parse_Unary_Boolean (False));
end Parse_Boolean;
function Parse_Psl_Boolean return PSL_Node is
@@ -162,7 +199,7 @@ package body Parse_Psl is
Kind : Nkind;
Op_Prio : Priority;
begin
- Left := Parse_Psl_Sequence; -- FIXME: allow boolean;
+ Left := Parse_Psl_Sequence (True);
loop
case Current_Token is
when Tok_Semi_Colon =>
@@ -283,7 +320,7 @@ package body Parse_Psl is
end if;
end Parse_Bracket_Number;
- function Parse_Psl_Sequence return Node is
+ function Parse_Psl_Sequence (Full_Hdl_Expr : Boolean) return Node is
Res, N : Node;
begin
case Current_Token is
@@ -314,7 +351,7 @@ package body Parse_Psl is
return Res;
when others =>
-- Repeated_SERE
- Res := Parse_Unary_Boolean;
+ Res := Parse_Unary_Boolean (Full_Hdl_Expr);
end case;
loop
case Current_Token is
@@ -458,7 +495,7 @@ package body Parse_Psl is
when Tok_Left_Paren =>
return Parse_Parenthesis_FL_Property;
when Tok_Left_Curly =>
- Res := Parse_Psl_Sequence;
+ Res := Parse_Psl_Sequence (True);
if Get_Kind (Res) = N_Braced_SERE
and then Current_Token = Tok_Left_Paren
then
@@ -470,7 +507,7 @@ package body Parse_Psl is
Res := Tmp;
end if;
when others =>
- Res := Parse_Psl_Sequence;
+ Res := Parse_Psl_Sequence (False);
end case;
return Res;
end Parse_FL_Property_1;
@@ -692,7 +729,7 @@ package body Parse_Psl is
Set_Property (Res, Parse_Psl_Property);
when N_Sequence_Declaration
| N_Endpoint_Declaration =>
- Set_Sequence (Res, Parse_Psl_Sequence);
+ Set_Sequence (Res, Parse_Psl_Sequence (True));
when others =>
raise Internal_Error;
end case;
diff --git a/src/vhdl/parse_psl.ads b/src/vhdl/parse_psl.ads
index 17989d8b3..1df993e82 100644
--- a/src/vhdl/parse_psl.ads
+++ b/src/vhdl/parse_psl.ads
@@ -20,7 +20,7 @@ with Types; use Types;
with Tokens; use Tokens;
package Parse_Psl is
- function Parse_Psl_Sequence return PSL_Node;
+ function Parse_Psl_Sequence (Full_Hdl_Expr : Boolean) return PSL_Node;
function Parse_Psl_Property return PSL_Node;
function Parse_Psl_Boolean return PSL_Node;
function Parse_Psl_Declaration (Tok : Token_Type) return PSL_Node;
diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb
index 00295f738..3213e50a0 100644
--- a/src/vhdl/translate/trans-chap9.adb
+++ b/src/vhdl/translate/trans-chap9.adb
@@ -1257,6 +1257,15 @@ package body Trans.Chap9 is
Fields : constant Fields_Array := Get_Fields (Kind);
F : Fields_Enum;
begin
+ case Kind is
+ when Iir_Kind_Object_Alias_Declaration =>
+ -- No types to free, don't try to recurse as the name can be
+ -- a slice (which will then be freed).
+ return;
+ when others =>
+ null;
+ end case;
+
for I in Fields'Range loop
F := Fields (I);
case F is