OpenCores
URL https://opencores.org/ocsvn/funbase_ip_library/funbase_ip_library/trunk

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [soc/] [basic_tester_example/] [1.0/] [vhd/] [basic_tester_hibi_example.vhd] - Blame information for rev 151

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-- ***************************************************
2
-- File: basic_tester_hibi_example.vhd
3 151 lanttu
-- Creation date: 23.11.2012
4
-- Creation time: 16:44:19
5 145 lanttu
-- Description: Simple example on how to use basic_tester with hibi.
6
-- Hibi is instantiated a) as a segment, b) from 4 wrappers and an OR-network. 
7
-- 
8
--  Tx sends few words to rx which takes and checks them. 
9
-- Basic_tester is meant for simulation only.
10
-- Created by: matilail
11
-- This file was generated with Kactus2 vhdl generator.
12
-- ***************************************************
13
library IEEE;
14
library work;
15
use work.all;
16
use IEEE.std_logic_1164.all;
17
 
18
entity basic_tester_hibi_example is
19
 
20
end basic_tester_hibi_example;
21
 
22
-- Instantiates hibi as segement.
23
-- Graphical block diagram view. Hence, its type is "hierarchical".
24
architecture structural_seg of basic_tester_hibi_example is
25
 
26
        signal basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1AV : std_logic;
27
        signal basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1COMM : std_logic_vector(4 downto 0);
28
        signal basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1DATA : std_logic_vector(31 downto 0);
29
        signal basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1EMPTY : std_logic;
30
        signal basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1ONE_D : std_logic;
31
        signal basic_tester_rx_0_hibi_master_to_hibi_segment_0_ip_mMaster_1RE : std_logic;
32 150 lanttu
        signal clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK : std_logic;
33
        signal rst_gen_0_Generated_reset_to_hibi_segment_0_rst_nRESETn : std_logic;
34 145 lanttu
        signal hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterAV : std_logic;
35
        signal hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterCOMM : std_logic_vector(4 downto 0);
36
        signal hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterDATA : std_logic_vector(31 downto 0);
37
        signal hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveFULL : std_logic;
38
        signal hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveONE_P : std_logic;
39
        signal hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterWE : std_logic;
40
 
41
        -- Simple unit for receiving test data. There are separate units for transmitting (tx) and receiving (rx). This one can check the data coming from a IP  (e.g. via HIBI). The other unit can send the commands to the tested IP.
42
        -- 
43
        -- This IP-XACT component is fixed to 32-bit data and 5-bit command.
44
        -- 
45
        -- Works only in simulation because configuration is done with ASCII file.
46
        component basic_tester_rx
47
                generic (
48
                        comm_width_g : integer := 5;
49
                        conf_file_g : string := "test_rx.txt"; -- File that contains parameters for expected incoming data
50
                        data_width_g : integer := 32
51
 
52
                );
53
                port (
54
 
55
                        -- Interface: clock
56
                        clk : in std_logic;
57
 
58
                        -- Interface: hibi_master
59
                        -- Tester sends data via this port. Regular and hi-prior data muxed. Addr and data muxed also.
60
                        agent_re_out : out std_logic;
61
 
62
                        -- Interface: hibi_slave
63
                        agent_av_in : in std_logic;
64
                        agent_comm_in : in std_logic_vector(4 downto 0);
65
                        agent_data_in : in std_logic_vector(31 downto 0);
66
                        agent_empty_in : in std_logic;
67
                        agent_one_d_in : in std_logic;
68
 
69
                        -- These ports are not in any interface
70
                        -- done_out : out std_logic;
71
 
72
                        -- Interface: reset
73
                        rst_n : in std_logic -- Active low
74
 
75
                );
76
        end component;
77
 
78
        -- Simple unit for sending test data. There are separate units for transmitting (tx) and receiving (rx). This one sends commands to the tested IP (e.g. via HIBI). The other unit can then check the returned data. 
79
        -- 
80
        -- This IP-XACT component is fixed to 32-bit data and 5-bit command.
81
        -- 
82
        -- Works only in simulation because configuration is done with ASCII file.
83
        component basic_tester_tx
84
                generic (
85
                        comm_width_g : integer := 5;
86
                        conf_file_g : string := "test_tx.txt"; -- File that contains the sent data
87
                        data_width_g : integer := 32
88
 
89
                );
