aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-06-14 17:12:59 +0200
committerTristan Gingold <tgingold@free.fr>2014-06-14 17:12:59 +0200
commitc2f20226c9391afee6fd18bcad254714baa1e740 (patch)
tree495022b82af6523ddb11baa9a20f6d06202467f1
parente849553d7deea2c6c7d97012043946e1e105783e (diff)
downloadghdl-c2f20226c9391afee6fd18bcad254714baa1e740.tar.gz
ghdl-c2f20226c9391afee6fd18bcad254714baa1e740.tar.bz2
ghdl-c2f20226c9391afee6fd18bcad254714baa1e740.zip
sem_specs: allow no port/generic in default binding indication.
-rw-r--r--sem_specs.adb34
-rw-r--r--sem_specs.ads3
2 files changed, 19 insertions, 18 deletions
diff --git a/sem_specs.adb b/sem_specs.adb
index ebcb3f38f..b746a348e 100644
--- a/sem_specs.adb
+++ b/sem_specs.adb
@@ -995,8 +995,8 @@ package body Sem_Specs is
begin
if Bind = Null_Iir then
raise Internal_Error;
- return;
end if;
+
Entity_Aspect := Get_Entity_Aspect (Bind);
if Entity_Aspect /= Null_Iir then
Entity := Sem_Entity_Aspect (Entity_Aspect);
@@ -1058,6 +1058,11 @@ package body Sem_Specs is
end if;
else
Sem_Generic_Port_Association_Chain (Entity, Bind);
+
+ -- LRM 5.2.1 Binding Indication
+ -- If the generic map aspect or port map aspect of a binding
+ -- indication is not present, then the default rules as described
+ -- in 5.2.2 apply.
if Get_Generic_Map_Aspect_Chain (Bind) = Null_Iir
and then Primary_Entity_Aspect = Null_Iir
then
@@ -1260,14 +1265,12 @@ package body Sem_Specs is
& Image_Identifier (El) & ''', El);
elsif not Is_In_Current_Declarative_Region (Inter) then
-- FIXME.
- Error_Msg_Sem
- ("label not in block declarative part", El);
+ Error_Msg_Sem ("label not in block declarative part", El);
else
Comp := Get_Declaration (Inter);
if Get_Kind (Comp) /= Iir_Kind_Component_Instantiation_Statement
then
- Error_Msg_Sem
- ("label does not denote an instantiation", El);
+ Error_Msg_Sem ("label does not denote an instantiation", El);
else
Inst := Get_Instantiated_Unit (Comp);
if Get_Kind (Inst) /= Iir_Kind_Component_Declaration then
@@ -1408,6 +1411,10 @@ package body Sem_Specs is
end Sem_Create_Default_Binding_Indication;
-- LRM 5.2.2
+ -- The default binding indication includes a default generic map aspect
+ -- if the design entity implied by the entity aspect contains formal
+ -- generics.
+ --
-- The default generic map aspect associates each local generic in
-- the corresponding component instantiation (if any) with a formal
-- of the same simple name.
@@ -1417,6 +1424,10 @@ package body Sem_Specs is
-- designator OPEN.
-- LRM 5.2.2
+ -- The default binding indication includes a default port map aspect
+ -- if the design entity implied by the entity aspect contains formal
+ -- ports.
+ --
-- The default port map aspect associates each local port in the
-- corresponding component instantiation (if any) with a formal of
-- the same simple name.
@@ -1424,11 +1435,6 @@ package body Sem_Specs is
-- and type are not appropriate for such an association.
-- Any remaining unassociated formals are associated with the actual
-- designator OPEN.
- type Map_Kind_String_Type is array (Map_Kind_Type) of String_Cst;
- Map_Kind_Name : constant Map_Kind_String_Type :=
- (Map_Generic => new String'("generic"),
- Map_Port => new String'("port"));
-
function Create_Default_Map_Aspect
(Comp : Iir; Entity : Iir; Kind : Map_Kind_Type; Parent : Iir)
return Iir
@@ -1451,15 +1457,7 @@ package body Sem_Specs is
end case;
-- If no formal, then there is no association list.
- -- Just check there is no actuals.
if Ent_Chain = Null_Iir then
- if Comp_Chain /= Null_Iir then
- Error_Msg_Sem ("no " & Map_Kind_Name (Kind).all & "s of "
- & Disp_Node (Entity)
- & " to be associated with "
- & Map_Kind_Name (Kind).all
- & "s of " & Disp_Node (Comp), Parent);
- end if;
return Null_Iir;
end if;
diff --git a/sem_specs.ads b/sem_specs.ads
index 76edc0fce..f37d32ff9 100644
--- a/sem_specs.ads
+++ b/sem_specs.ads
@@ -37,6 +37,9 @@ package Sem_Specs is
procedure Sem_Configuration_Specification
(Parent_Stmts : Iir; Conf : Iir_Configuration_Specification);
+ -- Analyze binding indication BIND of configuration specification or
+ -- component configuration PARENT.
+ -- PRIMARY_ENTITY_ASPECT is not Null_Iir for an incremental binding.
procedure Sem_Binding_Indication (Bind : Iir_Binding_Indication;
Comp : Iir_Component_Declaration;
Parent : Iir;