summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/gpio/bch_gpio_it_detect.vhd
blob: 80ebd451b938f61f50756b4d4d23ea4de69615be (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
-- bch_gpio_it_detect.vhd
-- Eurobot 2004 : APB Team
-- Auteur : Pierre-Andr� Galmes
-- Test de gpio_it_detect.

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

use	work.isa_const.all;
use	work.nono_const.all;


entity bch_gpio_it_detect is
end bch_gpio_it_detect;

architecture sim1 of bch_gpio_it_detect is
    
    component gpio_it_detect
	port (
	    clk : in std_logic;
	    rst : in std_logic;
	    data_in : in T_DATA;
	    it_mask : in T_DATA;
	    it_detected : out std_logic
	);
    end component;

    -- d�finiton des signaux
    signal clk : std_logic := '0';
    signal rst : std_logic;
    signal data_in : T_DATA;
    signal it_mask : T_DATA;
    signal it_detected : std_logic;

begin
    U1 : gpio_it_detect port map (
	clk => clk,
	rst => rst,
	data_in => data_in,
	it_mask => it_mask,
	it_detected => it_detected
	);

    clk <= not clk after CK_PERIOD/2;
    rst <= '1', '0' after CK_PERIOD;
    data_in <= 	x"02", 
		x"08" after 3*CK_PERIOD,
    		x"01" after 5*CK_PERIOD;
		--x"03" after 5*CK_PERIOD;
    it_mask <= 	x"02",
		x"01" after 3*CK_PERIOD;
end sim1;

configuration cf1_bch_gpio_it_detect of bch_gpio_it_detect is
    for sim1
        for all : gpio_it_detect use entity work.gpio_it_detect(RTL); end for;
    end for;
end cf1_bch_gpio_it_detect;