Named Associations
Any index or parameter can be associated by position or by name
- Assignments to elements in records in arrays can use “|” and “OTHERS” :
- Port Map and Generic Map associations can use “OPEN” :
TYPE array_ex IS ARRAY (1 TO 3) OF INTEGER;
VARIABLE var_pos : array_ex := (12,34,5);
VARIABLE var_nam1 : array_ex := (3=ᡏ,2=ᡆ,1=ɴ);
VARIABLE var_nam2 : array_ex := (1|3=ᡃ,OTHERS=ᡇ);
r0 : ENTITY work.dff(behav)
PORT MAP (d0,clk,q=>q0,qn=>OPEN,enable=>enabled);
PORT(d,clk,enable : IN level;
Notes:
At any VHDL assignment to objects with parameters or indices, associations may be made by position, name, or by a combination of the two as long as the association is not then made ambiguous. Named associations are highlighted here for two reasons. First, the use of OTHERS can be very useful when assigning the values to an object with many indices. Second, it can be confusing to see an assignment as the one in the declaration of the variable var_nam1 above in which a constant seems to be assigned to another constant when in actuality it is a constant being assigned to the location referenced by a constant index.