Browse Source

Optimisation code

Paul Faure 2 years ago
parent
commit
6eca866e43

+ 4
- 24
Processeur.srcs/sources_1/new/Etage1_LectureInstruction.vhd View File

@@ -177,25 +177,13 @@
177 177
                     -- S'il ne faut pas injecter de bulles ont traite l'instruction (Possible code factorisable sur ce if)
178 178
                     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
179 179
                         -- CAS PARTICULIER : CALL ou JMP, on transmet et on saute
180
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
181
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
182
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
183
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
184 180
                         Pointeur_Instruction <= Instruction_courante (2 * Nb_bits + Addr_size_mem_instruction - 1 downto 2 * Nb_bits);
185 181
                     elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_RET) then
186 182
                         -- CAS PARTICULIER : RET, on transmet et on revient 
187
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
188
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
189
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
190
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
191 183
                         Pointeur_Instruction <= Adresse_Retour;
192 184
                     elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_JMZ) then
193 185
                         -- 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
194 186
                         compteur <= compteur + 1;
195
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
196
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
197
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
198
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
199 187
                         if (compteur = 2) then
200 188
                             if (Z = '1') then
201 189
                                 Pointeur_Instruction <= Instruction_courante (2 * Nb_bits + Addr_size_mem_instruction - 1 downto 2 * Nb_bits);
@@ -218,29 +206,21 @@
218 206
                                 compteur <= 0;
219 207
                             end if;
220 208
                         end if;
221
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
222
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
223
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
224
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
225 209
                     elsif (Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits) = Code_Instruction_PRI) then
226 210
                         -- CAS PARTICULIER : PRI, on transmet l'instruction et fixe le compteur pour proteger des collisions
227 211
                         Compteur_PRI <= Nb_bits/4 + 1;
228
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
229
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
230
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
231
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
232 212
                         Pointeur_Instruction <= Pointeur_Instruction + 1;
233 213
                     else
234 214
                         -- CAS GENERAL : On transmet l'instruction et les opérandes, si elle est critique en ecriture, on enregistre le registre associé dans le tableau
235
-                        C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
236
-                        B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
237
-                        A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
238
-                        Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
239 215
                         if (Instructions_critiques_ecriture(to_integer(unsigned(Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits)))) = '1') then
240 216
                             Tableau(1) <= to_integer(unsigned(Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits)));
241 217
                         end if;
242 218
                         Pointeur_Instruction <= Pointeur_Instruction + 1;
243 219
                     end if;
220
+                    C <= Instruction_courante (1 * Nb_bits - 1 downto 0 * Nb_bits);
221
+                    B <= Instruction_courante (2 * Nb_bits - 1 downto 1 * Nb_bits);
222
+                    A <= Instruction_courante (3 * Nb_bits - 1 downto 2 * Nb_bits);
223
+                    Instruction <= Instruction_courante (Instruction_bus_size + 3 * Nb_bits - 1 downto 3 * Nb_bits);
244 224
                 else 
245 225
                     -- Si besoin de bulle, on l'injecte
246 226
                     C <= Argument_nul;

+ 1
- 7
Processeur.srcs/sources_1/new/Etage2-5_Registres.vhd View File

@@ -167,13 +167,7 @@ begin
167 167
     process
168 168
     begin
169 169
         wait until CLK'event and CLK='1';
170
-        if (RST='0') then
171
-            Request_Stopped <= false;
172
-        elsif (STD_IN_Av = '1') then
173
-            Request_Stopped <= true;
174
-        else
175
-            Request_Stopped <= false;
176
-        end if;
170
+        Request_Stopped <= (STD_IN_Av = '1') and (RST = '1');
177 171
     end process;
178 172
     
179 173
    STD_IN_Request <= '1' when not(Request_Stopped) and IN_5_Instruction = Code_Instruction_GET and not(RST='0') else '0';

+ 3
- 3
Processeur.srcs/sources_1/new/Keyboard.vhd View File

@@ -53,7 +53,7 @@ architecture Behavioral of Keyboard is
53 53
     end component;
54 54
     
55 55
     signal buffer_Data : STD_LOGIC_VECTOR (0 to 7);
56
-    signal keyboardControleur_Data_av : STD_LOGIC;
56
+    signal kbCtrl_Data_av : STD_LOGIC;
57 57
     
58 58
     signal intern_Data_av : STD_LOGIC := '0';
59 59
     signal intern_Data : STD_LOGIC_VECTOR (0 to 6) := (others => '0');
@@ -66,7 +66,7 @@ begin
66 66
               PS2Clk => PS2Clk,
67 67
               PS2Data => PS2Data,
68 68
             
69
-              Data_av => keyboardControleur_Data_av,
69
+              Data_av => kbCtrl_Data_av,
70 70
               Data => buffer_Data,
71 71
               
72 72
               alert => alert);
@@ -79,7 +79,7 @@ begin
79 79
     begin
80 80
         wait until CLK'event and CLK = '1';
81 81
         if (intern_Data_av = '0') then
82
-            if (keyboardControleur_Data_av = '1') then
82
+            if (kbCtrl_Data_av = '1') then
83 83
                 Data <= intern_Data;
84 84
                 intern_Data_av <= '1';
85 85
             end if;

+ 1
- 1
Processeur.xpr View File

@@ -35,7 +35,7 @@
35 35
     <Option Name="DSAVendor" Val="xilinx"/>
36 36
     <Option Name="DSABoardId" Val="basys3"/>
37 37
     <Option Name="DSANumComputeUnits" Val="16"/>
38
-    <Option Name="WTXSimLaunchSim" Val="602"/>
38
+    <Option Name="WTXSimLaunchSim" Val="603"/>
39 39
     <Option Name="WTModelSimLaunchSim" Val="0"/>
40 40
     <Option Name="WTQuestaLaunchSim" Val="0"/>
41 41
     <Option Name="WTIesLaunchSim" Val="0"/>

Loading…
Cancel
Save