FPGA读取数据出现问题
时间:10-02
整理:3721RD
点击:
大家好,我写了一段程序来读一个并行总线的数据,本来应该读到的是0x34,就是逻辑分析仪图里红色方框里的TED7~TED0的值,可不知道为什么会读成0xb5,程序是状态机写的,大家帮忙看看这是怎么回事?谢过!
- ------------------------------------------
- process(CLK)
- begin
- if(CLK='1' and CLK'event) then
- if RSTn='0' then
- CURRENT_STATE 'Z');
- TLRDYn
- TLRDYn 'Z');
- if ((not TADSn) and TLWorRn and (not TCS1n))= '1' then
- CURRENT_STATE
- --led_out
- --led_out
- IF(TBE1n = '0') THEN
- CASE TEA IS
- WHEN ADR_tempd => tempd(15 DOWNTO 0) tempe(15 DOWNTO 0) tempf(15 DOWNTO 0) tempg(15 DOWNTO 0) temph(15 DOWNTO 0) tempi(15 DOWNTO 0) NULL;
- END CASE;
- END IF;
- IF(TBE1n = '1') THEN
- CASE TEA IS
- WHEN ADR_tempd => tempd(31 DOWNTO 16) tempe(31 DOWNTO 16) tempf(31 DOWNTO 16) tempg(31 DOWNTO 16) temph(31 DOWNTO 16) tempi(31 DOWNTO 16) NULL;
- END CASE;
- END IF;
- --led_out
- --led_out
- CURRENT_STATE
- if TRDn = '0' then
- CURRENT_STATE
- CURRENT_STATE
- IF(TBE1n = '0') THEN
- CASE TEA IS
- WHEN ADR_tempd => TED(15 downto 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 downto 0) 'Z');
- END CASE;
- END IF;
- IF(TBE1n = '1') THEN
- CASE TEA IS
- WHEN ADR_tempd => TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 DOWNTO 0) TED(15 downto 0) 'Z');
- --led_out --多一个等待周期,让数据稳定之后再发READY
- CURRENT_STATE
- CURRENT_STATE
- CURRENT_STATE CURRENT_STATE <= IDLE_STATE;
- end case;
- end if;
- end if;
- end process;
这是标准时序,应该没问题啊。
怎么了?gg什么意思?
原因是状态机跳错了状态,谢谢各位帮忙。现在已经正常了。