-- bascule.vhd -- Eurobot 2004 : APB Team -- Auteur : Pierre-André Galmes -- Bascule 8 bits avec signal de détection des changements. -- Remarque : -- masque : si bit à 1 => on détecte l'interruption. -- si bit à 0 => on détecte pas l'interruption. 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 bascule is port ( clk : in std_logic; rst : in std_logic; data_in : in T_DATA; data_out : out T_DATA; it_detected : out std_logic ); end entity; architecture RTL of bascule is begin -- process séquentiel process (rst, clk) begin if (rst = '1') then -- ne pas déclencher d'it après rst. data_out <= x"00"; it_detected <= '0'; elsif (clk'event and clk = '1') then -- TODO : ici c'est séquentiel. On peut le faire en combinatiore ? if (data_in(0) = '1') then data_out(0) <= '1'; end if; if (data_in(1) = '1') then data_out(1) <= '1'; end if; if (data_in(2) = '1') then data_out(2) <= '1'; end if; if (data_in(3) = '1') then data_out(3) <= '1'; end if; if (data_in(4) = '1') then data_out(4) <= '1'; end if; if (data_in(5) = '1') then data_out(5) <= '1'; end if; if (data_in(6) = '1') then data_out(6) <= '1'; end if; if (data_in(7) = '1') then data_out(7) <= '1'; end if; -- Détection des interruptions. if (data_in /= x"00") then it_detected <= '1'; end if; end if; end process; -- TODO : modifier et mettre en concurentiel cette partie (la c'est en -- séquentiel !!!) -- data_out(0) <= '1' when (data_in(0) = '1'); -- data_out(1) <= '1' when (data_in(1) = '1'); -- data_out(2) <= '1' when (data_in(2) = '1'); -- data_out(3) <= '1' when (data_in(3) = '1'); -- data_out(4) <= '1' when (data_in(4) = '1'); -- data_out(5) <= '1' when (data_in(5) = '1'); -- data_out(6) <= '1' when (data_in(6) = '1'); -- data_out(7) <= '1' when (data_in(7) = '1'); end RTL;