aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-static_oper.adb
diff options
context:
space:
mode:
authorbwimm <be.wimm@gmail.com>2020-04-07 21:05:32 +0200
committerGitHub <noreply@github.com>2020-04-07 21:05:32 +0200
commit921e989f6e638cd655835040839b2c003385ec38 (patch)
tree5fc93437e27dd433733cb29de2045d51af5e6d62 /src/synth/synth-static_oper.adb
parentdd36b3a7c22edeb73a821b1cd9f43c997920b3ef (diff)
downloadghdl-921e989f6e638cd655835040839b2c003385ec38.tar.gz
ghdl-921e989f6e638cd655835040839b2c003385ec38.tar.bz2
ghdl-921e989f6e638cd655835040839b2c003385ec38.zip
synth-static_oper: handle mul uns nat. (#1200)
Diffstat (limited to 'src/synth/synth-static_oper.adb')
-rw-r--r--src/synth/synth-static_oper.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index 4d4ff8305..4712dd844 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -462,6 +462,20 @@ package body Synth.Static_Oper is
end;
end Synth_Mul_Nat_Uns;
+ function Synth_Mul_Uns_Nat (L, R : Valtyp; Loc : Syn_Src) return Valtyp
+ is
+ pragma Unreferenced (Loc);
+ L_Arr : Std_Logic_Vector (1 .. Natural (Vec_Length (L.Typ)));
+ R_Val : constant Uns64 := Uns64 (Read_Discrete (R));
+ begin
+ To_Std_Logic_Vector (L, L_Arr);
+ declare
+ Res_Arr : constant Std_Logic_Vector := Mul_Uns_Nat (L_Arr, R_Val);
+ begin
+ return To_Valtyp (Res_Arr, L.Typ.Vec_El);
+ end;
+ end Synth_Mul_Uns_Nat;
+
function Synth_Mul_Sgn_Sgn (L, R : Valtyp; Loc : Syn_Src) return Valtyp
is
pragma Unreferenced (Loc);
@@ -904,6 +918,8 @@ package body Synth.Static_Oper is
return Synth_Mul_Uns_Uns (Left, Right, Expr);
when Iir_Predefined_Ieee_Numeric_Std_Mul_Nat_Uns =>
return Synth_Mul_Nat_Uns (Left, Right, Expr);
+ when Iir_Predefined_Ieee_Numeric_Std_Mul_Uns_Nat =>
+ return Synth_Mul_Uns_Nat (Left, Right, Expr);
when Iir_Predefined_Ieee_Numeric_Std_Mul_Sgn_Sgn =>
return Synth_Mul_Sgn_Sgn (Left, Right, Expr);