summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/packages/nono_const.vhd
blob: 30fc3d47a1de97e1aff5b6e54a40e4f4f1b4289c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
-- 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

    -- Temps d'une p�riode d'horloge sur la carte
    --constant CK_PERIOD : time := 10 ns;

    -- 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);
	 

    -- 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;