此代碼僅適用於4x4元素。 沒有合成。 即使是很小的初始部分不模擬VHDL中的直方圖均衡化
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.numeric_std.ALL;
use work.mypackage.ALL;
entity histo_two is
port(H_c: out hist_array);
end histo_two;
architecture Behavioral of histo_two is
constant my_hist:hist_array:=((0,1,2,3), (0, 2, 2, 0), (3, 3, 1, 3), (2, 3, 0, 2));
begin
p0: process
variable h: h_vector:= (0,0,0,0);
variable gp: integer;
variable temp: integer;
variable H_c: h_vector;
variable A: integer;
variable T: h_vector;
for i in my_hist'left(1) to my_hist'right(1) loop
for j in my_hist'left(2) to my_hist'right(2) loop
gp := my_hist(i,j);
temp:= h(gp) + 1;
h(gp) := temp;
end loop;
end loop;
-- Form the cumulative image histogram Hc:
H_c(0) := H(0);
for p in h'left(1)+1 to h'right(1) loop
A := H_c(p-1) + H(p);
H_c(p) := A;
end loop;
end process;
end behavioral;
這些都是我的警告。這是我大模塊的一部分。
輸出應該是H:4,2,5,5(這是內部信號值)和H_c:(4,6,11,16)
No sensitivity list and no wait in the process
WARNING:Xst:1306 - Output <H_c<1>> is never assigned.
WARNING:Xst:1306 - Output <H_c<2>> is never assigned.
WARNING:Xst:1306 - Output <H_c<3>> is never assigned.
WARNING:Xst:1306 - Output <H_c<0>> is never assigned.
包文件
library IEEE;
use IEEE.STD_LOGIC_1164.all;
包 包mypackage的是
type hist_array is array (0 to 3,0 to 3) of integer;
type h_vector is array (0 to 3) of integer;
end mypackage;
謝謝!
你是代碼示例不分析。包聲明中有一個額外的保留字「Package」,並且缺少一個進程聲明。同樣如您在Xilinx綜合技術警告中所述,該過程沒有等待語句,也沒有靈敏度列表。沒有輸入端口,靈敏度列表沒有任何內容,因此等待語句是按順序排列的。您也從不將變量分配給警告提示。你有具體的問題嗎? – user1155120
請縮進並格式化您的代碼,以便我們可以閱讀它。 – Paebbels