Hello, I'm trying to do image processing on BASYS3 using VHDL. I have 2 pictures, 1 with the green background and the other as the background image to change the greens in the first picture. I uploaded those 2 pictures into 2 single port rom using coe files and now trying to compare the bits in the addresses to write the chosen data in a RAM. The code I have:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity image_process is
end image_process;
architecture Behavioral of image_process is
COMPONENT image1
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(14 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
);
END COMPONENT;
COMPONENT image2
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(14 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
);
END COMPONENT;
COMPONENT image3
PORT (
clka : IN STD_LOGIC;
wea : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
addra : IN STD_LOGIC_VECTOR(14 DOWNTO 0);
dina : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
);
END COMPONENT;
signal done,clk : std_logic := '0';
signal wr_enable : STD_LOGIC_VECTOR(0 DOWNTO 0) := "0";
signal addr_rom1, addr_rom2, addr_ram : STD_LOGIC_VECTOR(14 DOWNTO 0) := (others => '0');
signal data_rom1, data_rom2, data_in_ram, data_out_ram : STD_LOGIC_VECTOR(15 DOWNTO 0) := (others => '0');
signal row_index,col_index : integer := 0;
begin
image_rom1 : image1 port map(Clk,addr_rom1,data_rom1);
image_rom2 : image2 port map(Clk,addr_rom2,data_rom2);
image_ram : image3 port map(Clk,wr_enable,addr_ram,data_in_ram,data_out_ram);
clk <= not clk after 5 ns;
process(clk)
begin
if(falling_edge(clk)) then
if(done = '0') then
addr_rom1 <= addr_rom1 + "1"; --start reading each pixel from rom
addr_rom2 <= addr_rom2 + "1";
if(col_index = 15) then --check if last column has reached
col_index <= 0; --reset it to zero.
if(row_index = 19199) then --check if last row has reached.
row_index <= 0; --reset it to zero
done <= '1'; --the processing is done.
else
row_index <= row_index + 1; --increment row index.
end if;
else
col_index <= col_index + 1; --increment column index.
end if;
wr_enable <= "1"; --write enable for the RAM
if (data_rom1 <= (x"1C" or x"14" or x"5C")) then
data_in_ram <= data_rom2;
else
data_in_ram <= data_rom1;
end if;
addr_ram <= addr_rom1; --set the address for RAM.
else
wr_enable <= "0"; --after processing write enable is disabled
addr_rom1 <= "000000000000000";
if(addr_ram = "100101011111111") then
addr_ram <= "000000000000000";
else
addr_ram <= addr_ram + 1;
end if;
end if;
end if;
end process;
end Behavioral;
one of the coe files is attached.
I'm getting the error as "The design is empty." and I don't know how to fix it. Can someone help?
Question
trian
Hello, I'm trying to do image processing on BASYS3 using VHDL. I have 2 pictures, 1 with the green background and the other as the background image to change the greens in the first picture. I uploaded those 2 pictures into 2 single port rom using coe files and now trying to compare the bits in the addresses to write the chosen data in a RAM. The code I have:
one of the coe files is attached.
I'm getting the error as "The design is empty." and I don't know how to fix it. Can someone help?
catgreen.coe.coe
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.