------------------------------------------------------------------------------- -- Title : adaptation au kit s3 de xilinx -- Project : ------------------------------------------------------------------------------- -- File : s3board.vhd -- Author : -- Company : http://vhdl33.free.fr -- Last update: 2008/10/23 -- Platform : ------------------------------------------------------------------------------- -- Description: ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2008/06/16 1.0 patrice Created ------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY s3board IS PORT ( clock : IN std_logic; -- horloge 50 Mhz push_button : IN std_logic_vector(3 DOWNTO 0); -- 4 poussoirs leds : OUT std_logic_vector(7 DOWNTO 0); -- 8 leds seven_seg_display : OUT std_logic_vector(11 DOWNTO 0)); -- 4x7seg END s3board; -- On adapte le projet PIC à la carte Spartan 3 de xilinx -- en remarquant que les leds sont allumés sur un signal "1" -- alors que les 7 segments le sont sur un niveau bas -- les 7 segments sont multiplexés -- l'appui sur un interrupteur correspond à un 1 -- l'horloge est à 50 MHz ARCHITECTURE adaptation OF s3board IS COMPONENT pic GENERIC ( simulation : boolean := false); -- change les constantes de temps PORT ( clk : IN std_logic; -- horloge systeme reset_n : IN std_logic; -- reset general int : IN std_logic; -- demande interruption port_a : INOUT std_logic_vector(7 DOWNTO 0); port_b : INOUT std_logic_vector(7 DOWNTO 0) ); END COMPONENT; SIGNAL afficheurs : std_logic_vector(31 DOWNTO 0); SIGNAL reset_n : std_ulogic; -- a inverser SIGNAL port_a : std_logic_vector(7 DOWNTO 0); SIGNAL port_b : std_logic_vector(7 DOWNTO 0); BEGIN -- adaptation P1 : pic PORT MAP ( clk => clock, reset_n => reset_n, int => push_button(3), port_a => port_a, port_b => port_b); -- inversion reset et affectation reset_n <= NOT push_button(3); -- probleme pour le port A en entrée ( ignoré pour l'instant -- port_a(0) <= push_button(2); -- port B leds <= NOT port_b; -- Validation des 4 anodes des 7 segments seven_seg_display(11 DOWNTO 8) <= "0000"; -- écrirure d'un segment ( g) après appui seven_seg_display(1) <= NOT port_a(1) ; -- les autres éteinds seven_seg_display(0) <= '1'; seven_seg_display(7 DOWNTO 2) <= "111111"; END adaptation;