source: PROJECT_CORE_MPI/MPI_HCL/BRANCHES/v2.0/CORE_MPI/MultiMPITest.vhd

Last change on this file was 139, checked in by rolagamo, 10 years ago

Ceci est la version 16 bits de la plateforme ainsi que la version hierarchique du NoCNoC

File size: 8.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;
30LIbrary MPI_HCL;
31use MPI_HCL.Packet_type.all;
32use work.Hcl_Arch_conf.all;
33USE ieee.numeric_std.ALL;
34 
35ENTITY MultiMPITest IS
36--simulation translate_off
37port (clkm : in std_logic;
38reset : in std_logic;
39Led : out std_logic_vector(Word-1 downto 0));
40--simulation translate_on
41END MultiMPITest;
42 
43ARCHITECTURE 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);
71end 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);
83signal dcount : natural range 0 to 255:=0; --permet de compter le packet de données envoyées
84signal count,count_i : natural range 0 to 15:=0;
85
86signal MPI_Node_in : Ar_MPIPort_in(1 to PROC) ;
87signal MPI_Node_Out : Ar_MPIPort_out(1 to PROC);
88signal result :std_logic_vector(Word-1 downto 0);
89
90
91 
92BEGIN
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
182Result<=MPi_Node_out(1).PushOut;
183
184Led(7 downto 0)<=result(7 downto 0);
185
186PE_s:for i in 1 to STATIC_HT generate
187S: PE   Generic map (DestId=>i-1)
188                        Port Map (
189                                Instruction => MPi_Node_in(i).Instruction,
190           Instruction_en => MPi_Node_in(i).Instruction_en,
191                          Core_PushOut => MPi_Node_out(i).PushOut,
192           clk =>clkm,
193           reset =>reset,
194                          CE => '1',
195           Core_RAM_Data_Out =>MPi_Node_in(i).Ram_Data_out,
196           Core_RAM_Data_IN => MPI_Node_out(i).ram_data_in,
197           Core_RAM_WE => MPI_Node_out(i).ram_we,
198           Core_RAM_EN => MPI_Node_out(i).ram_en,
199           --Core_RAM_ENB => MPI_Node_out(2).ram_en,
200           Core_RAM_Address_Wr => MPI_Node_out(i).ram_address_wr,
201           Core_RAM_Address_Rd => MPI_Node_out(i).ram_address_rd,
202           Core_Hold_req => MPI_Node_out(i).hold_req,
203           Core_Hold_Ack => MPI_Node_in(i).hold_ack
204);
205MPI_Node_in(i).reset<=reset;   
206MPI_Node_in(i).clk<=clkm;
207end generate PE_s;
208dyn_HT: if dyn_allowed='1' generate
209PE_D:for i in STATIC_HT+1 to NOC_SIZE generate
210D: PE   Generic map (DestId=>i-1)
211                        Port Map (
212                                Instruction => MPi_Node_in(i).Instruction,
213           Instruction_en => MPi_Node_in(i).Instruction_en,
214                          Core_PushOut => MPi_Node_out(i).PushOut,
215           clk =>clkm,
216           reset =>reset,
217                          CE => '0',
218           Core_RAM_Data_Out =>MPi_Node_in(i).Ram_Data_out,
219           Core_RAM_Data_IN => MPI_Node_out(i).ram_data_in,
220           Core_RAM_WE => MPI_Node_out(i).ram_we,
221           Core_RAM_EN => MPI_Node_out(i).ram_en,
222           --Core_RAM_ENB => MPI_Node_out(2).ram_en,
223           Core_RAM_Address_Wr => MPI_Node_out(i).ram_address_wr,
224           Core_RAM_Address_Rd => MPI_Node_out(i).ram_address_rd,
225           Core_Hold_req => MPI_Node_out(i).hold_req,
226           Core_Hold_Ack => MPI_Node_in(i).hold_ack
227);
228MPI_Node_in(i).reset<=reset;   
229MPI_Node_in(i).clk<=clkm;
230end generate PE_D;
231end generate dyn_HT;
232END;
Note: See TracBrowser for help on using the repository browser.