Index: PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/v0.03/Scheduler.vhd
===================================================================
--- PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/v0.03/Scheduler.vhd	(revision 45)
+++ PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/v0.03/Scheduler.vhd	(revision 65)
@@ -42,9 +42,10 @@
 		
 architecture Behavioral of Scheduler is
+-- signaux pour le pipeline;
+signal Request_latch :STD_LOGIC_VECTOR (number_of_ports*number_of_ports downto 1):=(others=>'0');
+signal Fifo_full_latch : STD_LOGIC_VECTOR (number_of_ports downto 1):=(others=>'0');
+signal priority_rotation_latch : STD_LOGIC_VECTOR (number_of_ports downto 1):=(others=>'1');
+         
 -- composants du scheduler
-
--- composants du scheduler
-
-
 COMPONENT Scheduler2_2
    PORT(
@@ -225,4 +226,46 @@
   Inst_Scheduler2_2 : Scheduler2_2
    PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler2x2; 
+
+--======================scheduler 3 ports=======================
+
+scheduler3x3 : if number_of_ports = 3 generate
+
+  Inst_Scheduler3_3 : Scheduler3_3
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler3x3; 
+
+--======================scheduler 4 ports=======================
+
+scheduler4x4 : if number_of_ports = 4 generate
+
+  Inst_Scheduler4_4 : Scheduler4_4
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler4x4; 
+
+--======================scheduler 5 ports=======================
+
+scheduler5x5 : if number_of_ports = 5 generate
+
+  Inst_Scheduler5_5 : Scheduler5_5
+   PORT MAP(
      Request => Request, 
      Fifo_full => Fifo_full,
@@ -231,11 +274,67 @@
      priority_rotation =>priority_rotation,
      port_grant =>port_grant);
-end generate scheduler2x2; 
-
---======================scheduler 3 ports=======================
-
-scheduler3x3 : if number_of_ports = 3 generate
-
-  Inst_Scheduler3_3 : Scheduler3_3
+end generate scheduler5x5; 
+
+--======================scheduler 6 ports=======================
+
+scheduler6x6 : if number_of_ports = 6 generate
+
+  Inst_Scheduler6_6 : Scheduler6_6
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler6x6; 
+
+--======================scheduler 7 ports=======================
+
+scheduler7x7 : if number_of_ports = 7 generate
+
+  Inst_Scheduler7_7 : Scheduler7_7
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler7x7; 
+
+--======================scheduler 8 ports=======================
+
+scheduler8x8 : if number_of_ports = 8 generate
+
+  Inst_Scheduler8_8 : Scheduler8_8
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler8x8; 
+
+--======================scheduler 9 ports=======================
+
+scheduler9x9 : if number_of_ports = 9 generate
+
+  Inst_Scheduler9_9 : Scheduler9_9
+   PORT MAP(
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
+     port_grant =>port_grant);
+end generate scheduler9x9; 
+
+--======================scheduler 10 ports=======================
+
+scheduler10x10 : if number_of_ports = 10 generate
+
+  Inst_Scheduler10_10 : Scheduler10_10
    PORT MAP(
      Request => Request, 
@@ -245,11 +344,11 @@
      priority_rotation =>priority_rotation,
      port_grant =>port_grant);
-end generate scheduler3x3; 
-
---======================scheduler 4 ports=======================
-
-scheduler4x4 : if number_of_ports = 4 generate
-
-  Inst_Scheduler4_4 : Scheduler4_4
+end generate scheduler10x10; 
+
+--======================scheduler 11 ports=======================
+
+scheduler11x11 : if number_of_ports = 11 generate
+
+  Inst_Scheduler11_11 : Scheduler11_11
    PORT MAP(
      Request => Request, 
@@ -259,102 +358,4 @@
      priority_rotation =>priority_rotation,
      port_grant =>port_grant);
-end generate scheduler4x4; 
-
---======================scheduler 5 ports=======================
-
-scheduler5x5 : if number_of_ports = 5 generate
-
-  Inst_Scheduler5_5 : Scheduler5_5
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler5x5; 
-
---======================scheduler 6 ports=======================
-
-scheduler6x6 : if number_of_ports = 6 generate
-
-  Inst_Scheduler6_6 : Scheduler6_6
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler6x6; 
-
---======================scheduler 7 ports=======================
-
-scheduler7x7 : if number_of_ports = 7 generate
-
-  Inst_Scheduler7_7 : Scheduler7_7
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler7x7; 
-
---======================scheduler 8 ports=======================
-
-scheduler8x8 : if number_of_ports = 8 generate
-
-  Inst_Scheduler8_8 : Scheduler8_8
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler8x8; 
-
---======================scheduler 9 ports=======================
-
-scheduler9x9 : if number_of_ports = 9 generate
-
-  Inst_Scheduler9_9 : Scheduler9_9
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler9x9; 
-
---======================scheduler 10 ports=======================
-
-scheduler10x10 : if number_of_ports = 10 generate
-
-  Inst_Scheduler10_10 : Scheduler10_10
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
-end generate scheduler10x10; 
-
---======================scheduler 11 ports=======================
-
-scheduler11x11 : if number_of_ports = 11 generate
-
-  Inst_Scheduler11_11 : Scheduler11_11
-   PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
-     port_grant =>port_grant);
 end generate scheduler11x11; 
 
@@ -365,9 +366,9 @@
   Inst_Scheduler12_12 : Scheduler12_12
    PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
      port_grant =>port_grant);
 end generate scheduler12x12; 
@@ -379,9 +380,9 @@
   Inst_Scheduler13_13 : Scheduler13_13
    PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
      port_grant =>port_grant);
 end generate scheduler13x13; 
@@ -393,9 +394,9 @@
   Inst_Scheduler14_14 : Scheduler14_14
    PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
      port_grant =>port_grant);
 end generate scheduler14x14; 
@@ -407,9 +408,9 @@
   Inst_Scheduler15_15 : Scheduler15_15
    PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
      port_grant =>port_grant);
 end generate scheduler15x15; 
@@ -421,12 +422,25 @@
   Inst_Scheduler16_16 : Scheduler16_16
    PORT MAP(
-     Request => Request, 
-     Fifo_full => Fifo_full,
-     clk => clk ,
-     reset =>reset,
-     priority_rotation =>priority_rotation,
+     Request => Request_latch, 
+     Fifo_full => Fifo_full_latch,
+     clk => clk ,
+     reset =>reset,
+     priority_rotation =>priority_rotation_latch,
      port_grant =>port_grant);
 end generate scheduler16x16; 
-
+Sched:process (clk,reset)
+begin
+if rising_edge(clk) then
+	if reset='1' then
+		request_latch<=(others=>'0');
+		Fifo_full_latch<=(others=>'0');
+		priority_rotation_latch<=(others=>'1');
+	else
+		request_latch<=request;
+		Fifo_full_latch<=fifo_full;
+		priority_rotation_latch<=priority_rotation;
+	end if;
+end if;
+end process sched;
 end Behavioral;
 
