diff options
Diffstat (limited to 'src/grt/grt-avhpi.adb')
-rw-r--r-- | src/grt/grt-avhpi.adb | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/grt/grt-avhpi.adb b/src/grt/grt-avhpi.adb index 374dcc3a6..5e234b9c7 100644 --- a/src/grt/grt-avhpi.adb +++ b/src/grt/grt-avhpi.adb @@ -126,7 +126,8 @@ package body Grt.Avhpi is end case; when VhpiIndexedNames => case Ref.Kind is - when VhpiGenericDeclK => + when VhpiGenericDeclK | + VhpiConstDeclK=> Res := (Kind => AvhpiNameIteratorK, Ctxt => Ref.Ctxt, N_Addr => Avhpi_Get_Address (Ref), @@ -184,7 +185,8 @@ package body Grt.Avhpi is El_Type1 : Ghdl_Rti_Access; begin case Obj_Rti.Common.Kind is - when Ghdl_Rtik_Generic => + when Ghdl_Rtik_Generic | + Ghdl_Rtik_Constant => Is_Sig := False; when others => Internal_Error ("add_index"); @@ -391,6 +393,10 @@ package body Grt.Avhpi is Res := (Kind => VhpiGenericDeclK, Ctxt => Ctxt, Obj => To_Ghdl_Rtin_Object_Acc (Rti)); + when Ghdl_Rtik_Constant => + Res := (Kind => VhpiConstDeclK, + Ctxt => Ctxt, + Obj => To_Ghdl_Rtin_Object_Acc (Rti)); when Ghdl_Rtik_Subtype_Array => declare Atype : constant Ghdl_Rtin_Subtype_Composite_Acc := @@ -480,6 +486,7 @@ package body Grt.Avhpi is case Ch.Kind is when Ghdl_Rtik_Port | Ghdl_Rtik_Generic + | Ghdl_Rtik_Constant | Ghdl_Rtik_Signal | Ghdl_Rtik_Type_Array | Ghdl_Rtik_Subtype_Array @@ -599,7 +606,8 @@ package body Grt.Avhpi is return Obj.Inst.Name; when VhpiSigDeclK | VhpiPortDeclK - | VhpiGenericDeclK => + | VhpiGenericDeclK + | VhpiConstDeclK => return Obj.Obj.Name; when VhpiSubtypeDeclK => return To_Ghdl_Rtin_Subtype_Scalar_Acc (Obj.Atype).Name; @@ -715,7 +723,8 @@ package body Grt.Avhpi is Add (Obj.Inst.Name); when VhpiSigDeclK | VhpiPortDeclK - | VhpiGenericDeclK => + | VhpiGenericDeclK + | VhpiConstDeclK => Add (Obj.Obj.Name); when VhpiIfGenerateK => Add (To_Ghdl_Rtin_Generate_Acc @@ -937,7 +946,8 @@ package body Grt.Avhpi is | VhpiSubtypeDeclK | VhpiArrayTypeDeclK => Atype := Ref.Atype; - when VhpiGenericDeclK => + when VhpiGenericDeclK + | VhpiConstDeclK => Atype := Ref.Obj.Obj_Type; when VhpiIndexedNameK => Atype := Ref.N_Type; @@ -1130,7 +1140,8 @@ package body Grt.Avhpi is case Obj.Kind is when VhpiSigDeclK | VhpiPortDeclK - | VhpiGenericDeclK => + | VhpiGenericDeclK + | VhpiConstDeclK => -- Objects. Linecol := Obj.Obj.Linecol; when VhpiPackInstK @@ -1230,7 +1241,8 @@ package body Grt.Avhpi is return Obj.Atype; when VhpiSigDeclK | VhpiPortDeclK - | VhpiGenericDeclK => + | VhpiGenericDeclK + | VhpiConstDeclK => return To_Ghdl_Rti_Access (Obj.Obj); when others => return null; @@ -1288,8 +1300,13 @@ package body Grt.Avhpi is Vptr := To_Ghdl_Value_Ptr (Obj.N_Addr); Atype := Obj.N_Type; when VhpiGenericDeclK => + -- Putting values for generics is necessary to support SDF + -- annotations. Vptr := To_Ghdl_Value_Ptr (Avhpi_Get_Address (Obj)); Atype := Obj.Obj.Obj_Type; + when VhpiConstDeclK => + -- Don't support changing values of constants. + return AvhpiErrorNotImplemented; when others => return AvhpiErrorNotImplemented; end case; |