Browse Source

Lifting du code

Paul Faure 2 years ago
parent
commit
d57f8a5b37

+ 2
- 2
Processeur.srcs/sim_1/new/Test_Pipeline.vhd View File

63
     
63
     
64
 begin
64
 begin
65
     instance : Pipeline
65
     instance : Pipeline
66
-    generic map (Addr_Memoire_Instruction_Size => 7,
67
-                 Memoire_Instruction_Size => 128)
66
+    generic map (Addr_Memoire_Instruction_Size => 8,
67
+                 Memoire_Instruction_Size => 256)
68
     port map (CLK => my_CLK,
68
     port map (CLK => my_CLK,
69
               RST => my_RST,
69
               RST => my_RST,
70
               STD_IN => my_STD_IN,
70
               STD_IN => my_STD_IN,

+ 37
- 26
Processeur.srcs/sources_1/new/ALU.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 13.04.2021 10:07:41
5
 -- Create Date: 13.04.2021 10:07:41
4
 -- Module Name: ALU - Behavioral
6
 -- Module Name: ALU - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+--
11
+-- Description: ALU 
5
 -- 
12
 -- 
13
+-- Dependencies: None
14
+--
15
+-- Comments : Assynchrone
6
 ----------------------------------------------------------------------------------
16
 ----------------------------------------------------------------------------------
7
 
17
 
8
 
18
 
9
 library IEEE;
19
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
20
 use IEEE.STD_LOGIC_1164.ALL;
11
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
21
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
12
-
13
 use IEEE.NUMERIC_STD.ALL;
22
 use IEEE.NUMERIC_STD.ALL;
14
 
23
 
15
---library UNISIM;
16
---use UNISIM.VComponents.all;
17
-
18
 entity ALU is
24
 entity ALU is
19
-    Generic (Nb_bits : Natural);
20
-    Port ( A : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
21
-           B : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
22
-           OP : in STD_LOGIC_VECTOR (2 downto 0);
23
-           S : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
24
-           N : out STD_LOGIC;
25
-           O : out STD_LOGIC;
26
-           Z : out STD_LOGIC;
27
-           C : out STD_LOGIC);
25
+    Generic (Nb_bits : Natural); -- Taille d'un mot binaire
26
+    Port ( A : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Entrée 1 de l'ALU
27
+           B : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Entrée 2 de l'ALU
28
+           OP : in STD_LOGIC_VECTOR (2 downto 0); -- Code d'opération de l'ALU
29
+           S : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Sortie de l'ALU
30
+           N : out STD_LOGIC; -- Flag Negative
31
+           O : out STD_LOGIC; -- Flag Overload
32
+           Z : out STD_LOGIC; -- Flag Zero
33
+           C : out STD_LOGIC);-- Flag Carry
28
 end ALU;
34
 end ALU;
29
 
35
 
30
 architecture Behavioral of ALU is
36
 architecture Behavioral of ALU is
31
-    signal A9 :  STD_LOGIC_VECTOR (Nb_bits downto 0);
32
-    signal B9 :  STD_LOGIC_VECTOR (Nb_bits downto 0);
33
-    signal ADD :  STD_LOGIC_VECTOR (Nb_bits downto 0);
34
-    signal SUB :  STD_LOGIC_VECTOR (Nb_bits downto 0);
35
-    signal MUL :  STD_LOGIC_VECTOR ((2*Nb_bits)-1 downto 0);
37
+    signal A9 :  STD_LOGIC_VECTOR (Nb_bits downto 0); -- Ajout d'un bit de poids fort supplémentaire (à 0)
38
+    signal B9 :  STD_LOGIC_VECTOR (Nb_bits downto 0); -- Ajout d'un bit de poids fort supplémentaire (à 0)
39
+    signal ADD :  STD_LOGIC_VECTOR (Nb_bits downto 0); -- A+B
40
+    signal SUB :  STD_LOGIC_VECTOR (Nb_bits downto 0); -- A-B
41
+    signal MUL :  STD_LOGIC_VECTOR ((2*Nb_bits)-1 downto 0); -- A*B
42
+    
43
+    -- Signaux interne
36
     signal intern_N : STD_LOGIC;
44
     signal intern_N : STD_LOGIC;
37
     signal intern_Z : STD_LOGIC;
45
     signal intern_Z : STD_LOGIC;
46
+    
47
+    -- Constantes
38
     constant ZERO_N : STD_LOGIC_VECTOR (Nb_bits downto 0) := (others => '0');
48
     constant ZERO_N : STD_LOGIC_VECTOR (Nb_bits downto 0) := (others => '0');
39
     constant ZERO_N1 : STD_LOGIC_VECTOR (Nb_bits downto 0) := (others => '0');
49
     constant ZERO_N1 : STD_LOGIC_VECTOR (Nb_bits downto 0) := (others => '0');
40
     
50
     
41
     
51
     
42
 begin
52
 begin
43
-    A9 <= '0' & A;
44
-    B9 <= '0' & B;
45
-    ADD <= A9 + B9;
46
-    SUB <= A9 - B9;
47
-    MUL <= A * B;    
53
+    A9 <= '0' & A; -- Ajout d'un bit de poids fort supplémentaire (à 0)
54
+    B9 <= '0' & B; -- Ajout d'un bit de poids fort supplémentaire (à 0)
55
+    ADD <= A9 + B9; -- A+B
56
+    SUB <= A9 - B9; -- A-B
57
+    MUL <= A * B;   -- A*B 
48
     
58
     
59
+    -- Selection de la sortie
49
     S <= ADD (Nb_bits-1 downto 0) when OP = "001" else 
60
     S <= ADD (Nb_bits-1 downto 0) when OP = "001" else 
50
          SUB (Nb_bits-1 downto 0) when OP = "010" else 
61
          SUB (Nb_bits-1 downto 0) when OP = "010" else 
51
          MUL (Nb_bits-1 downto 0) when OP = "011" else
62
          MUL (Nb_bits-1 downto 0) when OP = "011" else
52
          -- Add division
63
          -- Add division
53
-         (0 => intern_N, others => '0') when OP = "101" else
54
-         (0 => '1', others => '0') when OP = "110" and intern_Z = '0' and intern_N = '0' else
55
-         (0 => intern_Z, others => '0') when OP = "111" else
64
+         (0 => intern_N, others => '0') when OP = "101" else                                    -- Inferieur (<)
65
+         (0 => '1', others => '0') when OP = "110" and intern_Z = '0' and intern_N = '0' else   -- Superieur (>)
66
+         (0 => intern_Z, others => '0') when OP = "111" else                                    -- Egal      (=)
56
          (others => '0');
67
          (others => '0');
57
          
68
          
58
          
69
          

+ 31
- 21
Processeur.srcs/sources_1/new/BancRegistres.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 15.04.2021 08:23:48
5
 -- Create Date: 15.04.2021 08:23:48
4
 -- Module Name: BancRegistres - Behavioral
6
 -- Module Name: BancRegistres - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Banc de registre
5
 -- 
11
 -- 
12
+-- Dependencies: None
13
+--
14
+-- Comments : 
15
+--    - Il est possible de lire 3 registres en simultané
16
+--    - Si on souhaite lire et ecrire dans un même registre, l'écriture est prioritaire
6
 ----------------------------------------------------------------------------------
17
 ----------------------------------------------------------------------------------
7
 
18
 
8
 
19
 
9
 library IEEE;
20
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
21
 use IEEE.STD_LOGIC_1164.ALL;
11
---use IEEE.STD_LOGIC_UNSIGNED.ALL;
12
---use IEEE.STD_LOGIC_ARITH.ALL;
13
-
14
 use IEEE.NUMERIC_STD.ALL;
22
 use IEEE.NUMERIC_STD.ALL;
15
 
23
 
16
---library UNISIM;
17
---use UNISIM.VComponents.all;
18
-
19
 entity BancRegistres is
24
 entity BancRegistres is
20
-    Generic (Nb_bits : Natural;
21
-             Addr_size : Natural;
22
-             Nb_regs : Natural);
23
-    Port ( AddrA : in STD_LOGIC_VECTOR (Addr_size-1 downto 0);
24
-           AddrB : in STD_LOGIC_VECTOR (Addr_size-1 downto 0);
25
-           AddrC : in STD_LOGIC_VECTOR (Addr_size-1 downto 0);
26
-           AddrW : in STD_LOGIC_VECTOR (Addr_size-1 downto 0);
27
-           W : in STD_LOGIC;
28
-           DATA : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
29
-           RST : in STD_LOGIC;
30
-           CLK : in STD_LOGIC;
31
-           QA : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
32
-           QB : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
33
-           QC : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0));
25
+    Generic (Nb_bits : Natural; -- Taille d'un mot dans un registre
26
+             Addr_size : Natural; -- Nombres de bits nécessaires pour adresser les registres
27
+             Nb_regs : Natural); -- Nombre de registre
28
+    Port ( AddrA : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Adresse (numéro) du registre A à lire
29
+           AddrB : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Adresse (numéro) du registre B à lire
30
+           AddrC : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Adresse (numéro) du registre C à lire
31
+           AddrW : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Adresse (numéro) du registre W où ecrire
32
+           W : in STD_LOGIC; -- Flag d'écriture ('1' -> écriture)
33
+           DATA : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Donnée a écrire
34
+           RST : in STD_LOGIC; -- Reset
35
+           CLK : in STD_LOGIC; -- Clock
36
+           QA : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Sortie : Valeur contenue dans le registre AddrA
37
+           QB : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Sortie : Valeur contenue dans le registre AddrB
38
+           QC : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0));-- Sortie : Valeur contenue dans le registre AddrC
34
 end BancRegistres;
