我试图在VHDL中创建一个向量数组但是我在modelsim中遇到错误。 我有:
type read_data_array is array (0 to 73) of std_logic_vector(7 downto 0);
signal reg_data_stream : read_data_array;
我通过以下方式将数据存储到数组中:
reg_data_stream(counter) <= read_data;
“read_data”是std_logic_vector(7 downto 0),“counter”是从0开始递增的基本计数器。
答案 0 :(得分:0)
要索引数组或向量,VHDL需要一个整数。如果counter是std_logic_vector
,请尝试:
to_integer(unsigned(counter)) <= read_data;