diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-30 01:03:56 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-30 01:03:56 +0200 |
commit | 7201b1537e396d72ace4259a8a9578eda300a6a2 (patch) | |
tree | 0a292eada300354faf39a017c14a8897972ba851 /src/synth/synth-context.adb | |
parent | ecdc917bd5ff5d1e314796a24fd40d9716a37918 (diff) | |
download | ghdl-7201b1537e396d72ace4259a8a9578eda300a6a2.tar.gz ghdl-7201b1537e396d72ace4259a8a9578eda300a6a2.tar.bz2 ghdl-7201b1537e396d72ace4259a8a9578eda300a6a2.zip |
synth: special handling of 'const' functions.
Diffstat (limited to 'src/synth/synth-context.adb')
-rw-r--r-- | src/synth/synth-context.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb index 2a219a904..d05d45737 100644 --- a/src/synth/synth-context.adb +++ b/src/synth/synth-context.adb @@ -59,6 +59,7 @@ package body Synth.Context is Bit1 => No_Net); Res := new Synth_Instance_Type'(Max_Objs => Global_Info.Nbr_Objects, + Is_Const => False, Base => Base, Name => No_Sname, Block_Scope => Global_Info, @@ -85,6 +86,7 @@ package body Synth.Context is end if; Res := new Synth_Instance_Type'(Max_Objs => Info.Nbr_Objects, + Is_Const => False, Base => Parent.Base, Name => Name, Block_Scope => Scope, @@ -154,6 +156,17 @@ package body Synth.Context is return Inst.Base.Bit1; end Get_Inst_Bit1; + function Get_Instance_Const (Inst : Synth_Instance_Acc) return Boolean is + begin + return Inst.Is_Const; + end Get_Instance_Const; + + procedure Set_Instance_Const (Inst : Synth_Instance_Acc; Val : Boolean) is + begin + pragma Assert (not Val or else Inst.Elab_Objects = 0); + Inst.Is_Const := Val; + end Set_Instance_Const; + function Create_Value_Instance (Inst : Synth_Instance_Acc) return Value_Acc is begin |