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