【问题标题】:Array of parametrized elements in VHDLVHDL中的参数化元素数组
【发布时间】:2016-08-05 09:03:13
【问题描述】:

在VHDL中可以通过以下方式创建参数化范围的数组类型:

type t_array_type is array (natural range <>) of std_logic_vector(7 downto 0)

现在,是否可以创建一个可参数化元素的数组? IE。有一个数组类型,在实例化信号时,可以定义std_logic_vector的范围?这样做的目的是不必为每个 std_logic_vector 范围声明单独的数组类型。

【问题讨论】:

    标签: arrays range vhdl


    【解决方案1】:

    好的,我找到了。声明类型为:

    type t_array_type is array (natural range <>) of std_logic_vector;

    然后实例化为:

    signal t_array_type(23 downto 0)(7 downto 0);

    【讨论】:

    • 不过,这只适用于 VHDL-2008。在以前版本的 VHDL 中,您只能使用一个不受约束的维度,并且必须是外部维度 - 紧跟关键字 type 之后的维度。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多