Académique Documents
Professionnel Documents
Culture Documents
1 ENP/ELN/MSCL/2016 Taghi. M.
Process
Process
Syntaxe:
Définition
[Nom_du_process]
C’est une Instruction
process(Liste_de_sensibilité_nom_des_signaux)
concurrente définissant
Begin
un comportement qui doit
-- instructions du process
se dérouler lorsque ce
end process [Nom_du_process] ;
process devient actif.
Règles de fonctionnement d’un process
Le process est surtout
L’exécution d’un process a lieu à chaque
composé d’une suite
changement d’état d’un signal de la liste de
d’instructions séquentielles
sensibilité.
( if, case, for et while)
Les instructions du process s’exécutent
Indispensable pour la
séquentiellement.
description des systèmes
Les changements d’état des signaux par les
séquentiels, également
instructions du process sont pris en compte à la fin
utilisé pour décrire les
du process.
circuits combinatoires .
2 ENP/ELN/MSCL/2016 Taghi. M.
Fonctionnement process
EXEMPLE :
process (A,B,M)
begin
Y <= A;
M <= B;
Z <= M;
end process;
Un événement se produit : B 1
Le process se réveille, alors
Un nouvel événement sur M, le process se réveille encore
3 ENP/ELN/MSCL/2016 Taghi. M.
Mode Concurrent / Mode Séquentiel
4 ENP/ELN/MSCL/2016 Taghi. M.
Instructions séquentielles
Instruction if Exemple:
Begin
if condition then instructions
[elsif condition then If A=’1’ then SORTIE <= E1;
instructions] Elsif B = ‘1’ then
[else instructions] SORTIE <= E2;
end if ; Else SORTIE <= E3;
end if ;
Remarque : l’instruction if ne
peut être utilisée que dans un end process ;
process
5 ENP/ELN/MSCL/2016 Taghi. M.
Instructions séquentielles
Syntaxe
9 ENP/ELN/MSCL/2016 Taghi. M.
Process Multiples
-- nom_process1 :
PROCESS (liste sensible1)
BEGIN
.....
END PROCESS
nom_process1;
-- nom_process2 :
PROCESS (liste sensible2)
BEGIN .....
END PROCESS
nom_process2; ....
10 ENP/ELN/MSCL/2016 Taghi. M.
Variables VS Signaux
11 ENP/ELN/MSCL/2016 Taghi. M.
Variables VS Process
12 ENP/ELN/MSCL/2016 Taghi. M.
Variables VS process
Dans un process, préférer l’utilisation des variables intermédiaires
plutôt que les signaux intermédiaires (les variables sont rapides à mettre
à jour et ne sont pas citées dans la liste de sensitivité)
13 ENP/ELN/MSCL/2016 Taghi. M.
Modélisation des Circuits
combinatoires
14 ENP/ELN/MSCL/2016 Taghi. M.
Affectation incomplète
15 ENP/ELN/MSCL/2016 Taghi. M.
Description Comportementale VS
Concurrente
16 ENP/ELN/MSCL/2016 Taghi. M.
Exemples
Exemple : ALU
entity ALU is
port(A : in std_logic_vector(7 downto 0);
B : in std_logic_vector(7 downto 0);
Sel: in std_logic_vector(1 downto 0);
Res: out std_logic_vector(7 downto 0));
end ALU;
process(A,B,Sel)
begin
case Sel is
when "00" => Res <= A + B; -- Addition
when "01" => Res <= A + (not B)+1; -- Soustraction
when "10" => Res <= A and B;-- et logique bit à bit
when "11" => Res <= A or B;-- ou logique bit à bit
when others => Res <= "--";
end case;
end process;
end process;
17 end behv; ENP/ELN/MSCL/2016 Taghi. M.
Exemples
18 ENP/ELN/MSCL/2016 Taghi. M.
EXEMPLES
Multiplieur
Le but est de réaliser un multiplieur 4 bits fois 4 bits
19 ENP/ELN/MSCL/2016 Taghi. M.
EXEMPLES
Exemple : Multiplieur
entity main is
Port (A : in std_logic_vector(3 downto 0);
B : in std_logic_vector(3 downto 0);
RES : out std_logic_vector(7 downto 0));
end main;
architecture Behavioral of main is
begin process (A,B)
variable result : std_logic_vector(7 downto 0);
begin
result := (others => '0');
for I in 0 to 3 loop
if B(I)='1' then
result(I+4 downto I) := result(I+4 downto I) +('0' & A);
end if;
end loop;
RES <= result;
end process;
end Behavioral;
20 ENP/ELN/MSCL/2016 Taghi. M.
Exemples
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity mux is
generic (n : positive := 3 -- nombre de signaux de contrôle);
port (
D : in std_logic_vector(2 ** n - 1 downto 0);
S: in unsigned(n - 1 downto 0);
F : out std_logic);
end mux;
architecture comportementale of mux is
begin
process (D, S)
begin
F <= D(to_integer(S));
end process;
end comportementale;
21 ENP/ELN/MSCL/2016 Taghi. M.
Exemples Flot de données
Additionneur SVA
22 ENP/ELN/MSCL/2016 Taghi. M.
Exemples
23 ENP/ELN/MSCL/2016 Taghi. M.
EXEMPLES
24 ENP/ELN/MSCL/2016 Taghi. M.
Exemples
25 ENP/ELN/MSCL/2016 Taghi. M.
Généricité
26 ENP/ELN/MSCL/2016 Taghi. M.
Exemple
Une porte ET à N entrées
27 ENP/ELN/MSCL/2016 Taghi. M.
Exemple
28 ENP/ELN/MSCL/2016 Taghi. M.
l’instruction generate.
Permet de :
Répliquer du matériel (logique)
Ouverture/fermeture (ON/OFF) de blocs
logiques
Syntaxe :
Forme Conditionnelle
label : IF condition_booléenne GENERATE
instructions concurrentes;
END GENERATE label;
Forme Itérative
label : FOR index IN intervalle_discret)
GENERATE instructions concurrentes;
END GENERATE label;
29 ENP/ELN/MSCL/2016 Taghi. M.
Exemple
30 ENP/ELN/MSCL/2016 Taghi. M.
Exemple 2ème Version
31 ENP/ELN/MSCL/2016 Taghi. M.