90
                port (
91
 
92
                        -- Interface: clock
93
                        clk : in std_logic;
94
 
95
                        -- Interface: hibi_master
96
                        -- Tester sends data via this port. Regular and hi-prior data muxed. Addr and data muxed also.
97
                        agent_av_out : out std_logic;
98
                        agent_comm_out : out std_logic_vector(4 downto 0);
99
                        agent_data_out : out std_logic_vector(31 downto 0);
100
                        agent_we_out : out std_logic;
101
 
102
                        -- Interface: hibi_slave
103
                        agent_full_in : in std_logic;
104
                        agent_one_p_in : in std_logic;
105
 
106
                        -- These ports are not in any interface
107
                        -- done_out : out std_logic;
108
 
109
                        -- Interface: reset
110
                        rst_n : in std_logic -- Active low
111
 
112
                );
113
        end component;
114
 
115
        component hibi_segment
116
                generic (
117 150 lanttu
                        ip_mslave_0_addr_end : integer := 2; -- HIBI end address for interface 0
118
                        ip_mslave_0_addr_start : integer := 1; -- HIBI address for interface 0
119
                        ip_mslave_1_addr_end : integer := 4; -- HIBI end address for interface 1
120
                        ip_mslave_1_addr_start : integer := 3; -- HIBI address for interface 1
121
                        ip_mslave_2_addr_end : integer := 6; -- HIBI end address for interface 2
122
                        ip_mslave_2_addr_start : integer := 5; -- HIBI address for interface 2
123
                        ip_mslave_3_addr_end : integer := 8; -- HIBI end address for interface 3
124
                        ip_mslave_3_addr_start : integer := 7 -- HIBI address for interface 3
125 145 lanttu
 
126
                );
127
                port (
128
 
129
                        -- Interface: clocks_0
130
                        -- Clock inputs  interface for hibi wrapper_3
131
                        agent_clk : in std_logic;
132
                        agent_sync_clk : in std_logic;
133
                        bus_clk : in std_logic;
134
                        bus_sync_clk : in std_logic;
135
 
136
                        -- Interface: clocks_1
137
                        -- Clock inputs  interface for hibi wrapper_3
138
                        agent_clk_1 : in std_logic;
139
                        agent_sync_clk_1 : in std_logic;
140
                        bus_clk_1 : in std_logic;
141
                        bus_sync_clk_1 : in std_logic;
142
 
143
                        -- Interface: clocks_2
144
                        -- Clock inputs  interface for hibi wrapper_3
145 150 lanttu
                        agent_clk_2 : in std_logic;
146
                        agent_sync_clk_2 : in std_logic;
147
                        bus_clk_2 : in std_logic;
148 145 lanttu
                        bus_sync_clk_2 : in std_logic;
149
 
150
                        -- Interface: clocks_3
151
                        -- Clock inputs  interface for hibi wrapper_3
152 150 lanttu
                        agent_clk_3 : in std_logic;
153
                        agent_sync_clk_3 : in std_logic;
154
                        bus_clk_3 : in std_logic;
155 145 lanttu
                        bus_sync_clk_3 : in std_logic;
156
 
157
                        -- Interface: ip_mMaster_0
158
                        -- HIBI ip mirrored master agent interface 0 (r4 wrapper)
159
                        agent_av_in : in std_logic;
160
                        agent_comm_in : in std_logic_vector(4 downto 0);
161
                        agent_data_in : in std_logic_vector(31 downto 0);
162
                        agent_re_in : in std_logic;
163
                        agent_we_in : in std_logic;
164
 
165
                        -- Interface: ip_mMaster_1
166
                        -- HIBI ip mirrored master agent interface 1 (r4 wrapper)
167
                        agent_av_in_1 : in std_logic;
168
                        agent_comm_in_1 : in std_logic_vector(4 downto 0);
169
                        agent_data_in_1 : in std_logic_vector(31 downto 0);
170
                        agent_re_in_1 : in std_logic;
171
                        agent_we_in_1 : in std_logic;
172
 
173
                        -- Interface: ip_mMaster_2
174
                        -- HIBI ip mirrored master agent interface 2 (r4 wrapper)
175
                        agent_av_in_2 : in std_logic;
176
                        agent_comm_in_2 : in std_logic_vector(4 downto 0);
177
                        agent_data_in_2 : in std_logic_vector(31 downto 0);
178
                        agent_re_in_2 : in std_logic;
179
                        agent_we_in_2 : in std_logic;
180
 
181
                        -- Interface: ip_mMaster_3
182
                        -- HIBI ip mirrored master agent interface 3 (r4 wrapper)
183
                        agent_av_in_3 : in std_logic;
184
                        agent_comm_in_3 : in std_logic_vector(4 downto 0);
185
                        agent_data_in_3 : in std_logic_vector(31 downto 0);
186
                        agent_re_in_3 : in std_logic;
187
                        agent_we_in_3 : in std_logic;
188
 
189
                        -- Interface: ip_mSlave_0
190
                        -- HIBI ip mirrored slave agent interface 0 (r4 wrapper)
191
                        -- agent_av_out : out std_logic;
192
                        -- agent_comm_out : out std_logic_vector(4 downto 0);
193
                        -- agent_data_out : out std_logic_vector(31 downto 0);
194
                        -- agent_empty_out : out std_logic;
195
                        agent_full_out : out std_logic;
196
                        -- agent_one_d_out : out std_logic;
197
                        agent_one_p_out : out std_logic;
198
 
199
                        -- Interface: ip_mSlave_1
200
                        -- HIBI ip mirrored slave agent interface 1  (r4 wrapper)
201
                        agent_av_out_1 : out std_logic;
202
                        agent_comm_out_1 : out std_logic_vector(4 downto 0);
203
                        agent_data_out_1 : out std_logic_vector(31 downto 0);
204
                        agent_empty_out_1 : out std_logic;
205
                        -- agent_full_out_1 : out std_logic;
206
                        agent_one_d_out_1 : out std_logic;
207
                        -- agent_one_p_out_1 : out std_logic;
208
 
209
                        -- Interface: ip_mSlave_2
210
                        -- HIBI ip mirrored slave agent interface 2 (r4 wrapper)
211
                        -- agent_av_out_2 : out std_logic;
212
                        -- agent_comm_out_2 : out std_logic_vector(4 downto 0);
213
                        -- agent_data_out_2 : out std_logic_vector(31 downto 0);
214
                        -- agent_empty_out_2 : out std_logic;
215
                        -- agent_full_out_2 : out std_logic;
216
                        -- agent_one_d_out_2 : out std_logic;
217
                        -- agent_one_p_out_2 : out std_logic;
218
 
219
                        -- Interface: ip_mSlave_3
220
                        -- HIBI ip mirrored slave agent interface_3 (r4 wrapper)
221
                        -- agent_av_out_3 : out std_logic;
222
                        -- agent_comm_out_3 : out std_logic_vector(4 downto 0);
223
                        -- agent_data_out_3 : out std_logic_vector(31 downto 0);
224
                        -- agent_empty_out_3 : out std_logic;
225
                        -- agent_full_out_3 : out std_logic;
226
                        -- agent_one_d_out_3 : out std_logic;
227
                        -- agent_one_p_out_3 : out std_logic;
228
 
229
                        -- Interface: rst_n
230
                        -- Active low reset interface.
231
                        rst_n : in std_logic
232
 
233
                );
