diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-01-14 06:24:33 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-01-14 06:24:33 +0100 |
commit | 1b3915222c3755692ae1693ef1bb8f9d3dc52172 (patch) | |
tree | 799779b4f9b35d9f4faa4046786ee7dec5f91b58 | |
parent | 4b97bbb1830f10ec17e07c5d312e35a83019a9ce (diff) | |
download | ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.tar.gz ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.tar.bz2 ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.zip |
synth: handle macro-expanded package body. Fix #1948
-rw-r--r-- | src/synth/elab-vhdl_insts.adb | 3 | ||||
-rw-r--r-- | src/synth/synth-vhdl_decls.adb | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-annotations.adb | 16 |
3 files changed, 16 insertions, 6 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb index 5192046b1..cb7a6bd9e 100644 --- a/src/synth/elab-vhdl_insts.adb +++ b/src/synth/elab-vhdl_insts.adb @@ -183,7 +183,8 @@ package body Elab.Vhdl_Insts is if Bod /= Null_Node then -- Macro expanded package instantiation. - raise Internal_Error; + Elab_Declarations + (Sub_Inst, Get_Declaration_Chain (Bod)); else -- Shared body declare diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb index 5eefbdaef..c7ab62d8e 100644 --- a/src/synth/synth-vhdl_decls.adb +++ b/src/synth/synth-vhdl_decls.adb @@ -341,7 +341,8 @@ package body Synth.Vhdl_Decls is if Bod /= Null_Node then -- Macro expanded package instantiation. - raise Internal_Error; + Synth_Concurrent_Declarations + (Sub_Inst, Get_Declaration_Chain (Bod)); else -- Shared body declare diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb index ec6efd46a..43477c1d2 100644 --- a/src/vhdl/vhdl-annotations.adb +++ b/src/vhdl/vhdl-annotations.adb @@ -665,15 +665,23 @@ package body Vhdl.Annotations is end if; end Annotate_Package_Declaration; - procedure Annotate_Package_Body (Decl: Iir) + procedure Annotate_Package_Body (Bod: Iir) is - Package_Info : constant Sim_Info_Acc := Get_Info (Get_Package (Decl)); + Pkg : constant Node := Get_Package (Bod); + Package_Info : constant Sim_Info_Acc := Get_Info (Pkg); begin + if Is_Uninstantiated_Package (Pkg) + and then Get_Macro_Expanded_Flag (Pkg) + then + -- The body of a macro-expanded flag. + return; + end if; + -- Set info field of package body declaration. - Set_Info (Decl, Package_Info); + Set_Info (Bod, Package_Info); -- declarations - Annotate_Declaration_List (Package_Info, Get_Declaration_Chain (Decl)); + Annotate_Declaration_List (Package_Info, Get_Declaration_Chain (Bod)); end Annotate_Package_Body; procedure Annotate_Declaration_Type (Block_Info: Sim_Info_Acc; Decl: Iir) |