39
 end BancRegistres;
35
 
40
 
41
+
36
 architecture Behavioral of BancRegistres is
42
 architecture Behavioral of BancRegistres is
37
-    signal REGISTRES : STD_LOGIC_VECTOR ((Nb_regs * Nb_bits)-1 downto 0) := (others => '0');
43
+    signal REGISTRES : STD_LOGIC_VECTOR ((Nb_regs * Nb_bits)-1 downto 0) := (others => '0'); -- Buffer (registres)
38
 begin
44
 begin
39
     process
45
     process
40
     begin
46
     begin
47
+        -- Synchronisation
41
         wait until CLK'event and CLK = '1';
48
         wait until CLK'event and CLK = '1';
42
         if (RST = '0') then
49
         if (RST = '0') then
43
             REGISTRES <= (others => '0');
50
             REGISTRES <= (others => '0');
44
         else 
51
         else 
52
+            -- Ecriture
45
             if (W = '1') then
53
             if (W = '1') then
46
                 REGISTRES (((to_integer(unsigned(AddrW)) + 1) * Nb_bits - 1) downto Nb_bits * to_integer(unsigned(AddrW))) <= DATA;
54
                 REGISTRES (((to_integer(unsigned(AddrW)) + 1) * Nb_bits - 1) downto Nb_bits * to_integer(unsigned(AddrW))) <= DATA;
47
             end if;
55
             end if;
48
         end if;
56
         end if;
49
     end process;
57
     end process;
58
+    
59
+    -- Lecture en Assynchrone (donc écriture prioritaire)
50
     QA <= REGISTRES (((to_integer(unsigned(AddrA)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrA)));
60
     QA <= REGISTRES (((to_integer(unsigned(AddrA)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrA)));
51
     QB <= REGISTRES (((to_integer(unsigned(AddrB)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrB)));
61
     QB <= REGISTRES (((to_integer(unsigned(AddrB)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrB)));
52
     QC <= REGISTRES (((to_integer(unsigned(AddrC)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrC)));    
62
     QC <= REGISTRES (((to_integer(unsigned(AddrC)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(AddrC)));    

+ 16
- 5
Processeur.srcs/sources_1/new/Clock_Divider.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 08.05.2021 21:00:25
5
 -- Create Date: 08.05.2021 21:00:25
4
 -- Module Name: Clock_Divider - Behavioral
6
 -- Module Name: Clock_Divider - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Diviseur de clock (rapport de 1000)
5
 -- 
11
 -- 
12
+-- Dependencies: None
6
 ----------------------------------------------------------------------------------
13
 ----------------------------------------------------------------------------------
7
 
14
 
8
 
15
 
9
 library IEEE;
16
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
17
 use IEEE.STD_LOGIC_1164.ALL;
11
 
18
 
12
---use IEEE.NUMERIC_STD.ALL;
13
-
14
---library UNISIM;
15
---use UNISIM.VComponents.all;
16
-
17
 entity Clock_Divider is
19
 entity Clock_Divider is
18
     Port ( CLK_IN : in STD_LOGIC;
20
     Port ( CLK_IN : in STD_LOGIC;
19
            CLK_OUT : out STD_LOGIC);
21
            CLK_OUT : out STD_LOGIC);
20
 end Clock_Divider;
22
 end Clock_Divider;
21
 
23
 
22
 architecture Behavioral of Clock_Divider is
24
 architecture Behavioral of Clock_Divider is
25
+    -- Compteur pour le diviseur
23
     signal N : Integer := 0;
26
     signal N : Integer := 0;
27
+    -- Signal enregistrant l'ancienne valeur de CLK
24
     signal CLK : STD_LOGIC := '1';
28
     signal CLK : STD_LOGIC := '1';
25
 begin
29
 begin
26
     process
30
     process
27
     begin
31
     begin
32
+        -- Synchronisation
28
         wait until CLK_IN'event and CLK_IN = '1';
33
         wait until CLK_IN'event and CLK_IN = '1';
34
+        
35
+        -- Incrementation du compteur
29
         N <= N + 1;
36
         N <= N + 1;
37
+       
30
         if (N = 1000) then
38
         if (N = 1000) then
39
+            -- Remise a 0 et changement d'état de la CLK
31
             N <= 0;
40
             N <= 0;
32
             if (CLK = '1') then
41
             if (CLK = '1') then
33
                 CLK <= '0';
42
                 CLK <= '0';
53
             end if;
45
             end if;
54
         end if;
46
         end if;
55
     end process;
47
     end process;
48
+    
49
+    -- Sortie du signal (assynchrone -> imédiat)
56
     CLK_OUT <= CLK;
50
     CLK_OUT <= CLK;
57
 end Behavioral;
51
 end Behavioral;

+ 79
- 33
Processeur.srcs/sources_1/new/Etage1_LectureInstruction.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 18.04.2021 21:19:41
5
 -- Create Date: 18.04.2021 21:19:41
4
 -- Module Name: Etage1_LectureInstruction - Behavioral
6
 -- Module Name: Etage1_LectureInstruction - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Etage 1 du processeur
11
+--     - Gestion des instructions, lecture en mémoire
12
+--     - Gestion des aléas sur les registres
13
+--     - Gestion des sauts et appels de fonction
5
 -- 
14
 -- 
6
 -- Dependencies: 
15
 -- Dependencies: 
16
+--    - MemoireInstruction
17
+--    - MemoireAdressesRetour
7
 ----------------------------------------------------------------------------------
18
 ----------------------------------------------------------------------------------
8
 
19
 
9
 
20
 
10
 library IEEE;
21
 library IEEE;
11
 use IEEE.STD_LOGIC_1164.ALL;
22
 use IEEE.STD_LOGIC_1164.ALL;
12
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
23
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
13
-
14
 use IEEE.NUMERIC_STD.ALL;
24
 use IEEE.NUMERIC_STD.ALL;
15
 
25
 
16
---library UNISIM;
17
---use UNISIM.VComponents.all;
18
 
26
 
19
 entity Etage1_LectureInstruction is
27
 entity Etage1_LectureInstruction is
20
-    Generic (Instruction_size_in_memory : Natural;
21
-             Addr_size_mem_instruction : Natural;
22
-             Mem_instruction_size : Natural;
23
-             Nb_bits : Natural;
24
-             Instruction_bus_size : Natural;
25
-             Nb_registres : Natural;
26
-             Mem_adresse_retour_size : Natural;
27
-             Adresse_size_mem_adresse_retour : Natural;
28
-             Instructions_critiques_lecture_A : STD_LOGIC_VECTOR;
29
-             Instructions_critiques_lecture_B : STD_LOGIC_VECTOR;
30
-             Instructions_critiques_lecture_C : STD_LOGIC_VECTOR;
31
-             Instructions_critiques_ecriture : STD_LOGIC_VECTOR;
32
-             Code_Instruction_JMP : STD_LOGIC_VECTOR;
33
-             Code_Instruction_JMZ : STD_LOGIC_VECTOR;
34
-             Code_Instruction_CALL : STD_LOGIC_VECTOR;
35
-             Code_Instruction_RET : STD_LOGIC_VECTOR;
36
-             Code_Instruction_STOP : STD_LOGIC_VECTOR);
37
-    Port ( CLK : in STD_LOGIC;
38
-           RST : in STD_LOGIC;
39
-           Z : in STD_LOGIC;
40
-           A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
41
-           B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
42
-           C : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
43
-           Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0));
28
+    Generic (Instruction_size_in_memory : Natural; -- Taille d'une instruction en mémoire (Taille d'un code instruction + 3*Taille d'un mot binaire)
29
+             Addr_size_mem_instruction : Natural; -- Nombre de bits pour adresser la mémoire d'instruction
30
+             Mem_instruction_size : Natural; -- Taille de la mémoire d'instruction (nombre d'instructions stockées)
31
+             Nb_bits : Natural; -- Taille d'un mot binaire
32
+             Instruction_bus_size : Natural; -- Nombre de bits du bus d'instruction (Taille d'un code instruction)
33
+             Nb_registres : Natural; -- Nombre de registres du processeurs
34
+             Mem_adresse_retour_size : Natural; -- Taille de la mémoire des adresses de retour (nombre d'adresse maximum) (profondeur d'appel maximale)
35
+             Adresse_size_mem_adresse_retour : Natural; -- Nombre de bits pour adresser la mémoire des adresses de retour
36
+             Instructions_critiques_lecture_A : STD_LOGIC_VECTOR; -- Vecteur de bit représentant les instruction critiques sur l'opérande A (si le bit i est a un, l'instruction i lit une valeur dans le registre n°opérandeA)
37
+             Instructions_critiques_lecture_B : STD_LOGIC_VECTOR; -- Vecteur de bit représentant les instruction critiques sur l'opérande B (si le bit i est a un, l'instruction i lit une valeur dans le registre n°opérandeB)
38
+             Instructions_critiques_lecture_C : STD_LOGIC_VECTOR; -- Vecteur de bit représentant les instruction critiques sur l'opérande C (si le bit i est a un, l'instruction i lit une valeur dans le registre n°opérandeC)
39
+             Instructions_critiques_ecriture : STD_LOGIC_VECTOR; -- Vecteur de bit représentant les instruction critiques en écriture (toujours sur l'opérande A) (si le bit i est a un, l'instruction i ecrit une valeur dans le registre n°opérandeA)
40
+             
41
+             -- Exemple 1 : Soit MUL i j k avec pour numéro d'instruction 7 avec le comportement Ri <- Rj*Rk
42
+             --                Instructions_critiques_lecture_A(7) = '0'  --> MUL ne lit pas dans le registre de l'opérande A
43
+             --                Instructions_critiques_lecture_B(7) = '1'  --> MUL lit dans le registre de l'opérande B
44
+             --                Instructions_critiques_lecture_C(7) = '1'  --> MUL lit dans le registre de l'opérande C
45
+             --                Instructions_critiques_ecriture(7) = '1'  --> MUL ecrit dans le registre de l'opérande A
46
+             
47
+             -- Exemple 2 : Soit AFC i val avec pour numéro d'instruction 5 avec le comportement Ri <- val
48
+             --                Instructions_critiques_lecture_A(5) = '0'  --> AFC ne lit pas dans le registre de l'opérande A
49
+             --                Instructions_critiques_lecture_B(5) = '0'  --> AFC ne lit pas dans le registre de l'opérande B (pour AFC, B est directement la valeur, pas un numero de registre, il n'y a donc pas de lecture)
50
+             --                Instructions_critiques_lecture_C(5) = '0'  --> AFC ne lit pas dans le registre de l'opérande C
51
+             --                Instructions_critiques_ecriture(5) = '1'  --> AFC ecrit dans le registre de l'opérande A
52
+             
53
+             Code_Instruction_JMP : STD_LOGIC_VECTOR;   -- Numéro de l'instruction JMP
54
+             Code_Instruction_JMZ : STD_LOGIC_VECTOR;   -- Numéro de l'instruction JMZ
55
+             Code_Instruction_CALL : STD_LOGIC_VECTOR;  -- Numéro de l'instruction CALL
56
+             Code_Instruction_RET : STD_LOGIC_VECTOR;   -- Numéro de l'instruction RET
57
+             Code_Instruction_STOP : STD_LOGIC_VECTOR); -- Numéro de l'instruction STOP
58
+    Port ( CLK : in STD_LOGIC; -- Clock
59
+           RST : in STD_LOGIC; -- Reset
60
+           Z : in STD_LOGIC;   -- Flag Zero de l'ALU (utile pour le JMZ)
61
+           A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande A
62
+           B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande B
63
+           C : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande C
64
+           Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0)); -- Sortie du code de l'instruction
44
 end Etage1_LectureInstruction;
