| |
LCS-2016-014a |
| |
3 {22-Feb-2017} 2 {20-Feb-2017} 1 {30-Dec-2016} |
| |
22-Feb-2017 |
| |
Voting |
| |
Jim Lewis and Patrick Lehmann |
| |
Main.JimLewis and Main.PatrickLehmann |
| |
Allow Access Types to Composites of Protected Types |
| |
LCS-2016-014 LCS-2016-034 Types for examples in this section come from 034 |
| |
Allow Access Types to Protected Types and Composites of Protected Types |
access_type_definition ::=
access subtype_indication [ generic_map_aspect ]
type ADDRESS is access MEMORY;
type BUFFER_PTR is access TEMP_BUFFER;
type SB_Ptr_Type_slv is access ScoreBoardPType_slv ;
-- ScoreBoardPType_slv is defined in 5.6.4
type SB_Generic_Ptr_Type is access ScoreBoardGenericPType ;
-- access to uninstantiated protected types is allowed
-- ScoreBoardGenericPType is defined in 5.6.2
type SB_Ptr_Type_int is access ScoreBoardGenericPType
generic map (
ExpectedType => integer,
ActualType => integer,
check => std.standard."="
) ;
Examples:
new NODE -- Takes on default initial value.
new NODE'(15 ns, null) -- Initial value is specified.
new NODE'(Delay => 5 ns,
\Next\=> Stack) -- Initial value is specified.
new BIT_VECTOR'("00110110") -- Constrained by initial value.
new STRING (1 to 10) -- Constrained by index constraint.
new STRING -- Illegal: must be constrained.
-- Example using a generic map aspect with new:
process
-- Using types defined in 5.4.1
variable SB_Ptr_slv : SB_Ptr_Type_slv ;
variable SB_Generic_Ptr : SB_Generic_Ptr_Type ;
variable SB_Ptr_int : SB_Ptr_Type_int ;
begin
. . .
SB_Ptr_slv := new ScoreBoardPType_slv ;
SB_Generic_Ptr := new ScoreBoardGenericPType generic map (
ExpectedType => std_logic_vector,
ActualType => std_logic_vector,
check => std_match
) ;
SB_Ptr_slv := new SB_Ptr_Type_int'DESIGNATED_TYPE ;
. . .