我正在用VHDL编写一个指定的UART组件。
send: process(send_start)
variable bit_index : integer range 0 to 2 := 0;
begin
if (falling_edge(send_start)) then
if (start = '0' and transceiver_start = '1') then
bit_index := 0;
end if;
transceiver_start <= '1';
if (bit_index = 0) then
temp_data <= data.RE;
bit_index := 1;
transceiver_start <= '0';
delay_counter <= 0;
elsif (bit_index = 1) then
temp_data <= data.IM;
bit_index := 2;
transceiver_start <= '0';
end if;
end if;
end process;transceiver_start信号的下降边缘触发子组件运行.我想触发它两次,但我不知道如何产生第二个下降的边缘。
我考虑使用一个并发进程,这将基本上将transceiver_start信号在delay_counter达到某种限制后重新设置为它的状态。因此,我可以再次在send过程中将其降下来,以生成下降的边缘。然而,这使我有两个驱动delay_counter信号的进程,并且我看到,拥有分辨率函数并不是一个很好的合成实践(这段代码需要被合成)。
有什么办法让我产生下降的边缘当bit_index = 1
发布于 2015-12-11 06:25:36
FPGA器件和相关的综合工具被优化为同步逻辑,从而VHDL,其中时钟触发进程执行。因此,使用特定的信号触发进程执行(如问题代码)不符合缩进的FPGA和VHDL设计方法。
相反,使用内部时钟触发进程执行,通常是时钟的上升边缘。然后,进程内的实际更新可以以检测到控制信号的变化为条件,控制信号可以是send_start。
process (clock) is
begin
if rising_edge(clock) then
send_start_prev <= send_start; -- Previous for edge detection
if ((send_start = '0') and (send_start_prev = '1')) then -- Falling edge of send_start
... -- More code
end if;
end if;
end process;为了重新运行条件进程代码(例如基于bit_index = 1 ),可以更新流程内容如下:
send_start_prev <= send_start; -- Previous for edge detection
rerun_request <= '0'; -- Default no rerun
if ((send_start = '0') and (send_start_prev = '1')) or -- Falling edge of send_start
(rerun_request = '1') then -- Rerun request
if bit_index = 1 then
rerun_request <= '1';
end if;
... -- More code
end if;https://stackoverflow.com/questions/34214786
复制相似问题