|
LCS-2016-072b History |
|
18 |
|
23-Mar-2017 |
|
Voting |
|
Kevin Jennings, Martin Zabel, Jim Lewis, and Patrick Lehmann |
|
FunctionKnowsVectorSize |
|
LCS_2016_072 |
constant w_uv8 : unsigned(7 downto 0) := to_unsigned(15); constant x_uv10 : unsigned(9 downto 0) := to_unsigned(15); signal y_uv8 : unsigned(7 downto 0) := w_uv8 ; --! signal z_uv10 : unsigned(9 downto 0) := w_uv8 ; -- error constant x_uv10 : unsigned(9 downto 0) := to_unsigned(15);A pure function returns the same value every time it is called. Since to_unsigned(15) can return a different subtype for each call, to_unsigned[integer] is an impure function. OTOH, I suppose if the return value is a scalar or an already sized return value, then it need not be impure. OTOH, if the return_identifier is used to provide array constraints or determine the value, the function is impure. However, I do not need to make that observation here as it is already a part of the definition of pure and impure. --