diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-11-13 21:21:48 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-30 08:41:55 +0100 |
commit | cf17632924e55d4a9357942d8dac828c1e93b41c (patch) | |
tree | 1a12aedead88ea280cccbfff0f52b6cd0c97ddb9 /src | |
parent | b4aa85dc3288855ccecc53de4d0dd8bb0af0724c (diff) | |
download | ghdl-cf17632924e55d4a9357942d8dac828c1e93b41c.tar.gz ghdl-cf17632924e55d4a9357942d8dac828c1e93b41c.tar.bz2 ghdl-cf17632924e55d4a9357942d8dac828c1e93b41c.zip |
ieee-std_logic_1164: save literals 0 and 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/ieee-std_logic_1164.adb | 20 | ||||
-rw-r--r-- | src/vhdl/ieee-std_logic_1164.ads | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/vhdl/ieee-std_logic_1164.adb b/src/vhdl/ieee-std_logic_1164.adb index b24e868d8..aa6eb4c53 100644 --- a/src/vhdl/ieee-std_logic_1164.adb +++ b/src/vhdl/ieee-std_logic_1164.adb @@ -16,6 +16,7 @@ -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. with Types; use Types; +with Name_Table; with Std_Names; use Std_Names; with Iirs_Utils; use Iirs_Utils; with Errorout; use Errorout; @@ -165,6 +166,23 @@ package body Ieee.Std_Logic_1164 is end if; Std_Ulogic_Type := Def; + -- Get node of some literals. + declare + use Name_Table; + Lit_List : constant Iir_List := Get_Enumeration_Literal_List (Def); + begin + if Get_Nbr_Elements (Lit_List) /= 9 then + raise Error; + end if; + Std_Ulogic_0 := Get_Nth_Element (Lit_List, 2); + Std_Ulogic_1 := Get_Nth_Element (Lit_List, 3); + if Get_Identifier (Std_Ulogic_0) /= Get_Identifier ('0') + or else Get_Identifier (Std_Ulogic_1) /= Get_Identifier ('1') + then + raise Error; + end if; + end; + -- The second declaration should be std_ulogic_vector. Decl := Get_Chain (Decl); Decl := Skip_Implicit (Decl); @@ -315,6 +333,8 @@ package body Ieee.Std_Logic_1164 is Std_Ulogic_Vector_Type := Null_Iir; Std_Logic_Type := Null_Iir; Std_Logic_Vector_Type := Null_Iir; + Std_Ulogic_0 := Null_Iir; + Std_Ulogic_1 := Null_Iir; Rising_Edge := Null_Iir; Falling_Edge := Null_Iir; end Extract_Declarations; diff --git a/src/vhdl/ieee-std_logic_1164.ads b/src/vhdl/ieee-std_logic_1164.ads index 7b11ded48..c8d7614cb 100644 --- a/src/vhdl/ieee-std_logic_1164.ads +++ b/src/vhdl/ieee-std_logic_1164.ads @@ -22,6 +22,8 @@ package Ieee.Std_Logic_1164 is Std_Logic_1164_Pkg : Iir_Package_Declaration := Null_Iir; Std_Ulogic_Type : Iir_Enumeration_Type_Definition := Null_Iir; Std_Ulogic_Vector_Type : Iir_Array_Type_Definition := Null_Iir; + Std_Ulogic_0 : Iir_Enumeration_Literal := Null_Iir; + Std_Ulogic_1 : Iir_Enumeration_Literal := Null_Iir; Std_Logic_Type : Iir_Enumeration_Subtype_Definition := Null_Iir; Std_Logic_Vector_Type : Iir_Array_Type_Definition := Null_Iir; Resolved : Iir_Function_Declaration := Null_Iir; |