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
アルテラQuartusII9.1WebEditionを使用しています。
どうすればこれを機能させることができますか?