1
我試圖用VHDL一些簡單的數學函數,但我不斷收到錯誤VHDL綜合誤差
found '0' definitions of operator "+", cannot determine exact overload matching definition for "+"
,我也得到有關司同樣的錯誤。
下面是相關代碼:
signal delay_1 : integer range 0 to 127;
-- signal delay_2 : integer range 0 to 127;
-- signal delay_3 : integer range 0 to 127;
-- signal delay_4 : integer range 0 to 127;
signal us_clock : std_logic;
signal ds_squareroot : integer range 0 to 100;
signal ds_squared : integer range 0 to 5000;
if(i_reset = '1') then
delay_1 <= 0;
delay_2 <= 0;
delay_3 <= 0;
delay_4 <= 0;
ds_squared <= 0;
ds_squareroot <= 0;
elsif(rising_edge(i_clock)) then
-- Delay 1 calculations
ds_squared <= (i_distance*i_distance + (speaker_distance)*(speaker_distance));
for n in 0 to 20 loop
ds_squareroot <= ((50 + ds_squared/ds_squareroot)/2);
end loop;
delay_1 <= (ds_squareroot - i_distance)/ speed_sound;
這裏是我打電話的庫。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
library UNISIM;
use UNISIM.VComponents.all;
任何意見,爲什麼這不是編譯將是非常有益的。
你可以看看http://stackoverflow.com/questions/8109078/addition-in-vhdl-not-compiling,它有一個類似的錯誤。 – sashoalm
在另一個說明中,不應該將'numeric_std'和'std_logic_unsigned'一起使用,事實上,根本不應該使用'std_logic_unsigned',因爲它實際上不是一個標準包。 –
這一切都與你的信號有哪些數據類型有關。既然你切斷了聲明,我們無法真正幫助你。請讓你的代碼片段VETSMOD。 http://www.sigasi.com/content/vetsmod-get-better-feedback-your-vhdl-code-snippets – Philippe