I want to make my integer type signal range depend on output of some procedure i.e. something like this
procedure blah( signal A : in std_logic_vector(0 to 1); signal B : inout integer)
Begin
Case A is
When "00" => B <= 215;
When "01" => B <= 300;
When others => B <= 105;
end case;
End;
Next I want to use output from this procedure to define signal range of say type integer
Blah(A,myrange);
Signal myint: inout integer range 0 to myrange/23;
The difficulity is I can not use procedure in declaration of architecture, is there any way to define variable range for integer or is there a way to define integer range within architecture part after begin statement
function blah( A : std_logic_vector(0 to 1) ) return integer is begin case A is when "00" => return 215; when "01" return 300 when others => return 105; end case; end function;outand an integer can't have multiple drivers. With only one 'result' value this can be provided by a function call. If B were a signal it's value would be the default or initial value when signalmyintis elaborated. You'd have to check at least one bound ofmyintanyway or get a run time error. VHDL doesn't have modular integers. Use the maximum value for the bound.