aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-16 08:08:31 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-16 08:17:50 +0200
commit2412f7355e029905cdac0883982fd3927f493e3a (patch)
treee3ee89c4d63d925d160050bf04c5c92fd074e09e /src
parent23bb49eb1f24c65effe07377d8748687e5a668bf (diff)
downloadghdl-2412f7355e029905cdac0883982fd3927f493e3a.tar.gz
ghdl-2412f7355e029905cdac0883982fd3927f493e3a.tar.bz2
ghdl-2412f7355e029905cdac0883982fd3927f493e3a.zip
synth: handle functional call to numeric_std binary operators. For #1313
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-expr.adb3
-rw-r--r--src/vhdl/vhdl-nodes.ads57
2 files changed, 35 insertions, 25 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index faebd7c93..c960b8867 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1985,7 +1985,8 @@ package body Synth.Expr is
Imp : constant Node := Get_Implementation (Expr);
begin
case Get_Implicit_Definition (Imp) is
- when Iir_Predefined_Pure_Functions =>
+ when Iir_Predefined_Pure_Functions
+ | Iir_Predefined_Ieee_Numeric_Std_Binary_Operators =>
return Synth_Operator_Function_Call (Syn_Inst, Expr);
when Iir_Predefined_None =>
return Synth_User_Function_Call (Syn_Inst, Expr);
diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads
index 56407a607..50ffbfcb0 100644
--- a/src/vhdl/vhdl-nodes.ads
+++ b/src/vhdl/vhdl-nodes.ads
@@ -5498,6 +5498,7 @@ package Vhdl.Nodes is
Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Uns,
Iir_Predefined_Ieee_Numeric_Std_Resize_Sgn_Sgn,
+ -- Numeric_Std operators (Start)
Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns,
Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Nat,
Iir_Predefined_Ieee_Numeric_Std_Add_Nat_Uns,
@@ -5590,20 +5591,6 @@ package Vhdl.Nodes is
Iir_Predefined_Ieee_Numeric_Std_Ne_Sgn_Int,
Iir_Predefined_Ieee_Numeric_Std_Ne_Int_Sgn,
- Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Uns,
- Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Min_Nat_Uns,
- Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Sgn,
- Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Int,
- Iir_Predefined_Ieee_Numeric_Std_Min_Int_Sgn,
-
- Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Uns,
- Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Max_Nat_Uns,
- Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Sgn,
- Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Int,
- Iir_Predefined_Ieee_Numeric_Std_Max_Int_Sgn,
-
Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Uns_Uns,
Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Uns_Nat,
Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Nat_Uns,
@@ -5646,11 +5633,6 @@ package Vhdl.Nodes is
Iir_Predefined_Ieee_Numeric_Std_Match_Ne_Sgn_Int,
Iir_Predefined_Ieee_Numeric_Std_Match_Ne_Int_Sgn,
- Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Shr_Uns_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat,
-
Iir_Predefined_Ieee_Numeric_Std_Sll_Uns_Int,
Iir_Predefined_Ieee_Numeric_Std_Sll_Sgn_Int,
Iir_Predefined_Ieee_Numeric_Std_Srl_Uns_Int,
@@ -5665,11 +5647,6 @@ package Vhdl.Nodes is
Iir_Predefined_Ieee_Numeric_Std_Rol_Sgn_Nat,
Iir_Predefined_Ieee_Numeric_Std_Ror_Sgn_Nat,
- Iir_Predefined_Ieee_Numeric_Std_Not_Uns,
- Iir_Predefined_Ieee_Numeric_Std_Not_Sgn,
-
- Iir_Predefined_Ieee_Numeric_Std_Abs_Sgn,
-
Iir_Predefined_Ieee_Numeric_Std_And_Uns_Uns,
Iir_Predefined_Ieee_Numeric_Std_And_Sgn_Sgn,
@@ -5687,11 +5664,38 @@ package Vhdl.Nodes is
Iir_Predefined_Ieee_Numeric_Std_Xnor_Uns_Uns,
Iir_Predefined_Ieee_Numeric_Std_Xnor_Sgn_Sgn,
+ -- Numeric_Std binary operators (end)
-- Unary functions for numeric_std
+ Iir_Predefined_Ieee_Numeric_Std_Not_Uns,
+ Iir_Predefined_Ieee_Numeric_Std_Not_Sgn,
+
+ Iir_Predefined_Ieee_Numeric_Std_Abs_Sgn,
+
Iir_Predefined_Ieee_Numeric_Std_Neg_Uns,
Iir_Predefined_Ieee_Numeric_Std_Neg_Sgn,
+ -- Min and Max.
+ Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Uns,
+ Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Nat,
+ Iir_Predefined_Ieee_Numeric_Std_Min_Nat_Uns,
+ Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Sgn,
+ Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Int,
+ Iir_Predefined_Ieee_Numeric_Std_Min_Int_Sgn,
+
+ Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Uns,
+ Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Nat,
+ Iir_Predefined_Ieee_Numeric_Std_Max_Nat_Uns,
+ Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Sgn,
+ Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Int,
+ Iir_Predefined_Ieee_Numeric_Std_Max_Int_Sgn,
+
+ -- Shift and rotate functions.
+ Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat,
+ Iir_Predefined_Ieee_Numeric_Std_Shr_Uns_Nat,
+ Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat,
+ Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat,
+
-- Std_Match functions.
Iir_Predefined_Ieee_Numeric_Std_Match_Log,
Iir_Predefined_Ieee_Numeric_Std_Match_Uns,
@@ -5985,6 +5989,11 @@ package Vhdl.Nodes is
Iir_Predefined_Functions'Succ (Iir_Predefined_None) ..
Iir_Predefined_Functions'Last;
+ subtype Iir_Predefined_Ieee_Numeric_Std_Binary_Operators
+ is Iir_Predefined_Functions range
+ Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns ..
+ Iir_Predefined_Ieee_Numeric_Std_Xnor_Sgn_Sgn;
+
-- Size of scalar types.
-- Their size is determined during analysis (using the range), so that
-- all backends have the same view.