Gast
#388591
Hallo,
ich wollte mir einen Rom Programmieren in dem 2 getrennte Werte über
eine Adresse angesprochen werden. Dazu habe ich ein Array von Typ eines
anderen Arrays (aus 2 Integer-Werten) erstellt.
Wenn das Programm kompilieren will bekomme ich folgende Fehlermeldung:
** Error: test_Rom.vhd(24): Cannot resolve indexed name as type
integer.
Wieso schafft er es nicht, die Integer-Werte aus den ROM in eine
Integer-Variable zu schreiben?!?
Hat jemand ne Idee?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
entity ROM is
port(
-- Input signals
address : in std_logic_vector(1 downto 0);
-- Output signals
output : out integer range -3 to 3;
);
end entity ROM;
architecture BEHAVIOR of ROM is
type BLOC is array (0 to 1) of integer range -3 to 3;
type MEMORY is array (0 to 3) of BLOC;
constant ROM: MEMORY := ((1,2),
(3,0),
(1,1),
(2,2));
begin
output <= ROM(0,0);
end BEHAVIOR;