------------------------------------------------------------------------------- -- Title : adaptation au kit s3 de xilinx -- Project : ------------------------------------------------------------------------------- -- File : s3board.vhd -- Author : -- Company : http://vhdl33.free.fr -- Last update: 2008/06/16 -- 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); -- "reset, mode, plus, moins leds : OUT std_logic_vector(2 DOWNTO 0); -- seconde, alarme, alarm seven_seg_display : OUT std_logic_vector(11 DOWNTO 0)); -- 4 afficheurs multiplexes END s3board; -- par rapport au projet premier, la seule contrainte est de -- multiplexer l'affichage -- il faut donc créer un balayage des anodes et des cathodes -- avec une duree de 2 ms environ ( soient 100000 cycles) ARCHITECTURE adaptation OF s3board IS COMPONENT premier GENERIC ( simulation : boolean := false); -- permet de changer l'echelle du temps PORT ( clock : IN std_ulogic; boutons : IN std_logic_vector(3 DOWNTO 0); afficheurs : OUT std_logic_vector(31 DOWNTO 0); leds : OUT std_logic_vector(2 DOWNTO 0)); END COMPONENT; SIGNAL afficheurs : std_logic_vector(31 DOWNTO 0); BEGIN -- adaptation P1 : premier PORT MAP ( clock => clock, boutons => push_button, afficheurs => afficheurs, leds => leds); -- choix de l'afficheur actif decale : PROCESS CONSTANT Tempo : natural := 100000; VARIABLE compt : natural; VARIABLE position : std_logic_vector(3 DOWNTO 0); -- gauche ... droit BEGIN -- PROCESS decale WAIT UNTIL rising_edge(clock); IF Compt /= 0 THEN -- timer compt := compt -1; ELSE compt := Tempo; CASE position IS -- multiplexage WHEN "0111" => position := "1011"; seven_seg_display <= position & afficheurs(23 DOWNTO 16); WHEN "1011" => position := "1101"; seven_seg_display <= position & afficheurs(15 DOWNTO 8); WHEN "1101" => position := "1110"; seven_seg_display <= position & afficheurs(7 DOWNTO 0); WHEN OTHERS => position := "0111"; seven_seg_display <= position & afficheurs(31 DOWNTO 24); END CASE; END IF; END PROCESS decale; END adaptation;