整数からSTD_LOGIC_VECTORを減算する際に問題があります。問題は、次のコード行である整数からstd_logic_vectorを減算する
entity ROM is
Port ( hcount: in STD_LOGIC_VECTOR(9 downto 0);
vcount: in STD_LOGIC_VECTOR(9 downto 0);
hpos: in integer;
vpos: in integer;
clk25: in STD_LOGIC;
Pixeldata: out std_logic);
end ROM;
architecture Behavioral of ROM is
signal romtemp : std_logic_vector(9 downto 0);
shared variable yas : integer range 0 to 9 := 0;
shared variable xas : integer range 0 to 9 := 0;
Type RomType is array (9 downto 0) of std_logic_vector(9 downto 0);
Constant Rom: RomType :=
("0001111000", "0111111110", "0111111110", "1111111111", "1111111111"
, "1111111111", "1111111111", "0111111110", "0111111110", "0001111000");
begin
process(clk25)
begin
if(hpos > hcount - 10) and (hpos <= hcount) and (vpos > vcount - 10) and (vpos <= vcount) then
xas := hpos - to_integer(unsigned(hcount));
end if;
end process;
end Behavioral;
:
xas := hpos - to_integer(unsigned(hcount));
私はXASという名前の整数で減算を入れしようとしています
これは私が今持っているコードです。
次のエラーがその行に発生します。このエラーで私を助けることができる
Error: Multiple declarations of unsigned included via multiple use clauses; none are made directly visible
Error: Expecting type unsigned for < unsigned(hcount) >.
Error: Formal < arg > has no actual or default value.
Error: Type integer is not an array type and cannot be indexed
Error: found '0' definitions of operator "=", cannot determine exact overload matching definition for "-"
誰か?あなたは、ファイルの先頭にあなたのuse
条項が含まれていない
最後の項目は非常に重要です。あなたが何をしているのか分からない限り、共有変数を使わないでください。プロセススコープ内で変数を使用するか、アーキテクチャスコープ内のシグナルを使用します。それがあなたが達成しようとしているもののためにうまくいかなければ、あなたは別のプログラミング言語から来ていると思います。 VHDLはハードウェア設計言語です。コードでは多くのことが可能ですが、結局はレジスタやロジックとして考える必要があります。たとえば伝搬遅延ゼロのように、すべてが可能ではありません。 – JHBonarius