0

我在 vhdl 中使用别名命令,但出现错误“索引约束不能应用于已经约束的类型 vec。”

我的代码是

    type vec is array (11 downto 0) of std_logic;
    signal s:vec;
    alias s1:vec (3 downto 0) is s(11 downto 8);
    alias s2:vec (4 downto 0) is s(7 downto  4);
4

1 回答 1

0

这将做:

signal vec: std_logic_vector(11 downto 0);-- std_logic_vector IS an array of std_logic's
alias s1: std_logic_vector(3 downto 0) is vec(3 downto 0);
alias s2: std_logic_vector(3 downto 0) is vec(7 downto 0);-- note: Left: #4 = Right: #4
于 2013-01-25T08:14:29.080 回答