- Timestamp:
- May 21, 2014, 11:36:19 AM (10 years ago)
- Location:
- PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
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 =>
Note: See TracChangeset
for help on using the changeset viewer.