From 26005c0d7a24b0b436625bbe7c7e869bf8f5079e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 10 Oct 2016 06:56:14 +0200 Subject: avhpi_get_base_name: return the label for if/for generate. Fix issue #158 --- src/grt/grt-avhpi.adb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/grt/grt-avhpi.adb') diff --git a/src/grt/grt-avhpi.adb b/src/grt/grt-avhpi.adb index 1777f54cf..a83be7cc6 100644 --- a/src/grt/grt-avhpi.adb +++ b/src/grt/grt-avhpi.adb @@ -563,10 +563,18 @@ package body Grt.Avhpi is | VhpiArchBodyK | VhpiEntityDeclK | VhpiProcessStmtK - | VhpiBlockStmtK - | VhpiIfGenerateK - | VhpiForGenerateK => + | VhpiBlockStmtK => return To_Ghdl_Rtin_Block_Acc (Obj.Ctxt.Block).Name; + when VhpiIfGenerateK + | VhpiForGenerateK => + declare + -- The context is a generate body. + Gen : constant Ghdl_Rtin_Block_Acc := + To_Ghdl_Rtin_Block_Acc (Obj.Ctxt.Block); + begin + -- Get the name of the if/for/case generate. + return To_Ghdl_Rtin_Generate_Acc (Gen.Parent).Name; + end; when VhpiRootInstK => declare Blk : Ghdl_Rtin_Block_Acc; -- cgit v1.2.3