Allow record subtype to constrain record elements or fields
Lets say I have the following types:
type r_t is record
a: std_logic_vector;
b : std_logic_vector;
end record;
type r_array_t is array(natural range <>) of r_t;
subtype r_8_8_st is r_t(a(7 downto 0), b(7 downto 0));
Currently, if I declare an object of r_array_t
, there is no way to use r_8_8_t
to constrain the elements other than each field:
signal r : r_array_t(0 to 7)( a(r_8_8_st.a'range), b(r_8_8_st.b'range) );
It would be useful if we could use a fully constrained subtype to constrain the array element.
signal r : r_array_t(0 to 7)( r_8_8_t );
If a new element is added to the record type, then currently all objects would need to be updated. With the proposal, all objects could be constrained simply by updating the subtype.
Edited by Richard Head