[96] | 1 | -------------------------------------------------------------------------------- |
---|
| 2 | -- Company: |
---|
| 3 | -- Engineer: GAMOM Roland Christian |
---|
| 4 | -- |
---|
| 5 | -- Create Date: 16:44:13 08/01/2012 |
---|
| 6 | -- Design Name: |
---|
| 7 | -- Module Name: C:/Core MPI/CORE_MPI/MultiMPITest.vhd |
---|
| 8 | -- Project Name: MPI_CORE_COMPONENTS |
---|
| 9 | -- Target Device: |
---|
| 10 | -- Tool versions: |
---|
| 11 | -- Description: |
---|
| 12 | -- |
---|
| 13 | -- VHDL Test Bench Created by ISE for module: MPI_NOC |
---|
| 14 | -- |
---|
| 15 | -- Dependencies: |
---|
| 16 | -- |
---|
| 17 | -- Revision: |
---|
| 18 | -- Revision 0.01 - File Created |
---|
| 19 | -- Additional Comments: |
---|
| 20 | -- |
---|
| 21 | -- |
---|
| 22 | -- |
---|
| 23 | -------------------------------------------------------------------------------- |
---|
| 24 | LIBRARY ieee; |
---|
| 25 | USE ieee.std_logic_1164.ALL; |
---|
| 26 | |
---|
| 27 | library NocLib ; |
---|
| 28 | |
---|
| 29 | use NocLib.CoreTypes.all; |
---|
| 30 | LIbrary MPI_HCL; |
---|
| 31 | use MPI_HCL.Packet_type.all; |
---|
| 32 | use work.Hcl_Arch_conf.all; |
---|
| 33 | USE ieee.numeric_std.ALL; |
---|
| 34 | |
---|
| 35 | ENTITY MultiMPITest IS |
---|
| 36 | --simulation translate_off |
---|
| 37 | port (clkm : in std_logic; |
---|
| 38 | reset : in std_logic; |
---|
| 39 | result : out std_logic_vector(Word-1 downto 0)); |
---|
| 40 | --simulation translate_on |
---|
| 41 | END MultiMPITest; |
---|
| 42 | |
---|
| 43 | ARCHITECTURE behavior OF MultiMPITest IS |
---|
| 44 | |
---|
| 45 | -- Component Declaration for the Unit Under Test (UUT) |
---|
| 46 | |
---|
| 47 | COMPONENT MPI_NOC |
---|
| 48 | generic (NPROC: natural:=2); |
---|
| 49 | PORT( |
---|
| 50 | MPI_Node_in : IN Ar_MPIPort_in(1 to NPROC); |
---|
| 51 | MPI_Node_Out : OUT Ar_MPIPort_out(1 to NPROC) |
---|
| 52 | ); |
---|
| 53 | END COMPONENT; |
---|
| 54 | Component PE |
---|
| 55 | generic(destid : natural); |
---|
| 56 | Port ( Instruction : out STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 57 | Instruction_en : out STD_LOGIC; |
---|
| 58 | Core_PushOut : in STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 59 | clk : in STD_LOGIC; |
---|
| 60 | reset : in STD_LOGIC; |
---|
| 61 | CE : in STD_LOGIC; |
---|
| 62 | Core_RAM_Data_Out : out STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 63 | Core_RAM_Data_In : in STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 64 | Core_RAM_WE : in STD_LOGIC; |
---|
| 65 | Core_RAM_EN : in STD_LOGIC; |
---|
| 66 | --Core_RAM_ENB : in STD_LOGIC; |
---|
| 67 | Core_RAM_ADDRESS_WR : in STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 68 | Core_RAM_ADDRESS_RD : in STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 69 | Core_Hold_req : in STD_LOGIC; |
---|
| 70 | Core_Hold_Ack : out STD_LOGIC); |
---|
| 71 | end Component; |
---|
| 72 | |
---|
| 73 | constant clk_period : time := 15 ns; |
---|
| 74 | constant PROC : positive :=NOC_SIZE; --4 |
---|
| 75 | -- synthesis translate_off |
---|
| 76 | --===================signaux pour l'horloge ============================== |
---|
| 77 | --signal reset,clkm : std_logic := '0'; |
---|
| 78 | --======================================================================== |
---|
| 79 | -- synthesis translate_on |
---|
| 80 | --signaux pour la gestion de la MAE |
---|
| 81 | type typ_mae is (start,Fillmem,NextFill,InitApp,InitCompleted,writeptr,InstrCopy, |
---|
| 82 | putdata,putdata2,putcompleted,getdata,getdata2,getcompleted,terminate,st_timeout); |
---|
| 83 | signal dcount : natural range 0 to 255:=0; --permet de compter le packet de données envoyées |
---|
| 84 | signal count,count_i : natural range 0 to 15:=0; |
---|
| 85 | |
---|
| 86 | signal MPI_Node_in : Ar_MPIPort_in(1 to PROC) ; |
---|
| 87 | signal MPI_Node_Out : Ar_MPIPort_out(1 to PROC); |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | BEGIN |
---|
| 93 | Xbar: MPI_NOC GENERIC MAP (NPROC=>NOC_SIZE) |
---|
| 94 | PORT MAP ( |
---|
| 95 | MPI_Node_in => MPI_Node_in, |
---|
| 96 | MPI_Node_Out => MPI_Node_Out |
---|
| 97 | ); |
---|
| 98 | |
---|
| 99 | --PE1: PE generic map (DestId=>0) |
---|
| 100 | --Port Map ( |
---|
| 101 | --Instruction => MPi_Node_in(1).Instruction, |
---|
| 102 | -- Instruction_en => MPi_Node_in(1).Instruction_en, |
---|
| 103 | -- Core_PushOut => MPi_Node_out(1).PushOut, |
---|
| 104 | -- clk =>clkm, |
---|
| 105 | -- reset =>reset, |
---|
| 106 | -- CE => '1', |
---|
| 107 | -- Core_RAM_Data_Out =>MPi_Node_in(1).Ram_Data_out, |
---|
| 108 | -- Core_RAM_Data_IN => MPI_Node_out(1).ram_data_in, |
---|
| 109 | -- Core_RAM_WE => MPI_Node_out(1).ram_we, |
---|
| 110 | -- Core_RAM_EN => MPI_Node_out(1).ram_en, |
---|
| 111 | -- -- Core_RAM_ENB => MPI_Node_out(1).ram_en, |
---|
| 112 | -- Core_RAM_Address_Wr => MPI_Node_out(1).ram_address_wr, |
---|
| 113 | -- Core_RAM_Address_Rd => MPI_Node_out(1).ram_address_rd, |
---|
| 114 | -- Core_Hold_req => MPI_Node_out(1).hold_req, |
---|
| 115 | -- Core_Hold_Ack => MPI_Node_in(1).hold_ack |
---|
| 116 | --); |
---|
| 117 | -- |
---|
| 118 | --PE2: PE Generic map (DestId=>1) |
---|
| 119 | -- Port Map ( |
---|
| 120 | -- Instruction => MPi_Node_in(2).Instruction, |
---|
| 121 | -- Instruction_en => MPi_Node_in(2).Instruction_en, |
---|
| 122 | -- Core_PushOut => MPi_Node_out(2).PushOut, |
---|
| 123 | -- clk =>clkm, |
---|
| 124 | -- reset =>reset, |
---|
| 125 | -- CE => '1', |
---|
| 126 | -- Core_RAM_Data_Out =>MPi_Node_in(2).Ram_Data_out, |
---|
| 127 | -- Core_RAM_Data_IN => MPI_Node_out(2).ram_data_in, |
---|
| 128 | -- Core_RAM_WE => MPI_Node_out(2).ram_we, |
---|
| 129 | -- Core_RAM_EN => MPI_Node_out(2).ram_en, |
---|
| 130 | -- --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
| 131 | -- Core_RAM_Address_Wr => MPI_Node_out(2).ram_address_wr, |
---|
| 132 | -- Core_RAM_Address_Rd => MPI_Node_out(2).ram_address_rd, |
---|
| 133 | -- Core_Hold_req => MPI_Node_out(2).hold_req, |
---|
| 134 | -- Core_Hold_Ack => MPI_Node_in(2).hold_ack |
---|
| 135 | --); |
---|
| 136 | --PE3: PE generic map (DestId=>2) |
---|
| 137 | --Port Map ( |
---|
| 138 | --Instruction => MPi_Node_in(3).Instruction, |
---|
| 139 | -- Instruction_en => MPi_Node_in(3).Instruction_en, |
---|
| 140 | -- Core_PushOut => MPi_Node_out(3).PushOut, |
---|
| 141 | -- clk =>clkm, |
---|
| 142 | -- reset =>reset, |
---|
| 143 | -- CE => '1', |
---|
| 144 | -- Core_RAM_Data_Out =>MPi_Node_in(3).Ram_Data_out, |
---|
| 145 | -- Core_RAM_Data_IN => MPI_Node_out(3).ram_data_in, |
---|
| 146 | -- Core_RAM_WE => MPI_Node_out(3).ram_we, |
---|
| 147 | -- Core_RAM_EN => MPI_Node_out(3).ram_en, |
---|
| 148 | -- -- Core_RAM_ENB => MPI_Node_out(1).ram_en, |
---|
| 149 | -- Core_RAM_Address_Wr => MPI_Node_out(3).ram_address_wr, |
---|
| 150 | -- Core_RAM_Address_Rd => MPI_Node_out(3).ram_address_rd, |
---|
| 151 | -- Core_Hold_req => MPI_Node_out(3).hold_req, |
---|
| 152 | -- Core_Hold_Ack => MPI_Node_in(3).hold_ack |
---|
| 153 | --); |
---|
| 154 | -- |
---|
| 155 | --PE4: PE Generic map (DestId=>3) |
---|
| 156 | -- Port Map ( |
---|
| 157 | -- Instruction => MPi_Node_in(4).Instruction, |
---|
| 158 | -- Instruction_en => MPi_Node_in(4).Instruction_en, |
---|
| 159 | -- Core_PushOut => MPi_Node_out(4).PushOut, |
---|
| 160 | -- clk =>clkm, |
---|
| 161 | -- reset =>reset, |
---|
| 162 | -- CE => '1', |
---|
| 163 | -- Core_RAM_Data_Out =>MPi_Node_in(4).Ram_Data_out, |
---|
| 164 | -- Core_RAM_Data_IN => MPI_Node_out(4).ram_data_in, |
---|
| 165 | -- Core_RAM_WE => MPI_Node_out(4).ram_we, |
---|
| 166 | -- Core_RAM_EN => MPI_Node_out(4).ram_en, |
---|
| 167 | -- --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
| 168 | -- Core_RAM_Address_Wr => MPI_Node_out(4).ram_address_wr, |
---|
| 169 | -- Core_RAM_Address_Rd => MPI_Node_out(4).ram_address_rd, |
---|
| 170 | -- Core_Hold_req => MPI_Node_out(4).hold_req, |
---|
| 171 | -- Core_Hold_Ack => MPI_Node_in(4).hold_ack |
---|
| 172 | --); |
---|
| 173 | --MPI_Node_in(1).reset<=reset; |
---|
| 174 | --MPI_Node_in(1).clk<=clkm; |
---|
| 175 | --MPI_Node_in(2).reset<=reset; |
---|
| 176 | --MPI_Node_in(2).clk<=clkm; |
---|
| 177 | --MPI_Node_in(3).reset<=reset; |
---|
| 178 | --MPI_Node_in(3).clk<=clkm; |
---|
| 179 | --MPI_Node_in(4).reset<=reset; |
---|
| 180 | --MPI_Node_in(4).clk<=clkm; |
---|
| 181 | Result<=MPi_Node_out(1).PushOut; |
---|
| 182 | PE_s:for i in 1 to STATIC_HT generate |
---|
| 183 | S: PE Generic map (DestId=>i-1) |
---|
| 184 | Port Map ( |
---|
| 185 | Instruction => MPi_Node_in(i).Instruction, |
---|
| 186 | Instruction_en => MPi_Node_in(i).Instruction_en, |
---|
| 187 | Core_PushOut => MPi_Node_out(i).PushOut, |
---|
| 188 | clk =>clkm, |
---|
| 189 | reset =>reset, |
---|
| 190 | CE => '1', |
---|
| 191 | Core_RAM_Data_Out =>MPi_Node_in(i).Ram_Data_out, |
---|
| 192 | Core_RAM_Data_IN => MPI_Node_out(i).ram_data_in, |
---|
| 193 | Core_RAM_WE => MPI_Node_out(i).ram_we, |
---|
| 194 | Core_RAM_EN => MPI_Node_out(i).ram_en, |
---|
| 195 | --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
| 196 | Core_RAM_Address_Wr => MPI_Node_out(i).ram_address_wr, |
---|
| 197 | Core_RAM_Address_Rd => MPI_Node_out(i).ram_address_rd, |
---|
| 198 | Core_Hold_req => MPI_Node_out(i).hold_req, |
---|
| 199 | Core_Hold_Ack => MPI_Node_in(i).hold_ack |
---|
| 200 | ); |
---|
| 201 | MPI_Node_in(i).reset<=reset; |
---|
| 202 | MPI_Node_in(i).clk<=clkm; |
---|
| 203 | end generate PE_s; |
---|
| 204 | dyn_HT: if dyn_allowed='1' generate |
---|
| 205 | PE_D:for i in STATIC_HT+1 to NOC_SIZE generate |
---|
| 206 | D: PE Generic map (DestId=>i-1) |
---|
| 207 | Port Map ( |
---|
| 208 | Instruction => MPi_Node_in(i).Instruction, |
---|
| 209 | Instruction_en => MPi_Node_in(i).Instruction_en, |
---|
| 210 | Core_PushOut => MPi_Node_out(i).PushOut, |
---|
| 211 | clk =>clkm, |
---|
| 212 | reset =>reset, |
---|
| 213 | CE => '0', |
---|
| 214 | Core_RAM_Data_Out =>MPi_Node_in(i).Ram_Data_out, |
---|
| 215 | Core_RAM_Data_IN => MPI_Node_out(i).ram_data_in, |
---|
| 216 | Core_RAM_WE => MPI_Node_out(i).ram_we, |
---|
| 217 | Core_RAM_EN => MPI_Node_out(i).ram_en, |
---|
| 218 | --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
| 219 | Core_RAM_Address_Wr => MPI_Node_out(i).ram_address_wr, |
---|
| 220 | Core_RAM_Address_Rd => MPI_Node_out(i).ram_address_rd, |
---|
| 221 | Core_Hold_req => MPI_Node_out(i).hold_req, |
---|
| 222 | Core_Hold_Ack => MPI_Node_in(i).hold_ack |
---|
| 223 | ); |
---|
| 224 | MPI_Node_in(i).reset<=reset; |
---|
| 225 | MPI_Node_in(i).clk<=clkm; |
---|
| 226 | end generate PE_D; |
---|
| 227 | end generate dyn_HT; |
---|
| 228 | END; |
---|