Rapport : Contrôleurd’affichage vidéo VGARéaliser par :AYARI YAHIA & DAHMANI MOHAMED2010/2011                             ...
SommaireBut : Introduction : Description des machines à état :   Décoder :   Générateur de synchronisation :          ...
 Simulation:      Fichier texte:            Exemple de simulation: Rapport technique : Outils de développement : Conc...
BUT :Notre projet sert à réaliser une propriété intellectuelle d’affichage vidéo VGA destiné audébogage hardware en enviro...
25MHZ                                                           ST                   Module d’affichage de 16             ...
Séquenceurs : Gestion de décodage binaire : ce module ce module séquentielle à chaque début de trameil sert à indexer la R...
Description des machines à états :   a) Décoder :   b) Générateur de synchronisation :   Synchro ligne :                  ...
Synchro trame :                  8
c) Afficher :                9
I. Description matérielle:  1. Schema RTL                             10
II.    Description en VHDL (code source):    1. MUX1library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity MUX_8_1 is port(u0 : i...
se : in STD_LOGIC_vector(2 downto 0); -----entrée selective-----ds : out STD_LOGIC_vector(3 downto 0)); -----sortie de MUX...
2. ROM------------------------------------------------------------------------------------ Company:-- Engineer:---- Create...
-- Uncomment the following library declaration if instantiating-- any Xilinx primitives in this code.--library UNISIM;--us...
13 => "00100000",14 => "00100000",15 => "11111000",                          16 => "01110000", --2--17 => "10001000",18 =>...
43 => "11111000",44 => "00001000",45 => "00001000",46 => "11111000",47 => "11111000", --6--                          48 =>...
73 => "10001000",74 => "11111000",75 => "00001000",76 => "00001000",77 => "10001000",78 => "11111000",79 => "01110000",   ...
103=> "11111000",             104=> "11110000",     --D--             105=> "10001000",             106=> "10001000",     ...
j <= (to_integer ( unsigned (A(9 downto 4))));inter(7 downto 0) <= D(i); inter(39 downto 32) <= D(i+4);inter(15 downto 8) ...
----------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL...
if WR=1 then (RAM_MEM(to_integer(unsigned(A)))) <= Din;end if;end if;end process;read_process: process(R,wr,RAM_MEM)begini...
final : out STD_LOGIC); -----sortie de MUX------end MUX_2_1;architecture Behavioral of MUX_2_1 isbeginprocess (se,enter,ma...
use IEEE.STD_LOGIC_unsigned.ALL;-- Uncomment the following library declaration if using-- arithmetic functions with Signed...
inter<="000000000";                         wr<=0;                               if st=0 then                         etat...
b) Gestionnaire d’affichagelibrary IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.A...
beginprocess(clk)begin  if (clk event and clk=1) then          case etat is  when repot =>                           ---re...
when incrementation =>                      ---incrementation de nombre de ligne----                           noir<=0;   ...
end process;end Behavioral;            c) Générateur de synchronisation     i.   Générateur ligne-------------------------...
-- Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned values--use IEEE.NU...
when tsl =>            ---retour en ligne--                 n<= n-1;                 sl<=0;                        fl<=0; ...
end if; end process;end Behavioral; ii.       Générateur trame------------------------------------------------------------...
use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.ALL;-- Uncomment the following library de...
when deb =>          ---debut-----n<=503;st<=1;ft<=0;etat<= tst;     when tst =>          ---nouvelle trame--             ...
if n=0 then                                  etat<= deb;                                          end if;                 ...
------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.A...
end top;architecture top of top isCOMPONENT ROM  PORT(     A : IN std_logic_vector(9 downto 0);     data : OUT std_logic  ...
u7 : in STD_LOGIC_vector(3 downto 0);  se : in STD_LOGIC_vector(2 downto 0);  ds : out STD_LOGIC_vector(3 downto 0));     ...
);  END COMPONENT; COMPONENT generateur_trame  PORT(     sl : IN std_logic;     st : OUT std_logic;     ft : OUT std_logic...
signal fl1:std_logic;signal st1:std_logic;signal sl1:std_logic;signal mass:std_logic;beginmass<=0;a1:MUX_8_1 PORT MAP(    ...
a2:ROM PORT MAP (     A(3 downto 0)=> ds1,                         A(9 downto 4)=>sortie1(5 downto 0),     data => data1  ...
clk => clk_25MHZ,      wr => WR1,      sortie => sortie1    );a6:generateur_trame PORT MAP (      sl => sl1,      st => st...
III. Les scenarios de test (les tests bench):    1. Test MUX :------------------------------------------------------------...
-- simulation model.--------------------------------------------------------------------------------LIBRARY ieee;USE ieee....
--Inputs signal u0 : std_logic_vector(3 downto 0) := "1011"; signal u1 : std_logic_vector(3 downto 0) := (others => 0); si...
u6 => u6,       u7 => u7,       se => se,       ds => ds     );END;     2. Test ROM :-------------------------------------...
-- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of ...
--Inputs     signal A : std_logic_vector(9 downto 0) := "1111101111";             --Outputs     signal data : std_logic;  ...
-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: decoder---- Dependencies:---- Revision:-- ...
ARCHITECTURE behavior OF test_decoder IS  -- Component Declaration for the Unit Under Test (UUT)  COMPONENT decoder  PORT(...
-- Instantiate the Unit Under Test (UUT)uut: decoder PORT MAP (    st => st,    clk => clk,    wr => wr,    sortie => sort...
-- insert stimulus here      wait;     end process;END;Test afficher------------------------------------------------------...
-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-...
--Inputs signal clk : std_logic := 0; signal ft : std_logic := 1; signal fl : std_logic := 1;         --Outputs signal nl ...
fl<=1;                     clk <= 0;                     wait for clk_period/2;                     clk <= 1;             ...
-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using ...
END COMPONENT; --Inputs signal clk : std_logic := 0;         --Outputs signal sl : std_logic; signal fl : std_logic; -- Cl...
-- Stimulus process     stim_proc: process     begin      -- hold reset state for 100 ns.      wait for 100 ns;      wait ...
-- VHDL Test Bench Created by ISE for module: generateur_trame---- Dependencies:---- Revision:-- Revision 0.01 - File Crea...
PORT(    sl : IN std_logic;    st : OUT std_logic;    ft : OUT std_logic    ); END COMPONENT; --Inputs signal sl : std_log...
begin                sl <= 0;                wait for clk/2;                sl <= 1;                wait for clk/2; end pr...
5. Test_VGA---------------------------------------------------------------------------------- Company:-- Engineer:---- Cre...
use std.textio.all;USE ieee.std_logic_1164.all ;LIBRARY std;use IEEE.std_logic_textio.all;-- Uncomment the following libra...
);END COMPONENT;--Inputssignal uu0 : std_logic_vector(3 downto 0) := "1111";signal uu1 : std_logic_vector(3 downto 0) := "...
signal deb6:integer range 1 downto 0 :=0;        signal deb7:integer range 1 downto 0 :=0;        signal deb8:integer rang...
clk_25MHZ <= 0;                    wait for clk_25MHZ_period/2;                    clk_25MHZ <= 1;                    wait...
end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop  write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture...
end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=3;end if;end if;end if; if(deb3=1 and d=3)thenif...
if(deb4=1 and d=4)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=...
T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop  write(L, T(i)); end loop;writeline(S...
for i in 0 to 66 loop  write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=7;end if;...
end if;end if; if(deb8=1 and d=8)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;...
IV.   Simulation                   72
1. Fichier:i. Simulation (0, 0, 0, 0, 0, 0, 0, 0):ii.   Simulation (F, 1, 0, 0, 0, 0, 0, 0):                              ...
Rapport technique:Outil de développement utilisé:Logiciel :Xilinx est une entreprise américaine de semi-conducteurs. Inven...
Langage :VHDL est un langage de description matériel destiné à représenter le comportement ainsique larchitecture d’un sys...
76
Prochain SlideShare
Chargement dans…5
×

Rapport

869 vues

Publié le

Publié dans : Technologie, Business
0 commentaire
0 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Aucun téléchargement
Vues
Nombre de vues
869
Sur SlideShare
0
Issues des intégrations
0
Intégrations
8
Actions
Partages
0
Téléchargements
22
Commentaires
0
J’aime
0
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

Rapport

  1. 1. Rapport : Contrôleurd’affichage vidéo VGARéaliser par :AYARI YAHIA & DAHMANI MOHAMED2010/2011 1
  2. 2. SommaireBut : Introduction : Description des machines à état :  Décoder :  Générateur de synchronisation :  Synchro ligne :  Synchro trame :  Afficher : Description matérielle :  Schéma RTL : Description en VHDL (code source) :  MUX1 :  ROM :  RAM :  MUX2 :  Séquenceurs :  Générateur de décodage :  Gestionnaire d’affichage :  Générateur de synchronisation :  Générateur trame  Générateur ligne :  Top module VGA : Les scenarios de test (TEST BENCH):  Test MUX  Test ROM:  Test decoder:  Test afficher :  Test ligne :  Test trame :  Test VGA: 2
  3. 3.  Simulation:  Fichier texte: Exemple de simulation: Rapport technique : Outils de développement : Conclusion : 3
  4. 4. BUT :Notre projet sert à réaliser une propriété intellectuelle d’affichage vidéo VGA destiné audébogage hardware en environnement FPGA. Dans ce TP on va se familiariser avec un outilde développement hard trop connu XILINX, puis on va implémenter notre application surune FPGA adéquate. I. Introduction :Il existe plusieurs modes pour la norme VGA, et nous allons utiliser celle dont la définition del’image est de 640×480 dont les informations sont codées chacune sur un ensemble de bit.Le protocole VGA consiste à utiliser deux signaux de synchronisation horizontaleSL et verticale ST pour pouvoir guider la manière d’afficher. Pour une qui parvient à tous lespixels de l’écran à une fréquence de 25 MHz (soit à une période de 40 ns).Le module d’affichage VGA lit une image à partir d’une mémoire et l’affiche sur un écran. Lescontraintes à prendre en compte sont les contraintes de temps d’accès aux données despixels et leur transmission sur un câble VGA dans les délais requis. D’autres difficultés seprésentent aussi, surtout lorsque l’image en question stockée dans la mémoire est lue àpartir d’un PC à travers un câble série.Dans ce cas, il faut gérer et organiser l’accès en lecture et en écriture à la mémoire par lesdifférentes unités et en utilisant des autres modules de traitement et de gestion qui serontdes extensions pour notre application et notre IP ;Cette IP étant intégré dans des applications matérielles sur FPGA permet de visualiser surécran SVGA une ligne de 8 caractère des valeurs hexadécimaux à partir de 8 signaux en entréU0-U7 codés sur 4 bits. 4
  5. 5. 25MHZ ST Module d’affichage de 16 SLU<0> Mots binaires à 4 bits SPU<7> RVB SPECIFICATION EXTERNE D’IPEn sortie : cette IP fournira des signaux de contrôle d’affichage vidéo :ST : Synchronisation de début d’une image (trame) affichée en temps réels.SL : Synchronisation de début d’une ligne.SP : Synchronisation de Transfer d’un pixel<<point image>>.RVB(Final) : signal résultat validé à chaque front montant d’horloge.La fréquence de rafraichissement doit être suffisante pour tromper la persistance de l’œilhumaine, les pixels sont affichés séquentiellement par succession de lignes horizontaux dehaut en bas, le balayage de ligne s’effectue de droite à gauche.Pour cette IP on choisie l’affichage SVGA SP=25 MHZ, SL=31.25 KHZ, ST=62. HZOn distingue les modules suivants :Chemin de données :Mux1 : multiplexeur des signaux Ui.ROM : permet de garder la police des caractères en mémorisant les fonts de ces caractèreshexadécimaux de 0 à F.RAM : une mémoire en double port pour mémoriser le plan image dit bitmap.Mux2 : pour la sérialisation des mots binaire vers les signaux d’affichage. 5
  6. 6. Séquenceurs : Gestion de décodage binaire : ce module ce module séquentielle à chaque début de trameil sert à indexer la Rom et la Ram pour pouvoir savoir d’où et où en va écrire. Gestion d’affichage : ce module génère le signal sortie et gère le nombre de colonne et deligne de la trame lors de la l’écriture il est dirigé par le générateur de synchronisation.Gestion de synchronisation : ce module génère les synchro trame ST et les synchro ligne SL.C’est lui qui indique le début d’une trame ou celle d’une ligne. 6
  7. 7. Description des machines à états : a) Décoder : b) Générateur de synchronisation : Synchro ligne : 7
  8. 8. Synchro trame : 8
  9. 9. c) Afficher : 9
  10. 10. I. Description matérielle: 1. Schema RTL 10
  11. 11. II. Description en VHDL (code source): 1. MUX1library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity MUX_8_1 is port(u0 : in STD_LOGIC_vector(3 downto 0); ----les données à afficher----u1 : in STD_LOGIC_vector(3 downto 0);u2 : in STD_LOGIC_vector(3 downto 0);u3 : in STD_LOGIC_vector(3 downto 0);u4 : in STD_LOGIC_vector(3 downto 0);u5 : in STD_LOGIC_vector(3 downto 0);u6 : in STD_LOGIC_vector(3 downto 0);u7 : in STD_LOGIC_vector(3 downto 0); 11
  12. 12. se : in STD_LOGIC_vector(2 downto 0); -----entrée selective-----ds : out STD_LOGIC_vector(3 downto 0)); -----sortie de MUX------end MUX_8_1;architecture MUX_8_1 of MUX_8_1 isbegin process(se,u0,u1,u2,u3,u4,u5,u6,u7) begin Case se is when "000" => ds <= u0; when "001" => ds <= u1; when "010" => ds <= u2; when "011" => ds <= u3; when "100" => ds <= u4; when "101" => ds <= u5; when "110" => ds <= u6; when "111" => ds <= u7; when others => ds <= "0000" ; end case ;end process;end MUX_8_1; 12
  13. 13. 2. ROM------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 15:43:06 03/14/2011-- Design Name:-- Module Name: ROM - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.ALL;-- Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned values--use IEEE.NUMERIC_STD.ALL; 13
  14. 14. -- Uncomment the following library declaration if instantiating-- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity ROM is port(A: in std_logic_vector(9 downto 0);data:out std_logic);end ROM;architecture Behavioral of ROM issignal inter :std_logic_vector(63 downto 0):=(others => 0);signal i:integer range 127 downto 0 :=0;signal j:integer range 63 downto 0 :=0;type police is array(127 downto 0) of std_logic_vector(7 downto 0);constant D : police := ( 0 => "01110000", --0-- 1 => "10001000", 2 => "10001000", 3 => "10001000", 4 => "10001000", 5 => "10001000", 6 => "10001000", 7 => "01110000", 8 => "00100000", --1-- 9 => "01100000", 10 => "10100000", 11 => "00100000", 12 => "00100000", 14
  15. 15. 13 => "00100000",14 => "00100000",15 => "11111000", 16 => "01110000", --2--17 => "10001000",18 => "10001000",19 => "00010000",20 => "00100000",21 => "01000000",22 => "11111000",23 => "11111000", --3--24 => "00001000",25 => "00001000",26 => "01111000",27 => "01111000",28 => "00001000",29 => "00001000",30 => "11111000",31 => "10000000", --4-- 32 => "10000000",33 => "10010000",34 => "10010000",35 => "11111000",36 => "00010000",37 => "00010000",38 => "00010000",39 => "11111000", --5--40 => "10000000",41 => "10000000",42 => "10000000", 15
  16. 16. 43 => "11111000",44 => "00001000",45 => "00001000",46 => "11111000",47 => "11111000", --6-- 48 => "00001000",49 => "00001000",50 => "11111000",51 => "10001000",52 => "10001000",53 => "10001000",54 => "11111000",55 => "11111000", --7--56 => "10001000", 57 => "00001000", 58 => "00001000", 59 => "00010000",60 => "00100000",61 => "01000000",62 => "10000000",63 => "11111000", --8--64 => "10001000",65 => "10001000",66 => "11111000", 67 => "10001000",68 => "10001000",69 => "10001000",70 => "11111000",71 => "11111000", --9--72 => "10001000", 16
  17. 17. 73 => "10001000",74 => "11111000",75 => "00001000",76 => "00001000",77 => "10001000",78 => "11111000",79 => "01110000", --A--80 => "10001000",81 => "10001000",82 => "10001000", 83 => "11111000",84 => "10001000",85 => "10001000",86 => "10001000",87 => "11111000", --B--88 => "10001000",89 => "10001000",90 => "11111000",91 => "10001000",92 => "10001000",93 => "10001000",94 => "11111000",95 => "11111000", --C--96 => "10001000",97 => "10000000",98 => "10000000", 99 => "10000000",100=> "10000000",101=> "10000000",102=> "10000000", 17
  18. 18. 103=> "11111000", 104=> "11110000", --D-- 105=> "10001000", 106=> "10001000", 107=> "10001000", 108=> "10001000", 109=> "10001000", 110=> "10001000", 111=> "11110000", 112=> "11111000", --E-- 113=> "10001000", 114=> "10000000", 115=> "10000000", 116=> "11110000", 117=> "10000000", 118=> "10001000", 119=> "11111000", 120=> "11111000", --F-- 121=> "10001000", 122=> "10000000", 123=> "11110000", 124=> "10000000", 125=> "10000000", 126=> "10000000", 127=> "10000000");begini <= 8*(to_integer ( unsigned (A(3 downto 0)))); 18
  19. 19. j <= (to_integer ( unsigned (A(9 downto 4))));inter(7 downto 0) <= D(i); inter(39 downto 32) <= D(i+4);inter(15 downto 8) <= D(i+1); inter(47 downto 40) <= D(i+5);inter(23 downto 16) <= D(i+2); inter(55 downto 48) <= D(i+6);inter(31 downto 24) <= D(i+3); inter(63 downto 56) <= D(i+7);data <= inter(j);end Behavioral; 3. RAM------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 14:40:18 03/15/2011-- Design Name:-- Module Name: RAM - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:-- 19
  20. 20. ----------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.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 RAM_VGA is port(A: in std_logic_vector(8 downto 0);R: in std_logic_vector(8 downto 0);Din,clk,WR:in std_logic;Dout:out std_logic);end RAM_VGA;architecture Behavioral of RAM_VGA issignal RAM_MEM:std_logic_vector(511 downto 0);beginwrite_process: Process(clk,WR)beginif(clk event and clk=1) then 20
  21. 21. if WR=1 then (RAM_MEM(to_integer(unsigned(A)))) <= Din;end if;end if;end process;read_process: process(R,wr,RAM_MEM)beginif(wr=0)thenDout <= (RAM_MEM(to_integer(unsigned(R))));end if;end process;end Behavioral; 4. MUX2library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.ALL;entity MUX_2_1 is port(enter : in STD_LOGIC; ----les données à afficher----mass : in STD_LOGIC;se : in std_logic; -----entrée selective----- 21
  22. 22. final : out STD_LOGIC); -----sortie de MUX------end MUX_2_1;architecture Behavioral of MUX_2_1 isbeginprocess (se,enter,mass) begin Case se is when 0 => final <= mass; when 1 => final <= enter; when others => final <= 0 ; end case ; end process;end Behavioral; 5. Sequenceurs a) Gestionneur de decodagelibrary IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL; 22
  23. 23. use IEEE.STD_LOGIC_unsigned.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 decoder is port(st,clk:in std_logic;wr:out std_logic;sortie:out std_logic_vector(8 downto 0));end decoder;architecture Behavioral of decoder istype state is(repot,copier,fin_t);signal etat:state;signal inter:std_logic_vector(8 downto 0):=(others => 0);beginprocess(clk)beginif(clkevent and clk=1) then case etat is when repot => ---repot-- 23
  24. 24. inter<="000000000"; wr<=0; if st=0 then etat<= copier; end if; when copier => sortie<=inter; ---copier -- inter<=inter+"000000001"; wr<=1; if inter="111111111" then etat<= fin_t; end if; when fin_t => ---fin_t-- wr<=0; if st=1 then etat<= repot; end if; end case; end if;end process;end Behavioral; 24
  25. 25. b) Gestionnaire d’affichagelibrary IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.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 affichage is port(clk,ft,fl:in std_logic;nl:out std_logic_vector( 2 downto 0);nc:out std_logic_vector( 5 downto 0);noir:out std_logic);end affichage;architecture Behavioral of affichage istype state is(repot,attendre_fl,ligne,incrementation,fin_ligne,fin_trame);signal etat:state;signal nc1:std_logic_vector( 5 downto 0):=(others => 0);signal nl1:std_logic_vector( 3 downto 0):=(others => 0); 25
  26. 26. beginprocess(clk)begin if (clk event and clk=1) then case etat is when repot => ---repot-- noir<=0; nc1<="000000"; nl1<="0000"; if ft=1 then etat<= attendre_fl; end if; when attendre_fl => ---attendre fenetre ligne-- noir<=0; nc1<="000000"; if fl=1 then etat<= ligne; end if; when ligne => ---affichage dune ligne--- noir<=1; nc<=nc1; nc1<=nc1+"000001"; if nc1="111111" then etat<= incrementation; end if; 26
  27. 27. when incrementation => ---incrementation de nombre de ligne---- noir<=0; nc1<="000000"; nl1<=nl1+"0001"; nl<=nl1(2 downto 0); if nl1="1000" then --etat<=fin_ligne; etat<=fin_trame; end if; if nl1/="1000" then etat<= fin_ligne; end if; when fin_ligne => ----fin ligne------------- noir<=0; if fl=0 then etat<= attendre_fl; end if; when fin_trame => ----fin trame---- noir<=0; if ft=0 then etat<= repot; end if; end case;end if; 27
  28. 28. end process;end Behavioral; c) Générateur de synchronisation i. Générateur ligne------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 19:32:25 03/17/2011-- Design Name:-- Module Name: generateur_ligne - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.ALL; 28
  29. 29. -- 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 generateur_ligne is port(clk: in std_logic;sl,fl:out std_logic );end generateur_ligne;architecture Behavioral of generateur_ligne istype state is(deb,tsl,gap1,gap2,ligne);signal etat : state;signal n : integer range 0 to 800;beginprocess(clk)begin if (clk event and clk=1) then case etat is when deb => ---debut-- n<= 800; sl<=1; fl<=0; etat<= tsl; 29
  30. 30. when tsl => ---retour en ligne-- n<= n-1; sl<=0; fl<=0; if n=740 then etat<= gap1; end if; when gap1 => ---debut dune fenetre ligne--- n<=n-1; sl<=1; fl<=0; if n=690 then etat<= ligne; end if;when ligne => ---ligne à écrire ---- n<=n-1; sl<=1; fl<=1; if n=50 then etat<= gap2; end if;when gap2 => ----fenetre ligne (blanc aprés ligne)---- n<=n-1; sl<=0; fl<=0; if n=0 then etat<= deb; end if; end case; 30
  31. 31. end if; end process;end Behavioral; ii. Générateur trame------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 13:11:39 03/29/2011-- Design Name:-- Module Name: generateur_trame - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:------------------------------------------------------------------------------------library IEEE; 31
  32. 32. use IEEE.STD_LOGIC_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.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 generateur_trame is port(sl:in std_logic;st,ft:out std_logic);end generateur_trame;architecture Behavioral of generateur_trame istype state is(deb,tst,gapt1,page,gapt2);signal etat:state;signal n : integer range 0 to 503;beginprocess(sl)begin if (sl=0) then case etat is 32
  33. 33. when deb => ---debut-----n<=503;st<=1;ft<=0;etat<= tst; when tst => ---nouvelle trame-- n<= n-1; st<=0; ft<=0; if n=495 then etat<= gapt1; end if; when gapt1 => ---debut dune fenetre trame--- n<=n-1; st<=1; ft<=0; if n=490 then etat<= page; end if;when page => ---trame à écrire ---- n<=n-1; st<=1; ft<=1; if n=10 then etat<= gapt2; end if;when gapt2 => ----fenetre trame (blanc aprés les lignes)---- n<=n-1; st<=1; ft<=0; 33
  34. 34. if n=0 then etat<= deb; end if; end case; end if;end process;end Behavioral; 6. Top module VGA------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 13:13:09 04/09/2011-- Design Name:-- Module Name: top - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments: 34
  35. 35. ------------------------------------------------------------------------------------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 top is port(uu0 : in std_logic_vector(3 downto 0);uu1 : in std_logic_vector(3 downto 0);uu2 : in std_logic_vector(3 downto 0);uu3 : in std_logic_vector(3 downto 0);uu4 : in std_logic_vector(3 downto 0);uu5 : in std_logic_vector(3 downto 0);uu6 : in std_logic_vector(3 downto 0);uu7 : in std_logic_vector(3 downto 0);clk_25MHZ: in std_logic;sl,st:out std_logic;final:out std_logic); 35
  36. 36. end top;architecture top of top isCOMPONENT ROM PORT( A : IN std_logic_vector(9 downto 0); data : OUT std_logic ); END COMPONENT;COMPONENT RAM_VGA port( A: in std_logic_vector(8 downto 0); R: in std_logic_vector(8 downto 0); Din,clk,WR:in std_logic; Dout:out std_logic ); END COMPONENT;COMPONENT MUX_8_1 PORT( u0 : in STD_LOGIC_vector(3 downto 0); u1 : in STD_LOGIC_vector(3 downto 0); u2 : in STD_LOGIC_vector(3 downto 0); u3 : in STD_LOGIC_vector(3 downto 0); u4 : in STD_LOGIC_vector(3 downto 0); u5 : in STD_LOGIC_vector(3 downto 0); u6 : in STD_LOGIC_vector(3 downto 0); 36
  37. 37. u7 : in STD_LOGIC_vector(3 downto 0); se : in STD_LOGIC_vector(2 downto 0); ds : out STD_LOGIC_vector(3 downto 0)); END COMPONENT;COMPONENT MUX_2_1 PORT( enter : in STD_LOGIC; mass : in STD_LOGIC; se : in std_logic; final : out STD_LOGIC);END COMPONENT;COMPONENT affichage PORT( clk : IN std_logic; ft : IN std_logic; fl : IN std_logic; nl : OUT std_logic_vector(2 downto 0); nc : OUT std_logic_vector(5 downto 0); noir : OUT std_logic ); END COMPONENT;COMPONENT decoder PORT( st : IN std_logic; clk : IN std_logic; wr : OUT std_logic; sortie : OUT std_logic_vector(8 downto 0) 37
  38. 38. ); END COMPONENT; COMPONENT generateur_trame PORT( sl : IN std_logic; st : OUT std_logic; ft : OUT std_logic ); END COMPONENT; COMPONENT generateur_ligne PORT( clk : IN std_logic; sl : OUT std_logic; fl : OUT std_logic ); END COMPONENT;signal ds1:std_logic_vector(3 downto 0);signal sortie1:std_logic_vector(8 downto 0);signal data1:std_logic;signal WR1:std_logic;signal DOUT1:std_logic;signal noir1:std_logic;signal nc1:std_logic_vector( 5 downto 0);signal nl1:std_logic_vector( 2 downto 0);signal ft1:std_logic; 38
  39. 39. signal fl1:std_logic;signal st1:std_logic;signal sl1:std_logic;signal mass:std_logic;beginmass<=0;a1:MUX_8_1 PORT MAP( u0=>uu0, u1=>uu1, u2=>uu2, u3=>uu3, u4=>uu4, u5=>uu5, u6=>uu6, u7=>uu7, se=>sortie1(8 downto 6), ds=>ds1 );a11: MUX_2_1 PORT MAP ( enter =>DOUT1, mass => mass, se => noir1, final=> final ); 39
  40. 40. a2:ROM PORT MAP ( A(3 downto 0)=> ds1, A(9 downto 4)=>sortie1(5 downto 0), data => data1 );a3:RAM_VGA port MAP( A=>sortie1, R(8 downto 6)=>nc1(5 downto 3), R(5 downto 3)=>nl1, R(2 downto 0)=>nc1(2 downto 0), Din=>data1, clk=>clk_25MHZ, WR=>WR1, Dout=>DOUT1 );a4:affichage PORT MAP ( clk => clk_25MHZ, ft => ft1, fl => fl1, nl => nl1, nc => nc1, noir => noir1 );a5:decoder PORT MAP ( st => st1, 40
  41. 41. clk => clk_25MHZ, wr => WR1, sortie => sortie1 );a6:generateur_trame PORT MAP ( sl => sl1, st => st1, ft => ft1 );a7:generateur_ligne PORT MAP ( clk => clk_25MHZ, sl => sl1, fl => fl1 );sl<=sl1;st<=st1;end top; 41
  42. 42. III. Les scenarios de test (les tests bench): 1. Test MUX :---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 20:31:03 03/30/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/test_MUX.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: MUX_8_1---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation 42
  43. 43. -- simulation model.--------------------------------------------------------------------------------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;ENTITY test_MUX ISEND test_MUX;ARCHITECTURE behavior OF test_MUX IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT MUX_8_1 PORT( u0 : IN std_logic_vector(3 downto 0); u1 : IN std_logic_vector(3 downto 0); u2 : IN std_logic_vector(3 downto 0); u3 : IN std_logic_vector(3 downto 0); u4 : IN std_logic_vector(3 downto 0); u5 : IN std_logic_vector(3 downto 0); u6 : IN std_logic_vector(3 downto 0); u7 : IN std_logic_vector(3 downto 0); se : IN std_logic_vector(2 downto 0); ds : OUT std_logic_vector(3 downto 0) ); END COMPONENT; 43
  44. 44. --Inputs signal u0 : std_logic_vector(3 downto 0) := "1011"; signal u1 : std_logic_vector(3 downto 0) := (others => 0); signal u2 : std_logic_vector(3 downto 0) := (others => 0); signal u3 : std_logic_vector(3 downto 0) := (others => 0); signal u4 : std_logic_vector(3 downto 0) := (others => 0); signal u5 : std_logic_vector(3 downto 0) := (others => 0); signal u6 : std_logic_vector(3 downto 0) := (others => 0); signal u7 : std_logic_vector(3 downto 0) := (others => 0); signal se : std_logic_vector(2 downto 0) := "000"; --Outputs signal ds : std_logic_vector(3 downto 0); -- No clocks detected in port list. Replace <clock> below with -- appropriate port nameBEGIN -- Instantiate the Unit Under Test (UUT) uut: MUX_8_1 PORT MAP ( u0 => u0, u1 => u1, u2 => u2, u3 => u3, u4 => u4, u5 => u5, 44
  45. 45. u6 => u6, u7 => u7, se => se, ds => ds );END; 2. Test ROM :---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 12:49:36 03/15/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/ROM_TEST.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: ROM---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:-- 45
  46. 46. -- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------LIBRARY ieee;USE ieee.std_logic_1164.ALL;use IEEE.numeric_std.ALL;use IEEE.STD_LOGIC_unsigned.ALL;-- Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned values--USE ieee.numeric_std.ALL;ENTITY ROM_TEST ISEND ROM_TEST;ARCHITECTURE behavior OF ROM_TEST IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT ROM PORT( A : IN std_logic_vector(9 downto 0); data : OUT std_logic ); END COMPONENT; 46
  47. 47. --Inputs signal A : std_logic_vector(9 downto 0) := "1111101111"; --Outputs signal data : std_logic; -- No clocks detected in port list. Replace <clock> below with -- appropriate port nameBEGIN -- Instantiate the Unit Under Test (UUT) uut: ROM PORT MAP ( A => A, data => data );END; 3. Test decoder---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 22:19:06 03/30/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/test_decoder.vhd-- Project Name: VGA-- Target Device: 47
  48. 48. -- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: decoder---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------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;ENTITY test_decoder ISEND test_decoder; 48
  49. 49. ARCHITECTURE behavior OF test_decoder IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT decoder PORT( st : IN std_logic; clk : IN std_logic; wr : OUT std_logic; sortie : OUT std_logic_vector(8 downto 0) ); END COMPONENT; --Inputs signal st : std_logic := 0; signal clk : std_logic := 0; --Outputs signal wr : std_logic; signal sortie : std_logic_vector(8 downto 0); -- Clock period definitions constant clk_period : time := 0.002 ns;BEGIN 49
  50. 50. -- Instantiate the Unit Under Test (UUT)uut: decoder PORT MAP ( st => st, clk => clk, wr => wr, sortie => sortie );-- Clock process definitionsclk_process :processbegin clk <= 0; wait for clk_period/2; clk <= 1; wait for clk_period/2;end process;-- Stimulus processstim_proc: processbegin -- hold reset state for 100 ns. wait for 100 ns; wait for clk_period*10; 50
  51. 51. -- insert stimulus here wait; end process;END;Test afficher---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 22:26:36 03/29/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/test_affichage.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: affichage---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and 51
  52. 52. -- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------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;ENTITY test_affichage ISEND test_affichage;ARCHITECTURE behavior OF test_affichage IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT affichage PORT( clk : IN std_logic; ft : IN std_logic; fl : IN std_logic; nl : OUT std_logic_vector(2 downto 0); nc : OUT std_logic_vector(5 downto 0); noir : OUT std_logic ); END COMPONENT; 52
  53. 53. --Inputs signal clk : std_logic := 0; signal ft : std_logic := 1; signal fl : std_logic := 1; --Outputs signal nl : std_logic_vector(2 downto 0); signal nc : std_logic_vector(5 downto 0); signal noir : std_logic; -- Clock period definitions constant clk_period : time := 0.002 ns; signal n:integer range 0 to 100;BEGIN -- Instantiate the Unit Under Test (UUT) uut: affichage PORT MAP ( clk => clk, ft => ft, fl => fl, nl => nl, nc => nc, noir => noir ); -- Clock process definitions clk_process :process begin 53
  54. 54. fl<=1; clk <= 0; wait for clk_period/2; clk <= 1; wait for clk_period/2; fl<=0after 0.137 ns; end process;END; 4. Test_ligne---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 22:51:19 03/17/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/tester_ligne.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: generateur_ligne---- Dependencies:---- Revision: 54
  55. 55. -- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------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;ENTITY tester_ligne ISEND tester_ligne;ARCHITECTURE behavior OF tester_ligne IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT generateur_ligne PORT( clk : IN std_logic; sl : OUT std_logic; fl : OUT std_logic ); 55
  56. 56. END COMPONENT; --Inputs signal clk : std_logic := 0; --Outputs signal sl : std_logic; signal fl : std_logic; -- Clock period definitions constant clk_period : time := 0.002 ns;BEGIN -- Instantiate the Unit Under Test (UUT) uut: generateur_ligne PORT MAP ( clk => clk, sl => sl, fl => fl ); -- Clock process definitions clk_process :process begin clk <= 0; wait for clk_period/2; clk <= 1; wait for clk_period/2; end process; 56
  57. 57. -- Stimulus process stim_proc: process begin -- hold reset state for 100 ns. wait for 100 ns; wait for clk_period*10; -- insert stimulus here wait; end process;END;Test_trame---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 14:19:18 03/29/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/test_trame.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:-- 57
  58. 58. -- VHDL Test Bench Created by ISE for module: generateur_trame---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------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;ENTITY test_trame ISEND test_trame;ARCHITECTURE behavior OF test_trame IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT generateur_trame 58
  59. 59. PORT( sl : IN std_logic; st : OUT std_logic; ft : OUT std_logic ); END COMPONENT; --Inputs signal sl : std_logic := 0; --Outputs signal st : std_logic; signal ft : std_logic; -- No clocks detected in port list. Replace <clock> below with -- appropriate port name constant clk : time := 0.002 ns;BEGIN -- Instantiate the Unit Under Test (UUT) uut: generateur_trame PORT MAP ( sl => sl, st => st, ft => ft ); -- Clock process definitions process 59
  60. 60. begin sl <= 0; wait for clk/2; sl <= 1; wait for clk/2; end process; -- Stimulus process stim_proc: process begin -- hold reset state for 100 ns. wait for 100 ns; wait for clk*10; -- insert stimulus here wait; end process;END 60
  61. 61. 5. Test_VGA---------------------------------------------------------------------------------- Company:-- Engineer:---- Create Date: 14:42:38 04/10/2011-- Design Name:-- Module Name: C:/Users/yahya/Desktop/project hard/VGA/test_top.vhd-- Project Name: VGA-- Target Device:-- Tool versions:-- Description:---- VHDL Test Bench Created by ISE for module: top---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:---- Notes:-- This testbench has been automatically generated using types std_logic and-- std_logic_vector for the ports of the unit under test. Xilinx recommends-- that these types always be used for the top-level I/O of a design in order-- to guarantee that the testbench will bind correctly to the post-implementation-- simulation model.--------------------------------------------------------------------------------LIBRARY ieee ; 61
  62. 62. use std.textio.all;USE ieee.std_logic_1164.all ;LIBRARY std;use IEEE.std_logic_textio.all;-- Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned values--USE ieee.numeric_std.ALL;ENTITY test_top ISEND test_top;ARCHITECTURE behavior OF test_top IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT top PORT( uu0 : IN std_logic_vector(3 downto 0); uu1 : IN std_logic_vector(3 downto 0); uu2 : IN std_logic_vector(3 downto 0); uu3 : IN std_logic_vector(3 downto 0); uu4 : IN std_logic_vector(3 downto 0); uu5 : IN std_logic_vector(3 downto 0); uu6 : IN std_logic_vector(3 downto 0); uu7 : IN std_logic_vector(3 downto 0); clk_25MHZ : IN std_logic; sl : OUT std_logic; st : OUT std_logic; final : OUT std_logic 62
  63. 63. );END COMPONENT;--Inputssignal uu0 : std_logic_vector(3 downto 0) := "1111";signal uu1 : std_logic_vector(3 downto 0) := "0001";signal uu2 : std_logic_vector(3 downto 0) := "0000";signal uu3 : std_logic_vector(3 downto 0) := "0000";signal uu4 : std_logic_vector(3 downto 0) := "0000";signal uu5 : std_logic_vector(3 downto 0) := "0000";signal uu6 : std_logic_vector(3 downto 0) := "0000";signal uu7 : std_logic_vector(3 downto 0) := "0000";signal clk_25MHZ : std_logic := 0; --Outputssignal sl : std_logic;signal st : std_logic;signal final : std_logic;-- Clock period definitionsconstant clk_25MHZ_period : time := 40 ps; signal a:integer range 66 downto 0 :=0;signal b:integer range 2 downto 0 :=0; signal deb1:integer range 1 downto 0 :=0; signal deb2:integer range 1 downto 0 :=0; signal deb3:integer range 1 downto 0 :=0; signal deb4:integer range 1 downto 0 :=0; signal deb5:integer range 1 downto 0 :=0; 63
  64. 64. signal deb6:integer range 1 downto 0 :=0; signal deb7:integer range 1 downto 0 :=0; signal deb8:integer range 1 downto 0 :=0; signal d:integer range 8 downto 0 :=1; type TAB is array(0 to 161) of bit; signal T : TAB;BEGIN -- Instantiate the Unit Under Test (UUT) uut: top PORT MAP ( uu0 => uu0, uu1 => uu1, uu2 => uu2, uu3 => uu3, uu4 => uu4, uu5 => uu5, uu6 => uu6, uu7 => uu7, clk_25MHZ => clk_25MHZ, sl => sl, st => st, final => final ); -- Clock process definitions clk_25MHZ_process :process begin 64
  65. 65. clk_25MHZ <= 0; wait for clk_25MHZ_period/2; clk_25MHZ <= 1; wait for clk_25MHZ_period/2; --fixer les debut des ligne pour laffichage dans notre fichier texte--- deb1<=1 after 293.280 ns; deb2<=1 after 325.380 ns; deb3<=1 after 357.460 ns; deb4<=1 after 389.540 ns; deb5<=1 after 421.620 ns; deb6<=1 after 453.700 ns; deb7<=1 after 485.780 ns; deb8<=1 after 517.860 ns; end process;--ecriture de resultat de notre controleur VGA dans une fichier TXT-----ECRITURE: process(clk_25MHZ,d,deb1,deb2,deb3,deb4,deb5,deb6,deb7,deb8)variable L: line;file SORTIES: text open WRITE_MODE is "C:UsersyahyaDesktopresres.txt";beginif(clk_25MHZ event and clk_25MHZ=1) thenif(deb1=1 and d=1)then if(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; 65
  66. 66. end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=2;end if;end if;end if;if(deb2=1 and d=2)then if(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); 66
  67. 67. end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=3;end if;end if;end if; if(deb3=1 and d=3)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=4;end if;end if;end if; 67
  68. 68. if(deb4=1 and d=4)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=5;end if;end if;end if; if(deb5=1 and d=5)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then 68
  69. 69. T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=6;end if;end if;end if; if(deb6=1 and d=6)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0; 69
  70. 70. for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=7;end if;end if;end if; if(deb7=1 and d=7)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L); -- écriture de la ligne dans le fichierd<=8;end if; 70
  71. 71. end if;end if; if(deb8=1 and d=8)thenif(final=0) thenT(a)<=0;a<=a+1;end if;if(final=1) then T(a)<=1; a<=a+1; b<=1; end if;if(a=66)thena<=0;if(b=1)thenb<=0;for i in 0 to 66 loop write(L, T(i)); end loop;writeline(SORTIES, L);end if;end if;end if;end if;end process ECRITURE;END; 71
  72. 72. IV. Simulation 72
  73. 73. 1. Fichier:i. Simulation (0, 0, 0, 0, 0, 0, 0, 0):ii. Simulation (F, 1, 0, 0, 0, 0, 0, 0): 73
  74. 74. Rapport technique:Outil de développement utilisé:Logiciel :Xilinx est une entreprise américaine de semi-conducteurs. Inventeur du FPGA, Xilinx faitpartie des plus grandes entreprises spécialisées dans le développement et lacommercialisation de composants logiques programmables, et des services associés tels queles logiciels de CAO électroniques ; blocs de propriété intellectuelle réutilisables etformation. 74
  75. 75. Langage :VHDL est un langage de description matériel destiné à représenter le comportement ainsique larchitecture d’un système électronique numérique. Son nom completest VHSIC Hardware Description Langage.Lintérêt dune telle description réside dans son caractère exécutable : une spécificationdécrite en VHDL peut être vérifiée par simulation, avant que la conception détaillée ne soitterminée. En outre, les outils de conception assistée par ordinateur permettant de passerdirectement dune description fonctionnelle en VHDL à un schéma en porte logique ontrévolutionné les méthodes de conception des circuits numériques, ASIC ou FPGA.Conclusion:Le but de ce projet est d’exploiter le FPGA Spartan 3 de Xilinx pour faire des applicationsbasiques d’entrée sortie pour passer par la suite à des architectures relativementcomplexes rassemblant plusieurs composants qu’il faut synchroniser et gérer l’accès à lamémoire.Au cours de ce projet, nous avons fait l’implantation en VHDL de circuits basiques, à savoir lemodule VGA et ces spécifications. Cependant, nous avons pu valider l’architecture del’affichage sur écran VGA en utilisant des méthodes de simulations qui peuvent réaliser lemême résultat qu’implémenter notre application sur carte. Mais nous sommes familiarisésavec les outils de développement hard.Notre ROM ne contient pas tous les caractères que lutilisateur peut saisir (restriction sur lesHEXA) donc on peut penser à des modules intermédiaires de traitements qui peuvent jouerle rôle de constructeur de nouveaux caractères à partir de notre ROM suite à un nouveaucodage que lon peut définir également. 75
  76. 76. 76

×