admin管理员组

文章数量:1303327

Consider these types

type pipi is array (natural range <>) of bit;
type papa is array (natural range <>) of pipi;

This constant declaration is allowed and the index constraint on (each?) pipi is inferred from the required default expression. The type of the inner expressions are also inferred. So, I am assuming that foo has type papa(0 to 1) and each element thereof has type pipi(0 to 1)

constant foo : papa := (0 => ('1', '1'), 1 => ('1', '1'))

This declaration is not allowed. In this case (each??) pipi has a different inferred index constraint.

constant foo : papa := (0 => ('1', '1'), 1 => ('1'))

If it really is the case that foo(0) have type pipi(0 to 1) and foo(1) have type pipi(0 to 0), then are they both subtypes of pipi? If yes, why are they not legal elements of papa? My only theory is that there is no each pipi and only one subtype exists for the elements of papa, whose index constraint clearly cannot be inferred.

本文标签: