aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-environment.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-03 16:56:38 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-04 19:04:07 +0200
commit5693801bed998b29639898bec120b621ae8eb94f (patch)
treedea16cb707f1d01446680a846e0a81ff70cf3871 /src/synth/synth-environment.ads
parenta7fce446f6334b4e791026b99987987b835d78a5 (diff)
downloadghdl-5693801bed998b29639898bec120b621ae8eb94f.tar.gz
ghdl-5693801bed998b29639898bec120b621ae8eb94f.tar.bz2
ghdl-5693801bed998b29639898bec120b621ae8eb94f.zip
synth-stmts: propagate constant values in case statements.
Diffstat (limited to 'src/synth/synth-environment.ads')
-rw-r--r--src/synth/synth-environment.ads35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/synth/synth-environment.ads b/src/synth/synth-environment.ads
index ec76f515a..74d0c3350 100644
--- a/src/synth/synth-environment.ads
+++ b/src/synth/synth-environment.ads
@@ -167,7 +167,22 @@ package Synth.Environment is
type Partial_Assign is private;
No_Partial_Assign : constant Partial_Assign;
- type Seq_Assign_Value is private;
+ type Seq_Assign_Value (Is_Static : Tri_State_Type := True) is record
+ case Is_Static is
+ when Unknown =>
+ -- Used only for no value (in that case, it will use the previous
+ -- value).
+ -- This is used only for temporary handling, and is never stored
+ -- in Seq_Assign.
+ null;
+ when True =>
+ Val : Memtyp;
+ when False =>
+ -- Values assigned.
+ Asgns : Partial_Assign;
+ end case;
+ end record;
+
No_Seq_Assign_Value : constant Seq_Assign_Value;
function Get_Assign_Partial (Asgn : Seq_Assign) return Partial_Assign;
@@ -188,6 +203,8 @@ package Synth.Environment is
procedure Partial_Assign_Init (List : out Partial_Assign_List);
procedure Partial_Assign_Append (List : in out Partial_Assign_List;
Pasgn : Partial_Assign);
+
+ -- Phi_Assign for each element of LIST.
procedure Merge_Partial_Assigns (Ctxt : Builders.Context_Acc;
Wid : Wire_Id;
List : in out Partial_Assign_List);
@@ -277,22 +294,6 @@ private
Nbr_Final_Assign : Natural;
end record;
- type Seq_Assign_Value (Is_Static : Tri_State_Type := True) is record
- case Is_Static is
- when Unknown =>
- -- Used only for no value (in that case, it will use the previous
- -- value).
- -- This is used only for temporary handling, and is never stored
- -- in Seq_Assign.
- null;
- when True =>
- Val : Memtyp;
- when False =>
- -- Values assigned.
- Asgns : Partial_Assign;
- end case;
- end record;
-
No_Seq_Assign_Value : constant Seq_Assign_Value := (Is_Static => Unknown);
type Seq_Assign_Record is record