aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-avhpi.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-31 06:57:10 +0100
committerTristan Gingold <tgingold@free.fr>2017-10-31 06:58:31 +0100
commit46af8fa0849ccfad4404786095d94161bf47c9bb (patch)
treeb70a357a2267d3445e0beea84cee337747ae621b /src/grt/grt-avhpi.adb
parent94b688c2323655338898bee15b99a0126c8af386 (diff)
downloadghdl-46af8fa0849ccfad4404786095d94161bf47c9bb.tar.gz
ghdl-46af8fa0849ccfad4404786095d94161bf47c9bb.tar.bz2
ghdl-46af8fa0849ccfad4404786095d94161bf47c9bb.zip
Fix VhpiNameP for VhpiForGenerateK: add generate label.
Fix #450
Diffstat (limited to 'src/grt/grt-avhpi.adb')
-rw-r--r--src/grt/grt-avhpi.adb17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/grt/grt-avhpi.adb b/src/grt/grt-avhpi.adb
index 06ad210a8..99097eb48 100644
--- a/src/grt/grt-avhpi.adb
+++ b/src/grt/grt-avhpi.adb
@@ -711,18 +711,19 @@ package body Grt.Avhpi is
Add (Obj.Obj.Name);
when VhpiForGenerateK =>
declare
- Blk : Ghdl_Rtin_Block_Acc;
- Iter : Ghdl_Rtin_Object_Acc;
+ Blk : constant Ghdl_Rtin_Block_Acc :=
+ To_Ghdl_Rtin_Block_Acc (Obj.Ctxt.Block);
+ Iter : constant Ghdl_Rtin_Object_Acc :=
+ To_Ghdl_Rtin_Object_Acc (Blk.Children (0));
+ Vptr : constant Ghdl_Value_Ptr := To_Ghdl_Value_Ptr
+ (Loc_To_Addr (Iter.Common.Depth, Iter.Loc, Obj.Ctxt));
Iter_Type : Ghdl_Rti_Access;
- Vptr : Ghdl_Value_Ptr;
Buf : String (1 .. 12);
Buf_Len : Natural;
begin
- Blk := To_Ghdl_Rtin_Block_Acc (Obj.Ctxt.Block);
- Iter := To_Ghdl_Rtin_Object_Acc (Blk.Children (0));
- Vptr := To_Ghdl_Value_Ptr
- (Loc_To_Addr (Iter.Common.Depth, Iter.Loc, Obj.Ctxt));
- Add (Blk.Name);
+ -- Add the name of the generate (need to skip the
+ -- generate body).
+ Add (To_Ghdl_Rtin_Generate_Acc (Blk.Parent).Name);
Add ('(');
Iter_Type := Iter.Obj_Type;
if Iter_Type.Kind = Ghdl_Rtik_Subtype_Scalar then