最近被一问题困扰很久了啊,具体是在FPGA的ROM中放入两张图像信息,实现按键能够切换显示的功能,但是代码方面却是解决不了啊关于I_ROM这个实在知道的很少呢,希望大侠们帮忙啊,代码如下。
LIBRARY ieee; --图象显示顶层程序
USE ieee.std_logic_1164.all;
ENtiTY img IS
port
( clk50MHz ,sel: IN STD_LOGIC;
hs, vs, r, g, b : OUT STD_LOGIC );
END img;
ARCHITECTURE modelstru OF img IS
component vga640480 --VGA显示控制模块
PORT(clk : IN STD_LOGIC;
rgbin : IN STD_LOGIC_VECTOR(2 downto 0);
hs, vs, r, g, b : OUT STD_LOGIC;
hcntout, vcntout : OUT STD_LOGIC_VECTOR(9 downto 0) );
end component;
component imgrom --图象数据ROM1,数据线3位;地址线13位
PORT(clock : IN STD_LOGIC;
address : IN STD_LOGIC_VECTOR(11 downto 0);
q : OUT STD_LOGIC_VECTOR(2 downto 0) );
end component;
component Imgrom1 --图象数据ROM2,数据线3位;地址线13位
PORT(clock1: IN STD_LOGIC;
address1 : IN STD_LOGIC_VECTOR(11 downto 0);
q1 : OUT STD_LOGIC_VECTOR(2 downto 0) );
end component;
signal rgb : STD_LOGIC_VECTOR(2 downto 0);
signal clk25MHz : std_logic;
signal romaddr : STD_LOGIC_VECTOR(11 downto 0);
signal hpos, vpos : std_logic_vector(9 downto 0);
BEGIN
romaddr <= vpos(5 downto 0) & hpos(5 downto 0);
process(clk50MHz)
begin
if clk50MHz'event and clk50MHz = '1' then clk25MHz <= not clk25MHz ;
end if;
end process;
i_rom2: Imgrom1 PORT MAP(clock1 => clk25MHz, address1 => romaddr, q1 => rgb);
i_rom1: imgrom PORT MAP(clock => clk25MHz, address => romaddr, q => rgb);
i_vga640480 : vga640480 PORT MAP(clk => clk25MHz, rgbin => rgb, hs => hs,
vs => vs, r => r, g => g, b => b, hcntout => hpos, vcntout => vpos);
process(sel)
begin
IF sel='1' then
i_rom:=i_rom1;
else i_rom:=i_rom2;
end if;
end process;
END modelstru ;
错误提示是
Error (10482): VHDL error at img.vhd(43): object "i_rom" is used but not declared
|