aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-13 05:37:29 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-13 06:30:33 +0100
commit35a583cd80d7448f653ffd7fc12dcb2d969a377c (patch)
tree4fc37f8a914cd2f6267d0bdc68fc98bbd9bb98f9 /src
parentc138b798d1830e255b4d8a9b229fe620db363919 (diff)
downloadghdl-35a583cd80d7448f653ffd7fc12dcb2d969a377c.tar.gz
ghdl-35a583cd80d7448f653ffd7fc12dcb2d969a377c.tar.bz2
ghdl-35a583cd80d7448f653ffd7fc12dcb2d969a377c.zip
synth-static_oper: handle static net for add_uns_nat.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-static_oper.adb19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index cb6fd0877..5af38cc42 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -149,11 +149,20 @@ package body Synth.Static_Oper is
end Synth_Vector_Dyadic;
procedure To_Std_Logic_Vector
- (Val : Value_Acc; Arr : out Std_Logic_Vector) is
+ (Val : Value_Acc; Arr : out Std_Logic_Vector)
+ is
+ Sarr : constant Static_Arr_Type := Get_Static_Array (Val);
begin
- for I in Val.Arr.V'Range loop
- Arr (Natural (I)) := Std_Ulogic'Val (Val.Arr.V (I).Scal);
- end loop;
+ case Sarr.Kind is
+ when Sarr_Value =>
+ for I in Val.Arr.V'Range loop
+ Arr (Natural (I)) := Std_Ulogic'Val (Val.Arr.V (I).Scal);
+ end loop;
+ when Sarr_Net =>
+ for I in Arr'Range loop
+ Arr (Natural (I)) := Get_Static_Std_Logic (Sarr, Uns32 (I - 1));
+ end loop;
+ end case;
end To_Std_Logic_Vector;
function To_Value_Acc (Vec : Std_Logic_Vector; El_Typ : Type_Acc)
@@ -207,7 +216,7 @@ package body Synth.Static_Oper is
return Value_Acc
is
pragma Unreferenced (Loc);
- L_Arr : Std_Logic_Vector (1 .. Natural (L.Arr.Len));
+ L_Arr : Std_Logic_Vector (1 .. Natural (L.Typ.W));
R_Val : constant Uns64 := Uns64 (R.Scal);
begin
To_Std_Logic_Vector (L, L_Arr);