Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 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);
这将做:
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