65
 end Etage1_LectureInstruction;
45
 
66
 
67
+
68
+
46
 architecture Behavioral of Etage1_LectureInstruction is
69
 architecture Behavioral of Etage1_LectureInstruction is
47
     component MemoireInstructions is
70
     component MemoireInstructions is
48
     Generic (Nb_bits : Natural;
71
     Generic (Nb_bits : Natural;
82
                F : out STD_LOGIC);
89
                F : out STD_LOGIC);
83
     end component;
90
     end component;
84
     
91
     
92
+    -- Signaux pour récuperer l'instruction de la mémoire
85
     signal Pointeur_instruction : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (others => '0');
93
     signal Pointeur_instruction : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (others => '0');
86
     signal Pointeur_instruction_next : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (0 => '1', others => '0');
94
     signal Pointeur_instruction_next : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (0 => '1', others => '0');
87
     signal Instruction_courante : STD_LOGIC_VECTOR (Instruction_size_in_memory - 1 downto 0) := (others => '0');
95
     signal Instruction_courante : STD_LOGIC_VECTOR (Instruction_size_in_memory - 1 downto 0) := (others => '0');
88
     
96
     
97
+    
98
+    -- Tableau pour gérer les aléas des registres (lecture en étage 2 avant écriture en étage 5)
89
     subtype Registre is integer range -1 to Nb_registres - 1;
99
     subtype Registre is integer range -1 to Nb_registres - 1;
90
     type Tab_registres is array (1 to 3) of Registre;
100
     type Tab_registres is array (1 to 3) of Registre;
91
     signal Tableau : Tab_registres := (others => - 1);
101
     signal Tableau : Tab_registres := (others => - 1);
92
     
102
     
103
+    -- Signaux de gestion pour la mémoire des adresses de retour
93
     signal Adresse_Retour : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (others => '0');
104
     signal Adresse_Retour : STD_LOGIC_VECTOR (Addr_size_mem_instruction - 1 downto 0) := (others => '0');
94
     signal E : STD_LOGIC;
105
     signal E : STD_LOGIC;
95
     signal F : STD_LOGIC;
106
     signal F : STD_LOGIC;
96
     signal R_Aux : STD_LOGIC := '0';
107
     signal R_Aux : STD_LOGIC := '0';
97
     signal W_Aux : STD_LOGIC := '0';
108
     signal W_Aux : STD_LOGIC := '0';
98
 
109
 
110
+    -- constantes pour injecter des bulles dans le pipeline
99
     constant Instruction_nulle : STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0) := (others => '0');
111
     constant Instruction_nulle : STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0) := (others => '0');
100
     constant Argument_nul : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
112
     constant Argument_nul : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
101
     
113
     
114
+    -- condition pour detecter si une bulle doit être injectée 
102
     signal bulles : boolean := false;
115
     signal bulles : boolean := false;
103
     
116
     
117
+    -- Compteur pour attendre lors d'un JMZ que l'instruction d'avant soit a l'ALU, ou lors d'un STOP k
104
     signal compteur : integer := 0;
118
     signal compteur : integer := 0;
119
+    
120
+    -- Signal d'arret (STOP 0)
105
     signal locked : boolean := false;
121
     signal locked : boolean := false;
106
     
122
     
107
 begin
123
 begin
130
               
146
               
131
     process 
147
     process 
132
     begin
148
     begin
149
+    -- Synchronisation
133
         wait until CLK'event and CLK = '1';
150
         wait until CLK'event and CLK = '1';
134
         if (RST = '0') then
151
         if (RST = '0') then
152
+            -- Reset de l'étage
135
             Tableau <= (others => -1);
153
             Tableau <= (others => -1);
136
             Pointeur_Instruction <= (others => '0');
154
             Pointeur_Instruction <= (others => '0');
137
             compteur <= 0;
155
             compteur <= 0;
141
             A <= Argument_nul;
159
             A <= Argument_nul;
142
             Instruction <= Instruction_nulle;
160
             Instruction <= Instruction_nulle;
143
         else
161
         else
162
+            -- Avancement des instructions en écritures dans le pipeline
144
             Tableau(3) <= Tableau(2);
163
             Tableau(3) <= Tableau(2);
145
             Tableau(2) <= Tableau(1);
164
             Tableau(2) <= Tableau(1);
146
             Tableau(1) <= -1;
165
             Tableau(1) <= -1;
147
             if (not bulles) then
166
             if (not bulles) then
167
+                -- S'il ne faut pas injecter de bulles ont traite l'instruction (Possible code factorisable sur ce if)
148
                 if ((Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_CALL) or (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_JMP)) then
168
                 if ((Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_CALL) or (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_JMP)) then
169
+                    -- CAS PARTICULIER : CALL ou JMP, on transmet et on saute
149
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
170
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
150
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
171
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
151
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
172
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
152
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
173
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
153
                     Pointeur_Instruction <= Instruction_courante (2 * Nb_bits + Addr_size_mem_instruction - 1 downto 2 * Nb_bits);
174
                     Pointeur_Instruction <= Instruction_courante (2 * Nb_bits + Addr_size_mem_instruction - 1 downto 2 * Nb_bits);
154
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_RET) then
175
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_RET) then
176
+                    -- CAS PARTICULIER : RET, on transmet et on revient 
155
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
177
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
156
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
178
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
157
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
179
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
158
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
180
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
159
                     Pointeur_Instruction <= Adresse_Retour;
181
                     Pointeur_Instruction <= Adresse_Retour;
160
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_JMZ) then
182
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_JMZ) then
183
+                    -- CAS PARTICULIER : JMZ, on attends que l'instruction précedente arrive sur l'ALU, si le flag Zero est a un on saute, sinon on continue normalement
161
                     compteur <= compteur + 1;
184
                     compteur <= compteur + 1;
162
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
185
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
163
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
186
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
172
                         compteur <= 0;
195
                         compteur <= 0;
173
                     end if;
196
                     end if;
174
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_STOP) then
197
                 elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_STOP) then
198
+                    -- CAS PARTICULIER : STOP, si on est bloqué, on ne fait rien, programme arrété
199
+                    --                         sinon, on regarde si l'on doit se bloquer
200
+                    --                         sinon, on incremente le compteur et on attends
175
                     if (not locked) then
201
                     if (not locked) then
176
                         if (Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits) = Argument_nul) then
202
                         if (Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits) = Argument_nul) then
177
                             locked <= true;
203
                             locked <= true;
187
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
213
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
188
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
214
                     Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
189
                 else
215
                 else
216
+                    -- CAS GENERAL : On transmet l'instruction et les opérandes, si elle est critique en ecriture, on enregistre le registre associé dans le tableau
190
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
217
                     C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
191
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
218
                     B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
192
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
219
                     A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
197
                     Pointeur_Instruction <= Pointeur_Instruction + 1;
