有人可以解释一下为什么我对以下内容的模拟有一个时钟延迟,我该如何解决它,它不应该存在,因为我在输出上遗漏了一点......
entity outBit is
port( clk1 : in STD_LOGIC;
clk2 : in STD_LOGIC;
-- reset : in STD_LOGIC;
int_in : in INTEGER;
bit_out : out STD_LOGIC); --_VECTOR of 32
end outBit ;
是我的实体,并且clk 1的每个上升沿都需要一个整数。根据它是什么整数(1、2、3、4...),它选择数组的相应行。该行是 32 位的。我想每个clk2输出 32 个中的一位。例如,如果clk1 = 100那么clk2 = 100/32。
architecture Behavioral of outBit is
signal temp : array; --the array is fixed
signal output_bits : std_logic_vector(31 downto 0);
signal bit_i : integer := 31; --outputting a single bit out of 32 each time
begin
temp(0) <= "11111111111111111111111111111111";
temp(1) <= "11111111111111111111111111111110";
temp(2) <= "11111111111111111111111111111100";
-- etc
output_bits <= temp(int_in);
process(clk2)
--outputting a single bit out of 32 each time
--variable bit_i : integer := 31;
begin
if rising_edge(clk2) then
bit_out <= output_bits(bit_i);
if bit_i = 0 then
bit_i <= 31;
else
bit_i <= bit_i - 1;
end if;
end if;
end process;
end Behavioral;
不需要的延迟如下所示。我希望每 32 个周期读取新行(根据输入整数)等等....
顺便说一下,第一个时钟(代码中),(图片中的第二个时钟)与问题无关,只是想知道整数何时到来