-- -- Definition of Repondeur -- -- Tue 06 Dec 2005 04:57:53 PM CET -- -- LeonardoSpectrum Level 3, 2003b.65 -- library IEEE; use IEEE.STD_LOGIC_1164.all; library unisim ; use unisim.vcomponents.all ; entity Repondeur is port ( Clk : IN std_logic ; K : IN std_logic_vector (0 TO 2) ; listen : OUT std_logic ; call : OUT std_logic ; play : OUT std_logic ; save : OUT std_logic ; erase : OUT std_logic ; recording : OUT std_logic) ; end Repondeur ; architecture comment_ca_marche of Repondeur is signal Clk_int, K_int_0, K_int_1, K_int_2, etat_courant_3, etat_courant_2, etat_courant_1, etat_courant_0, etat_suivant_3, etat_suivant_2, etat_suivant_1, etat_suivant_0, listen_dup0, call_dup0, play_dup0, save_dup0, erase_dup0, recording_dup0, nx57, nx58, nx59, nx60, nx61, nx62, nx63, nx64, nx65, nx66, nx67, nx68, nx69, nx70, nx71, nx72, nx73, nx74, nx75, nx76, nx77: std_logic ; begin K_ibuf_2 : IBUF port map ( O=>K_int_2, I=>K(2)); K_ibuf_1 : IBUF port map ( O=>K_int_1, I=>K(1)); K_ibuf_0 : IBUF port map ( O=>K_int_0, I=>K(0)); recording_obuf : OBUF port map ( O=>recording, I=>recording_dup0, GTS=> OPEN); erase_obuf : OBUF port map ( O=>erase, I=>erase_dup0, GTS=>OPEN); save_obuf : OBUF port map ( O=>save, I=>save_dup0, GTS=>OPEN); play_obuf : OBUF port map ( O=>play, I=>play_dup0, GTS=>OPEN); call_obuf : OBUF port map ( O=>call, I=>call_dup0, GTS=>OPEN); listen_obuf : OBUF port map ( O=>listen, I=>listen_dup0, GTS=>OPEN); reg_etat_courant_3 : FDCE port map ( Q=>etat_courant_3, D=>etat_suivant_3, CE=>OPEN, C=>Clk_int, CLR=>OPEN, GSR=>OPEN); reg_etat_courant_2 : FDCE port map ( Q=>etat_courant_2, D=>etat_suivant_2, CE=>OPEN, C=>Clk_int, CLR=>OPEN, GSR=>OPEN); reg_etat_courant_1 : FDCE port map ( Q=>etat_courant_1, D=>etat_suivant_1, CE=>OPEN, C=>Clk_int, CLR=>OPEN, GSR=>OPEN); reg_etat_courant_0 : FDCE port map ( Q=>etat_courant_0, D=>etat_suivant_0, CE=>OPEN, C=>Clk_int, CLR=>OPEN, GSR=>OPEN); Clk_ibuf : BUFG port map ( O=>Clk_int, I=>Clk); etat_suivant_3 <= (nx57 and nx60) or (nx58 and nx59) ; etat_suivant_2 <= (etat_courant_2 and nx63) or (not etat_courant_2 and nx61) ; etat_suivant_1 <= (not etat_courant_2 and nx73) or (not etat_courant_2 and nx72) or (nx75) ; etat_suivant_0 <= (etat_courant_2 and nx70) or (nx74) ; listen_dup0 <= (not etat_courant_2 and etat_courant_1 and etat_courant_0) ; call_dup0 <= (etat_courant_2 and etat_courant_1 and not etat_courant_0) ; play_dup0 <= (etat_courant_2 and etat_courant_1 and etat_courant_0) ; save_dup0 <= (etat_courant_3 and not etat_courant_2 and not etat_courant_1 and not etat_courant_0) ; erase_dup0 <= (etat_courant_3 and not etat_courant_2 and not etat_courant_1 and etat_courant_0) ; recording_dup0 <= (etat_courant_3 and not etat_courant_2 and etat_courant_1 and not etat_courant_0) ; nx57 <= (etat_courant_3 and not etat_courant_2 and etat_courant_1 and not etat_courant_0) ; nx58 <= (etat_courant_2 and not etat_courant_1) ; nx59 <= (not K_int_0 and K_int_1) or (not etat_courant_0) ; nx60 <= (K_int_2) or (K_int_1) or (K_int_0) ; nx61 <= (not etat_courant_3 and not etat_courant_0 and nx62) or ( etat_courant_3 and not etat_courant_1) ; nx62 <= (not etat_courant_1 and not K_int_0 and not K_int_1 and K_int_2) or (etat_courant_1 and K_int_0 and not K_int_1 and K_int_2) ; nx63 <= (nx77) or (etat_courant_1) ; nx64 <= (K_int_1) or (not etat_courant_3 and not K_int_0) or ( etat_courant_3 and K_int_2) or (K_int_0 and not K_int_2) ; nx65 <= (K_int_0 and not K_int_1 and not K_int_2) or (not K_int_0 and not K_int_1 and K_int_2) or (not etat_courant_0) ; nx66 <= (etat_courant_0 and not K_int_0 and K_int_1 and not K_int_2) or ( etat_courant_0 and not K_int_0 and not K_int_1 and K_int_2) ; nx67 <= (not etat_courant_1 and nx69) or (etat_courant_1 and nx68) ; nx68 <= (etat_courant_3 and not K_int_1 and not K_int_2) or ( etat_courant_0) ; nx69 <= (not etat_courant_0 and K_int_1 and not K_int_2) or (not K_int_1 and K_int_2) or (etat_courant_0 and K_int_2) or (etat_courant_3) ; nx70 <= (nx76) or (etat_courant_1) ; nx71 <= (etat_courant_3 and not etat_courant_1 and K_int_0) or ( etat_courant_0 and K_int_0) ; nx72 <= (etat_courant_1 and not etat_courant_0 and nx64) ; nx73 <= (not etat_courant_3 and not etat_courant_1 and nx66) ; nx74 <= (not etat_courant_2 and not K_int_0 and nx67) or (not etat_courant_2 and nx71) ; nx75 <= (etat_courant_2 and not etat_courant_1 and nx65) ; nx76 <= (etat_courant_0 and K_int_0 and K_int_1) or (etat_courant_0 and K_int_2) ; nx77 <= (etat_courant_0 and not K_int_1 and K_int_2) or (etat_courant_0 and K_int_0) ; end comment_ca_marche ; library ieee; use ieee.std_logic_1164.all; entity test_repondeur is end test_repondeur; architecture TEST_01 of test_repondeur is type Etats is ( main, welcome, new_recording, listening, beginRec, review, calling, repeat, saving, erasing, store ); -- signaux simules : signal Tclk: std_logic; signal TK : std_logic_vector(0 to 2); -- signaux observes : signal Tlisten, Tcall, Tplay, Tsave, Terase, Trecording: std_logic ; -- signal Tetat_suivant: Etats ; begin Repondeur : entity work.repondeur(comment_ca_marche) port map( Tclk, TK, Tlisten, Tcall, Tplay, Tsave, Terase, Trecording ); stimulus: process ( Tclk ) is begin Tclk <= if Tclk = '0' then Tclk <= '1' after 10 ns; else Tclk <= '0' after 10 ns; endif; TK <= "010" after 60 ns, -- welcome "001" after 100 ns, -- listen "010" after 180 ns, -- record message "101" after 300 ns, -- begin rec + store "000" after 420 ns, -- welcome + main "001" after 540 ns, -- review + repeat "010" after 660 ns, -- save "011" after 740 ns, -- erase "100" after 820 ns, -- call "000" after 860 ns; -- main end process stimulus; end TEST_01;