summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/gpio/gpio_it_detect.vhd
diff options
context:
space:
mode:
Diffstat (limited to '2004/n/fpga/src/gpio/gpio_it_detect.vhd')
-rw-r--r--2004/n/fpga/src/gpio/gpio_it_detect.vhd35
1 files changed, 23 insertions, 12 deletions
diff --git a/2004/n/fpga/src/gpio/gpio_it_detect.vhd b/2004/n/fpga/src/gpio/gpio_it_detect.vhd
index 003c00d..f56e766 100644
--- a/2004/n/fpga/src/gpio/gpio_it_detect.vhd
+++ b/2004/n/fpga/src/gpio/gpio_it_detect.vhd
@@ -7,6 +7,10 @@
-- masque : si bit à 1 => on détecte l'interruption.
-- si bit à 0 => on détecte pas l'interruption.
+--ATTENTION : On prendra soin de faire dureer le it_mask à 0
+-- au moins 1 cycle, sinon, on aura une interruption au début !!!
+-- ICI j'ai encore des soucis...
+
library ieee;
use ieee.std_logic_1164.all;
@@ -32,29 +36,36 @@ architecture RTL of gpio_it_detect is
-- constant IT_ENABLE : std_logic := '1';
-- Signal interne
signal state_p : T_DATA; -- etat passe
-
+
begin
+
-- process séquentiel
process (rst, clk)
begin
- if (rst = '1') then
+ if (rst = '1') then
-- ne pas déclencher d'it après rst.
state_p <= data_in;
it_detected <= '0';
- elsif (clk'event and clk = '1') then
- -- TODO : Ajouter la synchronisation ??????? Pas besoin, non ?????
-
- if (data_in /= state_p) then
+ elsif (clk'event and clk = '1') then
+
+ if (state_p /= data_in) then
-- bit ayant droit de générer une interruption ?
if (((data_in xor state_p) and it_mask) /= x"00") then
- -- on émet le signal d'interruption.
- it_detected <= '1';
- end if;
- else
- it_detected <= '0';
+ -- on émet le signal d'interruption.
+ it_detected <= '1';
+ end if;
end if;
state_p <= data_in;
- end if;
+ end if;
end process;
+-- process (data_in)
+-- begin
+-- if (((data_in xor state_p) and it_mask) /= x"00") then
+ -- on émet le signal d'interruption.
+-- it_detected <= '1';
+-- end if;
+-- end process;
+
+
end RTL;