From af23a43e34659e108e2afc8da8a6cd26d64622e3 Mon Sep 17 00:00:00 2001 From: LYAM Date: Sun, 18 May 2025 20:34:22 -0400 Subject: Test du reset fonctionnel. M8 is done. --- .../sources_1/imports/new/module_commande.vhd | 101 +++++++++++---------- 1 file changed, 53 insertions(+), 48 deletions(-) (limited to 'pb_logique_seq.srcs/sources_1/imports/new/module_commande.vhd') diff --git a/pb_logique_seq.srcs/sources_1/imports/new/module_commande.vhd b/pb_logique_seq.srcs/sources_1/imports/new/module_commande.vhd index 0e41ccd..f3f5833 100644 --- a/pb_logique_seq.srcs/sources_1/imports/new/module_commande.vhd +++ b/pb_logique_seq.srcs/sources_1/imports/new/module_commande.vhd @@ -70,55 +70,60 @@ BEGIN end if; end process; -state_manager : process(clk, current_distortion_effect, d_strobe_btn) +state_manager : process(clk, current_distortion_effect, d_strobe_btn, d_reset) begin - if rising_edge(clk) then - case current_distortion_effect is - when effect_a => - o_selection_fct <= "00"; - case d_strobe_btn(1 downto 0) is - when "01" => - wanted_distortion_effect <= effect_b; - when "10" => - wanted_distortion_effect <= effect_d; - when others => - -- Do nothing. It's not specified. - end case; - - when effect_b => - o_selection_fct <= "01"; - case d_strobe_btn(1 downto 0) is - when "01" => - wanted_distortion_effect <= effect_c; - when "10" => - wanted_distortion_effect <= effect_a; - when others => - -- Do nothing. It's not specified. - end case; - - when effect_c => - o_selection_fct <= "10"; - case d_strobe_btn(1 downto 0) is - when "01" => - wanted_distortion_effect <= effect_d; - when "10" => - wanted_distortion_effect <= effect_b; - when others => - -- Do nothing. It's not specified. - end case; - - when effect_d => - o_selection_fct <= "11"; - case d_strobe_btn(1 downto 0) is - when "01" => - wanted_distortion_effect <= effect_a; - when "10" => - wanted_distortion_effect <= effect_c; - when others => - -- Do nothing. It's not specified. - end case; - end case; - END IF; + if d_reset = '1' then + wanted_distortion_effect <= effect_a; + o_selection_fct <= "00"; + else + if rising_edge(clk) then + case current_distortion_effect is + when effect_a => + o_selection_fct <= "00"; + case d_strobe_btn(1 downto 0) is + when "01" => + wanted_distortion_effect <= effect_b; + when "10" => + wanted_distortion_effect <= effect_d; + when others => + -- Do nothing. It's not specified. + end case; + + when effect_b => + o_selection_fct <= "01"; + case d_strobe_btn(1 downto 0) is + when "01" => + wanted_distortion_effect <= effect_c; + when "10" => + wanted_distortion_effect <= effect_a; + when others => + -- Do nothing. It's not specified. + end case; + + when effect_c => + o_selection_fct <= "10"; + case d_strobe_btn(1 downto 0) is + when "01" => + wanted_distortion_effect <= effect_d; + when "10" => + wanted_distortion_effect <= effect_b; + when others => + -- Do nothing. It's not specified. + end case; + + when effect_d => + o_selection_fct <= "11"; + case d_strobe_btn(1 downto 0) is + when "01" => + wanted_distortion_effect <= effect_a; + when "10" => + wanted_distortion_effect <= effect_c; + when others => + -- Do nothing. It's not specified. + end case; + end case; + end if; + end if; end process; o_btn_cd <= d_btn_cd; -- cgit v1.2.3