本帖最后由 entepino 于 2013-3-13 10:47 编辑
--异步脉冲进行内同步process
SynPulse:process
begin
WAIT UNTIL CLK200k ='1';
SynPulseIN <= PulseIN;
end process SynPulse;
--接受SDK发送数据process。
RecData: Process
begin
TagRecData(3 downto 0) <= axi_gpio_0_GPIO_IO_O_pin(27 downto 24);
if(TagRecData = "0001" ) then
FixData1(9 downto 0) <= axi_gpio_0_GPIO_IO_O_pin(9 downto 0);
LED1 <= '0';
LED2 <= '1';
LED3 <= '1';
elsif (TagRecData = "0010" ) then
FixData2(9 downto 0) <= axi_gpio_0_GPIO_IO_O_pin(9 downto 0);
LED1 <= '0';
LED2 <= '0';
LED3 <= '1';
elsif (TagRecData = "0011" ) then
FixData3(9 downto 0) <= axi_gpio_0_GPIO_IO_O_pin(9 downto 0);
LED1 <= '1';
LED2 <= '0';
LED3 <= '1';
else
null;
end if;
end process RecData;
--
--计数并置电平process
INPulseCNT:process
begin
if (SynPulseIN'EVENT AND SynPulseIN = '1') then
CntINPulse<=CntINPulse+"0000000001";
if (CntINPulse>"0000000001" and CntINPulse<FixData1) then
EnPulseIN <= '1';
EnPulseOut <= '0';
EnTrig := '0';
elsif (CntINPulse>FixData1+"0000001011" and CntINPulse<FixData1+"0000001011"+"0000001001")
then
EnPulseIN <= '0';
EnPulseOut <= '1';
EnTrig := '1';
elsif CntINPulse = FixData1+"0000001011"+"0000001001" then
EnPulseIN <= '0';
EnPulseOut <= '0';
EnTrig := '0';
CntINPulse <= "0000000000";
else
null;
end if;
end if;
end process INPulseCNT;
指示灯亮了,说明数据已经接受到了,但就是置电平的process操作不对,如果把FixData1换成常数"0000001011",就一切电平就正常了,请问为何数据接受到了,在process中操作就不对啊?是不是前面的(SynPulseIN'EVENT AND SynPulseIN = '1触发条件有关系?也就是说在触发的那个时刻,FixData1这个信号没有保持住?
|