From 33a615e793066c19388fed03aef70cc5213e6479 Mon Sep 17 00:00:00 2001 From: galmes Date: Tue, 30 Mar 2004 13:36:30 +0000 Subject: interrupt.vhd : Première version du gestionnaire d'interruptions. reste à le débugger. --- 2004/n/fpga/src/interrupt/interrupt.vhd | 127 ++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 2004/n/fpga/src/interrupt/interrupt.vhd (limited to '2004/n/fpga/src/interrupt/interrupt.vhd') diff --git a/2004/n/fpga/src/interrupt/interrupt.vhd b/2004/n/fpga/src/interrupt/interrupt.vhd new file mode 100644 index 0000000..529e6d0 --- /dev/null +++ b/2004/n/fpga/src/interrupt/interrupt.vhd @@ -0,0 +1,127 @@ +-- interrupt.vhd +-- Eurobot 2004 : APB Team +-- Auteur : Pierre-André Galmes +-- Bloc de gestion des interruptions. + +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 interrupt is + port( + -- interruption de la caméra + it_fast : in std_logic; + -- autres interruptions. + it_bloc1 : in T_DATA; + it_bloc2 : in T_DATA; + it_bloc3 : in T_DATA; + -- chip select + cs_bloc1 : in std_logic; + cs_bloc2 : in std_logic; + cs_bloc3 : in std_logic; + -- les sorties + IRQ : out std_logic; + IRQ_fast : out std_logic; -- IRQ rapide (pour la caméra). + bus_data : out T_DATA + ); +end entity; + +architecture RTL of interrupt is + +-- Définition des composants utilisés. + +-- Ou à trois entrées. +component or3 is + port ( + in1 : in std_logic; + in2 : in std_logic; + in3 : in std_logic; + or_out : out std_logic + ); +end component; + +-- Ou à huit entrées. +component or8 is + port ( + or8_in : in std_logic_vector (7 downto 0); + or8_out : out std_logic + ); +end component; + +-- Composant three-state. +component tristate is + port ( + enable : in std_logic; + data_in : in T_DATA; + data_out : out T_DATA + ); +end component; + +-- définition des signaux. +-- clk, rst... sont définis dans l'entity du GPIO. +-- +signal it_aux_bloc1 : std_logic; +signal it_aux_bloc2 : std_logic; +signal it_aux_bloc3 : std_logic; + +begin + +-- Mapping des composants. + +--interruption de caméra. +IRQ_fast <= it_fast; + +-- Les autres interruptions +or8_bloc1 : or8 +port map ( + it_bloc1, + it_aux_bloc1 +); + +or8_bloc2 : or8 +port map ( + it_bloc2, + it_aux_bloc2 +); + +or8_bloc3 : or8 +port map ( + it_bloc3, + it_aux_bloc3 +); + +IRQ_gen : or3 +port map ( + it_aux_bloc1, + it_aux_bloc2, + it_aux_bloc3, + IRQ +); + + +-- Les blocs haute-impédance. +out_bloc1 : tristate +port map ( + cs_bloc1, + it_bloc1, + bus_data +); + +out_bloc2 : tristate +port map ( + cs_bloc2, + it_bloc2, + bus_data +); + +out_bloc3 : tristate +port map ( + cs_bloc3, + it_bloc3, + bus_data +); + +end RTL; -- cgit v1.2.3