aboutsummaryrefslogtreecommitdiffstats
path: root/src/psl/psl-rewrites.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-04-03 16:48:08 +0200
committerTristan Gingold <tgingold@free.fr>2021-04-03 16:48:08 +0200
commit6617613f93e70df2e2b964f380652ea43e2bb2a5 (patch)
tree2ce620bb15fc0e5e59fc61e1f4e4a1936b985049 /src/psl/psl-rewrites.adb
parentbfc5f5c20b791e09b5a2d80aeea5ce77b84d309f (diff)
downloadghdl-6617613f93e70df2e2b964f380652ea43e2bb2a5.tar.gz
ghdl-6617613f93e70df2e2b964f380652ea43e2bb2a5.tar.bz2
ghdl-6617613f93e70df2e2b964f380652ea43e2bb2a5.zip
psl: prefix of goto/non-consecutive repetition is a bool. Fix #1708
Diffstat (limited to 'src/psl/psl-rewrites.adb')
-rw-r--r--src/psl/psl-rewrites.adb22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/psl/psl-rewrites.adb b/src/psl/psl-rewrites.adb
index be9477088..7568ab8fc 100644
--- a/src/psl/psl-rewrites.adb
+++ b/src/psl/psl-rewrites.adb
@@ -188,12 +188,12 @@ package body PSL.Rewrites is
end if;
end Rewrite_Star_Repeat_Seq;
- function Rewrite_Goto_Repeat_Seq (Seq : Node;
- Lo, Hi : Node) return Node is
+ function Rewrite_Goto_Repeat_Seq (B : Node; Lo, Hi : Node) return Node
+ is
Res : Node;
begin
-- b[->] --> {(~b)[*];b}
- Res := Build_Concat (Build_Star (Build_Bool_Not (Seq)), Seq);
+ Res := Build_Concat (Build_Star (Build_Bool_Not (B)), B);
if Lo = Null_Node then
return Res;
@@ -203,12 +203,12 @@ package body PSL.Rewrites is
return Rewrite_Star_Repeat_Seq (Res, Lo, Hi);
end Rewrite_Goto_Repeat_Seq;
- function Rewrite_Goto_Repeat_Seq (Seq : Node;
- Lo, Hi : Uns32) return Node is
+ function Rewrite_Goto_Repeat_Seq (B : Node; Lo, Hi : Uns32) return Node
+ is
Res : Node;
begin
-- b[->] --> {(~b)[*];b}
- Res := Build_Concat (Build_Star (Build_Bool_Not (Seq)), Seq);
+ Res := Build_Concat (Build_Star (Build_Bool_Not (B)), B);
-- b[->l:h] --> {b[->]}[*l:h]
return Rewrite_Star_Repeat_Seq (Res, Lo, Hi);
@@ -216,13 +216,13 @@ package body PSL.Rewrites is
function Rewrite_Equal_Repeat_Seq (N : Node) return Node
is
- Seq : constant Node := Get_Sequence (N);
+ B : constant Node := Get_Boolean (N);
Lo : constant Node := Get_Low_Bound (N);
Hi : constant Node := Get_High_Bound (N);
begin
-- b[=l:h] --> {b[->l:h]};(~b)[*]
- return Build_Concat (Rewrite_Goto_Repeat_Seq (Seq, Lo, Hi),
- Build_Star (Build_Bool_Not (Seq)));
+ return Build_Concat (Rewrite_Goto_Repeat_Seq (B, Lo, Hi),
+ Build_Star (Build_Bool_Not (B)));
end Rewrite_Equal_Repeat_Seq;
function Rewrite_Within (N : Node) return Node is
@@ -291,10 +291,10 @@ package body PSL.Rewrites is
return N;
when N_Goto_Repeat_Seq =>
return Rewrite_Goto_Repeat_Seq
- (Rewrite_SERE (Get_Sequence (N)),
+ (Rewrite_SERE (Get_Boolean (N)),
Get_Low_Bound (N), Get_High_Bound (N));
when N_Equal_Repeat_Seq =>
- Set_Sequence (N, Rewrite_SERE (Get_Sequence (N)));
+ Set_Boolean (N, Rewrite_SERE (Get_Boolean (N)));
return Rewrite_Equal_Repeat_Seq (N);
when N_Braced_SERE =>
return Rewrite_SERE (Get_SERE (N));