aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-oper.adb14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index fcd11201e..471d82979 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -1186,6 +1186,20 @@ package body Synth.Oper is
return Create_Value_Float
(Ceil (V.Fp), Get_Value_Type (Syn_Inst, Get_Type (Imp)));
end;
+ when Iir_Predefined_Ieee_Math_Real_Round =>
+ declare
+ V : constant Value_Acc := Get_Value (Subprg_Inst, Param1);
+
+ function Round (Arg : Fp64) return Fp64;
+ pragma Import (C, Round);
+ begin
+ if V.Typ.Kind /= Type_Float then
+ Error_Msg_Synth(+Expr, "argument must be a float value");
+ return null;
+ end if;
+ return Create_Value_Float
+ (Round (V.Fp), Get_Value_Type (Syn_Inst, Get_Type (Imp)));
+ end;
when Iir_Predefined_Ieee_Math_Real_Sin =>
declare
V : constant Value_Acc := Get_Value (Subprg_Inst, Param1);