M
Matt North
Guest
I have a type which is generated in a package:
<<type matrix is array(natural range<> of bit_vector(7 downto 0);
the functions in the package return constrained arrays of type matrix:
<<return matrix is variable result: matrix(0 to length);
When i then go to use the type matrix in my entity:
<<variable rom:=matrix;
I get a warning saying that rom cant be an unconstrained type, i understand
that matrix is unconstrained (array(natural range<>) however the results
returned by the function in the package constrain the array.
Does anyone know of anyway of constraining the type matrix in the package
depending on the size of the array that each individual function returns?
In the finished code i would like to have a number of functions which all
return different sized arrays (all of the same type), which can then be used
by the entity.
Thanks,
Matt
<<type matrix is array(natural range<> of bit_vector(7 downto 0);
the functions in the package return constrained arrays of type matrix:
<<return matrix is variable result: matrix(0 to length);
When i then go to use the type matrix in my entity:
<<variable rom:=matrix;
I get a warning saying that rom cant be an unconstrained type, i understand
that matrix is unconstrained (array(natural range<>) however the results
returned by the function in the package constrain the array.
Does anyone know of anyway of constraining the type matrix in the package
depending on the size of the array that each individual function returns?
In the finished code i would like to have a number of functions which all
return different sized arrays (all of the same type), which can then be used
by the entity.
Thanks,
Matt