source: PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v1.00/MultiMPITest.vhd @ 70

Last change on this file since 70 was 70, checked in by rolagamo, 11 years ago
File size: 7.3 KB
Line 
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--------------------------------------------------------------------------------
24LIBRARY ieee;
25USE ieee.std_logic_1164.ALL;
26 
27library NocLib ;
28
29use NocLib.CoreTypes.all;
30use work.Packet_type.all;
31
32USE ieee.numeric_std.ALL;
33 
34ENTITY MultiMPITest IS
35--simulation translate_off
36port (clkm : in std_logic;
37reset : in std_logic;
38result : out std_logic_vector(Word-1 downto 0));
39--simulation translate_on
40END MultiMPITest;
41 
42ARCHITECTURE 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);
70end Component; 
71 
72        constant clk_period : time := 10 ns;
73   constant PROC : positive :=8;
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);
82signal dcount : natural range 0 to 255:=0; --permet de compter le packet de données envoyées
83signal count,count_i : natural range 0 to 15:=0;
84
85signal MPI_Node_in : Ar_MPIPort_in(1 to PROC) ;
86signal MPI_Node_Out : Ar_MPIPort_out(1 to PROC);
87
88
89
90 
91BEGIN
92 Xbar: MPI_NOC GENERIC MAP (NPROC=>PROC)
93                PORT MAP (
94          MPI_Node_in => MPI_Node_in,
95          MPI_Node_Out => MPI_Node_Out
96        );
97
98PE1: PE generic map (DestId=>0)
99Port Map (
100Instruction => 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
117PE2: 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);
135PE3: PE generic map (DestId=>2)
136Port Map (
137Instruction => 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
154PE4: 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);
172MPI_Node_in(1).reset<=reset;   
173MPI_Node_in(1).clk<=clkm;
174MPI_Node_in(2).reset<=reset;   
175MPI_Node_in(2).clk<=clkm;
176MPI_Node_in(3).reset<=reset;   
177MPI_Node_in(3).clk<=clkm;
178MPI_Node_in(4).reset<=reset;   
179MPI_Node_in(4).clk<=clkm;
180Result<=MPi_Node_out(1).PushOut;
181PE_Dyn:for i in 5 to 6 generate
182PE_i: PE        Generic map (DestId=>i)
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 => '0',
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);
200MPI_Node_in(i).reset<=reset;   
201MPI_Node_in(i).clk<=clkm;
202end generate PE_Dyn;
203END;
Note: See TracBrowser for help on using the repository browser.