VHDL - 与标准触发器不匹配

VHDL - Does not match a standard flipflop

我正在尝试使用 "VHDL" 编写一些非常简单的程序。但是我已经坚持了几个小时了,我找不到让它工作的方法。

我正在尝试找到一种在不同进程中使用相同信号或将它们组合到一个进程中的方法。 在不同的进程中使用一个信号是不可能的,如果我将它们组合到一个进程中,我会得到错误 "Does not match a standard flipflop"。我希望这里的任何人都可以帮助我并告诉我如何解决这个问题。

示例代码;

process(scan_ready,rc5_ready) 
variable welkescan : std_logic_vector(1 downto 0);
begin
    if (scan_ready' event and scan_ready = '0') and not((rc5_ready' event and rc5_ready = '0')) then
      welkescan := "01";
      visualisatiegebruikt <= "0001";
      visualisatiecode <= scan_code;
    elsif (rc5_ready' event and rc5_ready = '0') and not((scan_ready' event and scan_ready = '0')) then
      welkescan := "10";
      visualisatiegebruikt <= "0010";
      visualisatiecode <= scan_con;
    else
      welkescan := "00";
    end if;

    if ((welkescan = "01" and scan_code = "01110010") or (welkescan = "10" and scan_code = "00100001")) and (pwm_on /= "11111100") then
      pwm_on <= pwm_on +  28;
      visualisatiepwm <= visualisatiepwm + "0001";
    elsif ((welkescan = "01" and scan_code = "01110101") or (welkescan = "10" and scan_code = "00100000")) and (pwm_on /= "00000000") then
      pwm_on <= pwm_on - 28;
      visualisatiepwm <= visualisatiepwm - "0001";
    end if;
end process;    

我也尝试过代码示例:

process(scan_ready)
begin
    if scan_ready' event and scan_ready = '0' then
        visualisatie <= "0001"; -- 1 op display => toetsenbord
        scanwaarde(3 downto 0) <= scan_code(3 downto 0);
        scanwaarde(7 downto 4) <= scan_code(7 downto 4);
        if scan_code = "01110010" and pwmaansturen /= "11111100" then 
            pwmaansturen <= pwmaansturen +  28;
            visualisatiepwm <= visualisatie + "0001";
        elsif scan_code = "01110101" and pwmaansturen /= "00000000" then
            pwmaansturen <= pwmaansturen - 28;
            visualisatiepwm <= visualisatie - "0001";
        elsif scan_code = "01110100" then
            pwmaansturen <= "11111100";
            visualisatiepwm <= "1001";
        elsif scan_code = "01101011" then
            pwmaansturen <= "00000000";
            visualisatiepwm <= "0000";
        end if;
    end if;
end process;    

process(rc5_ready) 
    begin

    if rc5_ready' event and rc5_ready = '0' then
        visualisatie <= "0010"; -- 2 op display => afstandsbediening
        scanwaarde(3 downto 0) <= scan_con(3 downto 0);
        scanwaarde(7 downto 4) <= scan_con(7 downto 4);
        if scan_con = "00100001" and pwmaansturen /= "11111100" then 
            pwmaansturen <= pwmaansturen + 28;
            visualisatiepwm <= visualisatie + "0001";
        elsif scan_con = "00100000" and pwmaansturen /= "00000000" then 
            pwmaansturen <= pwmaansturen - 28;
            visualisatiepwm <= visualisatie - "0001";
        elsif scan_con = "00010110" then
            pwmaansturen <= "11111100";
            visualisatiepwm <= "1001";
        elsif scan_con = "00010111" then
            pwmaansturen <= "00000000";
            visualisatiepwm <= "0000";
        end if;
    end if;
end process;

我希望有人能帮助我。 问候。

此代码有多个问题。

首先,所有这些代码都是不可综合的。使用为仿真而制作的 'hardware description languages',用于真实的硬件描述和综合需要设计人员使用多种编码模式,以便工具可以将其转换为网表和门。

无法合成代码的主要原因:

  1. 您不能对两个时钟事件进行 AND。这个条件什么时候应该成立?
  2. 您不能使用 not(clock'event ...)

其他提示和问题:

  • 为什么要使用下降沿事件?
    常见设计使用上升沿时钟事件。并非每个平台都内置了对下降沿触发器的支持。
  • scan_readyrc5_ready是两个时钟信号吗?
    • 如果是:您构建了一个具有多个时钟域的设计,这需要适当的时钟同步电路和其他人员来消除设计中的多个故障。
    • 如果否:不推荐对非时钟信号使用rising/falling边沿检测。这意味着您的设计与系统时钟异步,这也需要交叉时钟电路。