diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-28 05:53:26 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-28 05:53:26 +0100 |
commit | cceab917794f7c6016519380dadd51a8f537e976 (patch) | |
tree | 5c18c448a68713e315bf4b2f4137fa211a6c818d /src | |
parent | 4e4a7bb439596bac36488322cb190afc4efd935b (diff) | |
download | ghdl-cceab917794f7c6016519380dadd51a8f537e976.tar.gz ghdl-cceab917794f7c6016519380dadd51a8f537e976.tar.bz2 ghdl-cceab917794f7c6016519380dadd51a8f537e976.zip |
netlists-errors: can display instance numbers.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-errors.adb | 45 | ||||
-rw-r--r-- | src/synth/netlists-errors.ads | 4 |
2 files changed, 30 insertions, 19 deletions
diff --git a/src/synth/netlists-errors.adb b/src/synth/netlists-errors.adb index 0bee02e6a..b67af38d1 100644 --- a/src/synth/netlists-errors.adb +++ b/src/synth/netlists-errors.adb @@ -67,11 +67,15 @@ package body Netlists.Errors is pragma Unreferenced (Err); Inst : constant Instance := Instance (Val); begin - if Format = 'n' then - Output_Name_1 (Get_Instance_Name (Inst)); - else - raise Internal_Error; - end if; + case Format is + when 'n' => + Output_Name_1 (Get_Instance_Name (Inst)); + when 'i' => + Output_Message ("i"); + Output_Uns32 (Uns32 (Inst)); + when others => + raise Internal_Error; + end case; end Synth_Instance_Handler; procedure Synth_Net_Handler @@ -80,20 +84,23 @@ package body Netlists.Errors is pragma Unreferenced (Err); N : constant Net := Net (Val); begin - if Format = 'n' then - declare - Inst : constant Instance := Get_Net_Parent (N); - Idx : constant Port_Idx := Get_Port_Idx (N); - begin - if Is_Self_Instance (Inst) then - Output_Name_1 (Get_Input_Desc (Get_Module (Inst), Idx).Name); - else - Output_Name_1 (Get_Output_Desc (Get_Module (Inst), Idx).Name); - end if; - end; - else - raise Internal_Error; - end if; + case Format is + when 'n' => + declare + Inst : constant Instance := Get_Net_Parent (N); + Idx : constant Port_Idx := Get_Port_Idx (N); + Name : Sname; + begin + if Is_Self_Instance (Inst) then + Name := Get_Input_Desc (Get_Module (Inst), Idx).Name; + else + Name := Get_Output_Desc (Get_Module (Inst), Idx).Name; + end if; + Output_Name_1 (Name); + end; + when others => + raise Internal_Error; + end case; end Synth_Net_Handler; procedure Synth_Name_Handler diff --git a/src/synth/netlists-errors.ads b/src/synth/netlists-errors.ads index 33765017d..12302ecea 100644 --- a/src/synth/netlists-errors.ads +++ b/src/synth/netlists-errors.ads @@ -22,7 +22,11 @@ with Errorout; use Errorout; with Netlists.Locations; package Netlists.Errors is + -- For instances: + -- %n : name + -- %i : instance number function "+" (N : Instance) return Earg_Type; + function "+" (N : Net) return Earg_Type; function "+" (N : Sname) return Earg_Type; function "+" (N : Instance) return Location_Type |