224
                     Pointeur_Instruction <= Pointeur_Instruction + 1;
198
                 end if;
225
                 end if;
199
             else 
226
             else 
227
+                -- Si besoin de bulle, on l'injecte
200
                 C <= Argument_nul;
228
                 C <= Argument_nul;
201
                 B <= Argument_nul;
229
                 B <= Argument_nul;
202
                 A <= Argument_nul;
230
                 A <= Argument_nul;
206
     end process;
234
     end process;
207
     
235
     
208
     
236
     
209
-    -- Condition degueu -> Instruction critique en lecture simple qui lit dans B et B dans tableau ou instruction critique en lecture double qui lit dans C et C dans tableau 
237
+    -- Condition horrible -> Instruction critique en lecture sur A qui lit dans A=i et Ri dans tableau ou instruction critique en lecture sur B qui lit dans B=j et Rj dans tableau ou instruction critique en lecture sur C qui lit dans C=k et Rk dans tableau 
210
     bulles <= 
238
     bulles <= 
211
     (
239
     (
212
         (
240
         (
213
-            Instructions_critiques_lecture_A(to_integer(unsigned(Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits)))) = '1'
241
+            Instructions_critiques_lecture_A(to_integer(unsigned(Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits)))) = '1' -- Intruction critique sur A
214
         )
242
         )
215
         and 
243
         and 
216
         (
244
         (
217
-            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(1))
245
+            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(1)) -- A est
218
             or 
246
             or 
219
-            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(2))
247
+            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(2)) --        dans le 
220
             or 
248
             or 
221
-            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(3))
249
+            (to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits))) = Tableau(3)) --                  tableau
222
         )
250
         )
223
     ) 
251
     ) 
224
     or 
252
     or 
250
         )
278
         )
251
     );
279
     );
252
     
280
     
253
-    
281
+    -- Gestion de l'écriture/lecture dans la mémoire des adresses de retour
254
     R_Aux <= '1' when Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_RET else
282
     R_Aux <= '1' when Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_RET else
255
              '0';
283
              '0';
256
     W_Aux <= '1' when Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_instruction_CALL else
284
     W_Aux <= '1' when Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_instruction_CALL else
257
              '0';
285
              '0';
286
+             
287
+             
258
     Pointeur_instruction_next <= Pointeur_instruction + 1;
288
     Pointeur_instruction_next <= Pointeur_instruction + 1;
259
 end Behavioral;
289
 end Behavioral;

+ 49
- 34
Processeur.srcs/sources_1/new/Etage2-5_Registres.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 18.04.2021 21:19:41
5
 -- Create Date: 18.04.2021 21:19:41
4
 -- Module Name: Etage2_5_Registres - Behavioral
6
 -- Module Name: Etage2_5_Registres - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Etage 2 et 5 du processeur
11
+--     - Gestion des registres, lecture étage 2 et écriture étage 5
12
+--     - Lecture et Ecriture dans les entrées sorties du processeur
5
 -- 
13
 -- 
6
 -- Dependencies: 
14
 -- Dependencies: 
15
+--    - BancRegistres
16
+--    - LC
17
+--    - MUX
7
 ----------------------------------------------------------------------------------
18
 ----------------------------------------------------------------------------------
8
 
19
 
9
 
20
 
10
 library IEEE;
21
 library IEEE;
11
 use IEEE.STD_LOGIC_1164.ALL;
22
 use IEEE.STD_LOGIC_1164.ALL;
12
 
23
 
13
---use IEEE.NUMERIC_STD.ALL;
14
-
15
---library UNISIM;
16
---use UNISIM.VComponents.all;
17
-
18
 entity Etage2_5_Registres is
24
 entity Etage2_5_Registres is
19
-    Generic ( Nb_bits : Natural;
20
-              Nb_registres : Natural;
21
-              Addr_registres_size : Natural;
22
-              Instruction_bus_size : Natural;
23
-              Bits_Controle_LC_5 : STD_LOGIC_VECTOR;
24
-              Bits_Controle_MUX_2_A : STD_LOGIC_VECTOR;
25
-              Bits_Controle_MUX_2_B : STD_LOGIC_VECTOR;
26
-              Code_Instruction_PRI : STD_LOGIC_VECTOR;
27
-              Code_Instruction_GET : STD_LOGIC_VECTOR);
28
-    Port ( CLK : in STD_LOGIC;
29
-           RST : in STD_LOGIC;
30
-           STD_IN : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
31
-           STD_OUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
32
-           IN_2_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
33
-           IN_2_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
34
-           IN_2_C : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
35
-           IN_2_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0);
36
-           OUT_2_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
37
-           OUT_2_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
38
-           OUT_2_C : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
39
-           OUT_2_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0);
40
-           IN_5_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
41
-           IN_5_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
42
-           IN_5_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0));
25
+    Generic ( Nb_bits : Natural; -- Taille d'un mot binaire
26
+              Nb_registres : Natural; -- Nombre de registres du processeurs
27
+              Addr_registres_size : Natural; -- Nombre de bits pour adresser les registres
28
+              Instruction_bus_size : Natural; -- Nombre de bits du bus d'instruction (Taille d'un code instruction)
29
+              Bits_Controle_LC_5 : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le Link Controler de l'étage 5 (cf LC.vhd)
30
+              Bits_Controle_MUX_2_A : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le multiplexeur de l'étage 2 sur A (cf MUX.vhd)
31
+              Bits_Controle_MUX_2_B : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le multiplexeur de l'étage 2 sur B (cf MUX.vhd)
32
+              Code_Instruction_PRI : STD_LOGIC_VECTOR;  -- Numéro de l'instruction PRI
33
+              Code_Instruction_GET : STD_LOGIC_VECTOR); -- Numéro de l'instruction GET
34
+    Port ( CLK : in STD_LOGIC; -- Clock
35
+           RST : in STD_LOGIC; -- Reset
36
+           STD_IN : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de données depuis l'exterieur du processeur
37
+           STD_OUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de données vers l'exterieur du processeur
38
+           IN_2_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande A de l'étage 2
39
+           IN_2_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande B de l'étage 2
40
+           IN_2_C : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande C de l'étage 2
41
+           IN_2_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0); -- Entrée de l'instruction de l'étage 2
42
+           OUT_2_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande A de l'étage 2
43
+           OUT_2_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande B de l'étage 2
44
+           OUT_2_C : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande C de l'étage 2
45
+           OUT_2_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0); -- Sortie de l'instruction de l'étage 2
46
+           IN_5_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande A de l'étage 5
47
+           IN_5_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande B de l'étage 5
48
+           IN_5_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0)); -- Entrée de l'instruction de l'étage 5
43
 end Etage2_5_Registres;
49
 end Etage2_5_Registres;
44
 
50
 
45
 architecture Behavioral of Etage2_5_Registres is
51
 architecture Behavioral of Etage2_5_Registres is
94
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
84
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
95
     end component;
85
     end component;
96
     
86
     
97
-    signal Commande_BancRegistres : STD_LOGIC_VECTOR (0 downto 0) := "0";
98
-    signal Entree_BancRegistre_DATA : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
99
-    signal Sortie_BancRegistres_A : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
100
-    signal Sortie_BancRegistres_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
87
+    signal Commande_BancRegistres : STD_LOGIC_VECTOR (0 downto 0) := "0"; -- Signal de sortie du LC
88
+    
89
+    signal Entree_BancRegistre_DATA : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0'); -- Entrée DATA du banc de registre (B de l'étage 5 ou STD_IN)
90
+    
91
+    signal Sortie_BancRegistres_A : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0'); -- Sortie du banc de registre a passer par le multiplexeur sur A
92
+    signal Sortie_BancRegistres_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0'); -- Sortie du banc de registre a passer par le multiplexeur sur B
93
+    
94
+    -- Signaux internes
101
     signal intern_OUT_2_A : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
95
     signal intern_OUT_2_A : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
102
     signal intern_OUT_2_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
96
     signal intern_OUT_2_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
103
     signal intern_OUT_2_C : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
97
     signal intern_OUT_2_C : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
153
                intern_OUT_2_C;
147
                intern_OUT_2_C;
154
     OUT_2_Instruction <= (others => '0') when RST = '0' else
148
     OUT_2_Instruction <= (others => '0') when RST = '0' else
155
                          IN_2_Instruction;    
149
                          IN_2_Instruction;    
156
-      
150
+     
151
+    -- Gestion de STD_OU (peut être améliorée) 
157
     process 
152
     process 
158
     begin
153
     begin
154
+        -- Synchronisation sur la clock
159
         wait until CLK'event and CLK = '1';
155
         wait until CLK'event and CLK = '1';
160
         if (RST = '0') then
156
         if (RST = '0') then
161
             intern_STD_OUT <= (others => '0');
157
             intern_STD_OUT <= (others => '0');
168
     STD_OUT <= intern_STD_OUT when RST = '1' else
164
     STD_OUT <= intern_STD_OUT when RST = '1' else
169
                (others => '0');
165
                (others => '0');
170
     
166
     
167
+    
168
+    
169
+    -- Un multiplexeur pourrait être utilisé ici, mais cela n'a pas été jugé pertinent
171
     Entree_BancRegistre_DATA <= (others => '0') when RST = '0' else
170
     Entree_BancRegistre_DATA <= (others => '0') when RST = '0' else
172
                                 STD_IN when IN_2_Instruction = Code_Instruction_GET else
