aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-rtis_addr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-01-07 08:07:42 +0100
committerTristan Gingold <tgingold@free.fr>2015-01-07 08:07:42 +0100
commit99443212bf78a5d36b693abab225a160a92d097a (patch)
tree9191d2419b376bd45737e3b23e9b95967c017560 /src/grt/grt-rtis_addr.adb
parent3aaf2679a61b4d8bd61c7cccd5ca0ec1f1606de5 (diff)
downloadghdl-99443212bf78a5d36b693abab225a160a92d097a.tar.gz
ghdl-99443212bf78a5d36b693abab225a160a92d097a.tar.bz2
ghdl-99443212bf78a5d36b693abab225a160a92d097a.zip
Handle vhdl08 if generate statements
Diffstat (limited to 'src/grt/grt-rtis_addr.adb')
-rw-r--r--src/grt/grt-rtis_addr.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/grt/grt-rtis_addr.adb b/src/grt/grt-rtis_addr.adb
index 199c449eb..444f1f033 100644
--- a/src/grt/grt-rtis_addr.adb
+++ b/src/grt/grt-rtis_addr.adb
@@ -135,6 +135,25 @@ package body Grt.Rtis_Addr is
end if;
end Get_Instance_Link;
+ function Get_If_Generate_Child (Ctxt : Rti_Context; Gen : Ghdl_Rti_Access)
+ return Rti_Context
+ is
+ pragma Assert (Gen.Kind = Ghdl_Rtik_If_Generate);
+ Blk : constant Ghdl_Rtin_Block_Acc := To_Ghdl_Rtin_Block_Acc (Gen);
+ Base_Addr : constant Address := Ctxt.Base + Blk.Loc;
+
+ -- Address of the block_id field. It is just after the instance field.
+ -- Assume alignment is ok (it is on 32 and 64 bit platforms).
+ Id_Addr : constant Address :=
+ Base_Addr + Ghdl_Index_Type'(Address'Size / Storage_Unit);
+ Id : Ghdl_Index_Type;
+ pragma Import (Ada, Id);
+ for Id'Address use Id_Addr;
+ begin
+ return (Base => To_Addr_Acc (Base_Addr).all,
+ Block => Blk.Children (Id));
+ end Get_If_Generate_Child;
+
function Loc_To_Addr (Depth : Ghdl_Rti_Depth;
Loc : Ghdl_Rti_Loc;
Ctxt : Rti_Context)