aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-11 18:17:47 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-11 18:17:47 +0100
commit707e6f42362fa30b5af6090cc68f8e94fe61925a (patch)
treec259b780c7d55232bcd317a4fec975e856b87557 /src
parentb1d2fb64a8e1ecceaaecd92e44e63fc7af0416f1 (diff)
downloadghdl-707e6f42362fa30b5af6090cc68f8e94fe61925a.tar.gz
ghdl-707e6f42362fa30b5af6090cc68f8e94fe61925a.tar.bz2
ghdl-707e6f42362fa30b5af6090cc68f8e94fe61925a.zip
synth: handle universal r*i and i*r mul, physical mod.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-vhdl_eval.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb
index f9bb11089..126c8a735 100644
--- a/src/synth/synth-vhdl_eval.adb
+++ b/src/synth/synth-vhdl_eval.adb
@@ -1118,6 +1118,13 @@ package body Synth.Vhdl_Eval is
Check_Integer_Overflow (Inst, Res, Res_Typ, Expr);
return Create_Memory_Discrete (Res, Res_Typ);
end;
+ when Iir_Predefined_Universal_I_R_Mul =>
+ return Create_Memory_Fp64
+ (Fp64 (Read_Discrete (Param1)) * Read_Fp64 (Param2), Res_Typ);
+ when Iir_Predefined_Universal_R_I_Mul =>
+ return Create_Memory_Fp64
+ (Read_Fp64 (Param1) * Fp64 (Read_Discrete (Param2)), Res_Typ);
+
when Iir_Predefined_Integer_Div
| Iir_Predefined_Physical_Physical_Div
| Iir_Predefined_Physical_Integer_Div =>
@@ -1134,7 +1141,8 @@ package body Synth.Vhdl_Eval is
Check_Integer_Overflow (Inst, Res, Res_Typ, Expr);
return Create_Memory_Discrete (Res, Res_Typ);
end;
- when Iir_Predefined_Integer_Mod =>
+ when Iir_Predefined_Integer_Mod
+ | Iir_Predefined_Physical_Mod =>
declare
Res : Int64;
Div : Int64;