From 06ee1499b50458cd23118b99b3727f8a08d847bd Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 Apr 2020 07:55:43 +0200 Subject: vhdl: recognize ext/sxt from std_logic_arith. --- src/std_names.adb | 2 ++ src/std_names.ads | 4 +++- src/vhdl/vhdl-ieee-std_logic_arith.adb | 10 ++++++++++ src/vhdl/vhdl-nodes.ads | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/std_names.adb b/src/std_names.adb index 9d9cfcbe7..ece86763f 100644 --- a/src/std_names.adb +++ b/src/std_names.adb @@ -668,6 +668,8 @@ package body Std_Names is Def ("log2", Name_Log2); Def ("sin", Name_Sin); Def ("cos", Name_Cos); + Def ("ext", Name_Ext); + Def ("sxt", Name_Sxt); Def ("allconst", Name_Allconst); Def ("allseq", Name_Allseq); diff --git a/src/std_names.ads b/src/std_names.ads index 2c12c0f00..6ed7fb6d5 100644 --- a/src/std_names.ads +++ b/src/std_names.ads @@ -751,7 +751,9 @@ package Std_Names is Name_Log2 : constant Name_Id := Name_First_Ieee_Name + 038; Name_Sin : constant Name_Id := Name_First_Ieee_Name + 039; Name_Cos : constant Name_Id := Name_First_Ieee_Name + 040; - Name_Last_Ieee_Name : constant Name_Id := Name_Cos; + Name_Ext : constant Name_Id := Name_First_Ieee_Name + 041; + Name_Sxt : constant Name_Id := Name_First_Ieee_Name + 042; + Name_Last_Ieee_Name : constant Name_Id := Name_Sxt; Name_First_Synthesis : constant Name_Id := Name_Last_Ieee_Name + 1; Name_Allconst : constant Name_Id := Name_First_Synthesis + 000; diff --git a/src/vhdl/vhdl-ieee-std_logic_arith.adb b/src/vhdl/vhdl-ieee-std_logic_arith.adb index 4c2b517ec..c1d7caccf 100644 --- a/src/vhdl/vhdl-ieee-std_logic_arith.adb +++ b/src/vhdl/vhdl-ieee-std_logic_arith.adb @@ -397,6 +397,16 @@ package body Vhdl.Ieee.Std_Logic_Arith is Def := Handle_Cmp (Eq_Patterns); when Name_Op_Inequality => Def := Handle_Cmp (Ne_Patterns); + when Name_Ext => + if Arg1_Kind /= Type_Slv or Arg2_Kind /= Type_Int then + raise Error; + end if; + Def := Iir_Predefined_Ieee_Std_Logic_Arith_Ext; + when Name_Sxt => + if Arg1_Kind /= Type_Slv or Arg2_Kind /= Type_Int then + raise Error; + end if; + Def := Iir_Predefined_Ieee_Std_Logic_Arith_Sxt; when others => null; end case; diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index c6f7d0891..393780a3f 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -5782,6 +5782,9 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Std_Logic_Arith_Conv_Vector_Sgn, Iir_Predefined_Ieee_Std_Logic_Arith_Conv_Vector_Log, + Iir_Predefined_Ieee_Std_Logic_Arith_Ext, + Iir_Predefined_Ieee_Std_Logic_Arith_Sxt, + Iir_Predefined_Ieee_Std_Logic_Arith_Mul_Uns_Uns_Uns, Iir_Predefined_Ieee_Std_Logic_Arith_Mul_Sgn_Sgn_Sgn, Iir_Predefined_Ieee_Std_Logic_Arith_Mul_Sgn_Uns_Sgn, -- cgit v1.2.3