diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-12-22 11:58:05 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-12-22 11:58:05 +0100 |
commit | 6aa5c00499ff83aa5926017c87339b5493cea4db (patch) | |
tree | 1289ede59c454637e12a9f1a5e19413600ad02d8 | |
parent | 846f7e02d664702bedc5ed086c7753bd93e3ba97 (diff) | |
download | ghdl-6aa5c00499ff83aa5926017c87339b5493cea4db.tar.gz ghdl-6aa5c00499ff83aa5926017c87339b5493cea4db.tar.bz2 ghdl-6aa5c00499ff83aa5926017c87339b5493cea4db.zip |
Add comments.
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 2 | ||||
-rw-r--r-- | src/ghdldrv/ghdllocal.adb | 9 | ||||
-rw-r--r-- | src/vhdl/configuration.adb | 7 | ||||
-rw-r--r-- | src/vhdl/configuration.ads | 1 |
4 files changed, 15 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index 6ffeef8a3..7e418d6b2 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -1470,6 +1470,8 @@ package body Ghdldrv is Unit := Get_First_Design_Unit (File); while Unit /= Null_Iir loop Lib_Unit := Get_Library_Unit (Unit); + -- Check if the unit is outdated (except for default + -- configurations). if not (Get_Kind (Lib_Unit) = Iir_Kind_Configuration_Declaration and then Get_Identifier (Lib_Unit) = Null_Identifier) then diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index be4587d63..ede9526f0 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -1207,6 +1207,7 @@ package body Ghdllocal is Work_Library := Old_Work; end Load_All_Libraries_And_Files; + -- Check the Elab_Flag is not set on design units of LIB. procedure Check_No_Elab_Flag (Lib : Iir_Library_Declaration) is File : Iir_Design_File; @@ -1271,6 +1272,7 @@ package body Ghdllocal is end if; if True then + -- Load the world. Load_All_Libraries_And_Files; else -- Re-parse modified files in order configure could find all design @@ -1313,11 +1315,11 @@ package body Ghdllocal is Top := Configure (Primary_Id, Secondary_Id); if Top = Null_Iir then - --Error ("cannot find primary unit " & Prim.all); + -- Error during configuration (primary unit not found). raise Option_Error; end if; - -- Add unused design units. + -- Add unused design units (and their dependencies). declare N : Natural; begin @@ -1339,7 +1341,8 @@ package body Ghdllocal is end loop; end; - -- Clear elab flag on design files. + -- Clear elab flag on design files (as it is used by below by + -- Build_Dependence_List). for I in reverse Design_Units.First .. Design_Units.Last loop Unit := Design_Units.Table (I); File := Get_Design_File (Unit); diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb index f570b692e..93d4b0072 100644 --- a/src/vhdl/configuration.adb +++ b/src/vhdl/configuration.adb @@ -43,8 +43,10 @@ package body Configuration is Prev_File_Dependence : Iir_List; begin if Flag_Build_File_Dependence then + -- The current file depends on unit. File := Get_Design_File (Unit); if Current_File_Dependence /= Null_Iir_List then + -- (There is no dependency for default configuration). Add_Element (Current_File_Dependence, File); end if; end if; @@ -69,6 +71,7 @@ package body Configuration is Lib_Unit := Get_Library_Unit (Unit); if Flag_Build_File_Dependence then + -- Switch current_file_dependence to the design file of Unit. Prev_File_Dependence := Current_File_Dependence; if Get_Kind (Lib_Unit) = Iir_Kind_Configuration_Declaration @@ -505,7 +508,9 @@ package body Configuration is -- For each element of the list: -- add direct dependences (packages, entity, arch) if not in the list -- for architectures and configuration: find instantiations and add - -- corresponding configurations + -- corresponding configurations. + -- + -- Return the configuration declaration for the design. function Configure (Primary_Id : Name_Id; Secondary_Id : Name_Id) return Iir is diff --git a/src/vhdl/configuration.ads b/src/vhdl/configuration.ads index 0a19a23c2..e02a2cdfb 100644 --- a/src/vhdl/configuration.ads +++ b/src/vhdl/configuration.ads @@ -45,6 +45,7 @@ package Configuration is -- If set, all design units (even package bodies) are loaded. Flag_Load_All_Design_Units : Boolean := True; + -- If set, compute the File_Dependence_List of design files. Flag_Build_File_Dependence : Boolean := False; -- Check if ENTITY can be at the top of a hierarchy, ie: |