-- Semantic analysis pass. -- Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold -- -- GHDL is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation; either version 2, or (at your option) any later -- version. -- -- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY -- WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- -- You should have received a copy of the GNU General Public License -- along with GHDL; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. with Errorout; use Errorout; with Libraries; with Std_Names; with Flags; use Flags; with Str_Table; with Vhdl.Errors; use Vhdl.Errors; with Vhdl.Std_Package; use Vhdl.Std_Package; with Vhdl.Ieee.Std_Logic_1164; with Vhdl.Sem_Scopes; use Vhdl.Sem_Scopes; with Vhdl.Sem_Expr; use Vhdl.Sem_Expr; with Vhdl.Sem_Names; use Vhdl.Sem_Names; with Vhdl.Sem_Specs; use Vhdl.Sem_Specs; with Vhdl.Sem_Decls; use Vhdl.Sem_Decls; with Vhdl.Sem_Assocs; use Vhdl.Sem_Assocs; with Vhdl.Sem_Inst; with Vhdl.Sem_Lib; use Vhdl.Sem_Lib; with Vhdl.Sem_Psl; with Vhdl.Utils; use Vhdl.Utils; with Vhdl.Sem_Utils; with Vhdl.Sem_Stmts; use Vhdl.Sem_Stmts; with Vhdl.Nodes_Utils; with Vhdl.Xrefs; use Vhdl.Xrefs; package body Vhdl.Sem is -- Forward declarations. procedure Sem_Context_Clauses (Unit: Iir); procedure Sem_Block_Configuration (Block_Conf : Iir_Block_Configuration; Father: Iir); procedure Sem_Component_Configuration (Conf : Iir_Component_Configuration; Father : Iir); procedure Add_Dependence (Unit : Iir) is Targ : constant Iir := Get_Current_Design_Unit; begin -- During normal analysis, there is a current design unit. But not -- during debugging outside of any context. if Targ = Null_Iir then return; end if; Add_Dependence (Targ, Unit); end Add_Dependence; -- LRM 1.1 Entity declaration. procedure Sem_Entity_Declaration (Entity : Iir_Entity_Declaration) is begin Xrefs.Xref_Decl (Entity); Sem_Scopes.Add_Name (Entity); Set_Visible_Flag (Entity, True); Set_Is_Within_Flag (Entity, True); -- LRM 10.1 -- 1. An entity declaration, together with a corresponding architecture -- body. Open_Declarative_Region; -- Sem generics. Sem_Interface_Chain (Get_Generic_Chain (Entity), Generic_Interface_List); -- Sem ports. Sem_Interface_Chain (Get_Port_Chain (Entity), Port_Interface_List); -- Entity declarative part and concurrent statements. Sem_Block (Entity); Close_Declarative_Region; Set_Is_Within_Flag (Entity, False); end Sem_Entity_Declaration; -- Get the entity unit for LIBRARY_UNIT (an architecture or a -- configuration declaration). -- Return NULL_IIR in case of error (not found, bad library). function Sem_Entity_Name (Library_Unit : Iir) return Iir is Name : Iir; Library : Iir_Library_Declaration; Entity : Iir; begin -- Get th