diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-10-08 04:53:25 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-10-08 14:57:24 +0200 |
commit | 8b090b01da269679e98a578f4fda17e3e4adce12 (patch) | |
tree | 8d3284a5aacde88d6662300d87abf645065d8e16 /src/vhdl/translate | |
parent | 120548782cb62cc5d8f82b1569e2383a8528b98a (diff) | |
download | ghdl-8b090b01da269679e98a578f4fda17e3e4adce12.tar.gz ghdl-8b090b01da269679e98a578f4fda17e3e4adce12.tar.bz2 ghdl-8b090b01da269679e98a578f4fda17e3e4adce12.zip |
Add signal_attribute_declaration to hold implicit atribute signals.
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r-- | src/vhdl/translate/trans-chap4.adb | 36 | ||||
-rw-r--r-- | src/vhdl/translate/trans-rtis.adb | 49 |
2 files changed, 56 insertions, 29 deletions
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb index c8e847fc3..3fa188df4 100644 --- a/src/vhdl/translate/trans-chap4.adb +++ b/src/vhdl/translate/trans-chap4.adb @@ -1725,8 +1725,16 @@ package body Trans.Chap4 is when Iir_Kind_Attribute_Specification => Chap5.Translate_Attribute_Specification (Decl); - when Iir_Kinds_Signal_Attribute => - Chap4.Create_Implicit_Signal (Decl); + when Iir_Kind_Signal_Attribute_Declaration => + declare + Sig : Iir; + begin + Sig := Get_Signal_Attribute_Chain (Decl); + while Is_Valid (Sig) loop + Chap4.Create_Implicit_Signal (Sig); + Sig := Get_Attr_Chain (Sig); + end loop; + end; when Iir_Kind_Guard_Signal_Declaration => Create_Signal (Decl); @@ -2455,13 +2463,23 @@ package body Trans.Chap4 is | Iir_Kind_Procedure_Body => null; - when Iir_Kind_Stable_Attribute - | Iir_Kind_Quiet_Attribute - | Iir_Kind_Transaction_Attribute => - Elab_Signal_Attribute (Decl); - - when Iir_Kind_Delayed_Attribute => - Elab_Signal_Delayed_Attribute (Decl); + when Iir_Kind_Signal_Attribute_Declaration => + declare + Sig : Iir; + begin + Sig := Get_Signal_Attribute_Chain (Decl); + while Is_Valid (Sig) loop + case Iir_Kinds_Signal_Attribute (Get_Kind (Sig)) is + when Iir_Kind_Stable_Attribute + | Iir_Kind_Quiet_Attribute + | Iir_Kind_Transaction_Attribute => + Elab_Signal_Attribute (Sig); + when Iir_Kind_Delayed_Attribute => + Elab_Signal_Delayed_Attribute (Sig); + end case; + Sig := Get_Attr_Chain (Sig); + end loop; + end; when Iir_Kind_Group_Template_Declaration | Iir_Kind_Group_Declaration => diff --git a/src/vhdl/translate/trans-rtis.adb b/src/vhdl/translate/trans-rtis.adb index 3da305ff8..77c12a358 100644 --- a/src/vhdl/translate/trans-rtis.adb +++ b/src/vhdl/translate/trans-rtis.adb @@ -2109,17 +2109,12 @@ package body Trans.Rtis is -- Eg: array subtypes. null; when Iir_Kind_Signal_Declaration - | Iir_Kind_Interface_Signal_Declaration - | Iir_Kind_Constant_Declaration - | Iir_Kind_Interface_Constant_Declaration - | Iir_Kind_Variable_Declaration - | Iir_Kind_File_Declaration - | Iir_Kind_Transaction_Attribute - | Iir_Kind_Quiet_Attribute - | Iir_Kind_Stable_Attribute => - null; - when Iir_Kind_Delayed_Attribute => - -- FIXME: to be added. + | Iir_Kind_Interface_Signal_Declaration + | Iir_Kind_Constant_Declaration + | Iir_Kind_Interface_Constant_Declaration + | Iir_Kind_Variable_Declaration + | Iir_Kind_File_Declaration + | Iir_Kind_Signal_Attribute_Declaration => null; when Iir_Kind_Object_Alias_Declaration | Iir_Kind_Attribute_Declaration => @@ -2233,9 +2228,8 @@ package body Trans.Rtis is or else Get_Deferred_Declaration_Flag (Decl) then declare - Info : Object_Info_Acc; + Info : constant Object_Info_Acc := Get_Info (Decl); begin - Info := Get_Info (Decl); Generate_Object (Decl, Info.Object_Rti); Add_Rti_Node (Info.Object_Rti); end; @@ -2250,19 +2244,34 @@ package body Trans.Rtis is Add_Rti_Node (Info.Object_Rti); end; when Iir_Kind_Signal_Declaration - | Iir_Kind_Interface_Signal_Declaration - | Iir_Kind_Transaction_Attribute - | Iir_Kind_Quiet_Attribute - | Iir_Kind_Stable_Attribute => + | Iir_Kind_Interface_Signal_Declaration => declare Info : constant Signal_Info_Acc := Get_Info (Decl); begin Generate_Object (Decl, Info.Signal_Rti); Add_Rti_Node (Info.Signal_Rti); end; - when Iir_Kind_Delayed_Attribute => - -- FIXME: to be added. - null; + when Iir_Kind_Signal_Attribute_Declaration => + declare + Sig : Iir; + Info : Signal_Info_Acc; + begin + Sig := Get_Signal_Attribute_Chain (Decl); + while Is_Valid (Sig) loop + case Iir_Kinds_Signal_Attribute (Get_Kind (Sig)) is + when Iir_Kind_Stable_Attribute + | Iir_Kind_Quiet_Attribute + | Iir_Kind_Transaction_Attribute => + Info := Get_Info (Sig); + Generate_Object (Sig, Info.Signal_Rti); + Add_Rti_Node (Info.Signal_Rti); + when Iir_Kind_Delayed_Attribute => + null; + end case; + Sig := Get_Attr_Chain (Sig); + end loop; + end; + when Iir_Kind_Object_Alias_Declaration | Iir_Kind_Attribute_Declaration => declare |