234
        end component;
235
 
236
        -- Simple clock generator dor simulation.
237
        component clk_gen
238
                generic (
239
                        hi_period_ns_g : integer := 1;
240
                        lo_period_ns_g : integer := 1
241
 
242
                );
243
                port (
244
 
245
                        -- There ports are contained in many interfaces
246
                        clk_out : out std_logic
247
 
248
                );
249
        end component;
250
 
251
        -- Simple active-low reset signal generator dor simulation
252
        component rst_gen
253
                generic (
254
                        active_period_ns_g : integer := 100
255
 
256
                );
257
                port (
258
 
259
                        -- Interface: Generated_reset
260
                        rst_n_out : out std_logic
261
 
262
                );
263
        end component;
264
 
265
        -- You can write vhdl code after this tag and it is saved through the generator.
266
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_BEGIN##
267
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_END##
268
        -- Stop writing your code after this tag.
269
 
270
 
271
begin
272
 
273
        -- You can write vhdl code after this tag and it is saved through the generator.
274
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_BEGIN##
275
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_END##
276
        -- Stop writing your code after this tag.
277
 
278
        basic_tester_rx_0 : basic_tester_rx
279
                generic map (
280
                        conf_file_g => "test_rx.txt"
281
                )
282
                port map (
283
                        agent_av_in => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1AV,
284
                        agent_comm_in(4 downto 0) => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1COMM(4 downto 0),
285
                        agent_data_in(31 downto 0) => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1DATA(31 downto 0),
286
                        agent_empty_in => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1EMPTY,
287
                        agent_one_d_in => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1ONE_D,
288
                        agent_re_out => basic_tester_rx_0_hibi_master_to_hibi_segment_0_ip_mMaster_1RE,
289 150 lanttu
                        clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
290
                        rst_n => rst_gen_0_Generated_reset_to_hibi_segment_0_rst_nRESETn
291 145 lanttu
                );