171
                                 STD_IN when IN_2_Instruction = Code_Instruction_GET else
173
                                 IN_5_B;
172
                                 IN_5_B;

+ 36
- 21
Processeur.srcs/sources_1/new/Etage3_Calcul.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
5
+-- Create Date: 18.04.2021 21:19:41 
6
+-- Module Name: Etage3_Calcul - Structural
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+--
11
+-- Description: Etage 3 du processeur
12
+--     - Gestion de l'ALU
3
 -- 
13
 -- 
4
 -- Dependencies: 
14
 -- Dependencies: 
15
+--    - ALU
16
+--    - LC
17
+--    - MUX
18
+--
19
+-- Additional Comments: Etage assynchrone
5
 ----------------------------------------------------------------------------------
20
 ----------------------------------------------------------------------------------
6
 
21
 
7
 
22
 
8
 library IEEE;
23
 library IEEE;
9
 use IEEE.STD_LOGIC_1164.ALL;
24
 use IEEE.STD_LOGIC_1164.ALL;
10
 
25
 
11
---use IEEE.NUMERIC_STD.ALL;
12
-
13
---library UNISIM;
14
---use UNISIM.VComponents.all;
15
-
16
 entity Etage3_Calcul is
26
 entity Etage3_Calcul is
17
-    Generic ( Nb_bits : Natural;
18
-              Instruction_bus_size : Natural;
19
-              Bits_Controle_LC : STD_LOGIC_VECTOR;
20
-              Bits_Controle_MUX : STD_LOGIC_VECTOR);
21
-    Port ( RST : in STD_LOGIC;
22
-           IN_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
23
-           IN_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
24
-           IN_C : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
25
-           IN_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0);
26
-           OUT_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
27
-           OUT_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
28
-           OUT_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0);
29
-           N : out STD_LOGIC;
30
-           O : out STD_LOGIC;
31
-           Z : out STD_LOGIC;
32
-           C : out STD_LOGIC);
27
+    Generic ( Nb_bits : Natural; -- Taille d'un mot binaire
28
+              Instruction_bus_size : Natural; -- Nombre de bits du bus d'instruction (Taille d'un code instruction)
29
+              Bits_Controle_LC : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le Link Controler (cf LC.vhd)
30
+              Bits_Controle_MUX : STD_LOGIC_VECTOR); -- Vecteur de bit controlant le multiplexeur (cf MUX.vhd)
31
+    Port ( RST : in STD_LOGIC; -- Reset
32
+           IN_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande A
33
+           IN_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande B
34
+           IN_C : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande C
35
+           IN_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0); -- Entrée de l'instruction
36
+           OUT_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande A
37
+           OUT_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande B
38
+           OUT_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0); -- Sortie de l'instruction
39
+           N : out STD_LOGIC; -- Flag Negative
40
+           O : out STD_LOGIC; -- Flag Overload
41
+           Z : out STD_LOGIC; -- Flag Zero
42
+           C : out STD_LOGIC);-- Flag Carry
33
 end Etage3_Calcul;
43
 end Etage3_Calcul;
34
 
44
 
35
 architecture Structural of Etage3_Calcul is
45
 architecture Structural of Etage3_Calcul is
81
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
73
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
82
     end component;
74
     end component;
83
     
75
     
76
+    -- Sortie du Link Controleur commandant l'ALU
84
     signal OP_ALU : STD_LOGIC_VECTOR (2 downto 0) := (others => '0');
77
     signal OP_ALU : STD_LOGIC_VECTOR (2 downto 0) := (others => '0');
78
+    
79
+    -- Sortie de l'ALU, a passer au multiplexeur
85
     signal Sortie_ALU : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
80
     signal Sortie_ALU : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
86
     
81
     
82
+    
83
+    -- signaux internes
87
     signal intern_OUT_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
84
     signal intern_OUT_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
88
     signal intern_N : STD_LOGIC := '0';
85
     signal intern_N : STD_LOGIC := '0';
89
     signal intern_O : STD_LOGIC := '0';
86
     signal intern_O : STD_LOGIC := '0';

+ 54
- 37
Processeur.srcs/sources_1/new/Etage4_Memoire.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 18.04.2021 21:19:41
5
 -- Create Date: 18.04.2021 21:19:41
6
+-- Module Name: Etage4_Memoire - Structural
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+--
11
+-- Description: Etage 4 du processeur
12
+--     - Gestion de la mémoire
13
+--     - Gestion de la sauvegarde du contexte lors des appels de fonction
4
 -- 
14
 -- 
5
 -- Dependencies: 
15
 -- Dependencies: 
16
+--    - MemoireDonnees
17
+--    - MemoireAdressesRetour
18
+--    - LC
19
+--    - MUX
6
 ----------------------------------------------------------------------------------
20
 ----------------------------------------------------------------------------------
7
 
21
 
8
 
22
 
23
 use IEEE.STD_LOGIC_1164.ALL;
24
 use IEEE.STD_LOGIC_1164.ALL;
24
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
25
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
25
 
26
 
26
-
27
---library UNISIM;
28
---use UNISIM.VComponents.all;
29
-
30
 entity Etage4_Memoire is
27
 entity Etage4_Memoire is
31
-    Generic ( Nb_bits : Natural;
32
-              Mem_size : Natural;
33
-              Adresse_mem_size : Natural;
34
-              Instruction_bus_size : Natural;
35
-              Mem_EBP_size : Natural;
36
-              Adresse_size_mem_EBP : Natural;
37
-              Bits_Controle_LC : STD_LOGIC_VECTOR;
38
-              Bits_Controle_MUX_IN : STD_LOGIC_VECTOR;
39
-              Bits_Controle_MUX_IN_EBP : STD_LOGIC_VECTOR;
40
-              Bits_Controle_MUX_OUT : STD_LOGIC_VECTOR;
41
-              Code_Instruction_CALL : STD_LOGIC_VECTOR;
42
-              Code_Instruction_RET : STD_LOGIC_VECTOR);
43
-    Port ( CLK : in STD_LOGIC;
44
-           RST : in STD_LOGIC;
45
-           IN_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
46
-           IN_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
47
-           IN_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0);
48
-           OUT_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
49
-           OUT_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
50
-           OUT_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0));
28
+    Generic ( Nb_bits : Natural; -- Taille d'un mot binaire
29
+              Mem_size : Natural; -- Taille de la mémoire de donnees (nombre de mots binaires stockables)
30
+              Adresse_mem_size : Natural; -- Nombre de bits pour adresser la mémoire de donnees
31
+              Instruction_bus_size : Natural; -- Nombre de bits du bus d'instruction (Taille d'un code instruction)
32
+              Mem_EBP_size : Natural; -- Taille de la mémoire du contexte (profondeur d'appel maximale)
33
+              Adresse_size_mem_EBP : Natural; -- Nombre de bits pour adresser la mémoire de contexte
34
+              Bits_Controle_LC : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le Link Controler (cf LC.vhd)
35
+              Bits_Controle_MUX_IN : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le multiplexer selectionnant A ou B comme adresse (cf MUX.vhd)
36
+              Bits_Controle_MUX_IN_EBP : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le multiplexer selectionnant si on doit ajouter ou non EBP à l'adresse (cf MUX.vhd)
37
+              Bits_Controle_MUX_OUT : STD_LOGIC_VECTOR; -- Vecteur de bit controlant le multiplexer de sortie (cf MUX.vhd)
38
+              Code_Instruction_CALL : STD_LOGIC_VECTOR; -- Numéro de l'instruction CALL
39
+              Code_Instruction_RET : STD_LOGIC_VECTOR); -- Numéro de l'instruction RET
40
+    Port ( CLK : in STD_LOGIC; -- Clock
41
+           RST : in STD_LOGIC; -- Reset
42
+           IN_A : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande A
43
+           IN_B : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée de l'opérande B
44
+           IN_Instruction : in STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0); -- Entrée de l'instruction
45
+           OUT_A : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande A
46
+           OUT_B : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Sortie de l'opérande B
47
+           OUT_Instruction : out STD_LOGIC_VECTOR (Instruction_bus_size - 1 downto 0)); -- Sortie de l'instruction
51
 end Etage4_Memoire;
48
 end Etage4_Memoire;
52
 
49
 
53
 architecture Structural of Etage4_Memoire is
50
 architecture Structural of Etage4_Memoire is
100
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
92
                OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
101
     end component;
93
     end component;
102
     
94
     
103
-    signal Addr_MemoireDonnees : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0');
104
-    signal IN_Addr_MemoireDonnees : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0');
105
-    signal Addr_MemoireDonnees_EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0');
106
-    signal Commande_MemoireDonnees : STD_LOGIC_VECTOR (0 downto 0) := "0";
107
-    signal Sortie_MemoireDonnees : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
108
-    signal intern_OUT_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0');
109
-    signal EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0');
110
-    signal New_EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0');
95
+    
96
+    signal EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0'); -- EBP (offset à ajouter à l'adresse)
97
+    signal New_EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0'); -- Nouvelle valeur d'EBP, a stocker lors d'un CALL (Cf fonctionnement MemoireAdressesRetour.vhd)
98
+    
99
+    signal Addr_MemoireDonnees : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0'); -- Adresse entrante dans le composant de mémoire de donnees
100
+    signal IN_Addr_MemoireDonnees : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0'); -- Sortie du mux de choix d'adresse entre A et B
101
+    signal Addr_MemoireDonnees_EBP : STD_LOGIC_VECTOR (Adresse_mem_size - 1 downto 0) := (others => '0'); -- Adresse avec EBP ajouté (IN_Addr_MemoireDonnees + BP)
102
+    
103
+    signal Commande_MemoireDonnees : STD_LOGIC_VECTOR (0 downto 0) := "0"; -- Sortie du Link Controler, signal de commande de la mémoire
104
+    
105
+    signal Sortie_MemoireDonnees : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0'); -- Sortie de la mémoire (a multiplexer)
106
+    
107
+    signal intern_OUT_B : STD_LOGIC_VECTOR (Nb_bits - 1 downto 0) := (others => '0'); -- Signal interne
108
+    
109
+    -- Signaux de la memoire de contexte
111
     signal R_Aux : STD_LOGIC := '0';
