-- nono_const.vhd -- Eurobot 2004 : APB Team -- Auteur : Pierre-André Galmes -- Fichier de déclaration de constantes. -- RQ : pour une indentation bien sous vim : -- 1 - ":set shiftwidth=4" -- 2 - se placer sous "package nono_const is" -- 3 - tapez : = puis shift+G library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; -- Constantes relatives package nono_const is -- Taille de l'octet. constant NB_BIT_OCTET : integer := 8; -- Taille du double octet. constant NB_BIT_DOUBLE_OCTET : integer := 16; -- Taille d'une addresse sur la carte -- RQ : 10 = nb suffisant -- 12 = 3 digit en héxa constant NB_BIT_ADDRESS : integer := 10; -- Taille des données sur la carte constant NB_BIT_DATA : integer := 8; -- Définition d'un nouveau type : le double ctet (16 bits). subtype T_OCTET is std_logic_vector ((NB_BIT_OCTET - 1) downto 0); -- Définition d'un nouveau type : le double ctet (16 bits). subtype T_DOUBLE_OCTET is std_logic_vector ((NB_BIT_DOUBLE_OCTET - 1) downto 0); -- Définition de nouveaux types : T_ADDRESS et T_DATA subtype T_ADDRESS is std_logic_vector ((NB_BIT_ADDRESS - 1) downto 0); subtype T_DATA is std_logic_vector ((NB_BIT_DATA - 1) downto 0); -- Fréquence de fonctionnement de la PWM : 40MHz. -- Nb de période d'horloge à 40MHz pour avoir 1us : 40 : x"28". -- constant FREQ_CLK : T_OCTET := x"28"; -- 40M constant FREQ_CLK : T_OCTET := x"64"; -- 100M -- Les différentes banques d'adresses (4 x 256) -- Rq pour Pierre : ça va influer sur le bloc de gestion du bus constant START_ADDR_B0 : T_ADDRESS := "0000000000"; constant START_ADDR_B1 : T_ADDRESS := "0100000000"; constant START_ADDR_B2 : T_ADDRESS := "1000000000"; constant START_ADDR_B3 : T_ADDRESS := "1100000000"; -- Les addresses des différents registres. -- gestion des interruptions constant A_INTERRUPT_MANAGER : T_ADDRESS := START_ADDR_B0 + x"00"; -- Bloc d'IO1 constant A_IO1_REG_DATA : T_ADDRESS := START_ADDR_B0 + x"01"; constant A_IO1_REG_DIRECTION : T_ADDRESS := START_ADDR_B0 + x"02"; constant A_IO1_REG_INTERRUPT_MASK : T_ADDRESS := START_ADDR_B0 + x"03"; constant A_IO1_READ_OUTPUT : T_ADDRESS := START_ADDR_B0 + x"04"; -- Bloc d'IO2 constant A_IO2_REG_DATA : T_ADDRESS := START_ADDR_B0 + x"05"; constant A_IO2_REG_DIRECTION : T_ADDRESS := START_ADDR_B0 + x"06"; constant A_IO2_REG_INTERRUPT_MASK : T_ADDRESS := START_ADDR_B0 + x"07"; constant A_IO2_READ_OUTPUT : T_ADDRESS := START_ADDR_B0 + x"08"; -- Bloc port série -- Bloc caméra -- Bloc PWM -- Bloc I²C -- Bloc servo-moteurs end nono_const;