I am running into a frustrating problem. I have a function that returns x"0000" as the default value and assigns its value to a signal. The files syntax is correct accourding to xilinx, but when i similate the file in modelsim i get a fatal error on the line where the assignment takes place. I have verified through modelsim that it is returning x"0000" so i suspect it has something types being used? Here is my code:
function get_current_data(channel_selection_data_par : in channel_selection_array;
channel_output_data_par : in channel_output_array;
adc_selected_par : in std_logic_vector(6 downto 0))
return std_logic_vector is
begin
-- first determine the current channel that needs to be selected
for i in 0 to 3 loop
if ( channel_selection_data_par(conv_integer(i),conv_integer(adc_selected_par)) = '1') then
-- the channel needed has been found. Now get the data
return channel_output_data_par(i,conv_integer(adc_selected_par));
end if;
end loop;
return x"0000";
end function get_current_data;
The assignment is:
signal output_reg_buffer : std_logic_vector (31 downto 0);
output_reg_buffer <= get_current_data(channel_selection_data,channel_output_data,adc_selected);
If anyone could help i would appreciete it.
function get_current_data(channel_selection_data_par : in channel_selection_array;
channel_output_data_par : in channel_output_array;
adc_selected_par : in std_logic_vector(6 downto 0))
return std_logic_vector is
begin
-- first determine the current channel that needs to be selected
for i in 0 to 3 loop
if ( channel_selection_data_par(conv_integer(i),conv_integer(adc_selected_par)) = '1') then
-- the channel needed has been found. Now get the data
return channel_output_data_par(i,conv_integer(adc_selected_par));
end if;
end loop;
return x"0000";
end function get_current_data;
The assignment is:
signal output_reg_buffer : std_logic_vector (31 downto 0);
output_reg_buffer <= get_current_data(channel_selection_data,channel_output_data,adc_selected);
If anyone could help i would appreciete it.