Changeset 135 for PROJECT_CORE_MPI/MPI_HCL/TRUNK/NOC
- Timestamp:
- Apr 8, 2014, 5:45:26 PM (11 years ago)
- Location:
- PROJECT_CORE_MPI/MPI_HCL/TRUNK/NOC
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PROJECT_CORE_MPI/MPI_HCL/TRUNK/NOC/SCHEDULER4_4.VHD
r101 r135 49 49 Grant,East,South : out STD_LOGIC ); 50 50 End Component;--Signaux de connexion des cellues 51 51 component Def_Request is 52 generic (NB_IO :positive:=4); 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; 52 61 constant NB_IO2 :positive:=NB_IO**2; -- le carré du nombre de ports d'E/S 53 62 … … 58 67 SIGNAL Signal_priority : STD_LOGIC_VECTOR (7 DOWNTO 1);--signal pour la connection des vecteur de priorité 59 68 SIGNAL High : std_logic;--niveau pour les cellules des extremités nord et ouest 60 Signal Fifo_out_full : STD_LOGIC_VECTOR (NB_IO downto 1);61 signal grant_latch : std_logic_vector(NB_IO2 downto 1);69 -- Signal Fifo_out_full : STD_LOGIC_VECTOR (NB_IO downto 1); 70 -- signal grant_latch : std_logic_vector(NB_IO2 downto 1); 62 71 signal priority_rotation_en : std_logic; 63 signal Grant,request ,req_grant,Grant_bak: std_logic_vector(NB_IO2 downto 1):=(others=>'0');64 signal Mreq : std_logic_vector(NB_IO2 downto 1):=(others=>'1');72 signal Grant,request : std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 73 -- signal Mreq : std_logic_vector(NB_IO2 downto 1):=(others=>'1'); 65 74 66 75 begin 67 76 68 -- validation de la rotation de priorité lorsque aucun port n'emet69 req_grant<=(req and grant );77 ----validation de la rotation de priorité lorsque aucun port n'emet 78 -- req_grant<=(req and grant ); 70 79 priority_rotation_en <= '1' when unsigned(priority_rotation) = 2**NB_IO-1 else '0'; 71 request<=req and mreq; 72 --latch qui memorise le signal grant pendant la transmission 73 grant_latch_process : process(clk) 74 begin 75 if rising_edge(clk) then 76 if reset = '1' then 77 grant_latch <= (others => '0'); 78 Fifo_out_full<=(others => '0'); 79 elsif priority_rotation_en = '1' or unsigned(req_grant)=0 then 80 grant_latch <= Grant; 81 Fifo_out_full<=fifo_full; 82 else 83 grant_latch <= Grant; 84 Fifo_out_full<=fifo_full; 85 end if; 86 end if; 87 88 end process; 89 def_mreq: process(grant_latch,fifo_full) 90 91 variable t:std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 92 begin 93 94 for i in 0 to NB_IO2-1 loop 95 t(i+1):='0'; 96 --sur le front montant de fifo_full sauver l'état Grant courant 97 if fifo_full(i mod NB_IO+1)='1' and fifo_out_full(i mod NB_IO+1)='0' then 98 Grant_bak(i+1)<= grant_latch(i+1); 99 elsif fifo_full(i mod NB_IO+1)='0' and fifo_out_full(i mod NB_IO+1)='0' then 100 Grant_bak(i+1)<='0'; 101 end if; 102 for j in 0 to NB_IO-1 loop 103 t(i+1):=t(i+1) or grant_latch(j*NB_IO+1+i mod NB_IO) or fifo_out_full(i mod NB_IO+1); 104 105 end loop; 106 mreq(i+1)<=not(t(i+1) ) or grant_latch(i+1)or grant_bak(i+1); 107 end loop; 108 end process; 80 --request<=req and mreq; 81 ----latch qui memorise le signal grant pendant la transmission 82 --grant_latch_process : process(clk) 83 -- begin 84 -- if rising_edge(clk) then 85 -- if reset = '1' then 86 -- grant_latch <= (others => '0'); 87 -- Fifo_out_full<=(others => '0'); 88 -- elsif priority_rotation_en = '1' or unsigned(req_grant)=0 then 89 -- grant_latch <= Grant; 90 -- Fifo_out_full<=fifo_full; 91 -- else 92 -- grant_latch <= Grant; 93 -- Fifo_out_full<=fifo_full; 94 -- end if; 95 -- end if; 96 -- 97 -- end process; 98 -- def_mreq: process(grant_latch,fifo_full) 99 -- 100 --variable t:std_logic_vector(NB_IO2 downto 1):=(others=>'0'); 101 --begin 102 -- 103 -- for i in 0 to NB_IO2-1 loop 104 -- t(i+1):='0'; 105 -- --sur le front montant de fifo_full sauver l'état Grant courant 106 -- if fifo_full(i mod NB_IO+1)='1' and fifo_out_full(i mod NB_IO+1)='0' then 107 -- Grant_bak(i+1)<= grant_latch(i+1); 108 -- elsif fifo_full(i mod NB_IO+1)='0' and fifo_out_full(i mod NB_IO+1)='0' then 109 -- Grant_bak(i+1)<='0'; 110 -- end if; 111 -- for j in 0 to NB_IO-1 loop 112 -- t(i+1):=t(i+1) or grant_latch(j*NB_IO+1+i mod NB_IO) or fifo_out_full(i mod NB_IO+1); 113 -- 114 -- end loop; 115 -- mreq(i+1)<=not(t(i+1) ) or grant_latch(i+1)or grant_bak(i+1); 116 -- end loop; 117 --end process; 118 --cette instance permet de déterminer le vecteur request en fonction de l'état fifo_full et de la requête initiale 119 inst_defreq: def_request generic map (NB_IO=>4) 120 port map (clk=>clk, 121 reset=>reset, 122 req=>req, 123 fifo_full=>fifo_full, 124 priority_rotation=>priority_rotation, 125 grant=>grant, 126 request=>request 127 ); 128 109 129 port_grant <= grant; 110 130 Grant(1) <= Signal_grant(1)(1) or Signal_grant(5)(1); -- Grant(1,1)
Note: See TracChangeset
for help on using the changeset viewer.