-1
我的設計採用了Spartan 3E XC35100E器件。我可以使用總共4個MUX。但是,儘管使用了3 *符號和一個FFT模塊(它也使用3 MUX),但設計摘要指定我只使用1個MUX。即使當我使用CLB邏輯代替FFT塊的MUX時,設計總結也是一樣的。Vhdl倍增器使用率太低
實現和模擬可以沒有任何問題地發生。那麼,爲什麼我使用的MUX數量如此之低?任何幫助將不勝感激。
爲簡潔起見,不包含相關庫,端口映射和信號聲明。
process (clk)
variable fsm : integer range 0 to 3:= 0;
variable i : integer range 0 to 127:= 0;
begin
if rising_edge(clk) then
if fsm = 0 then
tasiyici <= STD_LOGIC_VECTOR(to_signed(sample_1(i)* sample_2(i) , 16));
--sample1 and sample 2 are arrays with constant values
fsm := fsm +1;
elsif fsm = 1 then
wea_select <= '0';
wea_ram<= "1";
ram_write <= '0';
dina <= STD_LOGIC_VECTOR(tasiyici(15 downto 8));
mult_out<= STD_LOGIC_VECTOR(tasiyici(15 downto 8));
fsm := fsm +1;
elsif fsm = 2 then
address_write <= std_logic_vector(unsigned(addra) + 1);
wea_ram<= "0";
i := i+1 ;
if i=128 then
fsm:=3;
ram_write <= '1';
wea_select <= '1';
else
fsm := 0;
end if;
end if;
end if;
end process;
----FFT process---
process(clk)
variable fsm : integer range 0 to 7:= 0;
variable i : integer range 0 to 128;
variable counter : integer range 0 to 2:= 0;
variable j : integer range 0 to 512;
begin
if rising_edge(clk) then
if fsm = 0 then -- ram_write is control
if ram_write = '1' then
wea_fft <= "0";
fsm:= 1;
end if;
elsif fsm = 1 then --process start (pulse)
start <= '1';
fwd_inv_we <= '1';
fsm := fsm +1;
elsif fsm = 2 then
start <= '0';
fwd_inv_we <= '0';
fsm := fsm +1;
elsif fsm =3 then --128 cycle send data from douta to xn_re
if i= 128 then
fsm := fsm +1;
else
xn_re <= douta;
address_read <= std_logic_vector(unsigned(addra) + 1);
i:=i+1;
fsm := 3;
end if;
elsif fsm =4 then --all data sent. process complete
if done = '1' then --wait for done finish 3 clk cycle, then unload
if counter= 2 then
fsm := fsm +1;
else
counter := counter +1;
fsm :=4;
end if;
end if;
elsif fsm =5 then
counter := 0;
unload <= '1';
fsm := fsm +1;
fft_data_ready <= "1";
wea_fft<= "1";
elsif fsm =6 then --wait 512 clk cycle to read all outputs
unload <= '0';
wea_fft<= "0";
if dv = '1' then
fft_output <= std_logic_vector(signed(xk_re(15 downto 4))*signed(xk_re(15 downto 4))
+signed(xk_im(15 downto 4))*signed(xk_im(15 downto 4)));
if j=512 then
fsm:=fsm+1;
else
j:=j+1;
fsm:=6;
end if;
else
fsm:=6;
end if;
end if;
end if;
end process;
MUX通常是用來形容一個MU ltiple X ER術語的方式RTL。常數值將在合成期間被優化掉(例如'sample_1(i)','sample_2(i)')。存在於未標記FFT過程中的其餘兩個乘法運算符具有操作數('xk_imm','xk_re'),其中既沒有聲明也沒有分配。如果操作數連續提供,則單個乘數可能足夠。這不是[最小,完整和可驗證示例](http://stackoverflow.com/help/mcve)。 – user1155120 2014-10-19 20:41:50
感謝您的及時回覆。我試着保留所有的信號分配和聲明,以便縮短代碼。你所說的一切都是有道理的,但儘管使用聲稱使用3 MUX的FFT IP內核,仍然會出現乘法器的缺失。還有其他問題,我沒有注意到這裏? 我會努力讓格式正確! – BayK 2014-10-21 12:57:53
這個問題似乎是無關緊要的,因爲它是關於解釋模擬的VHDL規範的結果以及誰的實現工作。這不是一個編程問題,可能會更好地詢問electronics.stack.exchange。它也不能被複制,沒有MVCe。 – user1155120 2014-10-21 19:44:57