diff options
author | LYAM <cous5830@gmail.com> | 2025-05-03 16:33:51 -0400 |
---|---|---|
committer | LYAM <cous5830@gmail.com> | 2025-05-03 16:33:51 -0400 |
commit | 2b84bdea9181718bc7f62097bd1a8d1fa314fab9 (patch) | |
tree | 7dcf211f9c8e098096ba9835c2e40a6da04d881c | |
parent | 97264b8e89f704f55cc41673db9bceeff325ec6d (diff) | |
parent | 23c24950cab84bfc55011329048343addd9d5c00 (diff) |
Merge branch 'master' of git.chausse.xyz:s4-app1
-rw-r--r-- | pb_APP_log_comb.srcs/sources_1/imports/src/AppCombi_top.vhd | 146 |
1 files changed, 71 insertions, 75 deletions
diff --git a/pb_APP_log_comb.srcs/sources_1/imports/src/AppCombi_top.vhd b/pb_APP_log_comb.srcs/sources_1/imports/src/AppCombi_top.vhd index b9be1dc..7626428 100644 --- a/pb_APP_log_comb.srcs/sources_1/imports/src/AppCombi_top.vhd +++ b/pb_APP_log_comb.srcs/sources_1/imports/src/AppCombi_top.vhd @@ -25,34 +25,33 @@ use ieee.numeric_std.ALL; library UNISIM;
use UNISIM.Vcomponents.ALL;
-entity AppCombi_top is
- port (
- i_btn : in std_logic_vector (3 downto 0); -- Boutons de la carte Zybo
- i_sw : in std_logic_vector (3 downto 0); -- Interrupteurs de la carte Zybo
- sysclk : in std_logic; -- horloge systeme
- o_SSD : out std_logic_vector (7 downto 0); -- vers cnnecteur pmod afficheur 7 segments
- o_led : out std_logic_vector (3 downto 0); -- vers DELs de la carte Zybo
- o_led6_r : out std_logic; -- vers DEL rouge de la carte Zybo
- o_pmodled : out std_logic_vector (7 downto 0) -- vers connecteur pmod 8 DELs
- );
+entity AppCombi_top is port (
+ i_btn : in std_logic_vector (3 downto 0); -- Boutons de la carte Zybo
+ i_sw : in std_logic_vector (3 downto 0); -- Interrupteurs de la carte Zybo
+ sysclk : in std_logic; -- horloge systeme
+ o_SSD : out std_logic_vector (7 downto 0); -- vers cnnecteur pmod afficheur 7 segments
+ o_led : out std_logic_vector (3 downto 0); -- vers DELs de la carte Zybo
+ o_led6_r : out std_logic; -- vers DEL rouge de la carte Zybo
+ o_pmodled : out std_logic_vector (7 downto 0) -- vers connecteur pmod 8 DELs
+);
end AppCombi_top;
architecture BEHAVIORAL of AppCombi_top is
- constant nbreboutons : integer := 4; -- Carte Zybo Z7
- constant freq_sys_MHz : integer := 125; -- 125 MHz
+ constant nbreboutons : integer := 4; -- Carte Zybo Z7
+ constant freq_sys_MHz : integer := 125; -- 125 MHz
- signal d_s_1Hz : std_logic;
- signal clk_5MHz : std_logic;
- --
- signal d_opa : std_logic_vector (3 downto 0):= "0000"; -- operande A
- signal d_opb : std_logic_vector (3 downto 0):= "0000"; -- operande B
- signal d_cin : std_logic := '0'; -- retenue entree
- signal d_sum : std_logic_vector (3 downto 0):= "0000"; -- somme
- signal d_cout : std_logic := '0'; -- retenue sortie
- --
- signal d_AFF0 : std_logic_vector (3 downto 0):= "0000";
- signal d_AFF1 : std_logic_vector (3 downto 0):= "0000";
+ signal d_s_1Hz : std_logic;
+ signal clk_5MHz : std_logic;
+ --
+ signal d_opa : std_logic_vector (3 downto 0):= "0000"; -- operande A
+ signal d_opb : std_logic_vector (3 downto 0):= "0000"; -- operande B
+ signal d_cin : std_logic := '0'; -- retenue entree
+ signal d_sum : std_logic_vector (3 downto 0):= "0000"; -- somme
+ signal d_cout : std_logic := '0'; -- retenue sortie
+ --
+ signal d_AFF0 : std_logic_vector (3 downto 0):= "0000";
+ signal d_AFF1 : std_logic_vector (3 downto 0):= "0000";
component Add4Bits is Port (
@@ -64,63 +63,60 @@ architecture BEHAVIORAL of AppCombi_top is );
end component;
- component synchro_module_v2 is
- generic (const_CLK_syst_MHz: integer := freq_sys_MHz);
- Port (
- clkm : in STD_LOGIC; -- Entrée horloge maitre
- o_CLK_5MHz : out STD_LOGIC; -- horloge divise utilise pour le circuit
- o_S_1Hz : out STD_LOGIC -- Signal temoin 1 Hz
- );
- end component;
-
- component septSegments_Top is
- Port ( clk : in STD_LOGIC; -- horloge systeme, typique 100 MHz (preciser par le constante)
- i_AFF0 : in STD_LOGIC_VECTOR (3 downto 0); -- donnee a afficher sur 8 bits : chiffre hexa position 1 et 0
- i_AFF1 : in STD_LOGIC_VECTOR (3 downto 0); -- donnee a afficher sur 8 bits : chiffre hexa position 1 et 0
- o_AFFSSD_Sim : out string(1 to 2);
- o_AFFSSD : out STD_LOGIC_VECTOR (7 downto 0)
- );
- end component;
+ component synchro_module_v2 is generic (const_CLK_syst_MHz: integer := freq_sys_MHz);
+ Port (
+ clkm : in STD_LOGIC; -- Entrée horloge maitre
+ o_CLK_5MHz : out STD_LOGIC; -- horloge divise utilise pour le circuit
+ o_S_1Hz : out STD_LOGIC -- Signal temoin 1 Hz
+ );
+ end component;
+
+ component septSegments_Top is Port (
+ clk : in STD_LOGIC; -- horloge systeme, typique 100 MHz (preciser par le constante)
+ i_AFF0 : in STD_LOGIC_VECTOR (3 downto 0); -- donnee a afficher sur 8 bits : chiffre hexa position 1 et 0
+ i_AFF1 : in STD_LOGIC_VECTOR (3 downto 0); -- donnee a afficher sur 8 bits : chiffre hexa position 1 et 0
+ o_AFFSSD_Sim : out string(1 to 2);
+ o_AFFSSD : out STD_LOGIC_VECTOR (7 downto 0)
+ );
+ end component;
begin
inst_synch : synchro_module_v2
- generic map (const_CLK_syst_MHz => freq_sys_MHz)
- port map (
- clkm => sysclk,
- o_CLK_5MHz => clk_5MHz,
- o_S_1Hz => d_S_1Hz
- );
-
- inst_aff : septSegments_Top
- port map (
- clk => clk_5MHz,
- -- donnee a afficher definies sur 8 bits : chiffre hexa position 1 et 0
- i_AFF1 => d_AFF1,
- i_AFF0 => d_AFF0,
- o_AFFSSD_Sim => open, -- ne pas modifier le "open". Ligne pour simulations seulement.
- o_AFFSSD => o_SSD -- sorties directement adaptees au connecteur PmodSSD
- );
-
-
- d_opa <= i_sw; -- operande A sur interrupteurs
- d_opb <= i_btn; -- operande B sur boutons
- d_cin <= '0'; -- la retenue d'entrée alterne 0 1 a 1 Hz
-
- d_AFF0 <= d_sum(3 downto 0); -- Le resultat de votre additionneur affiché sur PmodSSD(0)
- d_AFF1 <= '0' & '0' & '0' & d_Cout; -- La retenue de sortie affichée sur PmodSSD(1) (0 ou 1)
- o_led6_r <= d_Cout; -- La led couleur représente aussi la retenue en sortie Cout
- o_pmodled <= d_opa & d_opb; -- Les opérandes d'entrés reproduits combinés sur Pmod8LD
- o_led (3 downto 0) <= '0' & '0' & '0' & d_S_1Hz; -- La LED0 sur la carte représente la retenue d'entrée
-
-adder4 : Add4Bits port map (
- A => d_opa,
- B => d_opb,
- C => d_cin,
- R => d_sum,
- Rc => d_cout
-);
+ generic map (const_CLK_syst_MHz => freq_sys_MHz) port map (
+ clkm => sysclk,
+ o_CLK_5MHz => clk_5MHz,
+ o_S_1Hz => d_S_1Hz
+ );
+
+ inst_aff : septSegments_Top port map (
+ clk => clk_5MHz,
+ -- donnee a afficher definies sur 8 bits : chiffre hexa position 1 et 0
+ i_AFF1 => d_AFF1,
+ i_AFF0 => d_AFF0,
+ o_AFFSSD_Sim => open, -- ne pas modifier le "open". Ligne pour simulations seulement.
+ o_AFFSSD => o_SSD -- sorties directement adaptees au connecteur PmodSSD
+ );
+
+
+ adder4 : Add4Bits port map (
+ A => d_opa,
+ B => d_opb,
+ C => d_cin,
+ R => d_sum,
+ Rc => d_cout
+ );
+
+ d_opa <= i_sw; -- operande A sur interrupteurs
+ d_opb <= i_btn; -- operande B sur boutons
+ d_cin <= '0'; -- la retenue d'entrée alterne 0 1 a 1 Hz
+
+ d_AFF0 <= d_sum(3 downto 0); -- Le resultat de votre additionneur affiché sur PmodSSD(0)
+ d_AFF1 <= '0' & '0' & '0' & d_Cout; -- La retenue de sortie affichée sur PmodSSD(1) (0 ou 1)
+ o_led6_r <= d_Cout; -- La led couleur représente aussi la retenue en sortie Cout
+ o_pmodled <= d_opa & d_opb; -- Les opérandes d'entrés reproduits combinés sur Pmod8LD
+ o_led (3 downto 0) <= '0' & '0' & '0' & d_S_1Hz; -- La LED0 sur la carte représente la retenue d'entrée
end BEHAVIORAL;
|