aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-expr.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-01 08:59:51 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-01 09:00:15 +0200
commit29712722a20caff1c1015f64b38d36f428535171 (patch)
tree3c607f382971a137626d4763e3d2a87db6adbf0e /src/synth/synth-expr.ads
parente33a1cd17bd2bff4d3832988cff9e78d7bd6be41 (diff)
downloadghdl-29712722a20caff1c1015f64b38d36f428535171.tar.gz
ghdl-29712722a20caff1c1015f64b38d36f428535171.tar.bz2
ghdl-29712722a20caff1c1015f64b38d36f428535171.zip
synth: propagate enable condition to expressions. For #1273
Diffstat (limited to 'src/synth/synth-expr.ads')
-rw-r--r--src/synth/synth-expr.ads25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/synth/synth-expr.ads b/src/synth/synth-expr.ads
index ef0499dc1..5104bcaaf 100644
--- a/src/synth/synth-expr.ads
+++ b/src/synth/synth-expr.ads
@@ -70,17 +70,24 @@ package Synth.Expr is
procedure Concat_Array (Arr : in out Net_Array; N : out Net);
- function Synth_Expression_With_Type
- (Syn_Inst : Synth_Instance_Acc; Expr : Node; Expr_Type : Type_Acc)
- return Valtyp;
-
- function Synth_Expression (Syn_Inst : Synth_Instance_Acc; Expr : Node)
- return Valtyp;
+ -- Synthesize EXPR. The expression must be self-constrained.
+ -- If EN is not No_Net, the execution is controlled by EN. This is used
+ -- for assertions and checks.
+ function Synth_Expression
+ (Syn_Inst : Synth_Instance_Acc; Expr : Node; En : Net) return Valtyp;
+
+ -- Same as Synth_Expression, but the expression may be constrained by
+ -- EXPR_TYPE.
+ function Synth_Expression_With_Type (Syn_Inst : Synth_Instance_Acc;
+ Expr : Node;
+ Expr_Type : Type_Acc;
+ En : Net) return Valtyp;
-- Use base type of EXPR to synthesize EXPR. Useful when the type of
-- EXPR is defined by itself or a range.
- function Synth_Expression_With_Basetype
- (Syn_Inst : Synth_Instance_Acc; Expr : Node) return Valtyp;
+ function Synth_Expression_With_Basetype (Syn_Inst : Synth_Instance_Acc;
+ Expr : Node;
+ En : Net) return Valtyp;
function Synth_Bounds_From_Range (Syn_Inst : Synth_Instance_Acc;
Atype : Node) return Bound_Type;
@@ -102,6 +109,7 @@ package Synth.Expr is
procedure Synth_Slice_Suffix (Syn_Inst : Synth_Instance_Acc;
Name : Node;
+ En : Net;
Pfx_Bnd : Bound_Type;
El_Typ : Type_Acc;
Res_Bnd : out Bound_Type;
@@ -112,6 +120,7 @@ package Synth.Expr is
-- OFF is 0.
procedure Synth_Indexed_Name (Syn_Inst : Synth_Instance_Acc;
Name : Node;
+ En : Net;
Pfx_Type : Type_Acc;
Voff : out Net;
Off : out Value_Offsets);