2

我想在模拟期间以 7.5 ns、15 ns、22.5 ns 等时间值返回 A、B 和 Y 的值。下面是我迄今为止实现的代码(用于 for 循环)。从数学上讲这是有道理的,但它有时会返回 7.5 ns、30 ns、67.5 ns、120 ns 的值……我不知道我的代码哪里出错了。你知道一个更好的方法来实现这个吗?

constant InputPeriod : time := 15 ns;

----------------------------------
TEST:process

variable n : integer range 1 to 9;

begin   

        for I in 0 to 4 loop
            wait for (n * (InputPeriod / 2)); 
            report "A: " & std_logic'image(A);
            report "B: " & std_logic'image(B);
            report "Y: " & std_logic'image(Y);  

            n := n + 2;
        end loop;

    report "Test Completed";
   wait;
end process TEST;
4

0 回答 0