110
     signal R_Aux : STD_LOGIC := '0';
112
     signal W_Aux : STD_LOGIC := '0';
111
     signal W_Aux : STD_LOGIC := '0';
113
     signal E : STD_LOGIC;
112
     signal E : STD_LOGIC;
115
     
114
     
116
     
115
     
117
 begin
116
 begin
118
-    instance_LC : LC
117
+    instance_LC : LC -- Link controleur sur la mémoire de donnees
119
     generic map (Instruction_Vector_Size => Instruction_bus_size,
118
     generic map (Instruction_Vector_Size => Instruction_bus_size,
120
                  Command_size => 1,
119
                  Command_size => 1,
121
                  Bits_Controle => Bits_Controle_LC)
120
                  Bits_Controle => Bits_Controle_LC)
122
     port map (   Instruction => IN_Instruction,
121
     port map (   Instruction => IN_Instruction,
123
                  Commande => Commande_MemoireDonnees);
122
                  Commande => Commande_MemoireDonnees);
124
                  
123
                  
125
-    instance_MUX_IN : MUX
124
+    instance_MUX_IN : MUX -- Multiplexeur selectionnant A ou B pour adresse
126
     generic map (Nb_bits => Adresse_mem_size,
125
     generic map (Nb_bits => Adresse_mem_size,
127
                  Instruction_Vector_Size => Instruction_bus_size,
126
                  Instruction_Vector_Size => Instruction_bus_size,
128
                  Bits_Controle => Bits_Controle_MUX_IN)
127
                  Bits_Controle => Bits_Controle_MUX_IN)
131
                  IN2 => IN_B (Adresse_mem_size - 1 downto 0),
130
                  IN2 => IN_B (Adresse_mem_size - 1 downto 0),
132
                  OUTPUT => IN_Addr_MemoireDonnees);
131
                  OUTPUT => IN_Addr_MemoireDonnees);
133
                  
132
                  
134
-    instance_MUX_IN_EBP : MUX
133
+    instance_MUX_IN_EBP : MUX -- Multiplexeur selectionnant l'adresse plus EBP ou l'adresse de base
135
     generic map (Nb_bits => Adresse_mem_size,
134
     generic map (Nb_bits => Adresse_mem_size,
136
                  Instruction_Vector_Size => Instruction_bus_size,
135
                  Instruction_Vector_Size => Instruction_bus_size,
137
                  Bits_Controle => Bits_Controle_MUX_IN_EBP)
136
                  Bits_Controle => Bits_Controle_MUX_IN_EBP)
140
                  IN2 => Addr_MemoireDonnees_EBP,
139
                  IN2 => Addr_MemoireDonnees_EBP,
141
                  OUTPUT => Addr_MemoireDonnees);
140
                  OUTPUT => Addr_MemoireDonnees);
142
                  
141
                  
143
-    instance_MUX_OUT : MUX
142
+    instance_MUX_OUT : MUX -- Multiplexeur selectionnant la sortie de l'étage (sur B)
144
     generic map (Nb_bits => Nb_bits,
143
     generic map (Nb_bits => Nb_bits,
145
                  Instruction_Vector_Size => Instruction_bus_size,
144
                  Instruction_Vector_Size => Instruction_bus_size,
146
                  Bits_Controle => Bits_Controle_MUX_OUT)
145
                  Bits_Controle => Bits_Controle_MUX_OUT)
182
     OUT_Instruction <= (others => '0') when RST = '0' else
181
     OUT_Instruction <= (others => '0') when RST = '0' else
183
              IN_Instruction;
182
              IN_Instruction;
184
              
183
              
185
-    
184
+    -- Controle de la mémoire de contexte (ici aussi un LC aurait été disproportionné)
186
     R_Aux <= '1' when IN_Instruction = Code_Instruction_RET else
185
     R_Aux <= '1' when IN_Instruction = Code_Instruction_RET else
187
              '0';
186
              '0';
188
     W_Aux <= '1' when IN_Instruction = Code_Instruction_CALL else
187
     W_Aux <= '1' when IN_Instruction = Code_Instruction_CALL else

+ 23
- 9
Processeur.srcs/sources_1/new/LC.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 17.04.2021 21:49:57
5
 -- Create Date: 17.04.2021 21:49:57
4
 -- Module Name: LC - Behavioral
6
 -- Module Name: LC - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Link Controler
5
 -- 
11
 -- 
12
+-- Dependencies: None
13
+--
14
+-- Comments : 
15
+--    - Associe une commande a l'instruction courante
16
+--    - A l'instruction i est renvoyé le ieme paquet de taille Command_size
17
+--
18
+-- Exemple : 
19
+--    - Soit le vecteur de bits de controle "010010100111" avec command size a 3
20
+--    - Pour l'instruction 0 sera renvoyé "111"
21
+--    - Pour l'instruction 1 sera renvoyé "100"
22
+--    - Pour l'instruction 2 sera renvoyé "010"
23
+--    - Pour l'instruction 3 sera renvoyé "010"
6
 ----------------------------------------------------------------------------------
24
 ----------------------------------------------------------------------------------
7
 
25
 
8
 
26
 
9
 library IEEE;
27
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
28
 use IEEE.STD_LOGIC_1164.ALL;
11
-
12
 use IEEE.NUMERIC_STD.ALL;
29
 use IEEE.NUMERIC_STD.ALL;
13
 
30
 
14
---library UNISIM;
15
---use UNISIM.VComponents.all;
16
-
17
 entity LC is
31
 entity LC is
18
-    Generic (Instruction_Vector_Size : Natural;
19
-            Command_size : Natural;
20
-            Bits_Controle : STD_LOGIC_VECTOR);
21
-    Port ( Instruction : in STD_LOGIC_VECTOR (Instruction_Vector_Size - 1 downto 0);
22
-           Commande : out STD_LOGIC_VECTOR (Command_size - 1 downto 0));
32
+    Generic (Instruction_Vector_Size : Natural; -- Nombres de bits nécessaires pour coder les instructions
33
+            Command_size : Natural; -- Nombre de bits de la commande en sortie
34
+            Bits_Controle : STD_LOGIC_VECTOR); -- Vecteur de bit contenant les commandes
35
+    Port ( Instruction : in STD_LOGIC_VECTOR (Instruction_Vector_Size - 1 downto 0); -- Instrcution courante
36
+           Commande : out STD_LOGIC_VECTOR (Command_size - 1 downto 0)); -- Sortie de la commande
23
 end LC;
37
 end LC;
24
 
38
 
25
 architecture Behavioral of LC is
39
 architecture Behavioral of LC is

+ 20
- 11
Processeur.srcs/sources_1/new/MUX.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 17.04.2021 21:49:57
5
 -- Create Date: 17.04.2021 21:49:57
4
 -- Module Name: MUX - Behavioral
6
 -- Module Name: MUX - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Multiplexeur
5
 -- 
11
 -- 
12
+-- Dependencies: None
13
+--
14
+-- Comments : 
15
+--    - Le multiplexeur selectionne une des deux entrées qu'il repercute en sortie en fonction de l'instruction
16
+--    - Les Bits_Controle definissent cette sélection : 
17
+--          Si Bits_Controle(Instruction) = '1' alors la première entrée est selectionnée
18
+--          Sinon, la seconde
6
 ----------------------------------------------------------------------------------
19
 ----------------------------------------------------------------------------------
7
 
20
 
8
 
21
 
9
 library IEEE;
22
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
23
 use IEEE.STD_LOGIC_1164.ALL;
11
-
12
 use IEEE.NUMERIC_STD.ALL;
24
 use IEEE.NUMERIC_STD.ALL;
13
 
25
 
14
---library UNISIM;
15
---use UNISIM.VComponents.all;
16
-
17
 entity MUX is
26
 entity MUX is
18
-    Generic (Nb_bits : Natural;
19
-            Instruction_Vector_Size : Natural;
20
-            Bits_Controle : STD_LOGIC_VECTOR);
21
-    Port ( Instruction : in STD_LOGIC_VECTOR (Instruction_Vector_Size - 1 downto 0);
22
-           IN1 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
23
-           IN2 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
24
-           OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
27
+    Generic (Nb_bits : Natural; -- Taille d'un mot en entrée
28
+            Instruction_Vector_Size : Natural; -- Nombres de bits nécessaires pour coder les instructions
29
+            Bits_Controle : STD_LOGIC_VECTOR); -- Vecteur de bit controlant le multiplexeur
30
+    Port ( Instruction : in STD_LOGIC_VECTOR (Instruction_Vector_Size - 1 downto 0); -- Instrcution courante
31
+           IN1 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée 1
32
+           IN2 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0); -- Entrée 2
33
+           OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0)); -- Sortie
25
 end MUX;
