summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/decodisa/bch_decodisa.vhd
blob: be1d0718987b0738307601a5e45d0b6c13ef71f9 (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
77
-- bch_decodeur4.vhd
-- Eurobot 2004 : APB Team
-- Auteur : Pierre-Andr� Galmes
-- Test du decodeur4.

library ieee;
use	ieee.std_logic_1164.all;
use     ieee.std_logic_arith.all;
use     ieee.std_logic_unsigned.all;

use	work.nono_const.all;


entity bch_decodeur4 is
end bch_decodeur4;

architecture sim1 of bch_decodeur4 is
    
    component decodeur4
    	generic (
            -- adresses des diff�rents registres du module.
	    A_REG0 : T_ADDRESS;
	    A_REG1 : T_ADDRESS;
	    A_REG2 : T_ADDRESS;
	    A_REG3 : T_ADDRESS
	    -- si autre choses � d�clarer...
	);
	port (
	    -- TODO : utile la clock ?
	    --clk : in std_logic;
	    bus_address : in T_ADDRESS;
	    enable0 : out std_logic;
	    enable1 : out std_logic;
	    enable2 : out std_logic;
	    enable3 : out std_logic
    );
    end component;

    -- d�finiton des signaux
    --signal clk : std_logic := '0';
    signal bus_address : T_ADDRESS;
    signal enable0 : std_logic;
    signal enable1 : std_logic;
    signal enable2 : std_logic;
    signal enable3 : std_logic;

begin
    U1 : decodeur4
    	generic map (
	    -- D�finition des addresses.
	    A_REG0 => A_IO1_REG_DATA,
	    A_REG1 => A_IO1_REG_DIRECTION,
	    A_REG2 => A_IO1_REG_INTERRUPT_MASK,
	    A_REG3 => A_IO1_READ_OUTPUT
	)
	port map (		
	    bus_address => bus_address,
	    enable0 => enable0,
	    enable1 => enable1,
	    enable2 => enable2,
	    enable3 => enable3
	);

    --clk <= not clk after (CK_PERIOD/2);
    bus_address <=	A_IO1_REG_DIRECTION, 
			A_IO1_READ_OUTPUT after 3*CK_PERIOD,
			A_IO1_REG_INTERRUPT_MASK	after 5*CK_PERIOD,
			A_IO1_REG_DATA after 7*CK_PERIOD;
end sim1;


configuration cf1_bch_decodeur4 of bch_decodeur4 is
    for sim1
        for all : decodeur4 use entity work.decodeur4(RTL); end for;
    end for;
end cf1_bch_decodeur4;