【发布时间】:2017-02-23 00:44:52
【问题描述】:
所以我似乎在声明标志信号方面遇到了问题。所以基本上我在 2 个 fpga 之间实现 i2c 接口。我的主人将发送超过 50 个字节。在我的从属端,我想将传入的字节存储到一个数组中。因此,我检查何时读取了整个字节并且可用,然后将其放入数组中。现在的问题是,在我填满整个数组后,我想断言一个应该激活进程的信号。我的问题是,当信号被断言并且进程被激活时,我永远卡在空闲循环中,这让我感到困惑,因为我假设当我进入进程并检查标志信号断言条件时它是估计很高。那么问题是我的信号没有激活进程还是我的问题是当我检查标志断言时标志已经回到0? 我附上了一些代码:
signal i : integer range 0 to 49 := 0;
type field_array is array(0 to 49) of std_logic_vector(7 downto 0);
begin
process(clk,rst)
begin
if( rst = '1') then
i <= 0;
elsif (rising_edge(clk)) then
if(data_available = '1') then
array_of_data(i) <= Master_Data;
i <= i + 1;
end if;
if(i = 49) then
i <= 0; -- reset index back to zero
end if;
end if;
end process;
flag <= '1' when i = 49 else '0';
process(state,flag)
begin
next_state <= state;
case (state) is
when idle =>
if(flag = '1') then
next_state <= Send_data;
end if;
when Send_data =>...
【问题讨论】:
标签: process signals vhdl fpga timing