gpt4 book ai didi

vhdl - 如何在 VHDL 中合成进程内的循环?

转载 作者:行者123 更新时间:2023-12-02 05:08:21 24 4
gpt4 key购买 nike

我正在使用 VHDL 实现 FIR 滤波器,需要一些关于何时使用和不使用过程语句的建议。部分代码如下所示。具体来说,我想知道 resetCoeffs 循环将如何合成。它会是顺序重置,因此我认为在速度和面积上都非常低效,还是会并行完成?如果是前者,我将如何编写它以便可以并行重置。

process (clk) is begin
if rising_edge(clk) then
if rst = '1' then
-- Reset pointer
ptr <= (others => '0');

-- Reset coefficients
resetCoeffs: for i in 0 to ORDER - 1 loop
coeffs(i) <= (others => '0');
end loop;
else
-- Increment pointer
ptr <= ptr + 1;

-- Fetch input value
vals( to_integer(ptr) ) <= ival;

-- Write coefficient
if coeff_wen = '1' then
coeffs( to_integer(ptr) ) <= ival;
end if;
end if;
end if;
end process;

最佳答案

这将是并行的。它基本上必须是因为整个循环(过程中的所有内容,实际上)必须在硬件中的单个时钟周期内运行。

不过我很好奇。既然你已经努力写下了整个过程,为什么不直接用你最喜欢的合成器合成呢?这就是我所做的,以检查我的答案。

关于vhdl - 如何在 VHDL 中合成进程内的循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15913205/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com