Files
2d_display_engine-new/src/vga_pixelgen.vhd
Matthias Blankertz 90631f89bd - Reworked VGA
- Started changing DDR controller interface to 64 bit bus width
- Debugging
2013-03-07 20:55:58 +01:00

87 lines
2.1 KiB
VHDL

----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 11/06/2012 03:04:35 PM
-- Design Name:
-- Module Name: vga_pixelgen - Behavioral
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description: VGA pixel generator
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity vga_pixelgen is
port (
clk : in std_logic;
-- from syncgen
vid_en : in std_logic;
-- from fifo
pixeldata : in std_logic_vector(15 downto 0);
fifo_read : out std_logic;
fifo_empty : in std_logic;
-- to vga
red : out std_logic_vector(3 downto 0);
green : out std_logic_vector(3 downto 0);
blue : out std_logic_vector(3 downto 0)
);
end vga_pixelgen;
architecture Behavioral of vga_pixelgen is
signal empty_dly : std_logic := '0';
signal data_valid : std_logic := '0';
begin
fifo_read <= vid_en;
pixelgen : process(clk)
-- synthesis translate_off
variable firstframe : boolean := true;
variable underflowing : boolean := false;
-- synthesis translate_on
begin
if rising_edge(clk) then
data_valid <= not fifo_empty and vid_en;
empty_dly <= fifo_empty;
if data_valid = '1' then
assert empty_dly = '0' report "Video output FIFO underflow" severity warning;
end if;
if data_valid = '1' and empty_dly = '0' then
red <= pixeldata(11 downto 8);
green <= pixeldata(7 downto 4);
blue <= pixeldata(3 downto 0);
else
red <= (others => '0');
green <= (others => '0');
blue <= (others => '0');
end if;
end if;
end process pixelgen;
end Behavioral;