假设我有3个控制信号A,B和C.
在测试平台中,VHDL中有一个函数可以对此进行分组,并快速迭代所有情况(例如,使用for循环进行迭代),而不是写出8个案例。
Psuedo代码示例:
for i in range 0 to 7
grouped_signals <=std_logic_vector(to_unsigned(i,3)
答案 0 :(得分:3)
它可以是目标是聚合的信号分配:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity agg_assign is
end entity;
architecture foo of agg_assign is
signal A, B, C: std_logic;
begin
process
begin
wait for 10 ns;
for i in 0 to 7 loop
(A, B, C) <= std_logic_vector(to_unsigned(i, 3));
wait for 10 ns;
end loop;
wait;
end process;
end architecture;
这就产生了: