diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-29 09:13:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-29 09:13:20 +0200 |
commit | 33600b36bb0c3c10686047b006b47be660164095 (patch) | |
tree | f18a6228b66e01315f45995b387728d711699b53 /src/synth/synth-expr.adb | |
parent | 59c6890377b635797dff61346a780b4d23436736 (diff) | |
download | ghdl-33600b36bb0c3c10686047b006b47be660164095.tar.gz ghdl-33600b36bb0c3c10686047b006b47be660164095.tar.bz2 ghdl-33600b36bb0c3c10686047b006b47be660164095.zip |
synth: introduce type_logic
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r-- | src/synth/synth-expr.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 714567176..4213ea506 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -131,8 +131,10 @@ package body Synth.Expr is (Enum : Int64; Etype : Type_Acc; Val : out Uns32; Zx : out Uns32) is begin if Etype = Logic_Type then + pragma Assert (Etype.Kind = Type_Logic); From_Std_Logic (Enum, Val, Zx); elsif Etype = Boolean_Type or Etype = Bit_Type then + pragma Assert (Etype.Kind = Type_Bit); From_Bit (Enum, Val); Zx := 0; else @@ -673,7 +675,7 @@ package body Synth.Expr is Bnd := Synth_Array_Bounds (Syn_Inst, Aggr_Type, 0); pragma Assert (Bnd.Len = Uns32 (Last + 1)); - if El_Typ.Kind = Type_Bit then + if El_Typ.Kind in Type_Nets then Res_Type := Create_Vector_Type (Bnd, El_Typ); else Bnds := Create_Bound_Array (1); @@ -725,6 +727,9 @@ package body Synth.Expr is when Type_Bit => pragma Assert (Vtype.Kind = Type_Bit); return Val; + when Type_Logic => + pragma Assert (Vtype.Kind = Type_Logic); + return Val; when Type_Discrete => pragma Assert (Vtype.Kind = Type_Discrete); declare @@ -1429,7 +1434,7 @@ package body Synth.Expr is begin Bounds := Synth_Array_Bounds (Syn_Inst, Str_Type, 0); El_Type := Get_Value_Type (Syn_Inst, Get_Element_Subtype (Str_Type)); - if El_Type.Kind = Type_Bit then + if El_Type.Kind in Type_Nets then Res_Type := Create_Vector_Type (Bounds, El_Type); else Bnds := Create_Bound_Array (1); |