-- *********************** Divers fonction utiles *************************** LIBRARY ieee; USE ieee.std_logic_1164.ALL; PACKAGE utils IS PROCEDURE horloge ( SIGNAL h: OUT std_logic; th, tb : time); PROCEDURE horloge_retard ( SIGNAL h : OUT std_logic; periode : time ; retard : time); END utils; --------------------------------------------------- PACKAGE BODY utils IS PROCEDURE horloge ( SIGNAL h : OUT std_logic; th, tb : time) IS BEGIN LOOP h <= '0', '1' AFTER tb; WAIT FOR tb + th ; END LOOP; END; PROCEDURE horloge_retard ( SIGNAL h : OUT std_logic; periode : time ; retard : time) IS BEGIN h <= '0'; WAIT FOR retard; LOOP h <= '1' , '0' AFTER periode/2 ; WAIT FOR periode; END LOOP; END; END utils;