为什么在ModelSim/QuestaSim中下面的时钟生成语句不是100%的代码覆盖率?为什么这个并发语句少于100%的代码覆盖率?
clk <= not clk after 5 ns when not finished;
这是完整的例子:
library ieee;
use ieee.std_logic_1164.all;
entity coverage1_tb is
end entity;
architecture tb of coverage1_tb is
signal clk : std_logic := '1';
signal finished : boolean := false;
begin -- architecture tb
clk <= not clk after 10 ns when not finished;
--clk <= not clk after 10 ns when not finished else unaffected;
process
begin
wait until rising_edge(clk);
wait until rising_edge(clk);
wait until rising_edge(clk);
finished <= true;
wait;
end process;
end architecture;
如果我添加此else分支:else unaffected
,然后我得到100%的覆盖率。
并行信号分配被转换成顺序信号分配的过程(LRM 11.6)。未受影响的分支被翻译为空语句(LRM 11.6,注2; LRM 10.5.2.1)。
我不知道为什么ModelSim/QuestaSim要求我写一个明确的else分支,其中不包含任何波形。
感谢布赖恩,什么是需要在Linux上运行'lcov'和'genhtml'(Debian的测试?)它看起来像我可以很容易地覆盖统计融入我们的[的PoC -library](https://github.com/VLSI-EDA/PoC)。 – Paebbels
据我记得,'apt-get install lcov' - genhtml是软件包的一部分。但看到其他Q/A的警告,看起来好像这两个模拟器在代码覆盖率上都不是完全平滑的。 –