【问题标题】:VHDL Vector ArrayVHDL 向量数组
【发布时间】:2016-01-11 23:51:46
【问题描述】:

我正在尝试在 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 开始递增的基本计数器。

【问题讨论】:

  • subtype byte is std_logic_vector(7 downto 0); type read_data_array is array (0 to 73) of byte; 或者告诉我们实际的错误信息是什么...
  • 还有 read_data 和 count 的声明以及实际的错误信息。
  • 在我的脑海中,我会说 counter 不是整数并且您缺少 to_integer(...) 语句,但我可能是错的。

标签: syntax vhdl


【解决方案1】:

要索引数组或向量,VHDL 需要一个整数。如果计数器是std_logic_vector,请尝试:

to_integer(unsigned(counter)) <= read_data; 

【讨论】:

    猜你喜欢
    • 2014-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多