说明:编辑环境是 QuartusII 5.0 问题现象:在这个编辑环境中仿真 波形正常,烧到芯片里后没有波形输出或波形异常。 设置说明:在Timing requirement and option 里设置Delay requirements 中分别设置TSU等4参数为空、1ns或10ns 烧入芯片后现象一样。 代码如下:LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_unsigned.all;
ENTITY CCD_DRIVER IS
PORT ( Rst:IN STD_LOGIC; CLK8mHz: IN STD_LOGIC; INT_ACK:IN STD_LOGIC; SH:BUFFER STD_LOGIC; TmpFre1:buffer std_logic_VECTOR(1 DOWNTO 0); RS:BUFFER STD_LOGIC; CP:BUFFER STD_LOGIC; CR1:BUFFER STD_LOGIC; CR2:BUFFER STD_LOGIC; OE_CPU:IN STD_LOGIC; WE_CPU:IN STD_LOGIC; ADC_INT:BUFFER STD_LOGIC; WE_SRAM:BUFFER STD_LOGIC; RD_SRAM:OUT STD_LOGIC; ADC_CLK:BUFFER STD_LOGIC; TmpCLK: BUFFER STD_LOGIC; ADC_OE:OUT STD_LOGIC; ADD_ADC:BUFFER STD_LOGIC_VECTOR(12 DOWNTO 0); ADD_CPU:IN STD_LOGIC_VECTOR(12 DOWNTO 0)--; ); END CCD_DRIVER;
ARCHITECTURE ART OF CCD_DRIVER IS signal TmpFre2: INTEGER RANGE 0 TO 8388; signal Tmpwe:std_logic_vector(2 downto 0); SIGNAL TemClkTest: STD_LOGIC_VECTOR(2 DOWNTO 0); BEGIN A: PROCESS(Rst,CLK8mHz,INT_ACK,OE_CPU,WE_CPU)
BEGIN IF(Rst='0') then TmpFre1<="00"; TmpFre2<=0; ElSIF (CLK8mHz'EVENT AND CLK8mHz='1') THEN IF(INT_ACK='0') THEN
IF TmpFre1="00" THEN TmpFre1<="11"; ELSE TmpFre1<=TmpFre1-'1'; END IF; ADC_CLK<=TmpFre1(1);
IF (TmpFre2=8388) THEN TmpFre2<=0; ELSE TmpFre2<=TmpFre2+1; END IF;
RD_SRAM<='1'; ADC_OE<='0'; IF 4<=TmpFre2 AND TmpFre2<20 THEN SH<='1'; ELSIF (TmpFre2<=8388) THEN SH<='0'; END IF; IF 0<=TmpFre2 AND TmpFre2<=20 THEN CR1<='1'; CR2<='0'; RS<='0'; CP<='0'; ELSIF (TmpFre2<=8388) THEN CR1<= NOT(TmpFre1(1) XOR TmpFre1(0)); CR2<= (TmpFre1(1) XOR TmpFre1(0)); RS<=TmpFre1(1) AND TmpFre1(0); CP<=TmpFre1(1) AND TmpFre1(0); ELSE CR1<='1'; CR2<='0'; RS<='0'; CP<='0'; END IF; IF (158<=TmpFre2 AND TmpFre2<=8350) THEN WE_SRAM<=NOT CP; ELSE WE_SRAM<='1'; END IF; TmpCLK<=CP OR WE_SRAM;
ELSE SH<='0'; CR1<='0'; CR2<='0'; RS<='0'; CP<='0'; RD_SRAM<=OE_CPU; ADC_OE<='1'; WE_SRAM<=WE_CPU;
END IF; END IF; END PROCESS A;
B: PROCESS(ADC_CLK,TemClkTest,TmpCLK,INT_ACK,ADD_CPU) BEGIN IF (INT_ACK='0') THEN IF (TmpCLK'EVENT AND TmpCLK='1') THEN IF (ADD_ADC="1111111111111") THEN ADD_ADC<="0000000000000"; ADC_INT<='1'; ELSE ADD_ADC<=ADD_ADC+'1'; ADC_INT<='0'; END IF; END IF; ELSE ADD_ADC<=ADD_CPU; ADC_INT<='0'; END IF;
END PROCESS B;
END ART;
哪路高手帮我看看问题出在哪? 谢谢 |