From bb4d537126f7c14f34017231cc519d0f60d00bef Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 16 May 2022 05:01:04 +0200 Subject: ghdlcomp(common_compile_elab): add allow_undef_generic parameter --- src/ghdldrv/ghdlcomp.adb | 4 +++- src/ghdldrv/ghdlcomp.ads | 4 +++- src/ghdldrv/ghdlrun.adb | 2 +- src/ghdldrv/ghdlsimul.adb | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ghdldrv/ghdlcomp.adb b/src/ghdldrv/ghdlcomp.adb index d06da3510..4f9644e9b 100644 --- a/src/ghdldrv/ghdlcomp.adb +++ b/src/ghdldrv/ghdlcomp.adb @@ -324,6 +324,7 @@ package body Ghdlcomp is procedure Common_Compile_Elab (Cmd_Name : String; Args : Argument_List; + Allow_Undef_Generic : Boolean; Opt_Arg : out Natural; Config : out Iir) is @@ -354,7 +355,8 @@ package body Ghdlcomp is (Get_Block_Specification (Get_Block_Configuration (Conf_Unit))); Entity : constant Iir := Vhdl.Utils.Get_Entity (Arch); begin - Vhdl.Configuration.Check_Entity_Declaration_Top (Entity, True); + Vhdl.Configuration.Check_Entity_Declaration_Top + (Entity, Allow_Undef_Generic); if Nbr_Errors > 0 then raise Compilation_Error; end if; diff --git a/src/ghdldrv/ghdlcomp.ads b/src/ghdldrv/ghdlcomp.ads index 75d1e9f1d..5af54eaad 100644 --- a/src/ghdldrv/ghdlcomp.ads +++ b/src/ghdldrv/ghdlcomp.ads @@ -85,9 +85,11 @@ package Ghdlcomp is -- Common action to perform before elaboration: -- * extract PRIM_NAME and SEC_NAME from ARGS. -- * configure - -- * Check top entity. + -- * Check top entity + -- If ALLOW_UNDEF_GENERIC is False, the generics must have a default value. procedure Common_Compile_Elab (Cmd_Name : String; Args : Argument_List; + Allow_Undef_Generic : Boolean; Opt_Arg : out Natural; Config : out Iir); diff --git a/src/ghdldrv/ghdlrun.adb b/src/ghdldrv/ghdlrun.adb index 8cc1a6df0..2adc63130 100644 --- a/src/ghdldrv/ghdlrun.adb +++ b/src/ghdldrv/ghdlrun.adb @@ -144,7 +144,7 @@ package body Ghdlrun is is Config : Iir; begin - Common_Compile_Elab (Cmd_Name, Args, Opt_Arg, Config); + Common_Compile_Elab (Cmd_Name, Args, True, Opt_Arg, Config); if Time_Resolution = 'a' then Time_Resolution := Vhdl.Std_Package.Get_Minimal_Time_Resolution; diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb index 62242be3c..259a3dc57 100644 --- a/src/ghdldrv/ghdlsimul.adb +++ b/src/ghdldrv/ghdlsimul.adb @@ -80,7 +80,7 @@ package body Ghdlsimul is Lib_Unit : Node; Inst : Synth_Instance_Acc; begin - Common_Compile_Elab (Cmd_Name, Args, Opt_Arg, Config); + Common_Compile_Elab (Cmd_Name, Args, False, Opt_Arg, Config); Lib_Unit := Get_Library_Unit (Config); pragma Assert (Get_Kind (Lib_Unit) /= Iir_Kind_Foreign_Module); -- cgit v1.2.3