|
本帖最后由 fpgaw 于 2010-7-6 05:22 编辑
程序如下,编译通过,可是我需要的 端口被忽略,怎么办?在仿真的时候我再加入可以吗?请大家指教,谢谢!!!
--OUPPUT.VHD
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
ENTITY OUTPUT IS
PORT( CLKIN:IN STD_LOGIC;
ADCABCP2,ADCABCP5:IN STD_LOGIC_VECTOR(2 DOWNTO 0);
ERROR0:IN STD_LOGIC;
OPEN_CLOSE:IN STD_LOGIC;
TILT:IN STD_LOGIC;
MOTOR11P2,MOTOR12P2,MOTOR21P2,MOTOR22P2:IN STD_LOGIC;
MOTOR11P5,MOTOR12P5,MOTOR21P5,MOTOR22P5:IN STD_LOGIC;
MOTOR11_OUT,MOTOR12_OUT:OUT STD_LOGIC;
MOTOR21_OUT,MOTOR22_OUT:OUT STD_LOGIC;
ADCABC00:OUT STD_LOGIC_VECTOR(2 DOWNTO 0));
END ENTITY OUTPUT;
ARCHITECTURE ART OF OUTPUT IS
SIGNAL OPEN_CLOSE0,TILT0:STD_LOGIC;
BEGIN
OPEN_CLOSE0<=OPEN_CLOSE;
TILT0<=TILT;
P7: PROCESS(CLKIN) IS
BEGIN
IF(ADCABCP2="000" OR ADCABCP5="000")THEN --通道0选择输出
ADCABC00<="000";
ELSIF(ADCABCP2="001" OR ADCABCP5="001")THEN
--通道1选择输出
ADCABC00<="001";
END IF;
IF(ERROR0='0')THEN --D―正常情况下输出
IF(MOTOR11P2='1' OR MOTOR11P5='1')THEN
--水平马达正方向转动
MOTOR11_OUT<='1';
ELSE
MOTOR11_OUT<='0';
END IF;
IF(MOTOR12P2='1' OR MOTOR12P5='1')THEN
MOTOR12_OUT<='1'; --水平马达反方向转动
ELSE
MOTOR12_OUT<='0';
END IF;
IF(MOTOR21P2='1' OR MOTOR21P5='1')THEN
MOTOR21_OUT<='1'; -- 翻转马达正方向转动
ELSE
MOTOR21_OUT<='0';
END IF;
IF(MOTOR22P2='1' OR MOTOR22P5='1')THEN
MOTOR22_OUT<='1'; -- 翻转马达反方向转动
ELSE
MOTOR22_OUT<='0';
END IF;
ELSIF(ERROR0='1')THEN -- 异常情况下对输出清零
MOTOR11_OUT<='0';
MOTOR12_OUT<='0';
MOTOR21_OUT<='0';
MOTOR22_OUT<='0';
END IF;
END PROCESS P7;
END ARCHITECTURE ART; |
|