Index: PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.01/PE.vhd
===================================================================
--- PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.01/PE.vhd	(revision 39)
+++ PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.01/PE.vhd	(revision 41)
@@ -27,10 +27,12 @@
 use work.Packet_type.all;
 use work.MPI_RMA.all;
+-- synthesis translate_off 
 use std.textio.all;
+-- synthesis translate_on
 use IEEE.NUMERIC_STD.ALL;
 
 
 entity PE is
-	Generic (DestId : natural );
+	Generic (DestId : natural:=0 );
     Port ( Instruction : out  STD_LOGIC_VECTOR (Word-1 downto 0);
            Instruction_en : out  STD_LOGIC;
@@ -189,4 +191,5 @@
 	--=======================================================
 	--variables pour la création du fichier de résultats
+		-- synthesis translate_off 
 		type char_file is file of character;
         file f: text;
@@ -196,7 +199,16 @@
 		  variable L: line; 
 		  variable fopened: std_logic:='0';
+		 -- synthesis translate_on
 --======================================================
 	begin
 	--=== Partie combinatoire du process ===================================
+			
+	--=== Fin de la partie combinatoire du process ==========================	
+		
+		    
+           
+        --end loop;
+        
+	if (clk'event and clk='1') then 
 			Libr.Instr_ack<=Core_pushout(0);
 			Libr.InitOk<=Core_pushout(4);
@@ -205,11 +217,5 @@
 			Libr.RamSel<=RamSel;
 			sram.data_out<=PE_ram_do;
-	--=== Fin de la partie combinatoire du process ==========================	
-		
-		    
-           
-        --end loop;
-        
-	if (clk'event and clk='1') then 
+			
 		if reset='1' then
 					RunState<=start;
@@ -237,4 +243,5 @@
 				timeout:=0;
 				dcount<=0;
+			-- synthesis translate_off 
 			if fopened='0' then 
 			file_open(status,f, integer'image(destid) & "test_file0.txt", APPEND_MODE);
@@ -247,5 +254,5 @@
 				fopened:='1';
 			end if;
-			 
+			 -- synthesis translate_on
 			 when Fillmem =>
 				if Ramsel='0' then 
@@ -284,10 +291,12 @@
 		when InitApp =>
 				--code pour Init 
-				dlen:=1;
+				dlen:=251;
 				if ct=0 then
-				write (l,string'("Dlen; ;INIT of Process n°; " & image(MyRank) & "; started at ; " & time'image(now)));
+				-- synthesis translate_off 
+				write (l,string'("Dlen; ;INIT1 " &  integer'image(Dlen)& "; " & image(MyRank) & "; started at ; " & time'image(now)));
 				
 				report l.all;
             writeline (f, l) ;
+				-- synthesis translate_on
 				end if;
 				pMPI_Init(ct,Libr,Clk,SRam);
@@ -300,7 +309,9 @@
 				if ct=0 then 
 					RunState<=GetRank;
-					write (l,string'("Dlen; ;INIT;" & ";  ended at  ; " & time'image(now)));
+					-- synthesis translate_off 
+					write (l,string'("Dlen; ;INIT2 " &  integer'image(Dlen) & ";" & image(MyRank) & ";  ended at  ; " & time'image(now)));
 					report l.all;
 					writeline (f, l) ;  
+					-- synthesis translate_on
 				end if;
 				
@@ -309,8 +320,9 @@
 		when GetRank =>
 		if ct=0 then
-				
-				write (l,string'("Dlen; ; Rank ; " & "; started  ; " & time'image(now)));
+				-- synthesis translate_off 
+				write (l,string'("Dlen; ;Rank1 " &  integer'image(Dlen) & "; ; started  ; " & time'image(now)));
 				report l.all;
             writeline (f, l) ;  
+				-- synthesis translate_on
 			end if;
 			pMPI_Comm_rank(ct,Libr,sram,MPI_COMM_WORLD,MyRank);
@@ -318,7 +330,9 @@
 			if ct=0 then
 				RunState<=PutData;
-				write (l,string'("Dlen; ; Rank ; " & "; ended at  ; " & time'image(now)));
+				-- synthesis translate_off
+				write (l,string'("Dlen; ;Rank2 " &  integer'image(Dlen) & ";" & image(MyRank) & "; ended at  ; " & time'image(now)));
 				report l.all;
-            writeline (f, l) ;  
+            writeline (f, l) ; 
+				-- synthesis translate_on
 			end if;
 			
@@ -331,10 +345,19 @@
 					--dlen:=251; ---
 					if ct=0 then
-					write (l,string'("Dlen;" & integer'image(dlen) & ";Put of Pr n°; " & image(MyRank) & "; started at ; " & time'image(now)));
+					-- synthesis translate_off 
+					write (l,string'("Dlen;" & integer'image(dlen) & ";PUT1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now)));
 					report l.all;
 					writeline (f, l) ; 
+					-- synthesis translate_on
 					end if;
 					if unsigned(MyRank) = 0 then 
+						Destrank:=2;
+						
+					elsif unsigned(MyRank) = 1 then
+						Destrank:=0;
+					elsif unsigned(MyRank) = 2 then
 						Destrank:=1;
+					elsif unsigned(MyRank) = 3 then
+						Destrank:=2;
 					else
 						DestRank:=0;
@@ -343,6 +366,6 @@
 					SrcAdr:=std_logic_vector(to_unsigned(DATAPTR,ADRLEN));
 					DestAdr:=X"2000";
-					
 					pMPI_put(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win);
+					
 					adresse:=to_integer(unsigned(sram.addr_wr));
 					adresse_rd:=to_integer(unsigned(sram.addr_rd));
@@ -353,8 +376,10 @@
 					if ct=0 then
 						RunState<=GetData;
+					-- synthesis translate_off 
 					report "Put of Process n°; " & image(MyRank) & "; ended at ; " & time'image(now);
-					write (l,string'("Dlen;" & integer'image(dlen) & ";Put of Pr n°; " & image(MyRank) & "; ended at time ; " & time'image(now)));
+					write (l,string'("Dlen;" & integer'image(dlen) & ";PUT2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at time ; " & time'image(now)));
 					report l.all;
-					writeline (f, l) ;  																	
+					writeline (f, l) ;
+					-- synthesis translate_on
 					end if;
 					
@@ -363,13 +388,18 @@
 					--dlen:=251; --- 
 					if ct=0 then
-					write (l,string'("Dlen;" & integer'image(dlen) & ";GET of Process n°; " & image(MyRank) & "; started at ; " & time'image(now)));
+					-- synthesis translate_off 
+					write (l,string'("Dlen;" & integer'image(dlen) & ";GET1; " & image(MyRank) & "; started at ; " & time'image(now)));
 					report l.all;
 					writeline (f, l) ; 
+					-- synthesis translate_on
 					end if;
 					
 					SrcAdr:=X"0120";
 					DestAdr:=X"4000";
-					
-					pMPI_GET(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win);
+					if unsigned(MyRank) /= 2 then 
+						pMPI_GET(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win);
+					else
+						RunState<=wincompleted;
+					end if;
 					adresse:=to_integer(unsigned(sram.addr_wr));
 					adresse_rd:=to_integer(unsigned(sram.addr_rd));
@@ -380,17 +410,21 @@
 					if ct=0 then
 						RunState<=wincompleted;
+						-- synthesis translate_off 
 						assert ct/=0 report "GET_END " & integer'image(destrank)
 								severity Warning ;
-						write (l,string'("Dlen ;" & integer'image(dlen) & ";GET of Proc n°; " & image(MyRank) & "; ended at ; " & time'image(now)));
+						write (l,string'("Dlen ;" & integer'image(dlen) & ";GET2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now)));
 					report l.all;
 					
-					writeline (f, l) ;  
+					writeline (f, l) ; 
+						-- synthesis translate_on
 					end if;
 				
 				when WinCompleted =>
 				if ct=0 then
-						write (l,string'("Dlen ;" & integer'image(dlen) & ";Wait of Proc n°; " & image(MyRank) & "; started at ; " & time'image(now)));
+						-- synthesis translate_off 
+						write (l,string'("Dlen ;" & integer'image(dlen) & ";WAIT1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now)));
 						report l.all;
 						writeline (f, l) ; 
+						-- synthesis translate_on 
 					end if;	
 					 pMPI_Win_wait(ct,Libr,sram,MyWin );
@@ -399,7 +433,9 @@
 					if ct=0 then
 						RunState<=finalize;	
-						write (l,string'("Dlen ;" & integer'image(dlen) & ";Wait of Proc n°; " & image(MyRank) & "; ended at ; " & time'image(now)));
+						-- synthesis translate_off 
+						write (l,string'("Dlen ;" & integer'image(dlen) & ";WAIT2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now)));
 						report l.all;
 						writeline (f, l) ;
+						-- synthesis translate_on
 						
 					end if;	  
@@ -408,15 +444,19 @@
 			when finalize =>
 					if ct=0 then
-						write (l,string'("Dlen ;" & integer'image(dlen) & ";Finalize of Proc n°; " & image(MyRank) & "; started at ; " & time'image(now)));
+						-- synthesis translate_off 
+						write (l,string'("Dlen ;" & integer'image(dlen) & ";FINALIZE1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now)));
 						report l.all;
 						writeline (f, l) ; 
+						-- synthesis translate_on
 					end if;	
 					 
 					if ct=0 then
 						RunState<=start;	
-						write (l,string'("Dlen ;" & integer'image(dlen) & ";Finalize of Proc n°; " & image(MyRank) & "; ended at ; " & time'image(now)));
+						-- synthesis translate_off 
+						write (l,string'("Dlen ;" & integer'image(dlen) & ";FINALIZE2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now)));
 						report l.all;
 						writeline (f, l) ;
 						file_close(f);	
+						-- synthesis translate_on 
 					end if;	  
 		
