报错信息:Multiple non-tristate drivers for net count_int(7) in aa4
Multiple non-tristate drivers for net count_int(6) in aa4
................
八个输出端都不对
--8位UP/DOWN计数器 LIBRARY ieee; USE ieee.Std_logic_1164.ALL; USE ieee.Std_logic_unsigned.ALL;
ENTITY aa4 IS GENERIC(n : Positive := 8); PORT(s1,s2,en,reset: IN Std_logic; count : OUT Std_logic_vector((n-1) DOWNTO 0)); END aa4;
ARCHITECTURE v1 OF aa4 IS SIGNAL count_int : Std_logic_vector((n-1) DOWNTO 0); -- count_int <= (OTHERS => '0'); BEGIN count_int <= (OTHERS => '0'); PROCESS BEGIN wait until (en='1'); --使能
if (reset='1') then count_int <= (OTHERS => '0'); --清零
elsif(s1'EVENT AND s1 = '1' and s2='1') then count_int<=count_int+1; --s1上升沿且s2为高时加记数
elsif(s1'EVENT AND s1 = '0' and s2='1') then count_int<=count_int-1; --s1下降沿且s2为高时减记数
ELSE NULL; END IF; END PROCESS; count <= count_int; END v1; |