我希望在 VHDL 中的通用参数之后调整实体端口的大小。
这是我的实体声明:
library ieee;
use ieee.std_logic_1164.all;
use IEEE.math_real.all;
use ieee.numeric_std.all;
entity counter is
generic(
ticks : natural := 10
);
port(
clk : in std_logic;
f_v : in std_logic_vector(natural(FLOOR(LOG2(Real(ticks)))) downto 0); --forced value
res : in std_logic;
z : out std_logic_vector(natural(FLOOR(LOG2(Real(ticks)))) downto 0)
);
end counter;
更具体地说,我想在实例化计数器实体时在函数 nest natural(FLOOR(LOG2(Real(ticks))))之后调整f_v和z的大小。
代码可以编译,但是当我尝试生成符号文件时,我收到以下错误消息:
Error (10017): Can't create symbol/include/instantiation/component file for entity "counter" because port "f_v" has an unsupported type
Error (10017): Can't create symbol/include/instantiation/component file for entity "counter" because port "z" has an unsupported type
我正在使用Altera Quartus II 9.1 Web Edition。
我怎样才能得到这个工作?