VHDL的If语句的优先级和并行问题
时间:10-02
整理:3721RD
点击:
process(clk)
begin
if rising_edge(clk) then
if a='0' then --第一个IF语句
outa <= '1';
end if;
if b='1' then --第二个IF语句
outb <= '0';
end if;
end if;
end process;
我像知道的是:在执行进程语句的时候,第一个和第二个是不是并发执行的,还是先执行完第一个IF语句再执行第二个IF语句。多谢!~~~
begin
if rising_edge(clk) then
if a='0' then --第一个IF语句
outa <= '1';
end if;
if b='1' then --第二个IF语句
outb <= '0';
end if;
end if;
end process;
我像知道的是:在执行进程语句的时候,第一个和第二个是不是并发执行的,还是先执行完第一个IF语句再执行第二个IF语句。多谢!~~~
在计算机中运行的话,PROCESS中的语句是按逐行运行下来的,
但综合成硬件,确是并行的,这些量不相干!
in this example, the two if-statements are absolutely independent.
synthesis: targeted circuit are parallel
simulation: two IF are run in same delta
you are right ,I think your English is well,also well in verilog.
执行时是串行的!
看你要实现什么功能,如果你要最终先执行第一个再第二个的话,还是要改改代码了
在process中,语句是串行执行的,在process外,语句是并行执行。这个里面肯定是顺序执行的
建议:在同一进程中最好只放入一个IF语句(可以包含嵌入的IF语句)。
哦
哦,可以
