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 | |
---|
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 | Core_RAM_Data_Out : out STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
61 | Core_RAM_Data_In : in STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
62 | Core_RAM_WE : in STD_LOGIC; |
---|
63 | Core_RAM_EN : in STD_LOGIC; |
---|
64 | --Core_RAM_ENB : in STD_LOGIC; |
---|
65 | Core_RAM_ADDRESS_WR : in STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
66 | Core_RAM_ADDRESS_RD : in STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
67 | Core_Hold_req : in STD_LOGIC; |
---|
68 | Core_Hold_Ack : out STD_LOGIC); |
---|
69 | end Component; |
---|
70 | |
---|
71 | constant clk_period : time := 10 ns; |
---|
72 | constant PROC : positive :=16; |
---|
73 | -- synthesis translate_off |
---|
74 | --===================signaux pour l'horloge ============================== |
---|
75 | --signal reset,clkm : std_logic := '0'; |
---|
76 | --======================================================================== |
---|
77 | -- synthesis translate_on |
---|
78 | --signaux pour la gestion de la MAE |
---|
79 | type typ_mae is (start,Fillmem,NextFill,InitApp,InitCompleted,writeptr,InstrCopy, |
---|
80 | putdata,putdata2,putcompleted,getdata,getdata2,getcompleted,terminate,st_timeout); |
---|
81 | signal dcount : natural range 0 to 255:=0; --permet de compter le packet de données envoyées |
---|
82 | signal count,count_i : natural range 0 to 15:=0; |
---|
83 | |
---|
84 | signal MPI_Node_in : Ar_MPIPort_in(1 to PROC) ; |
---|
85 | signal MPI_Node_Out : Ar_MPIPort_out(1 to PROC); |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | BEGIN |
---|
91 | Xbar: MPI_NOC GENERIC MAP (NPROC=>PROC) |
---|
92 | PORT MAP ( |
---|
93 | MPI_Node_in => MPI_Node_in, |
---|
94 | MPI_Node_Out => MPI_Node_Out |
---|
95 | ); |
---|
96 | |
---|
97 | PE1: PE generic map (DestId=>0) |
---|
98 | Port Map ( |
---|
99 | Instruction => MPi_Node_in(1).Instruction, |
---|
100 | Instruction_en => MPi_Node_in(1).Instruction_en, |
---|
101 | Core_PushOut => MPi_Node_out(1).PushOut, |
---|
102 | clk =>clkm, |
---|
103 | reset =>reset, |
---|
104 | Core_RAM_Data_Out =>MPi_Node_in(1).Ram_Data_out, |
---|
105 | Core_RAM_Data_IN => MPI_Node_out(1).ram_data_in, |
---|
106 | Core_RAM_WE => MPI_Node_out(1).ram_we, |
---|
107 | Core_RAM_EN => MPI_Node_out(1).ram_en, |
---|
108 | -- Core_RAM_ENB => MPI_Node_out(1).ram_en, |
---|
109 | Core_RAM_Address_Wr => MPI_Node_out(1).ram_address_wr, |
---|
110 | Core_RAM_Address_Rd => MPI_Node_out(1).ram_address_rd, |
---|
111 | Core_Hold_req => MPI_Node_out(1).hold_req, |
---|
112 | Core_Hold_Ack => MPI_Node_in(1).hold_ack |
---|
113 | ); |
---|
114 | |
---|
115 | PE2: PE Generic map (DestId=>1) |
---|
116 | Port Map ( |
---|
117 | Instruction => MPi_Node_in(2).Instruction, |
---|
118 | Instruction_en => MPi_Node_in(2).Instruction_en, |
---|
119 | Core_PushOut => MPi_Node_out(2).PushOut, |
---|
120 | clk =>clkm, |
---|
121 | reset =>reset, |
---|
122 | Core_RAM_Data_Out =>MPi_Node_in(2).Ram_Data_out, |
---|
123 | Core_RAM_Data_IN => MPI_Node_out(2).ram_data_in, |
---|
124 | Core_RAM_WE => MPI_Node_out(2).ram_we, |
---|
125 | Core_RAM_EN => MPI_Node_out(2).ram_en, |
---|
126 | --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
127 | Core_RAM_Address_Wr => MPI_Node_out(2).ram_address_wr, |
---|
128 | Core_RAM_Address_Rd => MPI_Node_out(2).ram_address_rd, |
---|
129 | Core_Hold_req => MPI_Node_out(2).hold_req, |
---|
130 | Core_Hold_Ack => MPI_Node_in(2).hold_ack |
---|
131 | ); |
---|
132 | PE3: PE generic map (DestId=>2) |
---|
133 | Port Map ( |
---|
134 | Instruction => MPi_Node_in(3).Instruction, |
---|
135 | Instruction_en => MPi_Node_in(3).Instruction_en, |
---|
136 | Core_PushOut => MPi_Node_out(3).PushOut, |
---|
137 | clk =>clkm, |
---|
138 | reset =>reset, |
---|
139 | Core_RAM_Data_Out =>MPi_Node_in(3).Ram_Data_out, |
---|
140 | Core_RAM_Data_IN => MPI_Node_out(3).ram_data_in, |
---|
141 | Core_RAM_WE => MPI_Node_out(3).ram_we, |
---|
142 | Core_RAM_EN => MPI_Node_out(3).ram_en, |
---|
143 | -- Core_RAM_ENB => MPI_Node_out(1).ram_en, |
---|
144 | Core_RAM_Address_Wr => MPI_Node_out(3).ram_address_wr, |
---|
145 | Core_RAM_Address_Rd => MPI_Node_out(3).ram_address_rd, |
---|
146 | Core_Hold_req => MPI_Node_out(3).hold_req, |
---|
147 | Core_Hold_Ack => MPI_Node_in(3).hold_ack |
---|
148 | ); |
---|
149 | |
---|
150 | PE4: PE Generic map (DestId=>3) |
---|
151 | Port Map ( |
---|
152 | Instruction => MPi_Node_in(4).Instruction, |
---|
153 | Instruction_en => MPi_Node_in(4).Instruction_en, |
---|
154 | Core_PushOut => MPi_Node_out(4).PushOut, |
---|
155 | clk =>clkm, |
---|
156 | reset =>reset, |
---|
157 | Core_RAM_Data_Out =>MPi_Node_in(4).Ram_Data_out, |
---|
158 | Core_RAM_Data_IN => MPI_Node_out(4).ram_data_in, |
---|
159 | Core_RAM_WE => MPI_Node_out(4).ram_we, |
---|
160 | Core_RAM_EN => MPI_Node_out(4).ram_en, |
---|
161 | --Core_RAM_ENB => MPI_Node_out(2).ram_en, |
---|
162 | Core_RAM_Address_Wr => MPI_Node_out(4).ram_address_wr, |
---|
163 | Core_RAM_Address_Rd => MPI_Node_out(4).ram_address_rd, |
---|
164 | Core_Hold_req => MPI_Node_out(4).hold_req, |
---|
165 | Core_Hold_Ack => MPI_Node_in(4).hold_ack |
---|
166 | ); |
---|
167 | MPI_Node_in(1).reset<=reset; |
---|
168 | MPI_Node_in(1).clk<=clkm; |
---|
169 | MPI_Node_in(2).reset<=reset; |
---|
170 | MPI_Node_in(2).clk<=clkm; |
---|
171 | MPI_Node_in(3).reset<=reset; |
---|
172 | MPI_Node_in(3).clk<=clkm; |
---|
173 | MPI_Node_in(4).reset<=reset; |
---|
174 | MPI_Node_in(4).clk<=clkm; |
---|
175 | Result<=MPi_Node_out(1).PushOut; |
---|
176 | --============================================================= |
---|
177 | -- Clock process definitions |
---|
178 | --============================================================= |
---|
179 | -- synthesis translate_off |
---|
180 | -- clk_process :process |
---|
181 | -- begin |
---|
182 | -- clkm <= '0' ; |
---|
183 | -- wait for clk_period/2; |
---|
184 | -- clkm <= '1' ; |
---|
185 | -- wait for clk_period/2; |
---|
186 | -- end process; |
---|
187 | -- stim_proc: process |
---|
188 | -- begin |
---|
189 | -- hold reset state for 100 ns. |
---|
190 | -- reset<='0'; |
---|
191 | -- wait for 1 ns; |
---|
192 | -- reset<='1'; |
---|
193 | -- wait for clk_period*10; |
---|
194 | -- reset<='0'; |
---|
195 | -- wait; |
---|
196 | -- |
---|
197 | -- |
---|
198 | -- end process; |
---|
199 | -- synthesis translate_on |
---|
200 | --================================================================ |
---|
201 | END; |
---|