2011-07-13 4 views
6

En utilisant le tutoriel cosmiac 13 http://www.cosmiac.org/tutorial_13.html et ISE 10.1 le fichier pdf montre comment générer une image et vous pouvez télécharger le projet en cliquant sur le premier fichier .zip. À la fin du projet, il est dit ... Maintenant, essayez de diffuser une petite vidéo dans une méthode similaire. Remarque: Vous devez modifier le fichier Matlab de manière appropriée pour obtenir les informations relatives aux pixels et le reader.vhd aux spécifications vidéo utilisées. Également besoin d'obtenir une vidéo qui utilise seulement les couleurs 8 (qui peuvent être représentés par la carte Spartan-3E) afin d'obtenir une sortie propre. Mes questions sont ... Si j'ai les fichiers matlab .coe (images vidéo), est-ce que j'utilise un seul ram de port (quel type de RAM dans le générateur de mémoire de base) pour diffuser une petite vidéo? et comment puis-je modifier le lecteur ci-dessous? Disons que je commence avec 2 images (2 images) .Je veux le montrer dos à dos comme une vidéo ou 1 sur l'autre (plus facile). Choses à se rappeler .. langage de programmation vhdl, Xilinx est toute version (je peux mettre à jour), Xilinx Impact.Comment diffuser une petite vidéo dans spartan 3e fpga?

--------------------------------------------------------------------------------- 
-- File Name: reader.vhd 
---------------------------------------------------------------------------------- 

library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 


entity reader is 
Port (clk, reset : in STD_LOGIC; 
     row : in STD_LOGIC_VECTOR (9 downto 0); 
     col : in STD_LOGIC_VECTOR (9 downto 0); 
     addr : out STD_LOGIC_VECTOR (15 downto 0); 
     ennormal, enencryp : out std_logic; 
      datain : in STD_LOGIC_VECTOR (2 downto 0); 
      dataout : out STD_LOGIC_VECTOR (2 downto 0)); 
end reader; 

architecture Behavioral of reader is 

constant vtop : integer := 128; 
constant vbottom : integer := 351; 

constant htop1 : integer := 64; 
constant hbottom1 : integer := 287; 
constant htop2 : integer := 352; 
constant hbottom2 : integer := 575; 

signal addr_normal : STD_LOGIC_VECTOR (15 downto 0) := (others => '0'); 
signal addr_encryp : STD_LOGIC_VECTOR (15 downto 0) := (others => '0'); 

signal en_normal : std_logic := '0'; 
signal en_encryp : std_logic := '0'; 

begin 

ens : process (clk, reset) 
begin 
    if reset = '1' then 
      en_normal <= '0'; 
      en_encryp <= '0';  

    elsif clk'event and clk='1' then 

      if (row >= vtop) and (row <= vbottom) then 

       if (col >= htop1) and (col <= hbottom1) then 
         en_normal <= '1'; 
         en_encryp <= '0'; 
       elsif (col >= htop2) and (col <= hbottom2) then 
         en_normal <= '0'; 
         en_encryp <= '1'; 
       else 
         en_normal <= '0'; 
         en_encryp <= '0'; 
       end if; 

      else 
        en_normal <= '0'; 
        en_encryp <= '0'; 
      end if; 

    end if; 

end process ens; 

c_normal: process (clk, reset) 
begin 
     if reset = '1' then 

      addr_normal <= (others => '0'); 

     elsif clk'event and clk='1' then 

      if en_normal = '1' then 

       if addr_normal = 50175 then 
        addr_normal <= (others => '0'); 
       else 
        addr_normal <= addr_normal + 1; 
       end if; 

      end if; 
     end if; 
end process c_normal; 

c_encryp: process (clk, reset) 
begin 
     if reset = '1' then 

      addr_encryp <= (others => '0'); 

     elsif clk'event and clk='1' then 

      if en_encryp = '1' then 

       if addr_encryp = 50175 then 
        addr_encryp <= (others => '0'); 
       else 
        addr_encryp <= addr_encryp + 1; 
       end if; 

      end if; 
     end if; 
end process c_encryp; 

addr <= addr_normal when (en_normal = '1') else addr_encryp; 

dataout <= datain; 

ennormal <= en_normal; 
enencryp <= en_encryp; 

end Behavioral; 

Répondre

Questions connexes