有人可以解释我为什么我有一个时钟延迟对我的模拟以下,我该如何解决它,它不应该在那里,因为我在输出上丢失了一点....不必要的一个时钟延迟vhdl
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位的。我想输出32位中的一位clk2。例如,如果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个周期来读取新行(根据输入整数)等....
顺便firstclock(在代码中),(在图片第二时钟)是不是真的相对于问题的目的只是为了让想法时,整数即将
您需要向我们展示了如何在测试平台产生CLK1和CLK2。为了能够在它们之间定时,它们需要相位对齐。 –