Changeset 64 for PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.03/PE.vhd
- Timestamp:
- Apr 22, 2013, 11:35:01 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v0.03/PE.vhd
r41 r64 66 66 ); 67 67 END COMPONENT; 68 COMPONENT Hold_FSM is 69 Port ( Hold_Req : in STD_LOGIC; 70 Ram_busy : in STD_LOGIC; 71 Clk : in STD_LOGIC; 72 Reset : in STD_LOGIC; 73 Ramsel : out STD_LOGIC; 74 Hold_Ack : out STD_LOGIC); 75 end COMPONENT Hold_FSM; 68 76 --données du programme PE 69 77 --signaux pour l'interconnexionsignal datain :std_logic_vector(word-1 downto 0):= (others => '0'); … … 76 84 signal pe_ram_addra,pe_ram_addrb :std_logic_vector(ADRLEN-1 downto 0); 77 85 signal sram : typ_dpram; 78 86 signal MyGroup:mpi_group; 87 signal MyWin : mpi_win; 79 88 signal SrcAdr0,SrcAdr1,destAdr0,destAdr1,Datalen:std_logic_vector(word-1 downto 0); 80 89 signal dpid,dpid_i : natural range 0 to 15:=DestId; … … 84 93 signal Lib_instr_ack : std_logic; -- l'instruction est copiée dans le tampon FIFO 85 94 signal Lib_Init : std_logic; -- l'initialisation est terminée 95 signal Hold_Ack : std_logic; 86 96 --signaux pour la gestion de la MAE 87 type typ_mae is (start,Fillmem,NextFill,InitApp,GetRank,WInCreate, putdata,getdata,WinCompleted,finalize,st_timeout); 97 type typ_mae is (start,Fillmem,NextFill,InitApp,GetRank,WInCreate,WinStart, putdata,getdata,WinCompleted,finalize,st_timeout); 98 type typ_Hld is (Ht_Lock,Core_Lock,Ht_free); 88 99 signal dcount : natural range 0 to 255:=0; --permet de compter le packet de données envoyées 89 100 signal count,count_i : natural range 0 to 15:=0; … … 91 102 92 103 signal RunState : typ_mae; 104 signal Hld_state :typ_hld; 93 105 signal Ram_busy :std_logic:='0'; 94 106 begin … … 147 159 Lib_Instr_ack<=Core_Pushout(0); --l'instruction a été copié 148 160 Lib_init<=Core_Pushout(4); -- Initialized 149 -- pe_hold_req<=Core_hold_req; 150 --Core_hold_ack<=pe_hold_ack; 151 152 hold:process (Core_Hold_Req,clk,reset) 153 begin 154 if rising_edge(clk) then 155 if reset='1' then 156 Core_Hold_Ack<='0'; 157 else 158 if Core_Hold_Req='1' then 159 160 ramsel<=not(ram_busy); 161 Core_Hold_Ack<=not(ram_busy); --si la mémoire est occupé, forcé une libération 162 Pe_hold_ack<=not(ram_busy); 163 else 164 Core_Hold_Ack<='0'; 165 ramsel<='0'; 166 Pe_hold_ack<='0'; 167 168 end if; 169 end if; 170 end if; 171 end process hold; 172 --======================================================================= 173 161 162 Hold1: Hold_fsm port map ( 163 clk=>clk, 164 reset =>reset, 165 Ram_Busy=>Libr.membusy, 166 Hold_Ack=>Hold_Ack, 167 Hold_req =>Core_Hold_Req, 168 RamSel => RamSel); 169 Core_Hold_Ack<=Hold_Ack; 174 170 175 171 … … 214 210 Libr.InitOk<=Core_pushout(4); 215 211 Libr.Hold_Req<=Core_Hold_req; 216 Libr.Hold_Ack<= Pe_Hold_Ack;212 Libr.Hold_Ack<=Hold_Ack; 217 213 Libr.RamSel<=RamSel; 218 214 sram.data_out<=PE_ram_do; … … 226 222 Libr.InitOk<=Core_pushout(4); 227 223 Libr.Hold_Req<=Core_Hold_req; 228 Libr.Hold_Ack<= Pe_Hold_Ack;224 Libr.Hold_Ack<=Hold_Ack; 229 225 Libr.RamSel<=RamSel; 230 226 sram.data_out<=PE_ram_do; 227 231 228 case RunState is 232 229 when start => … … 236 233 end if; 237 234 Ram_busy<='0'; 235 Libr.MemBusy<='0'; 238 236 PE_Instr_En<='0'; 239 237 iack:='0'; … … 264 262 dcount<=dcount+1; 265 263 266 if dcount= 200 then264 if dcount=100 then 267 265 bfill:=bfill+1; 268 266 … … 284 282 end if; 285 283 when nextfill => --prépare le prochain bloc mémoire qui sera rempli 286 adresse:=200*bfill ;284 adresse:=200*bfill+1; 287 285 dcount<=0; 288 286 ct:=0; … … 291 289 when InitApp => 292 290 --code pour Init 293 dlen:= 251;291 dlen:=139; 294 292 if ct=0 then 295 293 -- synthesis translate_off … … 305 303 adresse_rd:=to_integer(unsigned(sram.addr_rd)); 306 304 PE_ram_din<=sram.data_in; 307 305 Ram_busy<=Libr.membusy; 308 306 --if Libr.InitOk='1' then 309 307 if ct=0 then … … 328 326 pMPI_Comm_rank(ct,Libr,sram,MPI_COMM_WORLD,MyRank); 329 327 adresse_rd:=to_integer(unsigned(sram.addr_rd)); 328 Ram_busy<=Libr.membusy; 329 330 330 if ct=0 then 331 RunState<= PutData;331 RunState<=WinStart; 332 332 -- synthesis translate_off 333 333 write (l,string'("Dlen; ;Rank2 " & integer'image(Dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); … … 337 337 end if; 338 338 339 339 340 340 when Wincreate => 341 342 when WinStart => 343 if ct=0 then 344 -- synthesis translate_off 345 write (l,string'("Dlen; ;WStart1 " & integer'image(Dlen) & "; ; started ; " & time'image(now))); 346 report l.all; 347 writeline (f, l) ; 348 -- synthesis translate_on 349 end if; 350 pMPI_Win_start(ct,Libr,sram,MyGroup,0,MyWin); 351 adresse:=to_integer(unsigned(sram.addr_wr)); 352 adresse_rd:=to_integer(unsigned(sram.addr_rd)); 353 --PE_Instr_EN<=Libr.instr_en; 354 PE_ram_din<=sram.data_in; 355 Ram_busy<=Libr.membusy; 356 dcount<=ct; 357 358 if ct=0 then 359 RunState<=PutData; 360 -- synthesis translate_off 361 write (l,string'("Dlen; ;WStart2 " & integer'image(Dlen) & ";" & image(MyRank) & "; ended at ; " & time'image(now))); 362 report l.all; 363 writeline (f, l) ; 364 -- synthesis translate_on 365 end if; 341 366 342 367 … … 365 390 366 391 SrcAdr:=std_logic_vector(to_unsigned(DATAPTR,ADRLEN)); 367 DestAdr:=X" 2000";392 DestAdr:=X"0340"; 368 393 pMPI_put(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win); 369 394 … … 372 397 PE_Instr_EN<=Libr.instr_en; 373 398 PE_ram_din<=sram.data_in; 399 Ram_busy<=Libr.membusy; 374 400 dcount<=ct; 375 401 … … 396 422 397 423 SrcAdr:=X"0120"; 398 DestAdr:=X" 4000";424 DestAdr:=X"1400"; 399 425 if unsigned(MyRank) /= 2 then 400 426 pMPI_GET(ct,Libr,Clk,Sram,SrcAdr,Dlen,MPI_int,destrank,DestAdr,Dlen,Mpi_int,Default_win); … … 406 432 PE_Instr_EN<=Libr.instr_en; 407 433 PE_ram_din<=sram.data_in; 434 Ram_busy<=Libr.membusy; 408 435 dcount<=ct; 409 436 … … 431 458 adresse:=to_integer(unsigned(sram.addr_wr)); 432 459 adresse_rd:=to_integer(unsigned(sram.addr_rd)); 460 Ram_busy<=Libr.membusy; 433 461 if ct=0 then 434 462 RunState<=finalize; … … 518 546 PE_Ram_enb<=sram.enb; 519 547 520 548 when WinStart => 549 550 PE_Ram_we<=sram.we; 551 PE_Ram_ena<=sram.ena; 552 PE_Ram_enb<=sram.enb; 521 553 --positionnement du mot de longueur des données 522 554
Note: See TracChangeset
for help on using the changeset viewer.