aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-08-26 08:07:34 +0200
committerTristan Gingold <tgingold@free.fr>2021-08-26 08:07:34 +0200
commit8e84ebdf517fde66db0659245b88319f4da25a72 (patch)
tree5722770aa8e0c1bf7b593858d81d4e4ae48f37b8 /src/vhdl
parent3f7df930ee09c5dd259a5e40eeb5e824971197d0 (diff)
downloadghdl-8e84ebdf517fde66db0659245b88319f4da25a72.tar.gz
ghdl-8e84ebdf517fde66db0659245b88319f4da25a72.tar.bz2
ghdl-8e84ebdf517fde66db0659245b88319f4da25a72.zip
PSL: handle inf in star repeat sequence. Fix #1832
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-parse_psl.adb16
-rw-r--r--src/vhdl/vhdl-prints.adb4
2 files changed, 16 insertions, 4 deletions
diff --git a/src/vhdl/vhdl-parse_psl.adb b/src/vhdl/vhdl-parse_psl.adb
index 314249c14..808c2dae7 100644
--- a/src/vhdl/vhdl-parse_psl.adb
+++ b/src/vhdl/vhdl-parse_psl.adb
@@ -57,9 +57,9 @@ package body Vhdl.Parse_Psl is
Scan;
return Res;
elsif Current_Token = Tok_Inf then
- -- FIXME: create node
+ Res := Create_Node_Loc (N_Inf);
Scan;
- return Null_Node;
+ return Res;
else
Error_Msg_Parse ("number expected");
return Null_Node;
@@ -68,9 +68,16 @@ package body Vhdl.Parse_Psl is
procedure Check_Positive_Count (N : Node)
is
- Low : constant Uns32 := Get_Value (Get_Low_Bound (N));
- High : constant Uns32 := Get_Value (Get_High_Bound (N));
+ Low_B : constant Node := Get_Low_Bound (N);
+ High_B : constant Node := Get_High_Bound (N);
+ Low : constant Uns32 := Get_Value (Low_B);
+ High : Uns32;
begin
+ if Get_Kind (High_B) = N_Inf then
+ return;
+ end if;
+
+ High := Get_Value (High_B);
if Low > High then
Error_Msg_Parse
("Low bound of range must be lower than High bound," &
@@ -840,6 +847,7 @@ package body Vhdl.Parse_Psl is
| N_False
| N_True
| N_Number
+ | N_Inf
| N_Name_Decl
| N_Name
| N_EOS
diff --git a/src/vhdl/vhdl-prints.adb b/src/vhdl/vhdl-prints.adb
index 361cbe18b..ec4d870e5 100644
--- a/src/vhdl/vhdl-prints.adb
+++ b/src/vhdl/vhdl-prints.adb
@@ -1958,6 +1958,10 @@ package body Vhdl.Prints is
Disp_Str (Ctxt, Str);
Close_Lit (Ctxt);
end;
+ when N_Inf =>
+ Start_Lit (Ctxt, Tok_Identifier);
+ Disp_Str (Ctxt, "INF");
+ Close_Lit (Ctxt);
when N_Name_Decl =>
Disp_Ident (Ctxt, Get_Identifier (N));
when N_HDL_Expr