summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_decls.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/sem_decls.ads')
-rw-r--r--src/vhdl/sem_decls.ads42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vhdl/sem_decls.ads b/src/vhdl/sem_decls.ads
index 7a8e240..49ba43a 100644
--- a/src/vhdl/sem_decls.ads
+++ b/src/vhdl/sem_decls.ads
@@ -18,6 +18,7 @@
with Iirs; use Iirs;
package Sem_Decls is
+ -- Analyze an interface chain.
procedure Sem_Interface_Chain (Interface_Chain: Iir;
Interface_Kind : Interface_Kind_Type);
@@ -49,4 +50,45 @@ package Sem_Decls is
-- is an overload list, it is destroyed.
function Sem_Signature (Name : Iir; Sig : Iir_Signature) return Iir;
+ -- The attribute signals ('stable, 'quiet and 'transaction) are
+ -- implicitely declared.
+ -- Note: guard signals are also implicitly declared but with a guard
+ -- expression, which is at a known location.
+ -- Since these signals need resources and are not easily located (can be
+ -- nearly in every expression), it is useful to add a node into a
+ -- declaration list to declare them.
+ -- However, only a few declaration_list can declare signals. These
+ -- declarations lists must register and unregister themselves with
+ -- push_declarative_region_with_signals and
+ -- pop_declarative_region_with_signals.
+ type Implicit_Signal_Declaration_Type is private;
+
+ procedure Push_Signals_Declarative_Part
+ (Cell: out Implicit_Signal_Declaration_Type; Decls_Parent : Iir);
+
+ procedure Pop_Signals_Declarative_Part
+ (Cell: in Implicit_Signal_Declaration_Type);
+
+ -- Declare an implicit signal.
+ procedure Add_Declaration_For_Implicit_Signal (Sig : Iir);
+
+private
+ type Implicit_Signal_Declaration_Type is record
+ -- Declaration or statement than will contain implicit declarations.
+ Decls_Parent : Iir;
+
+ -- If True, declarations of DECLS_PARENT have already been analyzed.
+ -- So implicit declarations are appended to the parent, and the last
+ -- declaration is LAST_IMPLICIT_DECL.
+ -- If False, declarations are being analyzed. Implicit declarations
+ -- are saved in FIRST_IMPLICIT_DECL / LAST_IMPLICIT_DECL and will be
+ -- inserted before the current declaration.
+ Decls_Analyzed : Boolean;
+
+ -- If DECLS_ANALYZED is False, this is the chain of implicit
+ -- declarations. If True, LAST_IMPLICIT_DECL contains the last
+ -- declaration.
+ First_Implicit_Decl : Iir;
+ Last_Implicit_Decl : Iir;
+ end record;
end Sem_Decls;