library ieee; use ieee.std_logic_1164.all; entity Repondeur is port( Clk: in std_logic; K: in std_logic_vector(0 to 2); listen, call, play, save, erase, recording: out std_logic ); end Repondeur; architecture comment_ca_marche of Repondeur is type Etats is ( main, welcome, new_recording, listening, beginRec, review, calling, repeat, saving, erasing, store ); signal etat_courant, etat_suivant: Etats; begin Circuit_Memorisant: process ( Clk ) begin if rising_edge( Clk ) then etat_courant <= etat_suivant; end if; end process Circuit_Memorisant; Circuit_Combinatoire: process ( Clk, etat_courant, K ) begin recording <= '0'; listen <= '0'; erase <= '0'; call <= '0'; play <= '0'; save <= '0'; case etat_courant is when main => -- ASSERT FALSE REPORT "Main" SEVERITY NOTE; case K is when "001" => etat_suivant <= review; -- K = 1 when "010" => etat_suivant <= welcome; -- K = 2 when others => etat_suivant <= etat_courant; end case; when welcome => -- ASSERT FALSE REPORT "Welcome" SEVERITY NOTE; case K is when "000" => etat_suivant <= main; -- K = 0 when "001" => etat_suivant <= listening; -- K = 1 when "010" => etat_suivant <= new_recording; -- K = 2 when others => etat_suivant <= etat_courant; end case; when listening => -- ASSERT FALSE REPORT "Listening" SEVERITY NOTE; etat_suivant <= welcome; listen <= '1'; when new_recording => -- ASSERT FALSE REPORT "Record new" SEVERITY NOTE; case K is when "101" => etat_suivant <= beginRec; -- K = 5 when others => etat_suivant <= etat_courant; end case; when beginRec => -- ASSERT FALSE REPORT "Begin record" SEVERITY NOTE; etat_suivant <= store; when store => -- ASSERT FALSE REPORT "Message store" SEVERITY NOTE; recording <= '1'; case K is when "000" => etat_suivant <= welcome; -- K = 0 when others => etat_suivant <= etat_courant; end case; when review => -- ASSERT FALSE REPORT "Review" SEVERITY NOTE; case K is when "000" => etat_suivant <= main; -- K = 0 when "001" => etat_suivant <= repeat; -- K = 1 when "010" => etat_suivant <= saving; -- K = 2 when "011" => etat_suivant <= erasing; -- K = 3 when "100" => etat_suivant <= calling; -- K = 4 when others => etat_suivant <= etat_courant; end case; when repeat => -- ASSERT FALSE REPORT "Repeat" SEVERITY NOTE; play <= '1'; etat_suivant <= review; when saving => -- ASSERT FALSE REPORT "Save" SEVERITY NOTE; save <= '1'; etat_suivant <= review; when erasing => -- ASSERT FALSE REPORT "Erase" SEVERITY NOTE; erase <= '1'; etat_suivant <= review; when calling => -- ASSERT FALSE REPORT "Call" SEVERITY NOTE; call <= '1'; etat_suivant <= review; end case; end process Circuit_Combinatoire; end comment_ca_marche;