34
 end MUX;
26
 
35
 
27
 architecture Behavioral of MUX is
36
 architecture Behavioral of MUX is

+ 33
- 17
Processeur.srcs/sources_1/new/MemoireAdressesRetour.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 16.04.2021 14:35:04
5
 -- Create Date: 16.04.2021 14:35:04
4
 -- Module Name: MemoireAdressesRetour - Behavioral
6
 -- Module Name: MemoireAdressesRetour - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Memoire des informations de controle (adresse de retour ou EBP)
5
 -- 
11
 -- 
12
+-- Dependencies: None
13
+--
14
+-- Comments : Cette mémoire fonctionne comme une pile. 
15
+--               - La valeur renvoyée est toujours celle du sommet (D_OUT = sommet de la pile).
16
+--               - Lors d'une écriture, D_IN est empilé
17
+--               - Lors d'une lecture, le sommet de la pile est pop
18
+--
19
+-- Warning : 
20
+--    - On peut revoir le nom (lecture et ecriture)
21
+--    - Flags E et F non fonctionnels
6
 ----------------------------------------------------------------------------------
22
 ----------------------------------------------------------------------------------
7
 
23
 
8
 
24
 
9
 library IEEE;
25
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
26
 use IEEE.STD_LOGIC_1164.ALL;
11
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
27
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
12
-
13
 use IEEE.NUMERIC_STD.ALL;
28
 use IEEE.NUMERIC_STD.ALL;
14
 
29
 
15
---library UNISIM;
16
---use UNISIM.VComponents.all;
17
-
18
 entity MemoireAdressesRetour is
30
 entity MemoireAdressesRetour is
19
-    Generic (Nb_bits : Natural;
20
-             Addr_size : Natural;
21
-             Mem_size : Natural);
22
-    Port ( R : in STD_LOGIC;
23
-           W : in STD_LOGIC;
24
-           D_IN : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
25
-           RST : in STD_LOGIC;
26
-           CLK : in STD_LOGIC;
27
-           D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0');
28
-           E : out STD_LOGIC;
29
-           F : out STD_LOGIC);
31
+    Generic (Nb_bits : Natural; -- Taille d'un mot en memoire (taille d'une adresse de la memoire d'instruction ou d'un mot pour EBP)
32
+             Addr_size : Natural; -- Nombre de bits necessaires pour adresser la mémoire
33
+             Mem_size : Natural); -- Nombre d'éléments stockés en mémoire
34
+    Port ( R : in STD_LOGIC; -- Si R = 1 on pop le sommet
35
+           W : in STD_LOGIC; -- Si W = 1 on push D_IN
36
+           D_IN : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Data entrante
37
+           RST : in STD_LOGIC; -- Reset
38
+           CLK : in STD_LOGIC; -- Clock
39
+           D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0'); -- Sortie du composant (toujours la valeur au sommet)
40
+           E : out STD_LOGIC; -- Flag Empty
41
+           F : out STD_LOGIC);-- Flag Full
30
 end MemoireAdressesRetour;
42
 end MemoireAdressesRetour;
31
 
43
 
32
 architecture Behavioral of MemoireAdressesRetour is
44
 architecture Behavioral of MemoireAdressesRetour is
33
-    signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := (others => '0');
34
-    signal Addr : STD_LOGIC_VECTOR (Addr_size downto 0) := (others => '0');
45
+    signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := (others => '0'); -- Buffer (mémoire)
46
+    signal Addr : STD_LOGIC_VECTOR (Addr_size downto 0) := (others => '0'); -- Signal INTERNE, mémoire non adressable de l'extérieur. Pointe vers le sommet de pile
35
     constant EMPTY : STD_LOGIC_VECTOR (Addr_size downto 0) := (others => '0');
47
     constant EMPTY : STD_LOGIC_VECTOR (Addr_size downto 0) := (others => '0');
36
     constant FULL : STD_LOGIC_VECTOR (Addr_size downto 0) := (Addr_size => '1', others => '0');
48
     constant FULL : STD_LOGIC_VECTOR (Addr_size downto 0) := (Addr_size => '1', others => '0');
37
 begin
49
 begin
38
     process
50
     process
39
     begin
51
     begin
52
+    -- Synchronisation
40
         wait until CLK'event and CLK = '1';
53
         wait until CLK'event and CLK = '1';
41
         if (RST = '0' ) then
54
         if (RST = '0' ) then
42
             MEMORY <= (others => '0');
55
             MEMORY <= (others => '0');
43
             Addr <= (others => '0');
56
             Addr <= (others => '0');
44
         else
57
         else
58
+            -- Push
45
             if (W = '1') then
59
             if (W = '1') then
46
                 MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits - 1) downto Nb_bits * to_integer(unsigned(Addr))) <= D_IN;
60
                 MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits - 1) downto Nb_bits * to_integer(unsigned(Addr))) <= D_IN;
47
                 Addr <= Addr + 1;
61
                 Addr <= Addr + 1;
62
+            -- Pop
48
             elsif (R = '1') then 
63
             elsif (R = '1') then 
49
                 Addr <= Addr - 1;
64
                 Addr <= Addr - 1;
50
             end if;
65
             end if;
73
     F <= '1' when Addr = FULL else
71
     F <= '1' when Addr = FULL else
74
          '0';
72
          '0';
75
          
73
          
74
+    -- Sortie du sommet de pile (ou 0 si pile vide)
76
     D_OUT <= (others => '0') when Addr = EMPTY else
75
     D_OUT <= (others => '0') when Addr = EMPTY else
77
              MEMORY (to_integer(unsigned(Addr)) * Nb_bits - 1 downto Nb_bits * (to_integer(unsigned(Addr)) - 1));
76
              MEMORY (to_integer(unsigned(Addr)) * Nb_bits - 1 downto Nb_bits * (to_integer(unsigned(Addr)) - 1));
78
 end Behavioral;
77
 end Behavioral;

+ 18
- 15
Processeur.srcs/sources_1/new/MemoireDonnees.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 16.04.2021 14:35:04
5
 -- Create Date: 16.04.2021 14:35:04
4
 -- Module Name: MemoireDonnees - Behavioral
6
 -- Module Name: MemoireDonnees - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Memoire des donnees utilisateur
5
 -- 
11
 -- 
12
+-- Dependencies: None
6
 ----------------------------------------------------------------------------------
13
 ----------------------------------------------------------------------------------
7
 
14
 
8
-
9
 library IEEE;
15
 library IEEE;
10
 use IEEE.STD_LOGIC_1164.ALL;
16
 use IEEE.STD_LOGIC_1164.ALL;
11
-
12
 use IEEE.NUMERIC_STD.ALL;
17
 use IEEE.NUMERIC_STD.ALL;
13
 
18
 
14
---library UNISIM;
15
---use UNISIM.VComponents.all;
16
-
17
 entity MemoireDonnees is
19
 entity MemoireDonnees is
18
-    Generic (Nb_bits : Natural;
19
-             Addr_size : Natural;
20
-             Mem_size : Natural);
21
-    Port ( Addr : in STD_LOGIC_VECTOR (Addr_size-1 downto 0);
22
-           RW : in STD_LOGIC;
23
-           D_IN : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0);
24
-           RST : in STD_LOGIC;
25
-           CLK : in STD_LOGIC;
26
-           D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0'));
20
+    Generic (Nb_bits : Natural; -- Taille d'un mot en mémoire 
21
+             Addr_size : Natural; -- Nombre de bits nécessaires a l'adressage de la mémoire
22
+             Mem_size : Natural); -- Nombre de mot stockables
23
+    Port ( Addr : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- L'adresse a laquelle il faut agir
24
+           RW : in STD_LOGIC; -- Ce qu'il faut faire ('1' -> Read, '0' -> Write)
25
+           D_IN : in STD_LOGIC_VECTOR (Nb_bits-1 downto 0); -- Data a ecrire (si RW = 0)
26
+           RST : in STD_LOGIC; -- Reset
27
+           CLK : in STD_LOGIC; -- Clock
28
+           D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0')); -- Sortie de la mémoire 
27
 end MemoireDonnees;
29
 end MemoireDonnees;
28
 
30
 
29
 architecture Behavioral of MemoireDonnees is
31
 architecture Behavioral of MemoireDonnees is
30
-    signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := (others => '0');
32
+    signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := (others => '0'); -- Buffer pour la mémoire
31
 begin
33
 begin
32
     process
34
     process
33
     begin
35
     begin
58
         end if;
43
         end if;
59
     end process;
44
     end process;
60
     
45
     
46
+    -- Lecture assynchrone et en permanence
61
     D_OUT <= MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(Addr)));
47
     D_OUT <= MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(Addr)));
62
 end Behavioral;
48
 end Behavioral;

+ 21
- 10
Processeur.srcs/sources_1/new/MemoireInstructions.vhd
File diff suppressed because it is too large
View File


+ 20
- 7
Processeur.srcs/sources_1/new/System.vhd View File

1
 ----------------------------------------------------------------------------------
1
 ----------------------------------------------------------------------------------
2
+-- Company:  INSA-Toulouse
3
+-- Engineer: Paul Faure
2
 -- 
4
 -- 
3
 -- Create Date: 13.04.2021 10:19:15
