首页 > 解决方案 > 如何在 VHDL 中实现一个带有反馈的简单系统

问题描述

我希望您能帮助我弄清楚我的 VHDL 代码哪里出了问题。我附上了一个图来显示我正在尝试实现System2的系统。系统应该为其自身添加一个初始数字,当发生溢出时,它会重置为 0。我已经为所有不同的组件编写了代码,然后通过实例化它们来组合所有组件,如下面的代码所示。代码编译得很好,但是当我尝试模拟它时,我得到了下面的错误。请帮忙,谢谢。

################# 循环结束#################

** 错误(可抑制):(vsim-3601)迭代限制 5000 在时间 0 ps 达到。


--!@library libraryName
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity System2 is 
    port(i_A     : in  std_logic_vector(1 downto 0);
         i_Clk   : in  std_logic;
         o_Out   : inout std_logic_vector(1 downto 0));
end entity;

architecture rtl of System2 is
    -- 2 bit adder
    component Adder_2bit
        port (A, B  : in  STD_LOGIC_VECTOR (1 downto 0);
              o_Sum : out STD_LOGIC_VECTOR (1 downto 0);
              Cout  : out STD_LOGIC);
    end component;
    -- Mux
    component Mux
        port(i_Sel : in  std_logic;
             i_A   : in  std_logic_vector(1 downto 0);
             o_Out : out std_logic_vector(1 downto 0));
    end component;
    --Dff
    component Dff
        port(i_d   : in  std_logic_vector(1 downto 0);
             i_Clk : in  std_logic;
             o_Q   : out std_logic_vector(1 downto 0));
    end component;
    
    signal S1, S2, S3: std_logic_vector(1 downto 0);
    signal S4 : std_logic;

begin
    --process(i_Clk) is
    --begin
        Component_Adder_2bit : Adder_2bit port map(i_A, S3, S1, S4);
        Component_Dff        : Dff port map(S1, i_Clk, S2);
        Component_Mux        : Mux port map(S4, S2, o_Out);
        S3 <= o_Out;
   --end process;
end architecture;

标签: vhdl

解决方案


推荐阅读