VHDL中如何在同一进程中使用多个延迟计数器

VHDL中如何在同一进程中使用多个延迟计数器,vhdl,Vhdl,需要实现多个延迟计数器,用于后续等待时钟周期,可合成 if(clk'event and clk='1')then if (StartTX = 1)then TxBusy <= '1'; StartTxp <= '1'; Wait for 1 clock cycles; Sta

需要实现多个延迟计数器,用于后续等待时钟周期,可合成

    if(clk'event and clk='1')then           
           if (StartTX = 1)then
                    TxBusy <= '1';
                    StartTxp <= '1';
                    Wait for 1 clock cycles;
                    StartTxp <= '0';
           End IF;

           IF (StartTX = 1)then
                    Wait x clock cycles  ;
                    StartTxM <= '1';
                    Wait 1 clock cycles;
                    StartTxM<= '0';
           End IF ;  

           IF (StartCal = 1) AND (StartInut =1 ) AND (IValid = 1)then
                    Wait 78 ns   ;
                   Interrupt <= '1'   ;  
                    Wait 1 clock cycle
                    Interrupt = 0
           End IF
if(clk'event和clk='1'),则
如果(StartTX=1),则

TxBusy重写为三个独立的状态机。如果必须的话,可以将它们组合成一个流程,但每个流程对应一个流程可能更简单、更清晰

使用“等待X周期”计数器:当看到StartTX时,在空闲状态下加载X;在等待状态下减小该值,并在达到0时转换回空闲状态


将78ns转换为第三状态机的适当循环数,并以与第二状态机相同的方式实施。

您可以对控制信号的状态更改事件作出反应作为起点。例如:

if(clk'event and clk='1')then 
      StartTx_Last<=StartTx; -- 1 clock cycle delayed copy of control signal
      StartTxp <= '0'; -- default value

       if (StartTX = 1 AND StartTx_Last=0) then -- activate signals only for one clock
                TxBusy <= '1';
                StartTxp <= '1';
                DelayCounter <= X; -- start delay counter
       End IF;

       -- set StartTxM after X clocks for 1 cycle
       case DelayCounter is
       when 1 => -- activity state
          StartTxM <= '1';
          DelayCounter<=0;
       when 0 => -- idle state
           StartTxM <='0';
       when others => -- delay states
          DelayCounter<=DelayCounter - 1;
       end case;
       ....
if(clk'event和clk='1'),则

StartTx_LastIn second if语句,如果StartTx=1,则等待X时钟周期。然后等待StattxM=1的1个时钟周期,这就是上面示例中发生的情况。。。在StartTx=1时,DelayCounter用X初始化。一旦DelayCounter减至1,StartTxM设置为1个时钟。DelayCounter保持0直到下一个StartTx=1ok当你说每个进程对应一个进程时,你是说每个状态机进程对应一个进程,对吗?还有,如何将所有状态机过程组合在一起?