5
 -- Create Date: 13.04.2021 10:19:15
4
 -- Module Name: System - Behavioral
6
 -- Module Name: System - Behavioral
7
+-- Project Name: Processeur sécurisé
8
+-- Target Devices: Basys 3 ARTIX7
9
+-- Tool Versions: Vivado 2016.4
10
+-- Description: Environnement du processeur, mapping entre le processeur et la carte
5
 -- 
11
 -- 
6
 -- Dependencies: 
12
 -- Dependencies: 
13
+--    - Clock_Divider
14
+--    - Pipeline
7
 ----------------------------------------------------------------------------------
15
 ----------------------------------------------------------------------------------
8
 
16
 
9
 
17
 
10
 library IEEE;
18
 library IEEE;
11
 use IEEE.STD_LOGIC_1164.ALL;
19
 use IEEE.STD_LOGIC_1164.ALL;
12
 
20
 
13
---use IEEE.NUMERIC_STD.ALL;
14
-
15
---library UNISIM;
16
---use UNISIM.VComponents.all;
17
-
21
+-- Lien avec le fichier de contraintes 
22
+--   Récupération des leds pour STD_OUT
23
+--   Récupération des switchs pour STD_IN
24
+--   Récupération d'un bouton pour RST
25
+--   Récupération de la clock
18
 entity System is
26
 entity System is
19
     Port ( led : out STD_LOGIC_VECTOR (7 downto 0);
27
     Port ( led : out STD_LOGIC_VECTOR (7 downto 0);
20
            sw : in STD_LOGIC_VECTOR (7 downto 0);
28
            sw : in STD_LOGIC_VECTOR (7 downto 0);
61
                CLK_OUT : out STD_LOGIC);
53
                CLK_OUT : out STD_LOGIC);
62
     end component;
54
     end component;
63
     
55
     
56
+    -- signaux auxiliaires
64
     signal my_RST : STD_LOGIC;
57
     signal my_RST : STD_LOGIC;
65
     signal my_CLK : STD_LOGIC;
58
     signal my_CLK : STD_LOGIC;
66
     signal buff_CLK : STD_LOGIC;
59
     signal buff_CLK : STD_LOGIC;
67
         
60
         
68
 begin
61
 begin
62
+    -- Premier diviseur de clock
69
     clk_div : Clock_Divider
63
     clk_div : Clock_Divider
70
     port map (CLK_IN => CLK,
64
     port map (CLK_IN => CLK,
71
               CLK_OUT => buff_CLK);
65
               CLK_OUT => buff_CLK);
72
               
66
               
67
+    -- Second diviseur de clock
73
     clk_div_2 : Clock_Divider
68
     clk_div_2 : Clock_Divider
74
     port map (CLK_IN => buff_CLK,
69
     port map (CLK_IN => buff_CLK,
75
               CLK_OUT => my_CLK);
70
               CLK_OUT => my_CLK);
76
               
71
               
72
+    -- Le processeur, augmentation de la taille de la mémoire d'instruction
77
     instance : Pipeline
73
     instance : Pipeline
78
     generic map (Addr_Memoire_Instruction_Size => 8,
74
     generic map (Addr_Memoire_Instruction_Size => 8,
79
                  Memoire_Instruction_Size => 256)
75
                  Memoire_Instruction_Size => 256)
82
               STD_IN => sw,
78
               STD_IN => sw,
83
               STD_OUT => led);
79
               STD_OUT => led);
84
               
80
               
85
-    my_RST <= '0' when btnC = '1' else
86
-              '1';
81
+    -- Gestion du RST (inversion d'état)
82
+    my_RST <= '1' when btnC = '0' else
83
+              '0';
87
 end Structural;
84
 end Structural;
88
 
85
 

+ 13
- 8
Processeur.xpr View File

3
 <!--                                                         -->
3
 <!--                                                         -->
4
 <!-- Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.   -->
4
 <!-- Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.   -->
5
 
5
 
6
-<Project Version="7" Minor="17" Path="C:/Users/Hp/Documents/TestGITProcesseur/FPGA_PIR/Processeur.xpr">
6
+<Project Version="7" Minor="17" Path="/home/paulfaure/Documents/4A/PSI/Processeur/Processeur.xpr">
7
   <DefaultLaunch Dir="$PRUNDIR"/>
7
   <DefaultLaunch Dir="$PRUNDIR"/>
8
   <Configuration>
8
   <Configuration>
9
     <Option Name="Id" Val="c2fc77f80b2a4a04afc3ac9eb7900c74"/>
9
     <Option Name="Id" Val="c2fc77f80b2a4a04afc3ac9eb7900c74"/>
18
     <Option Name="CompiledLibDirActivehdl" Val="$PCACHEDIR/compile_simlib/activehdl"/>
18
     <Option Name="CompiledLibDirActivehdl" Val="$PCACHEDIR/compile_simlib/activehdl"/>
19
     <Option Name="TargetLanguage" Val="VHDL"/>
19
     <Option Name="TargetLanguage" Val="VHDL"/>
20
     <Option Name="SimulatorLanguage" Val="VHDL"/>
20
     <Option Name="SimulatorLanguage" Val="VHDL"/>
21
-    <Option Name="BoardPart" Val="digilentinc.com:basys3:part0:1.1"/>
21
+    <Option Name="BoardPart" Val=""/>
22
     <Option Name="SourceMgmtMode" Val="DisplayOnly"/>
22
     <Option Name="SourceMgmtMode" Val="DisplayOnly"/>
23
     <Option Name="ActiveSimSet" Val="sim_1"/>
23
     <Option Name="ActiveSimSet" Val="sim_1"/>
24
     <Option Name="DefaultLib" Val="xil_defaultlib"/>
24
     <Option Name="DefaultLib" Val="xil_defaultlib"/>
32
     <Option Name="EnableBDX" Val="FALSE"/>
32
     <Option Name="EnableBDX" Val="FALSE"/>
33
     <Option Name="DSABoardId" Val="basys3"/>
33
     <Option Name="DSABoardId" Val="basys3"/>
34
     <Option Name="DSANumComputeUnits" Val="16"/>
34
     <Option Name="DSANumComputeUnits" Val="16"/>
35
-    <Option Name="WTXSimLaunchSim" Val="231"/>
35
+    <Option Name="WTXSimLaunchSim" Val="234"/>
36
     <Option Name="WTModelSimLaunchSim" Val="0"/>
36
     <Option Name="WTModelSimLaunchSim" Val="0"/>
37
     <Option Name="WTQuestaLaunchSim" Val="0"/>
37
     <Option Name="WTQuestaLaunchSim" Val="0"/>
38
     <Option Name="WTIesLaunchSim" Val="0"/>
38
     <Option Name="WTIesLaunchSim" Val="0"/>
257
     <Simulator Name="Questa">
257
     <Simulator Name="Questa">
258
       <Option Name="Description" Val="Questa Advanced Simulator"/>
258
       <Option Name="Description" Val="Questa Advanced Simulator"/>
259
     </Simulator>
259
     </Simulator>
260
+    <Simulator Name="IES">
261
+      <Option Name="Description" Val="Incisive Enterprise Simulator (IES)"/>
262
+    </Simulator>
263
+    <Simulator Name="VCS">
264
+      <Option Name="Description" Val="Verilog Compiler Simulator (VCS)"/>
265
+    </Simulator>
260
     <Simulator Name="Riviera">
266
     <Simulator Name="Riviera">
261
       <Option Name="Description" Val="Riviera-PRO Simulator"/>
267
       <Option Name="Description" Val="Riviera-PRO Simulator"/>
262
     </Simulator>
268
     </Simulator>
263
-    <Simulator Name="ActiveHDL">
264
-      <Option Name="Description" Val="Active-HDL Simulator"/>
265
-    </Simulator>
266
   </Simulators>
269
   </Simulators>
267
   <Runs Version="1" Minor="10">
270
   <Runs Version="1" Minor="10">
268
-    <Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7a35tcpg236-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" State="current" IncludeInArchive="true">
271
+    <Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7a35tcpg236-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" State="current" Dir="$PRUNDIR/synth_1" IncludeInArchive="true">
269
       <Strategy Version="1" Minor="2">
272
       <Strategy Version="1" Minor="2">
270
         <StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2016"/>
273
         <StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2016"/>
271
         <Step Id="synth_design"/>
274
         <Step Id="synth_design"/>
272
       </Strategy>
275
       </Strategy>
276
+      <GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/>
273
       <Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
277
       <Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
274
     </Run>
278
     </Run>
275
-    <Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7a35tcpg236-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." State="current" SynthRun="synth_1" IncludeInArchive="true">
279
+    <Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7a35tcpg236-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." State="current" Dir="$PRUNDIR/impl_1" SynthRun="synth_1" IncludeInArchive="true">
276
       <Strategy Version="1" Minor="2">
280
       <Strategy Version="1" Minor="2">
277
         <StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2016"/>
281
         <StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2016"/>
278
         <Step Id="init_design"/>
282
         <Step Id="init_design"/>
285
         <Step Id="post_route_phys_opt_design"/>
289
         <Step Id="post_route_phys_opt_design"/>
286
         <Step Id="write_bitstream"/>
290
         <Step Id="write_bitstream"/>
287
       </Strategy>
291
       </Strategy>
292
+      <GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/>
288
       <Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
293
       <Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
289
     </Run>
294
     </Run>
290
   </Runs>
295
   </Runs>

Loading…
Cancel
Save