292
 
293
        basic_tester_tx_0 : basic_tester_tx
294
                generic map (
295
                        conf_file_g => "test_tx.txt"
296
                )
297
                port map (
298
                        agent_av_out => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterAV,
299
                        agent_comm_out(4 downto 0) => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterCOMM(4 downto 0),
300
                        agent_data_out(31 downto 0) => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterDATA(31 downto 0),
301
                        agent_full_in => hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveFULL,
302
                        agent_one_p_in => hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveONE_P,
303
                        agent_we_out => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterWE,
304 150 lanttu
                        clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
305
                        rst_n => rst_gen_0_Generated_reset_to_hibi_segment_0_rst_nRESETn
306 145 lanttu
                );
307
 
308
        clk_gen_0 : clk_gen
309
                port map (
310 150 lanttu
                        clk_out => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK
311 145 lanttu
                );
312
 
313 150 lanttu
        hibi_segment_0 : hibi_segment
314 145 lanttu
                port map (
315
                        agent_av_in => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterAV,
316
                        agent_av_in_1 => '0',
317
                        agent_av_in_2 => '0',
318
                        agent_av_in_3 => '0',
319
                        agent_av_out_1 => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1AV,
320 150 lanttu
                        agent_clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
321
                        agent_clk_1 => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
322
                        agent_clk_2 => '0',
323
                        agent_clk_3 => '0',
324 145 lanttu
                        agent_comm_in(4 downto 0) => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterCOMM(4 downto 0),
325
                        agent_comm_in_1 => (others => '0'),
326
                        agent_comm_in_2 => (others => '0'),
327
                        agent_comm_in_3 => (others => '0'),
328
                        agent_comm_out_1(4 downto 0) => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1COMM(4 downto 0),
329
                        agent_data_in(31 downto 0) => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterDATA(31 downto 0),
330
                        agent_data_in_1 => (others => '0'),
331
                        agent_data_in_2 => (others => '0'),
332
                        agent_data_in_3 => (others => '0'),
333
                        agent_data_out_1(31 downto 0) => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1DATA(31 downto 0),
334
                        agent_empty_out_1 => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1EMPTY,
335
                        agent_full_out => hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveFULL,
336
                        agent_one_d_out_1 => basic_tester_rx_0_hibi_slave_to_hibi_segment_0_ip_mSlave_1ONE_D,
337
                        agent_one_p_out => hibi_segment_0_ip_mSlave_0_to_basic_tester_tx_0_hibi_slaveONE_P,
338
                        agent_re_in => '0',
339
                        agent_re_in_1 => basic_tester_rx_0_hibi_master_to_hibi_segment_0_ip_mMaster_1RE,
340
                        agent_re_in_2 => '0',
341
                        agent_re_in_3 => '0',
342 150 lanttu
                        agent_sync_clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
343
                        agent_sync_clk_1 => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
344
                        agent_sync_clk_2 => '0',
345
                        agent_sync_clk_3 => '0',
346 145 lanttu
                        agent_we_in => hibi_segment_0_ip_mMaster_0_to_basic_tester_tx_0_hibi_masterWE,
347
                        agent_we_in_1 => '0',
348
                        agent_we_in_2 => '0',
349
                        agent_we_in_3 => '0',
350 150 lanttu
                        bus_clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
351
                        bus_clk_1 => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
352
                        bus_clk_2 => '0',
353
                        bus_clk_3 => '0',
354
                        bus_sync_clk => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
355
                        bus_sync_clk_1 => clk_gen_0_Generated_hibi_clk_to_hibi_segment_0_clocks_0AGENT_SYNC_CLK,
356 145 lanttu
                        bus_sync_clk_2 => '0',
357
                        bus_sync_clk_3 => '0',
358 150 lanttu
                        rst_n => rst_gen_0_Generated_reset_to_hibi_segment_0_rst_nRESETn
359 145 lanttu
                );
360
 
361
        rst_gen_0 : rst_gen
362
                port map (
363 150 lanttu
                        rst_n_out => rst_gen_0_Generated_reset_to_hibi_segment_0_rst_nRESETn
364 145 lanttu
                );
365
 
366
end structural_seg;
367
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.