Changeset 41 for PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.01/PE.vhd
- Timestamp:
- Dec 20, 2012, 3:42:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.01/PE.vhd
r39 r41 27 27 use work.Packet_type.all; 28 28 use work.MPI_RMA.all; 29 -- synthesis translate_off 29 30 use std.textio.all; 31 -- synthesis translate_on 30 32 use IEEE.NUMERIC_STD.ALL; 31 33 32 34 33 35 entity PE is 34 Generic (DestId : natural );36 Generic (DestId : natural:=0 ); 35 37 Port ( Instruction : out STD_LOGIC_VECTOR (Word-1 downto 0); 36 38 Instruction_en : out STD_LOGIC; … … 189 191 --======================================================= 190 192 --variables pour la création du fichier de résultats 193 -- synthesis translate_off 191 194 type char_file is file of character; 192 195 file f: text; … … 196 199 variable L: line; 197 200 variable fopened: std_logic:='0'; 201 -- synthesis translate_on 198 202 --====================================================== 199 203 begin 200 204 --=== Partie combinatoire du process =================================== 205 206 --=== Fin de la partie combinatoire du process ========================== 207 208 209 210 --end loop; 211 212 if (clk'event and clk='1') then 201 213 Libr.Instr_ack<=Core_pushout(0); 202 214 Libr.InitOk<=Core_pushout(4); … … 205 217 Libr.RamSel<=RamSel; 206 218 sram.data_out<=PE_ram_do; 207 --=== Fin de la partie combinatoire du process ========================== 208 209 210 211 --end loop; 212 213 if (clk'event and clk='1') then 219 214 220 if reset='1' then 215 221 RunState<=start; … … 237 243 timeout:=0; 238 244 dcount<=0; 245 -- synthesis translate_off 239 246 if fopened='0' then 240 247 file_open(status,f, integer'image(destid) & "test_file0.txt", APPEND_MODE); … … 247 254 fopened:='1'; 248 255 end if; 249 256 -- synthesis translate_on 250 257 when Fillmem => 251 258 if Ramsel='0' then … … 284 291 when InitApp => 285 292 --code pour Init 286 dlen:= 1;293 dlen:=251; 287 294 if ct=0 then 288 write (l,string'("Dlen; ;INIT of Process n°; " & image(MyRank) & "; started at ; " & time'image(now))); 295 -- synthesis translate_off 296 write (l,string'("Dlen; ;INIT1 " & integer'image(Dlen)& "; " & image(MyRank) & "; started at ; " & time'image(now))); 289 297 290 298 report l.all; 291 299 writeline (f, l) ; 300 -- synthesis translate_on 292 301 end if; 293 302 pMPI_Init(ct,Libr,Clk,SRam); … … 300 309 if ct=0 then 301 310 RunState<=GetRank; 302 write (l,string'("Dlen; ;INIT;" & "; ended at ; " & time'image(now))); 311 -- synthesis translate_off 312 write (l,string'("Dlen; ;INIT2 " & integer'image(Dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 303 313 report l.all; 304 314 writeline (f, l) ; 315 -- synthesis translate_on 305 316 end if; 306 317 … … 309 320 when GetRank => 310 321 if ct=0 then 311 312 write (l,string'("Dlen; ; Rank ; " & "; started ; " & time'image(now)));322 -- synthesis translate_off 323 write (l,string'("Dlen; ;Rank1 " & integer'image(Dlen) & "; ; started ; " & time'image(now))); 313 324 report l.all; 314 325 writeline (f, l) ; 326 -- synthesis translate_on 315 327 end if; 316 328 pMPI_Comm_rank(ct,Libr,sram,MPI_COMM_WORLD,MyRank); … … 318 330 if ct=0 then 319 331 RunState<=PutData; 320 write (l,string'("Dlen; ; Rank ; " & "; ended at ; " & time'image(now))); 332 -- synthesis translate_off 333 write (l,string'("Dlen; ;Rank2 " & integer'image(Dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 321 334 report l.all; 322 writeline (f, l) ; 335 writeline (f, l) ; 336 -- synthesis translate_on 323 337 end if; 324 338 … … 331 345 --dlen:=251; --- 332 346 if ct=0 then 333 write (l,string'("Dlen;" & integer'image(dlen) & ";Put of Pr n°; " & image(MyRank) & "; started at ; " & time'image(now))); 347 -- synthesis translate_off 348 write (l,string'("Dlen;" & integer'image(dlen) & ";PUT1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now))); 334 349 report l.all; 335 350 writeline (f, l) ; 351 -- synthesis translate_on 336 352 end if; 337 353 if unsigned(MyRank) = 0 then 354 Destrank:=2; 355 356 elsif unsigned(MyRank) = 1 then 357 Destrank:=0; 358 elsif unsigned(MyRank) = 2 then 338 359 Destrank:=1; 360 elsif unsigned(MyRank) = 3 then 361 Destrank:=2; 339 362 else 340 363 DestRank:=0; … … 343 366 SrcAdr:=std_logic_vector(to_unsigned(DATAPTR,ADRLEN)); 344 367 DestAdr:=X"2000"; 345 346 368 pMPI_put(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win); 369 347 370 adresse:=to_integer(unsigned(sram.addr_wr)); 348 371 adresse_rd:=to_integer(unsigned(sram.addr_rd)); … … 353 376 if ct=0 then 354 377 RunState<=GetData; 378 -- synthesis translate_off 355 379 report "Put of Process n°; " & image(MyRank) & "; ended at ; " & time'image(now); 356 write (l,string'("Dlen;" & integer'image(dlen) & ";P ut of Pr n°;" & image(MyRank) & "; ended at time ; " & time'image(now)));380 write (l,string'("Dlen;" & integer'image(dlen) & ";PUT2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at time ; " & time'image(now))); 357 381 report l.all; 358 writeline (f, l) ; 382 writeline (f, l) ; 383 -- synthesis translate_on 359 384 end if; 360 385 … … 363 388 --dlen:=251; --- 364 389 if ct=0 then 365 write (l,string'("Dlen;" & integer'image(dlen) & ";GET of Process n°; " & image(MyRank) & "; started at ; " & time'image(now))); 390 -- synthesis translate_off 391 write (l,string'("Dlen;" & integer'image(dlen) & ";GET1; " & image(MyRank) & "; started at ; " & time'image(now))); 366 392 report l.all; 367 393 writeline (f, l) ; 394 -- synthesis translate_on 368 395 end if; 369 396 370 397 SrcAdr:=X"0120"; 371 398 DestAdr:=X"4000"; 372 373 pMPI_GET(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win); 399 if unsigned(MyRank) /= 2 then 400 pMPI_GET(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win); 401 else 402 RunState<=wincompleted; 403 end if; 374 404 adresse:=to_integer(unsigned(sram.addr_wr)); 375 405 adresse_rd:=to_integer(unsigned(sram.addr_rd)); … … 380 410 if ct=0 then 381 411 RunState<=wincompleted; 412 -- synthesis translate_off 382 413 assert ct/=0 report "GET_END " & integer'image(destrank) 383 414 severity Warning ; 384 write (l,string'("Dlen ;" & integer'image(dlen) & ";GET of Proc n°;" & image(MyRank) & "; ended at ; " & time'image(now)));415 write (l,string'("Dlen ;" & integer'image(dlen) & ";GET2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 385 416 report l.all; 386 417 387 writeline (f, l) ; 418 writeline (f, l) ; 419 -- synthesis translate_on 388 420 end if; 389 421 390 422 when WinCompleted => 391 423 if ct=0 then 392 write (l,string'("Dlen ;" & integer'image(dlen) & ";Wait of Proc n°; " & image(MyRank) & "; started at ; " & time'image(now))); 424 -- synthesis translate_off 425 write (l,string'("Dlen ;" & integer'image(dlen) & ";WAIT1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now))); 393 426 report l.all; 394 427 writeline (f, l) ; 428 -- synthesis translate_on 395 429 end if; 396 430 pMPI_Win_wait(ct,Libr,sram,MyWin ); … … 399 433 if ct=0 then 400 434 RunState<=finalize; 401 write (l,string'("Dlen ;" & integer'image(dlen) & ";Wait of Proc n°; " & image(MyRank) & "; ended at ; " & time'image(now))); 435 -- synthesis translate_off 436 write (l,string'("Dlen ;" & integer'image(dlen) & ";WAIT2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 402 437 report l.all; 403 438 writeline (f, l) ; 439 -- synthesis translate_on 404 440 405 441 end if; … … 408 444 when finalize => 409 445 if ct=0 then 410 write (l,string'("Dlen ;" & integer'image(dlen) & ";Finalize of Proc n°; " & image(MyRank) & "; started at ; " & time'image(now))); 446 -- synthesis translate_off 447 write (l,string'("Dlen ;" & integer'image(dlen) & ";FINALIZE1 " & integer'image(dlen) & ";" & image(MyRank) & "; started at ; " & time'image(now))); 411 448 report l.all; 412 449 writeline (f, l) ; 450 -- synthesis translate_on 413 451 end if; 414 452 415 453 if ct=0 then 416 454 RunState<=start; 417 write (l,string'("Dlen ;" & integer'image(dlen) & ";Finalize of Proc n°; " & image(MyRank) & "; ended at ; " & time'image(now))); 455 -- synthesis translate_off 456 write (l,string'("Dlen ;" & integer'image(dlen) & ";FINALIZE2 " & integer'image(dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 418 457 report l.all; 419 458 writeline (f, l) ; 420 459 file_close(f); 460 -- synthesis translate_on 421 461 end if; 422 462
Note: See TracChangeset
for help on using the changeset viewer.