向输入数据注入错误的VHDL代码如下所示:
entity error_test
Port (
clk : in STD_LOGIC;
force_error_i : in STD_LOGIC_VECTOR(1 downto 0);
din : in STD_LOGIC_VECTOR(127 downto 0);
dout : out STD_LOGIC_VECTOR(127 downto 0)
);
end error_test;
architecture Behavioral of error_test is
signal single_error_2 : std_logic_vector(127 downto 0) := x"00000000000000000000000000000001";
signal double_error_2 : std_logic_vector(127 downto 0) := x"00000000000000000000000000000003";
signal triple_error_2 : std_logic_vector(127 downto 0) := x"00000000000000000000000000000007";
signal din_errinj_2 : std_logic_vector(127 downto 0);
process (force_error_i, din, single_error, double_error, triple_error)
begin
case (force_error_i) is
when "00" =>
din_errinj_2 <= din;
when "01" =>
din_errinj_2 <= din xor single_error_2(127 downto 0);
when "10" =>
din_errinj_2 <= din xor double_error_2(127 downto 0);
when "11" =>
din_errinj_2 <= din xor triple_error_2(127 downto 0);
when others =>
din_errinj_2 <= din;
end case;
end process;
end Behavioral;该模块在主要设计和测试平台仿真中工作良好。
但问题在于代码覆盖工具的分析。代码覆盖工具(Aldec的Reviera-PRO)显示,当输入force_error_i(2)为"00“时,时覆盖"00",当其他条件也被覆盖时,也会被覆盖!当其他人的条件在这里是多余的时候,是否是多余的?或者我们需要别人的陈述,但这里有其他的问题吗?
发布于 2015-09-01 12:32:05
不,这不是多余的,因为你可以有像"UU“这样的值。我想这是您的问题,因为您不是同步的,这个过程最初只运行一次。不过,不确定模拟器中的覆盖率是多少。
https://stackoverflow.com/questions/32330013
复制相似问题