我有兩個新手問題。我正嘗試將數組中的數據輸出到vhdl上的文本文件中。儘管引用了許多在線指南來做到這一點,但我總是想出一個「不存在的文件」。有什麼問題的任何建議?未實例化文本輸出文件
其次,當我嘗試使用下面的數組信號作爲寫入函數的參數時,它會給出錯誤。我還可以如何使用非常量數據作爲操作數?
entity Top_Module is
Port (clk : in STD_LOGIC);
end Top_Module;
architecture Behavioral of Top_Module is
type array_1 is array (0 to 127) of integer range -128 to 127;
signal sample_1: array_1 := (104,40,-40,-104,-128,-104,-40,40,104,127,104,40,40,-4);
constant a :std_logic_vector(3 downto 0):= "0111";
begin
process(clk) -- process for writing the outputs to the "*.txt" file
file result_file: text is out "fft_output.txt";
variable outline:line;
constant tmp_fft:integer:=0;
begin
if(clk'event and clk='1') then
--tmp_fft :=to_integer(signed(sample_1));
write(outline,a);
writeline(result_file,outline);
end if;
end process;
感謝您的及時答覆。我做了你所建議的調整,但是當寫入過程接受向量時,只有當它們不變時纔會這樣做。使用信號不可能達到這個目的嗎?我將要輸入數據。 當綜合出現以下錯誤: 錯誤:地圖:116 - 設計是空的。不會進行處理。 錯誤:映射:52 - 遇到處理RPM時遇到問題。 任何想法? – BayK 2014-10-09 21:08:42