Changeset 139 for PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC
- Timestamp:
- May 21, 2014, 11:36:19 AM (10 years ago)
- Location:
- PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0
- Files:
-
- 12 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/CoreTypes.vhd
r101 r139 9 9 use IEEE.numeric_std.all; 10 10 package CoreTypes is 11 CONSTANT Word :POSITIVE:= 8;11 CONSTANT Word :POSITIVE:= 16; 12 12 CONSTANT ADRLEN:POSITIVE:=16; 13 13 CONSTANT LZFILL :std_logic_vector(2*Word-ADRLEN to 0):=(others=>'0');--indique le nombre de zero à utiliser pour completer le bus de données lorsque la longueur restante du bus d'adresse est inférueure à la largeur du bus de données … … 37 37 array(natural range <>) of std_logic_vector( Word-1 downto 0); 38 38 39 type Typ_PortIO8 is 40 array(natural range <>) of std_logic_vector( 7 downto 0); 39 41 type memory is 40 42 array (natural range <>) of std_logic_vector(word-1 downto 0); … … 176 178 end component SWITCH_GEN; 177 179 -- déclaration des fonctions utilisées 178 180 function wor (din : std_logic_vector) return std_logic; 181 subtype resolved_or is wor std_logic; 182 179 183 FUNCTION all_ones(s1:std_logic_vector) return std_logic; 180 184 --This function returns if the input vector has all ones and no zeros … … 330 334 variable bit_image: String(1 to 3) := std_logic'image(L); 331 335 begin 332 return(bit_image( 1 to 1));336 return(bit_image(2 to 2)); 333 337 end function image; 334 338 … … 355 359 return(RetVal); 356 360 end function image; 361 function wor (din : std_logic_vector) return std_logic is 362 begin 363 for i in din'range loop 364 if (din(i)='1') then 365 return din(i); 366 end if; 367 end loop; 368 return '0'; 369 end function wor; 370 357 371 end CoreTypes; -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/Crossbar.vhd
r101 r139 38 38 Port ( clk : in STD_LOGIC; 39 39 reset : in STD_LOGIC; --pour gérer le pipeline 40 Port1_in : in STD_LOGIC_VECTOR ( Word-1downto 0);41 Port2_in : in STD_LOGIC_VECTOR ( Word-1downto 0);42 Port3_in : in STD_LOGIC_VECTOR ( Word-1downto 0);43 Port4_in : in STD_LOGIC_VECTOR ( Word-1downto 0);44 Port5_in : in STD_LOGIC_VECTOR ( Word-1downto 0);45 Port6_in : in STD_LOGIC_VECTOR ( Word-1downto 0);46 Port7_in : in STD_LOGIC_VECTOR ( Word-1downto 0);47 Port8_in : in STD_LOGIC_VECTOR ( Word-1downto 0);48 Port9_in : in STD_LOGIC_VECTOR ( Word-1downto 0);49 Port10_in : in STD_LOGIC_VECTOR ( Word-1downto 0);50 Port11_in : in STD_LOGIC_VECTOR ( Word-1downto 0);51 Port12_in : in STD_LOGIC_VECTOR ( Word-1downto 0);52 Port13_in : in STD_LOGIC_VECTOR ( Word-1downto 0);53 Port14_in : in STD_LOGIC_VECTOR ( Word-1downto 0);54 Port15_in : in STD_LOGIC_VECTOR ( Word-1downto 0);55 Port16_in : in STD_LOGIC_VECTOR ( Word-1downto 0);40 Port1_in : in STD_LOGIC_VECTOR (7 downto 0); 41 Port2_in : in STD_LOGIC_VECTOR (7 downto 0); 42 Port3_in : in STD_LOGIC_VECTOR (7 downto 0); 43 Port4_in : in STD_LOGIC_VECTOR (7 downto 0); 44 Port5_in : in STD_LOGIC_VECTOR (7 downto 0); 45 Port6_in : in STD_LOGIC_VECTOR (7 downto 0); 46 Port7_in : in STD_LOGIC_VECTOR (7 downto 0); 47 Port8_in : in STD_LOGIC_VECTOR (7 downto 0); 48 Port9_in : in STD_LOGIC_VECTOR (7 downto 0); 49 Port10_in : in STD_LOGIC_VECTOR (7 downto 0); 50 Port11_in : in STD_LOGIC_VECTOR (7 downto 0); 51 Port12_in : in STD_LOGIC_VECTOR (7 downto 0); 52 Port13_in : in STD_LOGIC_VECTOR (7 downto 0); 53 Port14_in : in STD_LOGIC_VECTOR (7 downto 0); 54 Port15_in : in STD_LOGIC_VECTOR (7 downto 0); 55 Port16_in : in STD_LOGIC_VECTOR (7 downto 0); 56 56 57 57 Port1_pulse_in : in std_logic; … … 89 89 Port16_pulse_out : out std_logic; 90 90 91 Port1_out : out STD_LOGIC_VECTOR ( Word-1downto 0);92 Port2_out : out STD_LOGIC_VECTOR ( Word-1downto 0);93 Port3_out : out STD_LOGIC_VECTOR ( Word-1downto 0);94 Port4_out : out STD_LOGIC_VECTOR ( Word-1downto 0);95 Port5_out : out STD_LOGIC_VECTOR ( Word-1downto 0);96 Port6_out : out STD_LOGIC_VECTOR ( Word-1downto 0);97 Port7_out : out STD_LOGIC_VECTOR ( Word-1downto 0);98 Port8_out : out STD_LOGIC_VECTOR ( Word-1downto 0);99 Port9_out : out STD_LOGIC_VECTOR ( Word-1downto 0);100 Port10_out : out STD_LOGIC_VECTOR ( Word-1downto 0);101 Port11_out : out STD_LOGIC_VECTOR ( Word-1downto 0);102 Port12_out : out STD_LOGIC_VECTOR ( Word-1downto 0);103 Port13_out : out STD_LOGIC_VECTOR ( Word-1downto 0);104 Port14_out : out STD_LOGIC_VECTOR ( Word-1downto 0);105 Port15_out : out STD_LOGIC_VECTOR ( Word-1downto 0);106 Port16_out : out STD_LOGIC_VECTOR ( Word-1downto 0);91 Port1_out : out STD_LOGIC_VECTOR (7 downto 0); 92 Port2_out : out STD_LOGIC_VECTOR (7 downto 0); 93 Port3_out : out STD_LOGIC_VECTOR (7 downto 0); 94 Port4_out : out STD_LOGIC_VECTOR (7 downto 0); 95 Port5_out : out STD_LOGIC_VECTOR (7 downto 0); 96 Port6_out : out STD_LOGIC_VECTOR (7 downto 0); 97 Port7_out : out STD_LOGIC_VECTOR (7 downto 0); 98 Port8_out : out STD_LOGIC_VECTOR (7 downto 0); 99 Port9_out : out STD_LOGIC_VECTOR (7 downto 0); 100 Port10_out : out STD_LOGIC_VECTOR (7 downto 0); 101 Port11_out : out STD_LOGIC_VECTOR (7 downto 0); 102 Port12_out : out STD_LOGIC_VECTOR (7 downto 0); 103 Port13_out : out STD_LOGIC_VECTOR (7 downto 0); 104 Port14_out : out STD_LOGIC_VECTOR (7 downto 0); 105 Port15_out : out STD_LOGIC_VECTOR (7 downto 0); 106 Port16_out : out STD_LOGIC_VECTOR (7 downto 0); 107 107 108 108 Ctrl : in STD_LOGIC_VECTOR (number_of_crossbar_ports*number_of_crossbar_ports downto 1) -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/FIFO_256_FWFT.vhd
r101 r139 66 66 attribute RAM_STYLE : string; 67 67 68 type ram_type is array (2**(MPROOF+ word)-1 downto 0) of std_logic_vector (Word-1 downto 0);68 type ram_type is array (2**(MPROOF+8)-1 downto 0) of std_logic_vector (Word-1 downto 0); 69 69 signal RAM: ram_type; 70 70 attribute RAM_STYLE of RAM: signal is "BLOCK"; 71 71 -- declaration des signeaux des compteurs 72 signal push_address_counter: std_logic_vector(MPROOF+ Word-1 downto 0);73 signal pop_address_counter : std_logic_vector(MPROOF+ Word-1 downto 0);74 signal fifo_counter : std_logic_vector(MPROOF+ Word-1 downto 0);72 signal push_address_counter: std_logic_vector(MPROOF+8-1 downto 0); 73 signal pop_address_counter : std_logic_vector(MPROOF+8-1 downto 0); 74 signal fifo_counter : std_logic_vector(MPROOF+8-1 downto 0); 75 75 --autre signaux 76 76 signal empty_signal: std_logic:='1'; … … 105 105 wr_en_signal <= wr_en and (not full_signal); -- la donnée est ignorée si le fifo est plein 106 106 rd_en_signal <= rd_en and (not empty_signal);-- pas de lecture si le fifo est vide 107 full_signal <= '1' when unsigned(fifo_counter) = 2**(MProof+ word)-1 else107 full_signal <= '1' when unsigned(fifo_counter) = 2**(MProof+8)-1 else 108 108 '0'; 109 near_full <= '1' when unsigned(fifo_counter) >= 2**(MProof+ word)-5 else109 near_full <= '1' when unsigned(fifo_counter) >= 2**(MProof+8)-5 else 110 110 '0'; 111 111 --empty_signal <= '1' when fifo_counter = "000000" else … … 254 254 -- processus de comptage des octets dans le fifo 255 255 fifo_counter_process : process(clk_signal) 256 variable count : std_logic_vector(MPROOF+ word-1 downto 0):= (others=>'0');256 variable count : std_logic_vector(MPROOF+8-1 downto 0):= (others=>'0'); 257 257 begin 258 258 if rising_edge(clk_signal) then -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/INPUT_PORT_MODULE.vhd
r101 r139 40 40 entity INPUT_PORT_MODULE is 41 41 generic(number_of_ports : positive := 4; 42 43 Port_num: natural:=1); -- port_num est l'id du port 42 adr_mask : natural := 0;--le nombre de'1' en partant le la gauche de l'adresse 43 adr_len: positive:=10; --la taille en bit de l'adresse 10 bits --> 1024 hotes 44 tot_ports: positive :=8; --Nomnre de ports total du réseau 45 adr_sub_net : std_logic_vector(9 downto 0) := (others=>'0');--l'adresse du sous-réseau 46 Port_num: natural:=1; -- port_num est l'id du port 47 nbyte : positive:=2); -- le nombre de Byte dans chaque mot du port par défaut 2 44 48 Port ( data_in : in STD_LOGIC_VECTOR (Word-1 downto 0); 45 49 data_in_en : in STD_LOGIC; -- signaler la présence des données en entrée … … 52 56 fifo_empty : out STD_LOGIC; -- le tampon d'entrée est vide 53 57 priority_rotation : out std_logic; -- reserver le canal de transmission 54 data_out : out STD_LOGIC_VECTOR ( Word-1downto 0); --données vers le réseau crossbar58 data_out : out STD_LOGIC_VECTOR (7 downto 0); --données vers le réseau crossbar 55 59 data_out_pulse : out std_logic); -- permet de ... 56 60 … … 73 77 74 78 --definition du type etat pour les fsm 75 type fsm_states is (state0, CmdOn, WaitGrant, ReqPort, state1, state2,strecover,stpulse,stateErr, state3);-- definition du type etat pour le codage des etats des fsm76 type fsm_states2 is(cmdstart,cmdwait,cmdread,cmdSetDest,cmdSetCount,cmdSetId,cmd pulse,CmdEnd);79 type fsm_states is (state0, CmdOn, WaitGrant, ReqPort,addhead,addheadn, state1,state1n, state2,state2n,strecover,stpulse,stpulsen,stateErr, state3);-- definition du type etat pour le codage des etats des fsm 80 type fsm_states2 is(cmdstart,cmdwait,cmdread,cmdSetDest,cmdSetCount,cmdSetId,cmdSetDestn,cmdSetCountn,cmdSetIdn,cmdpulse,cmdpulsen,CmdEnd); 77 81 signal pop_state : fsm_states; 78 82 signal cmdstate : fsm_states2; … … 81 85 signal dat_Err :std_logic:='0'; -- signal une erreur pendant l'exécution 82 86 signal wrok,readOk,CmdReadOk : std_logic:='0'; --indique s'il est possible de lire les données 87 -- 88 signal rt_err : std_logic;--erreur sur la route 89 signal route :std_logic_vector(9 downto 0); 90 signal dest_port:std_logic_vector(Word/2-1 downto 0); 91 signal nib,cnib:natural range 0 to 4:=1;--indique le sous-octet à traiter 92 signal pulseOn :std_logic:='0';--indique que le prochain état est celui de l'impulsion 83 93 -- signaux utilisés dans les fsm 84 94 signal request_decoder,req_grant : STD_LOGIC_VECTOR(number_of_ports downto 1); … … 86 96 signal request_latch : STD_LOGIC_VECTOR(4 downto 1):=(others=>'0'); -- pourquoi pas 3 downto 0 ? 87 97 signal request_latch_en : std_logic; 88 signal pipeline_latch : std_logic_vector( Word-1downto 0);98 signal pipeline_latch : std_logic_vector(7 downto 0); 89 99 signal pipeline_latch_en : std_logic; 90 100 signal request_word : std_logic_vector(5 downto 1); … … 110 120 signal fifo_empty_signal : std_logic; 111 121 signal fifo_read_signal : std_logic; 112 signal fifo_out_signal, cmd_data_signal : std_logic_vector(Word-1 downto 0);113 signal push_dout : std_logic_vector( Word-1downto 0);122 signal fifo_out_signal,fifo_out2,cmd_data_signal : std_logic_vector(Word-1 downto 0); 123 signal push_dout : std_logic_vector(7 downto 0); 114 124 signal empty_latch : std_logic ; 115 signal PORT_ID :std_logic_vector(Word-1 downto 0):=STD_LOGIC_VECTOR(to_unsigned(number_of_ports-1,4))& STD_LOGIC_VECTOR(to_unsigned(port_num-1,4)); 125 116 126 -- signaux du compteur de données 117 127 signal data_counter : std_logic_vector(Word-1 downto 0); 118 128 129 function count_bits(param:natural) return natural is 130 131 variable p : natural range 0 to 127:=0; 132 begin 133 n1: for i in 0 to 127 loop 134 if param<=2**i then 135 p:=i; 136 exit n1; 137 end if; 138 end loop n1; 139 return p; 140 end function; 141 142 function Get_Port_ID(adr_sub_net:std_logic_vector;adr_mask:natural;n_ports:positive;numport:positive) return std_logic_vector is 143 --cette fonction permet de calculer le port_id ou l'adresse de sous réseau en fonction du masque 144 variable tport_id:std_logic_vector(adr_len-1 downto 0):=(others=>'0'); -- 145 variable p : natural range 0 to 9:=0; 146 begin 147 --n1: for i in 0 to 9 loop 148 -- if n_ports-1<2**i then 149 -- p:=i; 150 -- exit n1; 151 -- end if; 152 -- end loop n1; 153 p:=count_bits(n_ports-1); 154 tport_id:=adr_sub_net(adr_len-1 downto p) & std_logic_vector(to_unsigned(numport-1,p)); 155 return tport_id; 156 end function; 157 --case n_ports is 158 --when 1|2|3 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 159 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-2):= std_logic_vector(to_unsigned(numport,1)); 160 --when 4|5 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 161 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-3):= std_logic_vector(to_unsigned(numport,2)); 162 --when 6|9 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 163 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-4):= std_logic_vector(to_unsigned(numport,3)); 164 -- 165 --when others => --10 to 16 166 --tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1) ; 167 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-5):= std_logic_vector(to_unsigned(numport,4)); 168 -- 169 --end case; 170 -- return tport_id; 171 --end function; 172 signal PORT_ID :std_logic_vector(adr_len-1 downto 0):=GET_PORT_ID(adr_sub_net,adr_mask,number_of_ports,port_num); 173 constant n_ports_bits:natural:=count_bits(number_of_ports-1);--compte le nombre de bit par port 174 constant pid_bits:natural:=count_bits(tot_ports); --donne le nombre de bits utiles dans une adresse 119 175 begin 120 176 -- instantiation du FIFO_256 … … 471 527 pipeline_latch <= push_dout; 472 528 elsif pipeline_latch_en = '1' and cmd_exec='1' then 473 pipeline_latch <= cmd_data_signal ;529 pipeline_latch <= cmd_data_signal(8*cnib-1 downto 8*(cnib-1)); 474 530 end if; 475 531 end if; 476 532 end process; 477 533 534 478 535 --latch qui memorise l'adresse de destination du packet 479 536 480 537 request_latch_process : process(clk) 538 variable rt:std_logic_vector(9 downto 0):=(others=>'0');--route 539 variable reql:std_logic_vector(4 downto 1):=(others=>'0');--request_latch 540 --variable adr_e,p:natural range 0 to 15:=0; 541 481 542 begin 482 543 if rising_edge(clk) then 483 544 if reset_signal = '1' then 484 req uest_latch <= (others => '0');545 reql := (others => '0'); 485 546 elsif request_latch_en = '1' and cmd_in_en='0' then --si la lecture de la destination est autorisée 486 request_latch <=fifo_out_signal(3 downto 0); --fifo_out_signal(3) & fifo_out_signal(2) & fifo_out_signal(1) & fifo_out_signal(0); 487 assert (unsigned(fifo_out_signal(3 downto 0))<number_of_ports) 488 report "Input_port_module n° " & integer'image(port_num) & " Le port sollicité n'existe pas le NoC va être bloqué !" 489 severity failure; 490 elsif cmd_in_en='1' and request_latch_en='1' then --c'est une commande le port de dest est le même que le port d'entrée 547 rt:=(others=>'0'); 548 549 if adr_mask=0 then 550 reql(n_ports_bits downto 1):=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 551 request_latch(n_ports_bits downto 1)<=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 552 report "Route racine:"; 553 else 554 rt(pid_bits-1 downto pid_bits-adr_mask):=fifo_out_signal(pid_bits-1 downto pid_bits-adr_mask); 555 if rt=adr_sub_net then 556 report "Route trouvé:" & integer'image(to_integer(unsigned(rt))) & " adr_sub_net=" & integer'image(to_integer(unsigned(adr_sub_net))) & " fifo_out_sig:=" & image(fifo_out_signal) & " sur le port " & integer'image(to_integer(unsigned(port_id))+1); 557 reql(n_ports_bits downto 1):=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 558 request_latch(n_ports_bits downto 1)<=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 559 560 else 561 if number_of_ports=Port_num then --si c'est un paquet descendant alors le détruire 562 report "Input_port_module n°" & integer'image(to_integer(unsigned(port_id))) & " La route sollicité n'existe pas dans ce sous réseau le paquet va être détruit ! fifo_out_sig:=" & image(fifo_out_signal); 563 request_latch<="0000"; --à revoir il faut empêcher le routeur de se bloquer 564 rt_err<='1'; --il faut activer la destruction du paquet 565 else --faire monter les données vers le ports supérieur 566 request_latch<=std_logic_vector(to_unsigned(number_of_ports-1,4)); 567 reql:=std_logic_vector(to_unsigned(number_of_ports-1,4)); 568 rt_err<='0'; 569 end if; 570 571 end if; 572 end if; 573 report "fifo_out=" & image(fifo_out_signal) & " pid_bits:=" & integer'image(pid_bits) & " adr_mask:=" & integer'image(adr_mask) & " rt:=" & image(rt) & " adr_sub_net=" & image(adr_sub_net) & " reql:=" & image(reql) & " sur le port " & integer'image(to_integer(unsigned(port_id))+1); 574 575 assert (unsigned(reql)<number_of_ports-1) 576 report "Input_port_module n° " & integer'image(port_num) & " Le port sollicité n'est pas dans la branche !" 577 severity warning; 578 elsif cmd_in_en='1' and request_latch_en='1' then --c'est une commande le port de dest est le même que le port d'entrée 491 579 request_latch<=Port_ID(3 downto 0); --car les ports commencent à 0 492 580 end if; 493 494 end if; 581 end if; 582 --request_latch<=reql; 583 route<=rt; --pour le débogage uniquement pas besoin de conserver ce paramètre en principe 584 585 495 586 end process; 496 587 … … 515 606 pop_state <= CmdOn; 516 607 end if; 608 nib<=nbyte; 517 609 when CmdOn => if empty_latch='1' and cmd_in_en='0' then 518 610 pop_state <= state0; … … 533 625 -- 534 626 pop_state <= state1; 535 627 fifo_out2<=fifo_out_signal; 536 628 --end if; 537 629 when addhead => 630 pop_state <= addheadn; 631 when addheadn => pop_state <= state1; 538 632 when state1 => if port_granted ='1' then --lecture de la longueur des données 539 633 data_counter <= fifo_out_signal; … … 543 637 readOk<='1'; 544 638 end if; 545 pop_state <= state2; 639 pop_state <= state1n; 640 nib<=nib-1; 546 641 wrok<='1'; 547 642 else 548 643 wrok<='0'; 549 644 end if; 550 645 646 when state1n => if nib=1 then 647 pop_state <= state2; 648 nib<=nbyte; 649 else 650 nib<=nib-1; 651 end if; 652 wrok<='1'; 653 fifo_out2<=fifo_out_signal; 551 654 when state2 => if port_granted='1' then 552 655 wrok<='1'; 553 656 if fifo_empty_signal ='0' then 554 if rd_en_signal ='1' and unsigned(data_counter)<= 3then657 if rd_en_signal ='1' and unsigned(data_counter)<= 2 then 555 658 data_counter <= data_counter - 1; 556 pop_state <= stpulse; 659 pop_state <= state2n; 660 nib<=nib-1; 557 661 ReadOk<='1'; 662 pulseon<='1'; 558 663 elsif rd_en_signal ='1' then 559 664 data_counter <= data_counter - 1; 560 pop_state <= state2; 665 pop_state <= state2n; 666 nib<=nib-1; 561 667 ReadOk<='1'; 562 668 else --fifo_empty_signal='1' fin prématurée de la lecture … … 580 686 data_counter <= data_counter + 1; 581 687 end if; 688 689 when state2n => if nib=1 then 690 if pulseon='1' then 691 pop_state <= stpulse; 692 else 693 pop_state <= state2; 694 end if; 695 nib<=nbyte; 696 else 697 nib<=nib-1; 698 end if; 699 wrok<='1'; 700 fifo_out2<=fifo_out_signal; 582 701 when strecover => if fifo_empty_signal='0' and port_granted='1' then 583 702 pop_state<=state2; … … 591 710 592 711 when stpulse => if port_granted='1' then 593 pop_state <= state3; --pousser la dernière donnée dehors 712 pop_state <= state3;--stpulsen; --pousser la dernière donnée dehors 713 --nib<=nib-1; 594 714 data_counter <= data_counter - 1; 595 715 wrok<='1'; 596 end if; 597 wrok<='0'; 716 pulseon<='0'; 717 else 718 wrok<='0'; 719 end if; 720 721 when stpulsen => wrok<='0'; 722 if nib=1 then 723 pop_state <= state3; 724 nib<=nbyte; 725 else 726 nib<=nib-1; 727 end if; 728 fifo_out2<=fifo_out_signal; 598 729 when state3 => wrok<='0'; 599 730 data_counter <= data_counter - 1; … … 611 742 612 743 -- actions associées à chaque etat de la fsm de mealy 613 pop_fsm_action : process(pop_state, fifo_out_signal, empty_latch, rd_en_signal,readok, port_granted)744 pop_fsm_action : process(pop_state, fifo_out_signal,fifo_out2,empty_latch, rd_en_signal,readok, port_granted,nib ) 614 745 begin 615 746 -- code fonctionnel … … 623 754 dat_exec<='0'; 624 755 dat_Err<='0'; 625 push_dout<=fifo_out_signal ;756 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 626 757 627 758 when CmdOn => dat_request_latch_en <= '0'; … … 633 764 dat_exec<='0'; 634 765 dat_Err<='0'; 635 push_dout<=fifo_out_signal ;766 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 636 767 when WaitGrant => 637 768 dat_request_latch_en <='1'; --autoriser l'identification du port de destination … … 643 774 dat_exec<='1'; 644 775 dat_Err<='0'; 645 push_dout<=fifo_out_signal(7 downto 4) & PORT_ID(3 downto 0); 776 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 777 --push_dout<=fifo_out_signal(Word-1 downto Word/2) & PORT_ID(Word/2-1 downto 0); 646 778 when ReqPort => 647 779 dat_request_latch_en <='1'; --autoriser l'identification du port de destination 648 dat_pipeline_latch_en <= ' 1'; --pour le transmettre à travers le réseau780 dat_pipeline_latch_en <= '0'; --pour le transmettre à travers le réseau 649 781 dat_fifo_read_signal <= '1'; 650 782 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request … … 653 785 dat_exec<='1'; 654 786 dat_Err<='0'; 655 push_dout<=fifo_out_signal(7 downto 4) & PORT_ID(3 downto 0); 787 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 788 --push_dout<=fifo_out_signal(Word-1 downto Word/2) & PORT_ID(Word/2-1 downto 0); 789 when addhead => 790 dat_request_latch_en <='0'; --autoriser l'identification du port de destination 791 dat_pipeline_latch_en <= '1'; --pour le transmettre à travers le réseau 792 dat_fifo_read_signal <= '0'; 793 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 794 dat_data_out_pulse <= '0'; --transmettre le signal pour le dernier mot 795 dat_priority_rotation <= '0'; 796 dat_exec<='1'; 797 dat_Err<='0'; 798 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 656 799 657 800 when state1 => dat_request_latch_en <= '0'; 658 801 dat_pipeline_latch_en <= rd_en_signal and port_granted; 659 dat_fifo_read_signal <= rd_en_signal and port_granted; 802 dat_fifo_read_signal <= '0';--rd_en_signal and port_granted; 803 dat_request_decoder_en <= '1'; 804 dat_data_out_pulse <= '0';--port_granted; 805 dat_priority_rotation <= '0'; 806 dat_exec<='1'; 807 dat_Err<='0'; 808 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 809 when state1n => dat_request_latch_en <= '0'; 810 dat_pipeline_latch_en <= '1'; -- toujours actif pour cet octet 811 dat_fifo_read_signal <= '0'; 660 812 dat_request_decoder_en <= '1'; 661 813 dat_data_out_pulse <= port_granted; … … 663 815 dat_exec<='1'; 664 816 dat_Err<='0'; 665 push_dout<=fifo_out _signal;817 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 666 818 667 819 when state2 |strecover => dat_request_latch_en <= '0'; … … 669 821 dat_fifo_read_signal <= port_granted and readok; 670 822 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 671 dat_data_out_pulse <= port_granted and wrOk and not(fifo_empty_signal);823 dat_data_out_pulse <= port_granted and wrOk ;--and not(fifo_empty_signal); 672 824 dat_priority_rotation <= '0'; 673 825 dat_exec<='1'; 674 826 dat_Err<='0'; 675 push_dout<=fifo_out_signal; 676 677 when stpulse => dat_request_latch_en <= '0'; --pousser la dernière donnée 678 dat_pipeline_latch_en <= '0'; --autoriser la lecture du fifo en sortie 827 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 828 829 when state2n => dat_request_latch_en <= '0'; 830 dat_pipeline_latch_en <= '1'; --autoriser la lecture du fifo en sortie 831 dat_fifo_read_signal <= '0'; 832 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 833 dat_data_out_pulse <= port_granted and wrOk ;--and not(fifo_empty_signal); 834 dat_priority_rotation <= '0'; 835 dat_exec<='1'; 836 dat_Err<='0'; 837 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 838 when stpulse|stpulsen => dat_request_latch_en <= '0'; --pousser la dernière donnée 839 dat_pipeline_latch_en <= wrok; --autoriser la lecture du fifo en sortie 679 840 dat_fifo_read_signal <='0'; 680 841 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request … … 683 844 dat_exec<='1'; 684 845 dat_Err<='0'; 685 push_dout<=fifo_out_signal; 846 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 847 686 848 687 849 when state3 => dat_request_latch_en <= '0'; … … 693 855 dat_exec<='0'; 694 856 dat_Err<='0'; 695 push_dout<=fifo_out_signal ;857 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 696 858 when stateErr => dat_request_latch_en <= '0'; 697 859 dat_pipeline_latch_en <= '0'; … … 702 864 dat_exec<='1'; 703 865 dat_Err<='1'; 704 push_dout<=fifo_out_signal ;866 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 705 867 when others => dat_request_latch_en <= '0'; 706 868 dat_pipeline_latch_en <= '0'; … … 711 873 dat_exec<='0'; 712 874 dat_Err<='0'; 713 push_dout<=fifo_out_signal ;875 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 714 876 715 877 end case; 716 878 end process; 717 879 -- traitement des commandes reçues par le switch 718 fsm_cmd:process(clk ,cmd_in_en)880 fsm_cmd:process(clk) 719 881 variable timeout : natural:=0; 720 882 variable cmdcode : natural range 0 to 255; … … 731 893 end if; 732 894 cmdReadOk<='0'; 895 cnib<=nbyte; 733 896 when cmdwait => if port_granted='1' then -- demande du port de sortie 734 897 … … 754 917 -- end if; 755 918 when cmdsetdest => 919 756 920 if port_granted='1' then 921 cmdstate<=cmdsetdestn; 922 cnib<=cnib-1; 923 end if; 924 cmdReadOk<='0'; 925 when cmdsetdestn => if cnib=1 then 926 cmdstate<=cmdsetcount; 927 cnib<=nbyte; 928 else 929 cnib<=cnib-1; 930 end if; 931 when cmdsetcount => 932 if port_granted='1' then 933 cmdstate<=cmdsetcountn; 934 cnib<=cnib-1; 935 else 757 936 cmdstate<=cmdsetcount; 758 937 end if; 759 938 cmdReadOk<='0'; 760 when cmdsetcount =>761 if port_granted='1'then762 cmdstate<=cmdsetID;763 else764 cmdstate<=cmdsetdest;765 end if;766 cmdReadOk<='0';939 940 when cmdsetcountn => if cnib=1 then 941 cmdstate<=cmdsetID; 942 cnib<=nbyte; 943 else 944 cnib<=cnib-1; 945 end if; 767 946 when cmdsetID=> 768 947 if port_granted='1' then 769 cmdstate <=cmdpulse; 948 cmdstate <=cmdsetIDn; 949 cnib<=cnib-1; 770 950 end if; 771 951 cmdReadOk<='0'; 952 when cmdsetIDn => if cnib=1 then 953 cmdstate<=cmdpulse; 954 cnib<=nbyte; 955 else 956 cnib<=cnib-1; 957 end if; 772 958 when cmdpulse => 773 959 if port_granted='1' then 774 cmdstate <=cmdEnd; 960 cmdstate <=cmdpulsen; 961 cnib<=cnib-1; 775 962 end if; 776 963 cmdReadOk<='0'; 964 when cmdpulsen => if cnib=1 then 965 cmdstate<=cmdEnd; 966 cnib<=nbyte; 967 else 968 cnib<=cnib-1; 969 end if; 777 970 when cmdend => 778 971 if cmd_in_en='0' then --éviter l'exécution en boucle … … 808 1001 cmd_data_out_pulse <= '0'; 809 1002 cmd_priority_rotation <= '1'; --sans priorité 810 cmd_data_signal<= Port_ID;1003 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 811 1004 when cmdwait => 812 1005 cmd_exec<='1'; … … 816 1009 cmd_priority_rotation <= '0'; --avec priorité 817 1010 cmd_request_decoder_en <= '1'; --demande d'émission 818 cmd_data_signal<= Port_ID;1011 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 819 1012 cmd_data_out_pulse <= '0'; 820 1013 when cmdsetdest => … … 827 1020 cmd_data_out_pulse <= '0'; 828 1021 cmd_priority_rotation <= '0'; 829 cmd_data_signal<=Port_ID; -- le numéro du port et le nombre total des ports est envoyé 830 when cmdsetcount => 1022 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 1023 when cmdsetdestn => 1024 --cmd_request_decoder_en <= '1'; 1025 cmd_exec<='1'; 1026 cmd_pipeline_latch_en <='1'; --empiler dans le tampon de sortie la donnée 1027 cmd_fifo_read_signal <='0'; 1028 cmd_request_latch_en<='0'; 1029 cmd_request_decoder_en <= '1'; --autoriser le decodeur à activer le dernier bit de request 1030 cmd_data_out_pulse <= '1'; 1031 cmd_priority_rotation <= '0'; 1032 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 1033 1034 when cmdsetcount|cmdsetcountn=> 831 1035 832 1036 cmd_exec<='1'; … … 837 1041 cmd_data_out_pulse <= port_granted; 838 1042 cmd_priority_rotation <= '0'; 839 cmd_data_signal<=STD_LOGIC_VECTOR(to_unsigned(3, 8));840 when cmdSetId 1043 cmd_data_signal<=STD_LOGIC_VECTOR(to_unsigned(3,Word)); 1044 when cmdSetId| cmdSetIdn=> 841 1045 --cmd_request_decoder_en <= '1'; 842 1046 cmd_exec<='1'; … … 847 1051 cmd_data_out_pulse <= port_granted; 848 1052 cmd_priority_rotation <= '0'; 849 cmd_data_signal<= Port_ID; -- le numéro du port et le nombre total des ports est envoyé850 1053 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 1054 report "Le nombre de port est" & integer'image(tot_ports) & " l'id du port est : " & image(port_id); 851 1055 when cmdpulse => cmd_exec<='1'; 852 cmd_pipeline_latch_en <=' 0';1056 cmd_pipeline_latch_en <='1'; 853 1057 cmd_fifo_read_signal <='0'; 854 1058 cmd_request_latch_en<='0'; … … 856 1060 cmd_data_out_pulse <= '1';--port_granted; --s'assurer que la dernière donnée est bien lue 857 1061 cmd_priority_rotation <= '0'; 1062 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 1063 1064 when cmdpulsen => cmd_exec<='1'; 1065 cmd_pipeline_latch_en <='0'; 1066 cmd_fifo_read_signal <='0'; 1067 cmd_request_latch_en<='0'; 1068 cmd_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 1069 cmd_data_out_pulse <= '0';--port_granted; --s'assurer que la dernière donnée est bien lue 1070 cmd_priority_rotation <= '0'; 858 1071 --cmd_data_signal<=Port_ID ; 859 cmd_data_signal<= Port_ID;1072 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 860 1073 861 1074 when cmdend => -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/INPUT_PORT_MODULE.vhd.bak
r101 r139 40 40 entity INPUT_PORT_MODULE is 41 41 generic(number_of_ports : positive := 4; 42 43 Port_num: natural:=1); -- port_num est l'id du port 42 adr_mask : natural := 0;--le nombre de'1' en partant le la gauche de l'adresse 43 adr_len: positive:=10; --la taille en bit de l'adresse 10 bits --> 1024 hotes 44 tot_ports: positive :=8; --Nomnre de ports total du réseau 45 adr_sub_net : std_logic_vector(9 downto 0) := (others=>'0');--l'adresse du sous-réseau 46 Port_num: natural:=1; -- port_num est l'id du port 47 nbyte : positive:=2); -- le nombre de Byte dans chaque mot du port par défaut 2 44 48 Port ( data_in : in STD_LOGIC_VECTOR (Word-1 downto 0); 45 49 data_in_en : in STD_LOGIC; -- signaler la présence des données en entrée … … 52 56 fifo_empty : out STD_LOGIC; -- le tampon d'entrée est vide 53 57 priority_rotation : out std_logic; -- reserver le canal de transmission 54 data_out : out STD_LOGIC_VECTOR ( Word-1downto 0); --données vers le réseau crossbar58 data_out : out STD_LOGIC_VECTOR (7 downto 0); --données vers le réseau crossbar 55 59 data_out_pulse : out std_logic); -- permet de ... 56 60 … … 73 77 74 78 --definition du type etat pour les fsm 75 type fsm_states is (state0, CmdOn, WaitGrant, ReqPort, state1, state2,strecover,stpulse,stateErr, state3);-- definition du type etat pour le codage des etats des fsm76 type fsm_states2 is(cmdstart,cmdwait,cmdread,cmdSetDest,cmdSetCount,cmdSetId,cmd pulse,CmdEnd);79 type fsm_states is (state0, CmdOn, WaitGrant, ReqPort,addhead,addheadn, state1,state1n, state2,state2n,strecover,stpulse,stpulsen,stateErr, state3);-- definition du type etat pour le codage des etats des fsm 80 type fsm_states2 is(cmdstart,cmdwait,cmdread,cmdSetDest,cmdSetCount,cmdSetId,cmdSetDestn,cmdSetCountn,cmdSetIdn,cmdpulse,cmdpulsen,CmdEnd); 77 81 signal pop_state : fsm_states; 78 82 signal cmdstate : fsm_states2; … … 81 85 signal dat_Err :std_logic:='0'; -- signal une erreur pendant l'exécution 82 86 signal wrok,readOk,CmdReadOk : std_logic:='0'; --indique s'il est possible de lire les données 87 -- 88 signal rt_err : std_logic;--erreur sur la route 89 signal route :std_logic_vector(9 downto 0); 90 signal dest_port:std_logic_vector(Word/2-1 downto 0); 91 signal nib,cnib:natural range 0 to 4:=1;--indique le sous-octet à traiter 92 signal pulseOn :std_logic:='0';--indique que le prochain état est celui de l'impulsion 83 93 -- signaux utilisés dans les fsm 84 94 signal request_decoder,req_grant : STD_LOGIC_VECTOR(number_of_ports downto 1); … … 86 96 signal request_latch : STD_LOGIC_VECTOR(4 downto 1):=(others=>'0'); -- pourquoi pas 3 downto 0 ? 87 97 signal request_latch_en : std_logic; 88 signal pipeline_latch : std_logic_vector( Word-1downto 0);98 signal pipeline_latch : std_logic_vector(7 downto 0); 89 99 signal pipeline_latch_en : std_logic; 90 100 signal request_word : std_logic_vector(5 downto 1); … … 110 120 signal fifo_empty_signal : std_logic; 111 121 signal fifo_read_signal : std_logic; 112 signal fifo_out_signal, cmd_data_signal : std_logic_vector(Word-1 downto 0);113 signal push_dout : std_logic_vector( Word-1downto 0);122 signal fifo_out_signal,fifo_out2,cmd_data_signal : std_logic_vector(Word-1 downto 0); 123 signal push_dout : std_logic_vector(7 downto 0); 114 124 signal empty_latch : std_logic ; 115 signal PORT_ID :std_logic_vector(Word-1 downto 0):=STD_LOGIC_VECTOR(to_unsigned(number_of_ports-1,4))& STD_LOGIC_VECTOR(to_unsigned(port_num-1,4)); 125 116 126 -- signaux du compteur de données 117 127 signal data_counter : std_logic_vector(Word-1 downto 0); 118 128 129 function count_bits(param:natural) return natural is 130 131 variable p : natural range 0 to 127:=0; 132 begin 133 n1: for i in 0 to 127 loop 134 if param<=2**i then 135 p:=i; 136 exit n1; 137 end if; 138 end loop n1; 139 return p; 140 end function; 141 142 function Get_Port_ID(adr_sub_net:std_logic_vector;adr_mask:natural;n_ports:positive;numport:positive) return std_logic_vector is 143 --cette fonction permet de calculer le port_id ou l'adresse de sous réseau en fonction du masque 144 variable tport_id:std_logic_vector(adr_len-1 downto 0):=(others=>'0'); -- 145 variable p : natural range 0 to 9:=0; 146 begin 147 --n1: for i in 0 to 9 loop 148 -- if n_ports-1<2**i then 149 -- p:=i; 150 -- exit n1; 151 -- end if; 152 -- end loop n1; 153 p:=count_bits(n_ports-1); 154 tport_id:=adr_sub_net(adr_len-1 downto p) & std_logic_vector(to_unsigned(numport-1,p)); 155 return tport_id; 156 end function; 157 --case n_ports is 158 --when 1|2|3 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 159 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-2):= std_logic_vector(to_unsigned(numport,1)); 160 --when 4|5 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 161 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-3):= std_logic_vector(to_unsigned(numport,2)); 162 --when 6|9 =>tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1); 163 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-4):= std_logic_vector(to_unsigned(numport,3)); 164 -- 165 --when others => --10 to 16 166 --tport_id(adr_len-1 downto adr_len-adr_mask-1):=adr_sub_net(adr_len-1 downto adr_len-adr_mask-1) ; 167 --tport_id(adr_len-adr_mask-2 downto adr_len-adr_mask-5):= std_logic_vector(to_unsigned(numport,4)); 168 -- 169 --end case; 170 -- return tport_id; 171 --end function; 172 signal PORT_ID :std_logic_vector(adr_len-1 downto 0):=GET_PORT_ID(adr_sub_net,adr_mask,number_of_ports,port_num); 173 constant n_ports_bits:natural:=count_bits(number_of_ports-1);--compte le nombre de bit par port 174 constant pid_bits:natural:=count_bits(tot_ports); --donne le nombre de bits utiles dans une adresse 119 175 begin 120 176 -- instantiation du FIFO_256 … … 145 201 --end if; 146 202 end process; 147 rd_en_signal <= fifo_empty_signal;--not(empty_latch) ;203 rd_en_signal <= not(fifo_empty_signal);--not(empty_latch) ; 148 204 request <= request_decoder; 149 205 reg_grant:process (request_decoder,grant) … … 471 527 pipeline_latch <= push_dout; 472 528 elsif pipeline_latch_en = '1' and cmd_exec='1' then 473 pipeline_latch <= cmd_data_signal ;529 pipeline_latch <= cmd_data_signal(8*cnib-1 downto 8*(cnib-1)); 474 530 end if; 475 531 end if; 476 532 end process; 477 533 534 478 535 --latch qui memorise l'adresse de destination du packet 479 536 480 537 request_latch_process : process(clk) 538 variable rt:std_logic_vector(9 downto 0):=(others=>'0');--route 539 variable reql:std_logic_vector(4 downto 1):=(others=>'0');--request_latch 540 --variable adr_e,p:natural range 0 to 15:=0; 541 481 542 begin 482 543 if rising_edge(clk) then 483 544 if reset_signal = '1' then 484 req uest_latch <= (others => '0');545 reql := (others => '0'); 485 546 elsif request_latch_en = '1' and cmd_in_en='0' then --si la lecture de la destination est autorisée 486 request_latch <=fifo_out_signal(3 downto 0); --fifo_out_signal(3) & fifo_out_signal(2) & fifo_out_signal(1) & fifo_out_signal(0); 487 assert (unsigned(fifo_out_signal(3 downto 0))<number_of_ports) 488 report "Input_port_module n° " & integer'image(port_num) & " Le port sollicité n'existe pas le NoC va être bloqué !" 489 severity failure; 490 elsif cmd_in_en='1' and request_latch_en='1' then --c'est une commande le port de dest est le même que le port d'entrée 547 rt:=(others=>'0'); 548 549 if adr_mask=0 then 550 reql(n_ports_bits downto 1):=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 551 request_latch(n_ports_bits downto 1)<=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 552 report "Route racine:"; 553 else 554 rt(pid_bits-1 downto pid_bits-adr_mask):=fifo_out_signal(pid_bits-1 downto pid_bits-adr_mask); 555 if rt=adr_sub_net then 556 report "Route trouvé:" & integer'image(to_integer(unsigned(rt))) & " adr_sub_net=" & integer'image(to_integer(unsigned(adr_sub_net))) & " fifo_out_sig:=" & image(fifo_out_signal) & " sur le port " & integer'image(to_integer(unsigned(port_id))+1); 557 reql(n_ports_bits downto 1):=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 558 request_latch(n_ports_bits downto 1)<=fifo_out_signal(pid_bits-adr_mask-1 downto pid_bits-adr_mask-n_ports_bits); 559 560 else 561 if number_of_ports=Port_num then --si c'est un paquet descendant alors le détruire 562 report "Input_port_module n°" & integer'image(to_integer(unsigned(port_id))) & " La route sollicité n'existe pas dans ce sous réseau le paquet va être détruit ! fifo_out_sig:=" & image(fifo_out_signal); 563 request_latch<="0000"; --à revoir il faut empêcher le routeur de se bloquer 564 rt_err<='1'; --il faut activer la destruction du paquet 565 else --faire monter les données vers le ports supérieur 566 request_latch<=std_logic_vector(to_unsigned(number_of_ports-1,4)); 567 reql:=std_logic_vector(to_unsigned(number_of_ports-1,4)); 568 rt_err<='0'; 569 end if; 570 571 end if; 572 end if; 573 report "fifo_out=" & image(fifo_out_signal) & " pid_bits:=" & integer'image(pid_bits) & " adr_mask:=" & integer'image(adr_mask) & " rt:=" & image(rt) & " adr_sub_net=" & image(adr_sub_net) & " reql:=" & image(reql) & " sur le port " & integer'image(to_integer(unsigned(port_id))+1); 574 575 assert (unsigned(reql)<number_of_ports-1) 576 report "Input_port_module n° " & integer'image(port_num) & " Le port sollicité n'est pas dans la branche !" 577 severity warning; 578 elsif cmd_in_en='1' and request_latch_en='1' then --c'est une commande le port de dest est le même que le port d'entrée 491 579 request_latch<=Port_ID(3 downto 0); --car les ports commencent à 0 492 580 end if; 493 494 end if; 581 end if; 582 --request_latch<=reql; 583 route<=rt; --pour le débogage uniquement pas besoin de conserver ce paramètre en principe 584 585 495 586 end process; 496 587 … … 515 606 pop_state <= CmdOn; 516 607 end if; 608 nib<=nbyte; 517 609 when CmdOn => if empty_latch='1' and cmd_in_en='0' then 518 610 pop_state <= state0; … … 533 625 -- 534 626 pop_state <= state1; 535 627 fifo_out2<=fifo_out_signal; 536 628 --end if; 537 629 when addhead => 630 pop_state <= addheadn; 631 when addheadn => pop_state <= state1; 538 632 when state1 => if port_granted ='1' then --lecture de la longueur des données 539 633 data_counter <= fifo_out_signal; … … 543 637 readOk<='1'; 544 638 end if; 545 pop_state <= state2; 639 pop_state <= state1n; 640 nib<=nib-1; 546 641 wrok<='1'; 547 642 else 548 643 wrok<='0'; 549 644 end if; 550 645 646 when state1n => if nib=1 then 647 pop_state <= state2; 648 nib<=nbyte; 649 else 650 nib<=nib-1; 651 end if; 652 wrok<='1'; 653 fifo_out2<=fifo_out_signal; 551 654 when state2 => if port_granted='1' then 552 655 wrok<='1'; 553 656 if fifo_empty_signal ='0' then 554 if rd_en_signal ='1' and unsigned(data_counter)<= 3then657 if rd_en_signal ='1' and unsigned(data_counter)<= 2 then 555 658 data_counter <= data_counter - 1; 556 pop_state <= stpulse; 659 pop_state <= state2n; 660 nib<=nib-1; 557 661 ReadOk<='1'; 662 pulseon<='1'; 558 663 elsif rd_en_signal ='1' then 559 664 data_counter <= data_counter - 1; 560 pop_state <= state2; 665 pop_state <= state2n; 666 nib<=nib-1; 561 667 ReadOk<='1'; 562 668 else --fifo_empty_signal='1' fin prématurée de la lecture … … 580 686 data_counter <= data_counter + 1; 581 687 end if; 688 689 when state2n => if nib=1 then 690 if pulseon='1' then 691 pop_state <= stpulse; 692 else 693 pop_state <= state2; 694 end if; 695 nib<=nbyte; 696 else 697 nib<=nib-1; 698 end if; 699 wrok<='1'; 700 fifo_out2<=fifo_out_signal; 582 701 when strecover => if fifo_empty_signal='0' and port_granted='1' then 583 702 pop_state<=state2; … … 591 710 592 711 when stpulse => if port_granted='1' then 593 pop_state <= state3; --pousser la dernière donnée dehors 712 pop_state <= state3;--stpulsen; --pousser la dernière donnée dehors 713 --nib<=nib-1; 594 714 data_counter <= data_counter - 1; 595 715 wrok<='1'; 596 end if; 597 wrok<='0'; 716 pulseon<='0'; 717 else 718 wrok<='0'; 719 end if; 720 721 when stpulsen => wrok<='0'; 722 if nib=1 then 723 pop_state <= state3; 724 nib<=nbyte; 725 else 726 nib<=nib-1; 727 end if; 728 fifo_out2<=fifo_out_signal; 598 729 when state3 => wrok<='0'; 599 730 data_counter <= data_counter - 1; … … 611 742 612 743 -- actions associées à chaque etat de la fsm de mealy 613 pop_fsm_action : process(pop_state, fifo_out_signal, empty_latch, rd_en_signal,readok, port_granted)744 pop_fsm_action : process(pop_state, fifo_out_signal,fifo_out2,empty_latch, rd_en_signal,readok, port_granted,nib ) 614 745 begin 615 746 -- code fonctionnel … … 623 754 dat_exec<='0'; 624 755 dat_Err<='0'; 625 push_dout<=fifo_out_signal ;756 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 626 757 627 758 when CmdOn => dat_request_latch_en <= '0'; … … 633 764 dat_exec<='0'; 634 765 dat_Err<='0'; 635 push_dout<=fifo_out_signal ;766 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 636 767 when WaitGrant => 637 768 dat_request_latch_en <='1'; --autoriser l'identification du port de destination … … 643 774 dat_exec<='1'; 644 775 dat_Err<='0'; 645 push_dout<=fifo_out_signal(7 downto 4) & PORT_ID(3 downto 0); 776 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 777 --push_dout<=fifo_out_signal(Word-1 downto Word/2) & PORT_ID(Word/2-1 downto 0); 646 778 when ReqPort => 647 779 dat_request_latch_en <='1'; --autoriser l'identification du port de destination 648 dat_pipeline_latch_en <= ' 1'; --pour le transmettre à travers le réseau780 dat_pipeline_latch_en <= '0'; --pour le transmettre à travers le réseau 649 781 dat_fifo_read_signal <= '1'; 650 782 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request … … 653 785 dat_exec<='1'; 654 786 dat_Err<='0'; 655 push_dout<=fifo_out_signal(7 downto 4) & PORT_ID(3 downto 0); 787 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 788 --push_dout<=fifo_out_signal(Word-1 downto Word/2) & PORT_ID(Word/2-1 downto 0); 789 when addhead => 790 dat_request_latch_en <='0'; --autoriser l'identification du port de destination 791 dat_pipeline_latch_en <= '1'; --pour le transmettre à travers le réseau 792 dat_fifo_read_signal <= '0'; 793 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 794 dat_data_out_pulse <= '0'; --transmettre le signal pour le dernier mot 795 dat_priority_rotation <= '0'; 796 dat_exec<='1'; 797 dat_Err<='0'; 798 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 656 799 657 800 when state1 => dat_request_latch_en <= '0'; 658 801 dat_pipeline_latch_en <= rd_en_signal and port_granted; 659 dat_fifo_read_signal <= rd_en_signal and port_granted; 802 dat_fifo_read_signal <= '0';--rd_en_signal and port_granted; 803 dat_request_decoder_en <= '1'; 804 dat_data_out_pulse <= '0';--port_granted; 805 dat_priority_rotation <= '0'; 806 dat_exec<='1'; 807 dat_Err<='0'; 808 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 809 when state1n => dat_request_latch_en <= '0'; 810 dat_pipeline_latch_en <= '1'; -- toujours actif pour cet octet 811 dat_fifo_read_signal <= '0'; 660 812 dat_request_decoder_en <= '1'; 661 813 dat_data_out_pulse <= port_granted; … … 663 815 dat_exec<='1'; 664 816 dat_Err<='0'; 665 push_dout<=fifo_out _signal;817 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 666 818 667 819 when state2 |strecover => dat_request_latch_en <= '0'; … … 669 821 dat_fifo_read_signal <= port_granted and readok; 670 822 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 671 dat_data_out_pulse <= port_granted and wrOk and not(fifo_empty_signal);823 dat_data_out_pulse <= port_granted and wrOk ;--and not(fifo_empty_signal); 672 824 dat_priority_rotation <= '0'; 673 825 dat_exec<='1'; 674 826 dat_Err<='0'; 675 push_dout<=fifo_out_signal; 676 677 when stpulse => dat_request_latch_en <= '0'; --pousser la dernière donnée 678 dat_pipeline_latch_en <= '0'; --autoriser la lecture du fifo en sortie 827 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 828 829 when state2n => dat_request_latch_en <= '0'; 830 dat_pipeline_latch_en <= '1'; --autoriser la lecture du fifo en sortie 831 dat_fifo_read_signal <= '0'; 832 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 833 dat_data_out_pulse <= port_granted and wrOk ;--and not(fifo_empty_signal); 834 dat_priority_rotation <= '0'; 835 dat_exec<='1'; 836 dat_Err<='0'; 837 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 838 when stpulse|stpulsen => dat_request_latch_en <= '0'; --pousser la dernière donnée 839 dat_pipeline_latch_en <= wrok; --autoriser la lecture du fifo en sortie 679 840 dat_fifo_read_signal <='0'; 680 841 dat_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request … … 683 844 dat_exec<='1'; 684 845 dat_Err<='0'; 685 push_dout<=fifo_out_signal; 846 push_dout<=fifo_out2(8*nib-1 downto 8*(nib-1)); 847 686 848 687 849 when state3 => dat_request_latch_en <= '0'; … … 693 855 dat_exec<='0'; 694 856 dat_Err<='0'; 695 push_dout<=fifo_out_signal ;857 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 696 858 when stateErr => dat_request_latch_en <= '0'; 697 859 dat_pipeline_latch_en <= '0'; … … 702 864 dat_exec<='1'; 703 865 dat_Err<='1'; 704 push_dout<=fifo_out_signal ;866 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 705 867 when others => dat_request_latch_en <= '0'; 706 868 dat_pipeline_latch_en <= '0'; … … 711 873 dat_exec<='0'; 712 874 dat_Err<='0'; 713 push_dout<=fifo_out_signal ;875 push_dout<=fifo_out_signal(8*nib-1 downto 8*(nib-1)); 714 876 715 877 end case; 716 878 end process; 717 879 -- traitement des commandes reçues par le switch 718 fsm_cmd:process(clk ,cmd_in_en)880 fsm_cmd:process(clk) 719 881 variable timeout : natural:=0; 720 882 variable cmdcode : natural range 0 to 255; … … 731 893 end if; 732 894 cmdReadOk<='0'; 895 cnib<=nbyte; 733 896 when cmdwait => if port_granted='1' then -- demande du port de sortie 734 897 … … 754 917 -- end if; 755 918 when cmdsetdest => 919 756 920 if port_granted='1' then 921 cmdstate<=cmdsetdestn; 922 cnib<=cnib-1; 923 end if; 924 cmdReadOk<='0'; 925 when cmdsetdestn => if cnib=1 then 926 cmdstate<=cmdsetcount; 927 cnib<=nbyte; 928 else 929 cnib<=cnib-1; 930 end if; 931 when cmdsetcount => 932 if port_granted='1' then 933 cmdstate<=cmdsetcountn; 934 cnib<=cnib-1; 935 else 757 936 cmdstate<=cmdsetcount; 758 937 end if; 759 938 cmdReadOk<='0'; 760 when cmdsetcount =>761 if port_granted='1'then762 cmdstate<=cmdsetID;763 else764 cmdstate<=cmdsetdest;765 end if;766 cmdReadOk<='0';939 940 when cmdsetcountn => if cnib=1 then 941 cmdstate<=cmdsetID; 942 cnib<=nbyte; 943 else 944 cnib<=cnib-1; 945 end if; 767 946 when cmdsetID=> 768 947 if port_granted='1' then 769 cmdstate <=cmdpulse; 948 cmdstate <=cmdsetIDn; 949 cnib<=cnib-1; 770 950 end if; 771 951 cmdReadOk<='0'; 952 when cmdsetIDn => if cnib=1 then 953 cmdstate<=cmdpulse; 954 cnib<=nbyte; 955 else 956 cnib<=cnib-1; 957 end if; 772 958 when cmdpulse => 773 959 if port_granted='1' then 774 cmdstate <=cmdEnd; 960 cmdstate <=cmdpulsen; 961 cnib<=cnib-1; 775 962 end if; 776 963 cmdReadOk<='0'; 964 when cmdpulsen => if cnib=1 then 965 cmdstate<=cmdEnd; 966 cnib<=nbyte; 967 else 968 cnib<=cnib-1; 969 end if; 777 970 when cmdend => 778 971 if cmd_in_en='0' then --éviter l'exécution en boucle … … 808 1001 cmd_data_out_pulse <= '0'; 809 1002 cmd_priority_rotation <= '1'; --sans priorité 810 cmd_data_signal<= Port_ID;1003 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 811 1004 when cmdwait => 812 1005 cmd_exec<='1'; … … 816 1009 cmd_priority_rotation <= '0'; --avec priorité 817 1010 cmd_request_decoder_en <= '1'; --demande d'émission 818 cmd_data_signal<= Port_ID;1011 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 819 1012 cmd_data_out_pulse <= '0'; 820 1013 when cmdsetdest => … … 827 1020 cmd_data_out_pulse <= '0'; 828 1021 cmd_priority_rotation <= '0'; 829 cmd_data_signal<=Port_ID; -- le numéro du port et le nombre total des ports est envoyé 830 when cmdsetcount => 1022 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 1023 when cmdsetdestn => 1024 --cmd_request_decoder_en <= '1'; 1025 cmd_exec<='1'; 1026 cmd_pipeline_latch_en <='1'; --empiler dans le tampon de sortie la donnée 1027 cmd_fifo_read_signal <='0'; 1028 cmd_request_latch_en<='0'; 1029 cmd_request_decoder_en <= '1'; --autoriser le decodeur à activer le dernier bit de request 1030 cmd_data_out_pulse <= '1'; 1031 cmd_priority_rotation <= '0'; 1032 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 1033 1034 when cmdsetcount|cmdsetcountn=> 831 1035 832 1036 cmd_exec<='1'; … … 837 1041 cmd_data_out_pulse <= port_granted; 838 1042 cmd_priority_rotation <= '0'; 839 cmd_data_signal<=STD_LOGIC_VECTOR(to_unsigned(3, 8));840 when cmdSetId 1043 cmd_data_signal<=STD_LOGIC_VECTOR(to_unsigned(3,Word)); 1044 when cmdSetId| cmdSetIdn=> 841 1045 --cmd_request_decoder_en <= '1'; 842 1046 cmd_exec<='1'; … … 847 1051 cmd_data_out_pulse <= port_granted; 848 1052 cmd_priority_rotation <= '0'; 849 cmd_data_signal<= Port_ID; -- le numéro du port et le nombre total des ports est envoyé1053 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; -- le numéro du port et le nombre total des ports est envoyé 850 1054 851 1055 when cmdpulse => cmd_exec<='1'; 852 cmd_pipeline_latch_en <=' 0';1056 cmd_pipeline_latch_en <='1'; 853 1057 cmd_fifo_read_signal <='0'; 854 1058 cmd_request_latch_en<='0'; … … 856 1060 cmd_data_out_pulse <= '1';--port_granted; --s'assurer que la dernière donnée est bien lue 857 1061 cmd_priority_rotation <= '0'; 1062 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 1063 1064 when cmdpulsen => cmd_exec<='1'; 1065 cmd_pipeline_latch_en <='0'; 1066 cmd_fifo_read_signal <='0'; 1067 cmd_request_latch_en<='0'; 1068 cmd_request_decoder_en <= '1'; --autoriser le decodeur activer le dernier bit de request 1069 cmd_data_out_pulse <= '0';--port_granted; --s'assurer que la dernière donnée est bien lue 1070 cmd_priority_rotation <= '0'; 858 1071 --cmd_data_signal<=Port_ID ; 859 cmd_data_signal<= Port_ID;1072 cmd_data_signal<=std_logic_vector(to_unsigned(tot_ports,Word-adr_len)) & Port_ID; 860 1073 861 1074 when cmdend => -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/OUTPUT_PORT_MODULE.vhd
r101 r139 19 19 -- Additional Comments: Ajout d'un délai pour ignorer les paquets qui sont là depuis 20 20 -- longtemps 21 -- 21 --Revision: Mai-02-2014 22 -- Revision 0.01 - File 23 -- Additional Comments: Passage à la version 16 bits 24 -- longtemps 22 25 ---------------------------------------------------------------------------------- 23 26 library IEEE; … … 34 37 35 38 entity OUTPUT_PORT_MODULE is 36 Port ( data_in : in STD_LOGIC_VECTOR (Word-1 downto 0); 39 generic( nbyte : positive:=2); -- le nombre de Byte dans chaque mot du port par défaut 2 40 41 Port ( data_in : in STD_LOGIC_VECTOR (7 downto 0); 37 42 reset : in STD_LOGIC; 38 43 clk : in STD_LOGIC; … … 60 65 type typ_outfsm is (Idle,waiting,dropping,reading); 61 66 type typ_receiv is (r_wait,r_head,r_len,r_glen,r_data,r_pulse,r_end); 62 67 type typ_store is (idle,accu,transf); 63 68 signal EtRec : typ_receiv; 69 signal Et_store,next_et_store: typ_store; 64 70 signal Et_out_fsm : typ_outfsm; 65 signal fifo_empty : std_logic;71 signal fifo_empty ,fifo_wr: std_logic:='0'; 66 72 signal sw : std_logic:='0'; -- permet de positionner le mux sur les signaux internes 67 73 signal tlimit : natural:=0; --permet de compter les impulsions de temps 68 74 signal n : natural:=0; --utiliser pour la mae du tampon de sortie 75 signal nib : natural:=nbyte; --nombre de byte à transférer 69 76 signal rcv_start : std_logic; --début de la réception 70 77 signal rcv_ack : std_logic; -- acquittement de la réception 71 78 signal rcv_comp : std_logic; -- fin de la réception 72 79 signal spop,pop,rd_en,dat_avail : std_logic:='0'; 80 signal fifo_in :std_logic_vector(Word-1 downto 0); --le tampon de données d'entrée 73 81 signal mem,fifo_out : std_logic_vector(Word-1 downto 0); --variable tampon sans intérêt réel 74 82 begin … … 77 85 port map ( 78 86 clk => clk, 79 din => data_in,87 din => fifo_in, 80 88 rd_en => rd_en, 81 89 srst => reset, 82 wr_en => wr_en,90 wr_en => fifo_wr, 83 91 dout => fifo_out, 84 92 empty => fifo_empty, 85 93 full => fifo_full); 86 94 --sync_store_state:process (clk) 95 --begin 96 --if rising_edge(clk) then 97 -- if reset='1' then 98 -- et_store<=idle; 99 -- else 100 -- et_store<=next_et_store; 101 -- end if; 102 -- 103 --end if; 104 --end process sync_store_state; 105 next_store_state:process (clk) 106 begin 107 if rising_edge(clk) then 108 case et_store is 109 when idle => 110 if wr_en='1' then 111 et_store<=transf; 112 nib<=nib-1; 113 else 114 nib<=nbyte; 115 end if; 116 117 118 when accu => 119 120 if nib=1 then 121 et_store<=transf; 122 123 nib<=nbyte; 124 else 125 nib<=nib-1; 126 end if; 127 128 when transf => 129 --next_et_store<=idle; 130 if wr_en='1' then 131 if nib=1 then 132 nib<=nbyte; 133 else 134 nib<=nib-1; 135 end if; 136 et_store<=accu; 137 else 138 nib<=nbyte; 139 et_store<=idle; 140 end if; 141 end case ; 142 143 end if; 144 end process next_store_state; 145 146 val_store_state:process (et_store,nib,data_in,wr_en) 147 begin 148 --case et_store is 149 --when transf =>fifo_wr<='1'; 150 --when others => fifo_wr<='0'; 151 --end case; 152 if nib=1 then 153 fifo_wr<='1'; 154 else 155 fifo_wr<='0'; 156 end if; 157 fifo_in(8*nib-1 downto 8*(nib-1))<=data_in; 158 end process val_store_state; 159 87 160 88 161 outport_proc : process(clk,reset,fifo_empty) 89 162 begin 163 90 164 if rising_edge(clk) then 91 165 if reset='1' then -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/SCHEDULER3_3.VHD
r101 r139 30 30 --use UNISIM.VComponents.all; 31 31 entity Scheduler3_3 is 32 Port ( Req uest: in STD_LOGIC_VECTOR (9 downto 1);32 Port ( Req : in STD_LOGIC_VECTOR (9 downto 1); 33 33 Fifo_full : in STD_LOGIC_VECTOR (3 downto 1); 34 34 clk : in STD_LOGIC; … … 39 39 40 40 architecture Behavioral of Scheduler3_3 is 41 constant NB_IO:positive:=3; 41 42 --Declaration du types 42 43 --tableau de signaux de connexion des cellules arbitres … … 46 47 PORT (P, Fifo_full,Request, West,North : in STD_LOGIC; 47 48 Grant,East,South : out STD_LOGIC ); 48 End Component;--Signaux de connexion des cellues 49 End Component; 50 -- 51 component Def_Request is 52 generic (NB_IO :positive:=3); 53 Port ( Req : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 54 clk : in STD_LOGIC; 55 reset : in STD_LOGIC; 56 fifo_full : in STD_LOGIC_VECTOR (NB_IO downto 1); 57 priority_rotation : in STD_LOGIC_VECTOR (NB_IO downto 1); 58 grant : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 59 request : out STD_LOGIC_VECTOR (NB_IO**2 downto 1)); 60 end component; 61 constant NB_IO2 :positive:=NB_IO**2; -- le carré du nombre de ports d'E/S 62 --Signaux de connexion des cellues 49 63 SIGNAL south_2_north : C_Bar_Signal_Array; -- connexion south north 50 64 SIGNAL east_2_west : C_Bar_Signal_Array; -- connexion east west 51 65 SIGNAL Signal_mask : C_Bar_Signal_Array;-- connexion des masques de priorité 52 66 SIGNAL Signal_grant : C_Bar_Signal_Array;-- connexion des signaux de validation 53 SIGNAL Signal_priority : STD_LOGIC_VECTOR ( 5 DOWNTO 1);--signal pour la connection des vecteurde priorité67 SIGNAL Signal_priority : STD_LOGIC_VECTOR (2*NB_IO-1 DOWNTO 1);--signal pour la connection des vecteurs de priorité 54 68 SIGNAL High : std_logic;--niveau pour les cellules des extremités nord et ouest 55 signal grant_latch : std_logic_vector(9 downto 1); 69 56 70 signal priority_rotation_en : std_logic; 57 signal Grant,req_grant : std_logic_vector(9 downto 1); 71 72 signal Grant,request : std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 58 73 begin 59 74 60 75 --validation de la rotation de priorité lorsque aucun port n'emet 61 req_grant<=(request and grant_latch); 62 priority_rotation_en <= '1' when unsigned(priority_rotation) = 7 else '0'; 76 77 --priority_rotation_en <= '1' when unsigned(priority_rotation) = 7 else '0'; 78 priority_rotation_en <= '1' when unsigned(priority_rotation) = 2**NB_IO-1 else '0'; 63 79 --latch servant qui memorise le signal grant pendant a transmission 64 grant_latch_process : process(clk) 65 begin 66 if rising_edge(clk) then 67 if reset = '1' then 68 grant_latch <= (others => '0'); 69 elsif priority_rotation_en = '1' then 70 grant_latch <= Grant; 71 end if; 72 end if; 73 end process; 74 port_grant <= grant_latch; 80 --cette instance permet de déterminer le vecteur request 81 --en fonction de l'état fifo_full et de la requête initiale 82 inst_defreq: def_request generic map (NB_IO) 83 port map (clk=>clk, 84 reset=>reset, 85 req=>req, 86 fifo_full=>fifo_full, 87 priority_rotation=>priority_rotation, 88 grant=>grant, 89 request=>request 90 ); 91 port_grant <= grant; 75 92 Grant(1) <= Signal_grant(1)(1) or Signal_grant(4)(1); -- Grant(1,1) 76 93 Grant(2) <= Signal_grant(2)(2) or Signal_grant(5)(2); -- Grant(1,2) -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/SCHEDULER5_5.VHD
r101 r139 30 30 --use UNISIM.VComponents.all; 31 31 entity Scheduler5_5 is 32 Port ( Req uest: in STD_LOGIC_VECTOR (25 downto 1);32 Port ( Req : in STD_LOGIC_VECTOR (25 downto 1); 33 33 Fifo_full : in STD_LOGIC_VECTOR (5 downto 1); 34 34 clk : in STD_LOGIC; … … 41 41 --Declaration du types 42 42 --tableau de signaux de connexion des cellules arbitres 43 constant NB_IO:positive:=5; 43 44 TYPE C_Bar_Signal_Array IS ARRAY(9 downto 1) of STD_LOGIC_VECTOR(5 downto 1); 44 45 -- declaration du composant cellule d'arbitrage … … 47 48 Grant,East,South : out STD_LOGIC ); 48 49 End Component;--Signaux de connexion des cellues 50 component Def_Request is 51 generic (NB_IO :positive:=5); 52 Port ( Req : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 53 clk : in STD_LOGIC; 54 reset : in STD_LOGIC; 55 fifo_full : in STD_LOGIC_VECTOR (NB_IO downto 1); 56 priority_rotation : in STD_LOGIC_VECTOR (NB_IO downto 1); 57 grant : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 58 request : out STD_LOGIC_VECTOR (NB_IO**2 downto 1)); 59 end component; 60 constant NB_IO2 :positive:=NB_IO**2; -- le carré du nombre de ports d'E/S 49 61 SIGNAL south_2_north : C_Bar_Signal_Array; -- connexion south north 50 62 SIGNAL east_2_west : C_Bar_Signal_Array; -- connexion east west … … 53 65 SIGNAL Signal_priority : STD_LOGIC_VECTOR (9 DOWNTO 1);--signal pour la connection des vecteur de priorité 54 66 SIGNAL High : std_logic;--niveau pour les cellules des extremités nord et ouest 55 signal grant_latch : std_logic_vector(25 downto 1);67 --signal grant_latch : std_logic_vector(25 downto 1); 56 68 signal priority_rotation_en : std_logic; 57 signal Grant ,req_grant: std_logic_vector(25 downto 1); 69 --signal Grant ,req_grant: std_logic_vector(25 downto 1); 70 signal Grant,request : std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 58 71 begin 59 72 60 73 --validation de la rotation de priorité lorsque aucun port n'emet 61 req_grant<=(request and grant_latch); 62 priority_rotation_en <= '1' when unsigned(req_grant) = 0 or unsigned(priority_rotation) = 31 else '0'; 74 -- req_grant<=(request and grant_latch); 75 priority_rotation_en <= '1' when unsigned(priority_rotation) = 2**NB_IO-1 else '0'; 76 --priority_rotation_en <= '1' when unsigned(req_grant) = 0 or unsigned(priority_rotation) = 31 else '0'; 63 77 --latch servant qui memorise le signal grant pendant a transmission 64 grant_latch_process : process(clk) 65 begin 66 if rising_edge(clk) then 67 if reset = '1' then 68 grant_latch <= (others => '0'); 69 elsif priority_rotation_en = '1' then 70 grant_latch <= Grant; 71 end if; 72 end if; 73 end process; 74 port_grant <= grant_latch; 78 --cette instance permet de déterminer le vecteur request 79 --en fonction de l'état fifo_full et de la requête initiale 80 inst_defreq: def_request generic map (NB_IO) 81 port map (clk=>clk, 82 reset=>reset, 83 req=>req, 84 fifo_full=>fifo_full, 85 priority_rotation=>priority_rotation, 86 grant=>grant, 87 request=>request 88 ); 89 90 port_grant <= grant; 91 --port_grant <= grant_latch; 75 92 Grant(1) <= Signal_grant(1)(1) or Signal_grant(6)(1); -- Grant(1,1) 76 93 Grant(2) <= Signal_grant(2)(2) or Signal_grant(7)(2); -- Grant(1,2) -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/SCHEDULER9_9.VHD
r101 r139 30 30 --use UNISIM.VComponents.all; 31 31 entity Scheduler9_9 is 32 Port ( Req uest: in STD_LOGIC_VECTOR (81 downto 1);32 Port ( Req : in STD_LOGIC_VECTOR (81 downto 1); 33 33 Fifo_full : in STD_LOGIC_VECTOR (9 downto 1); 34 34 clk : in STD_LOGIC; … … 39 39 40 40 architecture Behavioral of Scheduler9_9 is 41 --déclaration de constantes 42 Constant NB_IO : positive:=9; --le nombre de ports d'entrée/sortie 41 43 --Declaration du types 42 44 --tableau de signaux de connexion des cellules arbitres 43 TYPE C_Bar_Signal_Array IS ARRAY( 17 downto 1) of STD_LOGIC_VECTOR(9downto 1);45 TYPE C_Bar_Signal_Array IS ARRAY(NB_IO*2-1 downto 1) of STD_LOGIC_VECTOR(NB_IO downto 1); 44 46 -- declaration du composant cellule d'arbitrage 45 47 Component Arbiter 46 48 PORT (P, Fifo_full,Request, West,North : in STD_LOGIC; 47 49 Grant,East,South : out STD_LOGIC ); 48 End Component;--Signaux de connexion des cellues 50 End Component; 51 component Def_Request is 52 generic (NB_IO :positive:=9); 53 Port ( Req : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 54 clk : in STD_LOGIC; 55 reset : in STD_LOGIC; 56 fifo_full : in STD_LOGIC_VECTOR (NB_IO downto 1); 57 priority_rotation : in STD_LOGIC_VECTOR (NB_IO downto 1); 58 grant : in STD_LOGIC_VECTOR (NB_IO**2 downto 1); 59 request : out STD_LOGIC_VECTOR (NB_IO**2 downto 1)); 60 end component; 61 constant NB_IO2 :positive:=NB_IO**2; -- le carré du nombre de ports d'E/S 62 63 --Signaux de connexion des cellues 49 64 SIGNAL south_2_north : C_Bar_Signal_Array; -- connexion south north 50 65 SIGNAL east_2_west : C_Bar_Signal_Array; -- connexion east west … … 53 68 SIGNAL Signal_priority : STD_LOGIC_VECTOR (17 DOWNTO 1);--signal pour la connection des vecteur de priorité 54 69 SIGNAL High : std_logic;--niveau pour les cellules des extremités nord et ouest 55 signal grant_latch : std_logic_vector(81 downto 1); 70 56 71 signal priority_rotation_en : std_logic; 57 signal Grant : std_logic_vector(81 downto 1);72 signal Grant,request : std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 58 73 begin 59 74 60 75 --validation de la rotation de priorité lorsque aucun port n'emet 61 priority_rotation_en <= '1' when unsigned(priority_rotation) = 511 else '0'; 62 --latch servant qui memorise le signal grant pendant a transmission 63 grant_latch_process : process(clk) 64 begin 65 if rising_edge(clk) then 66 if reset = '1' then 67 grant_latch <= (others => '0'); 68 elsif priority_rotation_en = '1' then 69 grant_latch <= Grant; 70 end if; 71 end if; 72 end process; 73 port_grant <= Grant and grant_latch; 76 -- priority_rotation_en <= '1' when unsigned(priority_rotation) = 511 else '0';tation) = 511 else '0'; 77 priority_rotation_en <= '1' when unsigned(priority_rotation) = 2**NB_IO-1 else '0'; 78 --evaluation du signal request 79 inst_defreq: def_request generic map (NB_IO=>9) 80 port map (clk=>clk, 81 reset=>reset, 82 req=>req, 83 fifo_full=>fifo_full, 84 priority_rotation=>priority_rotation, 85 grant=>grant, 86 request=>request 87 ); 88 89 port_grant <= grant; 74 90 Grant(1) <= Signal_grant(1)(1) or Signal_grant(10)(1); -- Grant(1,1) 75 91 Grant(2) <= Signal_grant(2)(2) or Signal_grant(11)(2); -- Grant(1,2) -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/SWITCH_GEN.vhd
r101 r139 14 14 -- nécessaire à l'implémentation du switch de la dimension voulue 15 15 -- Dependencies: 16 -- 16 -- Modifié le 28/04/1975 17 17 -- Revision: 18 18 -- Revision 0.01 - File Created … … 32 32 entity SWITCH_GEN is 33 33 --type portio is array(positive range) of std_logic_vector (7 downto 0); 34 generic(number_of_ports : positive := 8); 34 generic(n_ports : positive := 8;-- :nombre de ports E/S du NoC 2 à 16 35 tot_ports: positive :=16; -- nombre total de ports 36 NET_ADR :std_logic_vector(9 downto 0):="0000000000"; 37 NET_MASK:natural:=0); -- Nombre de bits à un du masque en partant de la gauche 35 38 port( 36 39 -- ports d'entree 37 Port_in : in typ_portIO(1 to n umber_of_ports) ;40 Port_in : in typ_portIO(1 to n_ports) ; 38 41 39 42 40 43 -- port de sortie 41 Port_out : out typ_portIO(1 to n umber_of_ports);44 Port_out : out typ_portIO(1 to n_ports); 42 45 43 46 -- signaux de controle 44 data_in_en : in std_logic_vector(n umber_of_ports downto 1);45 cmd_in_en : in std_logic_vector(n umber_of_ports downto 1);46 data_out_en : in std_logic_vector(n umber_of_ports downto 1);47 fifo_in_full : out std_logic_vector(n umber_of_ports downto 1);48 fifo_in_empty : out std_logic_vector(n umber_of_ports downto 1);49 data_available : out std_logic_vector(n umber_of_ports downto 1);47 data_in_en : in std_logic_vector(n_ports downto 1); 48 cmd_in_en : in std_logic_vector(n_ports downto 1); 49 data_out_en : in std_logic_vector(n_ports downto 1); 50 fifo_in_full : out std_logic_vector(n_ports downto 1); 51 fifo_in_empty : out std_logic_vector(n_ports downto 1); 52 data_available : out std_logic_vector(n_ports downto 1); 50 53 clk : in STD_LOGIC; 51 54 reset : in STD_LOGIC); … … 58 61 COMPONENT INPUT_PORT_MODULE 59 62 generic(number_of_ports : positive := 8; 60 Port_num: natural); 61 Port ( data_in : in STD_LOGIC_VECTOR (7 downto 0); 63 Port_num: natural; 64 adr_mask : natural := NET_MASK;--le nombre de '1' en partant le la gauche de l'adresse 65 adr_len: positive:=NET_ADR'length; --la taille en bit de l'adresse 10 bits --> 1024 hotes 66 tot_ports: positive :=tot_ports; --Nomnre de ports total du réseau 67 adr_sub_net : std_logic_vector(9 downto 0) := NET_ADR;--l'adresse du sous-réseau 68 nbyte : positive:=2 -- le nombre de Byte dans chaque mot du port par défaut 2 69 70 ); 71 Port ( data_in : in STD_LOGIC_VECTOR (Word-1 downto 0); 62 72 data_in_en : in STD_LOGIC; 63 73 cmd_in_en : in STD_LOGIC; 64 74 reset : in STD_LOGIC; 65 75 clk : in STD_LOGIC; 66 request : out STD_LOGIC_VECTOR (n umber_of_ports downto 1);67 grant : in STD_LOGIC_VECTOR (n umber_of_ports downto 1);76 request : out STD_LOGIC_VECTOR (n_ports downto 1); 77 grant : in STD_LOGIC_VECTOR (n_ports downto 1); 68 78 fifo_full : out STD_LOGIC; 69 79 fifo_empty : out STD_LOGIC; 70 80 priority_rotation : out std_logic; 71 data_out : out STD_LOGIC_VECTOR (7 downto 0); 81 data_out : out STD_LOGIC_VECTOR (7 downto 0); -- le crossbar est fixé à 8 bits 72 82 data_out_pulse : out std_logic); 73 83 END COMPONENT; … … 77 87 COMPONENT OUTPUT_PORT_MODULE 78 88 PORT( 79 data_in : IN std_logic_vector(7 downto 0); 89 data_in : IN std_logic_vector(7 downto 0); -- le crossbar est fixé à 8 bits 80 90 reset : IN std_logic; 81 91 clk : IN std_logic; 82 92 wr_en : IN std_logic; 83 93 rd_out_en : IN std_logic; 84 data_out : OUT std_logic_vector( 7downto 0);94 data_out : OUT std_logic_vector(Word-1 downto 0); 85 95 fifo_full : OUT std_logic; 86 96 data_avalaible : OUT std_logic … … 185 195 --declaration des signaux de connection entre les modules du switch 186 196 187 Signal Request_signal : STD_LOGIC_VECTOR(n umber_of_ports*number_of_ports downto 1);188 Signal grant_signal : STD_LOGIC_VECTOR(n umber_of_ports*number_of_ports downto 1);189 Signal priority_rotation_signal : STD_LOGIC_VECTOR(n umber_of_ports downto 1);190 signal fifo_out_full_signal : std_logic_vector(n umber_of_ports downto 1);191 192 signal crossbar_in_port : Typ_PortIO (1 to number_of_ports);193 194 195 196 signal crossbar_out_port : Typ_PortIO (1 to number_of_ports);197 198 199 signal crossbar_in_pulse : std_logic_vector(n umber_of_ports downto 1);200 201 202 signal crossbar_out_pulse : std_logic_vector(n umber_of_ports downto 1);197 Signal Request_signal : STD_LOGIC_VECTOR(n_ports*n_ports downto 1); 198 Signal grant_signal : STD_LOGIC_VECTOR(n_ports*n_ports downto 1); 199 Signal priority_rotation_signal : STD_LOGIC_VECTOR(n_ports downto 1); 200 signal fifo_out_full_signal : std_logic_vector(n_ports downto 1); 201 202 signal crossbar_in_port : Typ_PortIO8(1 to n_ports); 203 204 205 206 signal crossbar_out_port : Typ_PortIO8(1 to n_ports); 207 208 209 signal crossbar_in_pulse : std_logic_vector(n_ports downto 1); 210 211 212 signal crossbar_out_pulse : std_logic_vector(n_ports downto 1); 203 213 204 214 … … 208 218 -- le circuit genere depend du parametre generique nombre de ports 209 219 -- switch 2 ports 210 switch2x2 : if n umber_of_ports = 2 generate220 switch2x2 : if n_ports = 2 generate 211 221 212 222 PORT1_INPUT_PORT_MODULE: INPUT_PORT_MODULE 213 GENERIC MAP(number_of_ports =>2,Port_num=>1) 223 GENERIC MAP(number_of_ports =>2,Port_num=>1, 224 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 225 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 226 tot_ports=>tot_ports, --Nomnre de ports total du réseau 227 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 228 nbyte =>WORD/8) 214 229 PORT MAP( 215 230 data_in => Port_in(1), … … 230 245 231 246 PORT2_INPUT_PORT_MODULE: INPUT_PORT_MODULE 232 GENERIC MAP(number_of_ports =>2,Port_num=>2) 247 GENERIC MAP(number_of_ports =>2,Port_num=>2, 248 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 249 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 250 tot_ports=>tot_ports, --Nomnre de ports total du réseau 251 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 252 nbyte =>WORD/8) 233 253 PORT MAP( 234 254 data_in => Port_in(2), … … 252 272 253 273 -- switch 3 ports 254 switch3x3 : if n umber_of_ports = 3 generate274 switch3x3 : if n_ports = 3 generate 255 275 256 276 PORT1_INPUT_PORT_MODULE: INPUT_PORT_MODULE 257 GENERIC MAP(number_of_ports =>3,Port_num=>1) 277 GENERIC MAP(number_of_ports =>3,Port_num=>1, 278 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 279 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 280 tot_ports=>tot_ports, --Nomnre de ports total du réseau 281 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 282 nbyte =>WORD/8) 258 283 PORT MAP( 259 284 data_in => Port_in(1), … … 276 301 277 302 PORT2_INPUT_PORT_MODULE: INPUT_PORT_MODULE 278 GENERIC MAP(number_of_ports =>3,Port_num=>2) 303 GENERIC MAP(number_of_ports =>3,Port_num=>2, 304 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 305 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 306 tot_ports=>tot_ports, --Nomnre de ports total du réseau 307 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 308 nbyte =>WORD/8) 279 309 PORT MAP( 280 310 data_in => Port_in(2), … … 283 313 reset => reset, 284 314 clk =>clk, 285 grant( 4) => grant_signal(4),286 grant( 5) => grant_signal(5),287 grant( 6) => grant_signal(6),315 grant(1) => grant_signal(4), 316 grant(2) => grant_signal(5), 317 grant(3) => grant_signal(6), 288 318 fifo_full =>fifo_in_full(2), 289 319 priority_rotation => priority_rotation_signal(2), … … 291 321 data_out =>crossbar_in_port(2), 292 322 data_out_pulse =>crossbar_in_pulse(2), 293 request( 4) =>request_signal(4),294 request( 5) =>request_signal(5),295 request( 6) =>request_signal(6)323 request(1) =>request_signal(4), 324 request(2) =>request_signal(5), 325 request(3) =>request_signal(6) 296 326 ); 297 327 298 328 PORT3_INPUT_PORT_MODULE: INPUT_PORT_MODULE 299 GENERIC MAP(number_of_ports =>3,Port_num=>3) 329 GENERIC MAP(number_of_ports =>3,Port_num=>3, 330 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 331 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 332 tot_ports=>tot_ports, --Nomnre de ports total du réseau 333 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 334 nbyte =>WORD/8) 300 335 PORT MAP( 301 336 data_in => Port_in(3), … … 304 339 reset => reset, 305 340 clk =>clk, 306 grant( 7) => grant_signal(7),307 grant( 8) => grant_signal(8),308 grant( 9) => grant_signal(9),341 grant(1) => grant_signal(7), 342 grant(2) => grant_signal(8), 343 grant(3) => grant_signal(9), 309 344 fifo_full =>fifo_in_full(3), 310 345 priority_rotation => priority_rotation_signal(3), … … 312 347 data_out =>crossbar_in_port(3), 313 348 data_out_pulse =>crossbar_in_pulse(3), 314 request( 7) =>request_signal(7),315 request( 8) =>request_signal(8),316 request( 9) =>request_signal(9)349 request(1) =>request_signal(7), 350 request(2) =>request_signal(8), 351 request(3) =>request_signal(9) 317 352 ); 318 353 … … 321 356 322 357 -- switch 4 à 7 ports 323 switch4x4_7x7 : if n umber_of_ports >= 4 and number_of_ports <=7 generate324 325 switch_4x4_7x7:for i in 1 to n umber_of_ports generate326 327 constant j: natural:=n umber_of_ports*(i-1);358 switch4x4_7x7 : if n_ports >= 4 and n_ports <=7 generate 359 360 switch_4x4_7x7:for i in 1 to n_ports generate 361 362 constant j: natural:=n_ports*(i-1); 328 363 begin 329 --j=n umber_of_ports*(i-1);364 --j=n_ports*(i-1); 330 365 PORTx4_INPUT_PORT_MODULE: INPUT_PORT_MODULE 331 GENERIC MAP(number_of_ports =>number_of_ports,Port_num=>i) 366 GENERIC MAP(number_of_ports =>n_ports,Port_num=>i, 367 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 368 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 369 tot_ports=>tot_ports, --Nomnre de ports total du réseau 370 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 371 nbyte =>WORD/8) 332 372 PORT MAP( 333 373 data_in => Port_in(i), … … 336 376 reset => reset, 337 377 clk =>clk, 338 grant =>grant_signal(j+ NUMBER_OF_PORTSdownto j+1),378 grant =>grant_signal(j+n_ports downto j+1), 339 379 340 380 fifo_full =>fifo_in_full(i), … … 343 383 data_out =>crossbar_in_port(i), 344 384 data_out_pulse =>crossbar_in_pulse(i), 345 request =>request_signal(j+ NUMBER_OF_PORTSdownto j+1)385 request =>request_signal(j+n_ports downto j+1) 346 386 347 387 ); … … 351 391 352 392 ---- switch 5 ports 353 --switch5x5 : if n umber_of_ports = 5 generate393 --switch5x5 : if n_ports = 5 generate 354 394 -- 355 395 --PORT1_INPUT_PORT_MODULE: INPUT_PORT_MODULE 356 --GENERIC MAP(n umber_of_ports =>5)396 --GENERIC MAP(n_ports =>5) 357 397 --PORT MAP( 358 398 -- data_in => Port_in(1), … … 378 418 -- 379 419 --PORT2_INPUT_PORT_MODULE: INPUT_PORT_MODULE 380 --GENERIC MAP(n umber_of_ports =>5)420 --GENERIC MAP(n_ports =>5) 381 421 --PORT MAP( 382 422 -- data_in => Port_in(2), … … 402 442 -- 403 443 --PORT3_INPUT_PORT_MODULE: INPUT_PORT_MODULE 404 --GENERIC MAP(n umber_of_ports =>5)444 --GENERIC MAP(n_ports =>5) 405 445 --PORT MAP( 406 446 -- data_in => Port_in(3), … … 426 466 -- 427 467 --PORT4_INPUT_PORT_MODULE: INPUT_PORT_MODULE 428 --GENERIC MAP(n umber_of_ports =>5)468 --GENERIC MAP(n_ports =>5) 429 469 --PORT MAP( 430 470 -- data_in => Port_in(4), … … 450 490 -- 451 491 --PORT5_INPUT_PORT_MODULE: INPUT_PORT_MODULE 452 --GENERIC MAP(n umber_of_ports =>5)492 --GENERIC MAP(n_ports =>5) 453 493 --PORT MAP( 454 494 -- data_in => Port_in(5), … … 477 517 -- 478 518 ---- switch 6 ports 479 --switch6x6 : if n umber_of_ports = 6 generate519 --switch6x6 : if n_ports = 6 generate 480 520 -- 481 521 --PORT1_INPUT_PORT_MODULE: INPUT_PORT_MODULE 482 --GENERIC MAP(n umber_of_ports =>6)522 --GENERIC MAP(n_ports =>6) 483 523 --PORT MAP( 484 524 -- data_in => Port_in(1), … … 845 885 846 886 -- switch 8 ports 847 switch8x8 : if n umber_of_ports = 8 generate848 switch_8x8:for i in 1 to n umber_of_ports generate849 constant j: natural:=n umber_of_ports*(i-1);887 switch8x8 : if n_ports = 8 generate 888 switch_8x8:for i in 1 to n_ports generate 889 constant j: natural:=n_ports*(i-1); 850 890 begin 851 891 --j<=number_of_ports*(i-1); 852 892 PORTx8_INPUT_PORT_MODULE: INPUT_PORT_MODULE 853 GENERIC MAP(number_of_ports =>8,Port_num=>i) 893 GENERIC MAP(number_of_ports =>8,Port_num=>i, 894 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 895 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 896 tot_ports=>tot_ports, --Nomnre de ports total du réseau 897 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 898 nbyte =>WORD/8) 854 899 PORT MAP( 855 900 data_in => Port_in(i), … … 858 903 reset => reset, 859 904 clk =>clk, 860 grant =>grant_signal(j+ NUMBER_OF_PORTSdownto j+1),905 grant =>grant_signal(j+n_ports downto j+1), 861 906 fifo_full =>fifo_in_full(i), 862 907 priority_rotation => priority_rotation_signal(i), … … 865 910 data_out_pulse =>crossbar_in_pulse(i), 866 911 867 request =>request_signal(j+ NUMBER_OF_PORTSdownto j+1)912 request =>request_signal(j+n_ports downto j+1) 868 913 ); 869 914 end generate switch_8x8; … … 871 916 872 917 -- switch 9 ports 873 switch9x9_to_15 : if (n umber_of_ports >= 9)and (number_of_ports <= 15) generate874 875 switch_9x9_to_15:for i in 1 to n umber_of_ports generate876 877 constant j: natural:=n umber_of_ports*(i-1);918 switch9x9_to_15 : if (n_ports >= 9)and (n_ports <= 15) generate 919 920 switch_9x9_to_15:for i in 1 to n_ports generate 921 922 constant j: natural:=n_ports*(i-1); 878 923 begin 879 924 880 925 PORTx9_INPUT_PORT_MODULE: INPUT_PORT_MODULE 881 GENERIC MAP(number_of_ports =>NUMBER_OF_PORTS,Port_num=>i) 926 GENERIC MAP(number_of_ports =>n_ports,Port_num=>i, 927 adr_mask => NET_MASK,--le nombre de '1' en partant le la gauche de l'adresse 928 adr_len=>NET_ADR'length, --la taille en bit de l'adresse 10 bits --> 1024 hotes 929 tot_ports=>tot_ports, --Nomnre de ports total du réseau 930 adr_sub_net => NET_ADR,--l'adresse du sous-réseau 931 nbyte =>WORD/8) 882 932 PORT MAP( 883 933 data_in => Port_in(i), … … 886 936 reset => reset, 887 937 clk =>clk, 888 grant => grant_signal(j+ NUMBER_OF_PORTSdownto j+1),938 grant => grant_signal(j+n_ports downto j+1), 889 939 fifo_full =>fifo_in_full(i), 890 940 priority_rotation => priority_rotation_signal(i), … … 893 943 data_out_pulse =>crossbar_in_pulse(i), 894 944 895 request =>request_signal(j+ NUMBER_OF_PORTSdownto j+1)945 request =>request_signal(j+n_ports downto j+1) 896 946 ); 897 947 end generate switch_9x9_to_15; … … 3897 3947 3898 3948 -- switch 16 ports 3899 switch16x16 : if n umber_of_ports = 16 generate3900 switch_16x16 :for i in 1 to n umber_of_ports generate3901 Constant j : natural:=n umber_of_ports*(i-1);3949 switch16x16 : if n_ports = 16 generate 3950 switch_16x16 :for i in 1 to n_ports generate 3951 Constant j : natural:=n_ports*(i-1); 3902 3952 begin 3903 3953 --j<=number_of_ports*(i-1); … … 4644 4694 -- le circuit genere depend du parametre generique nombre de ports 4645 4695 -- switch 2 ports 4646 port_out_switch2x2 : if n umber_of_ports = 2 generate4696 port_out_switch2x2 : if n_ports = 2 generate 4647 4697 4648 4698 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 4674 4724 4675 4725 -- switch 3 ports 4676 port_out_switch3x3 : if n umber_of_ports = 3 generate4726 port_out_switch3x3 : if n_ports = 3 generate 4677 4727 4678 4728 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 4716 4766 4717 4767 -- switch 4 ports 4718 port_out_switch4x4 : if n umber_of_ports = 4 generate4768 port_out_switch4x4 : if n_ports = 4 generate 4719 4769 4720 4770 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 4770 4820 4771 4821 -- switch 5 ports 4772 port_out_switch5x5 : if n umber_of_ports = 5 generate4822 port_out_switch5x5 : if n_ports = 5 generate 4773 4823 4774 4824 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 4836 4886 4837 4887 -- switch 6 ports 4838 port_out_switch6x6 : if n umber_of_ports = 6 generate4888 port_out_switch6x6 : if n_ports = 6 generate 4839 4889 4840 4890 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 4914 4964 4915 4965 -- switch 7 ports 4916 port_out_switch7x7 : if n umber_of_ports = 7 generate4966 port_out_switch7x7 : if n_ports = 7 generate 4917 4967 4918 4968 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5004 5054 5005 5055 -- switch 8 ports 5006 port_out_switch8x8 : if n umber_of_ports = 8 generate5056 port_out_switch8x8 : if n_ports = 8 generate 5007 5057 5008 5058 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5106 5156 5107 5157 -- switch 9 ports 5108 port_out_switch9x9 : if n umber_of_ports = 9 generate5158 port_out_switch9x9 : if n_ports = 9 generate 5109 5159 5110 5160 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5220 5270 5221 5271 -- switch 10 ports 5222 port_out_switch10x10 : if n umber_of_ports = 10 generate5272 port_out_switch10x10 : if n_ports = 10 generate 5223 5273 5224 5274 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5346 5396 5347 5397 -- switch 11 ports 5348 port_out_switch11x11 : if n umber_of_ports = 11 generate5398 port_out_switch11x11 : if n_ports = 11 generate 5349 5399 5350 5400 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5484 5534 5485 5535 -- switch 12 ports 5486 port_out_switch12x12 : if n umber_of_ports = 12 generate5536 port_out_switch12x12 : if n_ports = 12 generate 5487 5537 5488 5538 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5634 5684 5635 5685 -- switch 13 ports 5636 port_out_switch13x13 : if n umber_of_ports = 13 generate5686 port_out_switch13x13 : if n_ports = 13 generate 5637 5687 5638 5688 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5796 5846 5797 5847 -- switch 14 ports 5798 port_out_switch14x14 : if n umber_of_ports = 14 generate5848 port_out_switch14x14 : if n_ports = 14 generate 5799 5849 5800 5850 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 5970 6020 5971 6021 -- switch 15 ports 5972 port_out_switch15x15 : if n umber_of_ports = 15 generate6022 port_out_switch15x15 : if n_ports = 15 generate 5973 6023 5974 6024 PORT1_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 6156 6206 6157 6207 -- switch 16 ports 6158 port_out_switch16x16 : if n umber_of_ports = 16 generate6159 port_out_switch_16x16:for i in 1 to n umber_of_ports generate6208 port_out_switch16x16 : if n_ports = 16 generate 6209 port_out_switch_16x16:for i in 1 to n_ports generate 6160 6210 begin 6161 6211 PORTx16_OUTPUT_PORT_MODULE: OUTPUT_PORT_MODULE … … 6177 6227 -- le circuit genere depend du parametre generique nombre de ports 6178 6228 -- switch 2 ports 6179 crossbar_switch2x2 : if n umber_of_ports = 2 generate6229 crossbar_switch2x2 : if n_ports = 2 generate 6180 6230 6181 6231 Switch_Crossbar2_2: Crossbar … … 6225 6275 6226 6276 -- switch 3 ports 6227 crossbar_switch3x3 : if n umber_of_ports = 3 generate6277 crossbar_switch3x3 : if n_ports = 3 generate 6228 6278 6229 6279 Switch_Crossbar3_3: Crossbar … … 6275 6325 6276 6326 -- switch 4 ports 6277 crossbar_switch4x4 : if n umber_of_ports = 4 generate6327 crossbar_switch4x4 : if n_ports = 4 generate 6278 6328 6279 6329 Switch_Crossbar4_4: Crossbar … … 6327 6377 6328 6378 -- switch 5 ports 6329 crossbar_switch5x5 : if n umber_of_ports = 5 generate6379 crossbar_switch5x5 : if n_ports = 5 generate 6330 6380 6331 6381 Switch_Crossbar5_5: Crossbar … … 6381 6431 6382 6432 -- switch 6 ports 6383 crossbar_switch6x6 : if n umber_of_ports = 6 generate6433 crossbar_switch6x6 : if n_ports = 6 generate 6384 6434 6385 6435 Switch_Crossbar6_6: Crossbar … … 6438 6488 6439 6489 -- switch 7 ports 6440 crossbar_switch7x7 : if n umber_of_ports = 7 generate6490 crossbar_switch7x7 : if n_ports = 7 generate 6441 6491 6442 6492 Switch_Crossbar7_7: Crossbar … … 6496 6546 6497 6547 -- switch 8 ports 6498 crossbar_switch8x8 : if n umber_of_ports = 8 generate6548 crossbar_switch8x8 : if n_ports = 8 generate 6499 6549 6500 6550 Switch_Crossbar8_8: Crossbar … … 6556 6606 6557 6607 -- switch 9 ports 6558 crossbar_switch9x9 : if n umber_of_ports = 9 generate6608 crossbar_switch9x9 : if n_ports = 9 generate 6559 6609 6560 6610 Switch_Crossbar9_9: Crossbar … … 6618 6668 6619 6669 -- switch 10 ports 6620 crossbar_switch10x10 : if n umber_of_ports = 10 generate6670 crossbar_switch10x10 : if n_ports = 10 generate 6621 6671 6622 6672 Switch_Crossbar10_10: Crossbar … … 6682 6732 6683 6733 -- switch 11 ports 6684 crossbar_switch11x11 : if n umber_of_ports = 11 generate6734 crossbar_switch11x11 : if n_ports = 11 generate 6685 6735 6686 6736 Switch_Crossbar11_11: Crossbar … … 6748 6798 6749 6799 -- switch 12 ports 6750 crossbar_switch12x12 : if n umber_of_ports = 12 generate6800 crossbar_switch12x12 : if n_ports = 12 generate 6751 6801 6752 6802 Switch_Crossbar12_12: Crossbar … … 6816 6866 6817 6867 -- switch 13 ports 6818 crossbar_switch13x13 : if n umber_of_ports = 13 generate6868 crossbar_switch13x13 : if n_ports = 13 generate 6819 6869 6820 6870 Switch_Crossbar13_13: Crossbar … … 6886 6936 6887 6937 -- switch 14 ports 6888 crossbar_switch14x14 : if n umber_of_ports = 14 generate6938 crossbar_switch14x14 : if n_ports = 14 generate 6889 6939 6890 6940 Switch_Crossbar14_14: Crossbar … … 6958 7008 6959 7009 -- switch 15 ports 6960 crossbar_switch15x15 : if n umber_of_ports = 15 generate7010 crossbar_switch15x15 : if n_ports = 15 generate 6961 7011 6962 7012 Switch_Crossbar15_15: Crossbar … … 7032 7082 7033 7083 -- switch 16 ports 7034 crossbar_switch16x16 : if n umber_of_ports = 16 generate7084 crossbar_switch16x16 : if n_ports = 16 generate 7035 7085 7036 7086 Switch_Crossbar16_16: Crossbar … … 7108 7158 -- le circuit genere depend du parametre generique nombre de ports 7109 7159 -- switch 2 ports 7110 scheduler_switch2x2 : if n umber_of_ports = 2 generate7160 scheduler_switch2x2 : if n_ports = 2 generate 7111 7161 7112 7162 Scheduler2_2: Scheduler … … 7125 7175 7126 7176 -- switch 3 ports 7127 scheduler_switch3x3 : if n umber_of_ports = 3 generate7177 scheduler_switch3x3 : if n_ports = 3 generate 7128 7178 7129 7179 Scheduler3_3: Scheduler … … 7142 7192 7143 7193 -- switch 4 ports 7144 scheduler_switch4x4 : if n umber_of_ports = 4 generate7194 scheduler_switch4x4 : if n_ports = 4 generate 7145 7195 7146 7196 Scheduler4_4: Scheduler … … 7159 7209 7160 7210 -- switch 5 ports 7161 scheduler_switch5x5 : if n umber_of_ports = 5 generate7211 scheduler_switch5x5 : if n_ports = 5 generate 7162 7212 7163 7213 Scheduler5_5: Scheduler … … 7176 7226 7177 7227 -- switch 6 ports 7178 scheduler_switch6x6 : if n umber_of_ports = 6 generate7228 scheduler_switch6x6 : if n_ports = 6 generate 7179 7229 7180 7230 Scheduler6_6: Scheduler … … 7193 7243 7194 7244 -- switch 7 ports 7195 scheduler_switch7x7 : if n umber_of_ports = 7 generate7245 scheduler_switch7x7 : if n_ports = 7 generate 7196 7246 7197 7247 Scheduler7_7: Scheduler … … 7210 7260 7211 7261 -- switch 8 ports 7212 scheduler_switch8x8 : if n umber_of_ports = 8 generate7262 scheduler_switch8x8 : if n_ports = 8 generate 7213 7263 7214 7264 Scheduler8_8: Scheduler … … 7227 7277 7228 7278 -- switch 9 ports 7229 scheduler_switch9x9 : if n umber_of_ports = 9 generate7279 scheduler_switch9x9 : if n_ports = 9 generate 7230 7280 7231 7281 Scheduler9_9: Scheduler … … 7244 7294 7245 7295 -- switch 10 ports 7246 scheduler_switch10x10 : if n umber_of_ports = 10 generate7296 scheduler_switch10x10 : if n_ports = 10 generate 7247 7297 7248 7298 Scheduler10_10: Scheduler … … 7261 7311 7262 7312 -- switch 11 ports 7263 scheduler_switch11x11 : if n umber_of_ports = 11 generate7313 scheduler_switch11x11 : if n_ports = 11 generate 7264 7314 7265 7315 Scheduler11_11: Scheduler … … 7278 7328 7279 7329 -- switch 12 ports 7280 scheduler_switch12x12 : if n umber_of_ports = 12 generate7330 scheduler_switch12x12 : if n_ports = 12 generate 7281 7331 7282 7332 Scheduler12_12: Scheduler … … 7295 7345 7296 7346 -- switch 13 ports 7297 scheduler_switch13x13 : if n umber_of_ports = 13 generate7347 scheduler_switch13x13 : if n_ports = 13 generate 7298 7348 7299 7349 Scheduler13_13: Scheduler … … 7312 7362 7313 7363 -- switch 14 ports 7314 scheduler_switch14x14 : if n umber_of_ports = 14 generate7364 scheduler_switch14x14 : if n_ports = 14 generate 7315 7365 7316 7366 Scheduler14_14: Scheduler … … 7329 7379 7330 7380 -- switch 15 ports 7331 scheduler_switch15x15 : if n umber_of_ports = 15 generate7381 scheduler_switch15x15 : if n_ports = 15 generate 7332 7382 7333 7383 Scheduler15_15: Scheduler … … 7346 7396 7347 7397 -- switch 16 ports 7348 scheduler_switch16x16 : if n umber_of_ports = 16 generate7398 scheduler_switch16x16 : if n_ports = 16 generate 7349 7399 7350 7400 Scheduler16_16: Scheduler -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/Scheduler.vhd
r101 r139 61 61 COMPONENT Scheduler3_3 62 62 PORT( 63 Req uest: IN std_logic_vector(9 downto 1);63 Req : IN std_logic_vector(9 downto 1); 64 64 Fifo_full : IN std_logic_vector(3 downto 1); 65 65 clk : IN std_logic; … … 83 83 COMPONENT Scheduler5_5 84 84 PORT( 85 Req uest: IN std_logic_vector(25 downto 1);85 Req : IN std_logic_vector(25 downto 1); 86 86 Fifo_full : IN std_logic_vector(5 downto 1); 87 87 clk : IN std_logic; … … 94 94 COMPONENT Scheduler6_6 95 95 PORT( 96 Req uest: IN std_logic_vector(36 downto 1);96 Req : IN std_logic_vector(36 downto 1); 97 97 Fifo_full : IN std_logic_vector(6 downto 1); 98 98 clk : IN std_logic; … … 105 105 COMPONENT Scheduler7_7 106 106 PORT( 107 Req uest: IN std_logic_vector(49 downto 1);107 Req : IN std_logic_vector(49 downto 1); 108 108 Fifo_full : IN std_logic_vector(7 downto 1); 109 109 clk : IN std_logic; … … 127 127 COMPONENT Scheduler9_9 128 128 PORT( 129 Req uest: IN std_logic_vector(81 downto 1);129 Req : IN std_logic_vector(81 downto 1); 130 130 Fifo_full : IN std_logic_vector(9 downto 1); 131 131 clk : IN std_logic; … … 240 240 Inst_Scheduler3_3 : Scheduler3_3 241 241 PORT MAP( 242 Req uest=> Request_latch,242 Req => Request_latch, 243 243 Fifo_full => Fifo_full_latch, 244 244 clk => clk , … … 268 268 Inst_Scheduler5_5 : Scheduler5_5 269 269 PORT MAP( 270 Req uest=> Request,270 Req => Request, 271 271 Fifo_full => Fifo_full, 272 272 clk => clk , … … 282 282 Inst_Scheduler6_6 : Scheduler6_6 283 283 PORT MAP( 284 Req uest=> Request_latch,284 Req => Request_latch, 285 285 Fifo_full => Fifo_full_latch, 286 286 clk => clk , … … 296 296 Inst_Scheduler7_7 : Scheduler7_7 297 297 PORT MAP( 298 Req uest=> Request_latch,298 Req => Request_latch, 299 299 Fifo_full => Fifo_full_latch, 300 300 clk => clk , … … 324 324 Inst_Scheduler9_9 : Scheduler9_9 325 325 PORT MAP( 326 Req uest=> Request_latch,326 Req => Request_latch, 327 327 Fifo_full => Fifo_full_latch, 328 328 clk => clk , -
PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/NOC/Scheduler.vhd.bak
r101 r139 61 61 COMPONENT Scheduler3_3 62 62 PORT( 63 Req uest: IN std_logic_vector(9 downto 1);63 Req : IN std_logic_vector(9 downto 1); 64 64 Fifo_full : IN std_logic_vector(3 downto 1); 65 65 clk : IN std_logic; … … 72 72 COMPONENT Scheduler4_4 73 73 PORT( 74 Req uest: IN std_logic_vector(16 downto 1);74 Req : IN std_logic_vector(16 downto 1); 75 75 Fifo_full : IN std_logic_vector(4 downto 1); 76 76 clk : IN std_logic; … … 83 83 COMPONENT Scheduler5_5 84 84 PORT( 85 Req uest: IN std_logic_vector(25 downto 1);85 Req : IN std_logic_vector(25 downto 1); 86 86 Fifo_full : IN std_logic_vector(5 downto 1); 87 87 clk : IN std_logic; … … 94 94 COMPONENT Scheduler6_6 95 95 PORT( 96 Req uest: IN std_logic_vector(36 downto 1);96 Req : IN std_logic_vector(36 downto 1); 97 97 Fifo_full : IN std_logic_vector(6 downto 1); 98 98 clk : IN std_logic; … … 105 105 COMPONENT Scheduler7_7 106 106 PORT( 107 Req uest: IN std_logic_vector(49 downto 1);107 Req : IN std_logic_vector(49 downto 1); 108 108 Fifo_full : IN std_logic_vector(7 downto 1); 109 109 clk : IN std_logic; … … 240 240 Inst_Scheduler3_3 : Scheduler3_3 241 241 PORT MAP( 242 Req uest=> Request_latch,242 Req => Request_latch, 243 243 Fifo_full => Fifo_full_latch, 244 244 clk => clk , … … 254 254 Inst_Scheduler4_4 : Scheduler4_4 255 255 PORT MAP( 256 Req uest=> Request_latch,256 Req => Request_latch, 257 257 Fifo_full => Fifo_full_latch, 258 258 clk => clk , … … 268 268 Inst_Scheduler5_5 : Scheduler5_5 269 269 PORT MAP( 270 Req uest=> Request,270 Req => Request, 271 271 Fifo_full => Fifo_full, 272 272 clk => clk , … … 282 282 Inst_Scheduler6_6 : Scheduler6_6 283 283 PORT MAP( 284 Req uest=> Request_latch,284 Req => Request_latch, 285 285 Fifo_full => Fifo_full_latch, 286 286 clk => clk , … … 296 296 Inst_Scheduler7_7 : Scheduler7_7 297 297 PORT MAP( 298 Req uest=> Request_latch,298 Req => Request_latch, 299 299 Fifo_full => Fifo_full_latch, 300 300 clk => clk ,
Note: See TracChangeset
for help on using the changeset viewer.