i am doing code using VHDL FPGA the code content 3 part first one VGA and second one is rom code and third draw image one is save of image rom display vga and get he problem
Error (10621): VHDL Use Clause error at vga.vhd(230): more than one Use Clause imports a declaration of simple name "unsigned" -- none of the declarations are directly visible
Thanks in advance.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;
LIBRARY lpm;
USE lpm.lpm_components.all;
----------------------------------------------------------
ENTITY vga IS
GENERIC (
Ha: INTEGER := 96; --Hpulse
Hb: INTEGER := 144; --Hpulse+HBP
Hc: INTEGER := 784; --Hpulse+HBP+Hactive
Hd: INTEGER := 800; --Hpulse+HBP+Hactive+HFP
Va: INTEGER := 2; --Vpulse
Vb: INTEGER := 35; --Vpulse+VBP
Vc: INTEGER := 515; --Vpulse+VBP+Vactive vbp
Vd: INTEGER := 525); --Vpulse+VBP+Vactive+VFP
PORT (
clk: IN STD_LOGIC; --50MHz in our board
red_switch, green_switch, blue_switch: IN STD_LOGIC;
pixel_clk: BUFFER STD_LOGIC;
Hsync, Vsync: BUFFER STD_LOGIC;
R, G, B: OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
nblanck, nsync : OUT STD_LOGIC);
END vga;
----------------------------------------------------------
ARCHITECTURE vga OF vga IS
SIGNAL Hactive, Vactive, dena: STD_LOGIC;
SIGNAL address: STD_LOGIC_VECTOR(9 DOWNTO 0);
SIGNAL intensity: STD_LOGIC_VECTOR(7 DOWNTO 0);
SIGNAL hPos: integer;
SIGNAL vPos : integer;
SIGNAL videoOn : STD_logic;
constant picture_size : Integer:=9000;
begin
-------------------------------------------
--ROM instantiation:
myrom: lpm_rom
GENERIC MAP (
lpm_widthad => 10, --address width
lpm_outdata => "UNREGISTERED",
lpm_address_control => "REGISTERED",
lpm_file => "2colom.mif", --data file
lpm_width => 8) --data width
PORT MAP (
inclock=>NOT pixel_clk, address=>address, q=>intensity);
--Create address (row number):
PROCESS (Vsync, Hsync)
VARIABLE line_counter: INTEGER RANGE 0 TO Vd;
BEGIN
IF (Vsync='0') THEN
line_counter := 0;
ELSIF (Hsync'EVENT AND Hsync='1') THEN
IF (Vactive='1') THEN
line_counter := line_counter + 1;
END IF;
END IF;
-- address <= conv_std_logic_vector(line_counter , 16);
-- address <= conv_std_logic_vector(line_counter , 10);
end process;
---------------------------------------------
Horizontal_position_counter:process(pixel_clk)
begin
if(pixel_clk'event and pixel_clk = '1')then
if (hPos = (Ha + Hb + Hc + Hd)) then
hPos <= 0;
else
hPos <= hPos + 1;
end if;
end if;
end process;
Vertical_position_counter:process(pixel_clk, hPos)
begin
if(pixel_clk'event and pixel_clk = '1')then
if(hPos = (Ha + Hb + Hc + Hd))then
if (vPos = (Va + Vb + Vc + Vd)) then
vPos <= 0;
else
vPos <= vPos + 1;
end if;
end if;
end if;
end process;
Horizontal_Synchronisation:process(pixel_clk, hPos)
begin
if(pixel_clk'event and pixel_clk = '1')then
if((hPos <= (Ha + Hb)) OR (hPos > Ha + Hb + Hc))then
Hsync <= '1';
else
Hsync <= '0';
end if;
end if;
Vertical_Synchronisation:process(pixel_clk, vPos)
begin
if(pixel_clk'event and pixel_clk = '1')then
if((vPos <= (Va + Vb)) OR (vPos > Va + Vb + Vc))then
Vsync <= '1';
else
Vsync <= '0';
end if;
end if;
end process;
video_on:process(pixel_clk, hPos, vPos)
begin
if(pixel_clk'event and pixel_clk = '1')then
if(hPos <= Ha and vPos <= va)then
videoOn <= '1';
else
videoOn <= '0';
end if;
end if;
end process;
draw:process(pixel_clk, hPos, vPos, videoOn)
begin
if(pixel_clk'event and pixel_clk = '1')then
if(videoOn = '1')then
if (unsigned(address)<picture_size) then
R<=intensity(11 downto 8);
G<=intensity(7 downto 4);
B<=intensity(3 downto 0);
address<= STD_LOGIC_VECTOR (unsigned(address)+1);
else
R<=(others=>'0');
G<=(others=>'0');
B<=(others=>'0');
end if;
else
R<=(others=>'0');
G<=(others=>'0');
B<=(others=>'0');
address<=(others=>'0');
end if;
end if;
end process;
----
END vga;