--DDPB.VHD
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
ENTITY DDPB IS
PORT(START,WCLK:IN STD_LOGIC;
CLK1HZ:IN STD_LOGIC;
DDBZ:OUT STD_LOGIC);
END ENTITY DDPB;
ARCHITECTURE ART OF DDPB IS
SIGNAL T60S:STD_LOGIC;
SIGNAL WCLKCOU:STD_LOGIC_VECTOR(7 DOWNTO 0);
BEGIN
--产生60 s周期性跳变信号进程
PROCESS(START, CLK1HZ) IS
VARIABLE CNT60: STD_LOGIC_VECTOR(7 DOWNTO 0);
BEGIN
IF START='1' THEN
CNT60:="00000000"; T60S<='0';
ELSIF CLK1HZ'EVENT AND CLK1HZ='1' THEN
IF CNT60="00111100" THEN --CNT60=60
T60S<='1'; CNT60:="00000000";
ELSE
CNT60: =CNT60+'1'; T60S<='0';
END IF;
END IF;
END PROCESS ;
--每分钟行驶距离计算进程
PROCESS(START, WCLK, T60S) IS
BEGIN
IF START='1' THEN
WCLKCOU<="00000000";
ELSIF WCLK'EVENT AND WCLK='1' THEN
IF T60S='1' THEN
WCLKCOU<="00000000";
ELSE
WCLKCOU<=WCLKCOU+'1';
--距离计算,单位为m
END IF;
END IF;
END PROCESS ;
--等待标志判别进程
PROCESS(WCLKCOU,T60S) IS
BEGIN
IF T60S'EVENT AND T60S='1' THEN
IF WCLKCOU<="11001000" THEN --WCLKCOU<=200
DDBZ<='1'; --等待
ELSE
DDBZ<='0'; --行驶
END IF;
END IF;
END PROCESS ;
END ARCHITECTURE ART;
符号问题哟
:)我今天也遇到类似的错误,语法我没看,但是有一点我敢确定是错误的,你看到这两句话的区别了吗?
CNT60: =CNT60+'1'; T60S<='0';与CNT60:="00000000" ,错了一个符号:=中间不应该有空格的哟,我就是因为这句话,程序出现了58个错误,你试试吧,