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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.accelerator/] [dct_to_hibi/] [1.0/] [tb/] [tb_dct_top.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : Testbech for dctQidct
3
-- Project    : 
4
-------------------------------------------------------------------------------
5
-- File       : tb_dct_top.vhd
6
-- Author     : 
7
-- Company    : 
8
-- Created    : 2006-05-24
9
-- Last update: 2006-09-06
10
-- Platform   : 
11
-- Standard   : VHDL'87
12
-------------------------------------------------------------------------------
13
-- Description: a simple tb 
14
-------------------------------------------------------------------------------
15
-- Copyright (c) 2006 
16
-------------------------------------------------------------------------------
17
-- Revisions  :
18
-- Date        Version  Author  Description
19
-- 2006-05-24  1.0      rasmusa Created
20
-------------------------------------------------------------------------------
21
 
22
library IEEE;
23
use ieee.std_logic_1164.all;
24
use ieee.numeric_std.all;
25
 
26
use work.tb_dct_package.all;
27
 
28
library dct;
29
library idct;
30
library quantizer;
31
library dctQidct;
32
 
33
use dct.DCT_pkg.all;
34
use idct.IDCT_pkg.all;
35
use quantizer.Quantizer_pkg.all;
36
 
37
entity tb_dct_top is
38
  generic (
39
    hw_fifo_depth_g : integer := 5);
40
end tb_dct_top;
41
 
42
 
43
architecture structural of tb_dct_top is
44
 
45
--  constant hw_fifo_depth_c : integer := dct_hw_fifo_depth_g;
46
 
47
  signal clk     : std_logic := '1';
48
  signal clk_dct : std_logic := '1';
49
  signal clk_cpu : std_logic := '1';
50
 
51
  signal rst_n   : std_logic := '0';
52
 
53
  signal bus_comm_in : std_logic_vector(comm_width_c-1 downto 0);
54
  signal bus_data_in : std_logic_vector(data_width_c-1 downto 0);
55
 
56
  signal bus_av_in   : std_logic;
57
  signal bus_full_in : std_logic;
58
  signal bus_lock_in : std_logic;
59
 
60
  signal bus_comm_out_cpu : std_logic_vector(comm_width_c-1 downto 0);
61
  signal bus_data_out_cpu : std_logic_vector(data_width_c-1 downto 0);
62
  signal bus_av_out_cpu   : std_logic;
63
  signal bus_full_out_cpu : std_logic;
64
  signal bus_lock_out_cpu : std_logic;
65
 
66
  signal bus_comm_out_dctqidct : std_logic_vector(comm_width_c-1 downto 0);
67
  signal bus_data_out_dctqidct : std_logic_vector(data_width_c-1 downto 0);
68
  signal bus_av_out_dctqidct   : std_logic;
69
  signal bus_full_out_dctqidct : std_logic;
70
  signal bus_lock_out_dctqidct : std_logic;
71
 
72
  signal bus_comm_out_pinger1 : std_logic_vector(comm_width_c-1 downto 0);
73
  signal bus_data_out_pinger1 : std_logic_vector(data_width_c-1 downto 0);
74
  signal bus_av_out_pinger1   : std_logic;
75
  signal bus_full_out_pinger1 : std_logic;
76
  signal bus_lock_out_pinger1 : std_logic;
77
 
78
  signal bus_comm_out_pinger2 : std_logic_vector(comm_width_c-1 downto 0);
79
  signal bus_data_out_pinger2 : std_logic_vector(data_width_c-1 downto 0);
80
  signal bus_av_out_pinger2   : std_logic;
81
  signal bus_full_out_pinger2 : std_logic;
82
  signal bus_lock_out_pinger2 : std_logic;
83
 
84
 
85
  -- Signals between hibi wrapper and DCTQIDCT
86
  signal dctqidct_data_in  : std_logic_vector(data_width_c-1 downto 0);
87
  signal dctqidct_comm_in  : std_logic_vector(comm_width_c-1 downto 0);
88
  signal dctqidct_av_in    : std_logic;
89
  signal dctqidct_re_out   : std_logic;
90
  signal dctqidct_empty_in : std_logic;
91
  signal dctqidct_data_out : std_logic_vector(data_width_c-1 downto 0);
92
  signal dctqidct_comm_out : std_logic_vector(comm_width_c-1 downto 0);
93
  signal dctqidct_av_out   : std_logic;
94
  signal dctqidct_we_out   : std_logic;
95
  signal dctqidct_full_in  : std_logic;
96
 
97
  -- Signals between hibi wrapper and cpu ( cpu point of view )
98
  signal cpu_data_in  : std_logic_vector(data_width_c-1 downto 0);
99
  signal cpu_comm_in  : std_logic_vector(comm_width_c-1 downto 0);
100
  signal cpu_av_in    : std_logic;
101
  signal cpu_re_out   : std_logic;
102
  signal cpu_empty_in : std_logic;
103
  signal cpu_data_out : std_logic_vector(data_width_c-1 downto 0);
104
  signal cpu_comm_out : std_logic_vector(comm_width_c-1 downto 0);
105
  signal cpu_av_out   : std_logic;
106
  signal cpu_we_out   : std_logic;
107
  signal cpu_full_in  : std_logic;
108
 
109
  -- Pinger signals
110
  signal pinger1_data_in  : std_logic_vector(data_width_c-1 downto 0);
111
  signal pinger1_comm_in  : std_logic_vector(comm_width_c-1 downto 0);
112
  signal pinger1_av_in    : std_logic;
113
  signal pinger1_re_out   : std_logic;
114
  signal pinger1_empty_in : std_logic;
115
  signal pinger1_data_out : std_logic_vector(data_width_c-1 downto 0);
116
  signal pinger1_comm_out : std_logic_vector(comm_width_c-1 downto 0);
117
  signal pinger1_av_out   : std_logic;
118
  signal pinger1_we_out   : std_logic;
119
  signal pinger1_full_in  : std_logic;
120
 
121
  signal pinger2_data_in  : std_logic_vector(data_width_c-1 downto 0);
122
  signal pinger2_comm_in  : std_logic_vector(comm_width_c-1 downto 0);
123
  signal pinger2_av_in    : std_logic;
124
  signal pinger2_re_out   : std_logic;
125
  signal pinger2_empty_in : std_logic;
126
  signal pinger2_data_out : std_logic_vector(data_width_c-1 downto 0);
127
  signal pinger2_comm_out : std_logic_vector(comm_width_c-1 downto 0);
128
  signal pinger2_av_out   : std_logic;
129
  signal pinger2_we_out   : std_logic;
130
  signal pinger2_full_in  : std_logic;
131
 
132
  component dct_to_hibi
133
    generic (
134
      data_width_g   : integer;
135
      comm_width_g   : integer;
136
      use_self_rel_g : integer;
137
      own_address_g  : integer;
138
      rtm_address_g  : integer;
139
      dct_width_g    : integer;
140
      quant_width_g  : integer;
141
      idct_width_g   : integer);
142
    port (
143
      clk                 : in  std_logic;
144
      rst_n               : in  std_logic;
145
      hibi_av_out         : out std_logic;
146
      hibi_data_out       : out std_logic_vector (data_width_g-1 downto 0);
147
      hibi_comm_out       : out std_logic_vector (comm_width_g-1 downto 0);
148
      hibi_we_out         : out std_logic;
149
      hibi_re_out         : out std_logic;
150
      hibi_av_in          : in  std_logic;
151
      hibi_data_in        : in  std_logic_vector (data_width_g-1 downto 0);
152
      hibi_comm_in        : in  std_logic_vector (comm_width_g-1 downto 0);
153
      hibi_empty_in       : in  std_logic;
154
      hibi_full_in        : in  std_logic;
155
      wr_dct_out          : out std_logic;
156
      quant_ready4col_out : out std_logic;
157
      idct_ready4col_out  : out std_logic;
158
      data_dct_out        : out std_logic_vector(dct_width_g-1 downto 0);
159
      intra_out           : out std_logic;
160
      loadQP_out          : out std_logic;
161
      QP_out              : out std_logic_vector (4 downto 0);
162
      chroma_out          : out std_logic;
163
      data_idct_in        : in  std_logic_vector(idct_width_g-1 downto 0);
164
      data_quant_in       : in  std_logic_vector(quant_width_g-1 downto 0);
165
      dct_ready4col_in    : in  std_logic;
166
      wr_idct_in          : in  std_logic;
167
      wr_quant_in         : in  std_logic);
168
  end component;
169
 
170
  component dctQidct_core
171
    port (
172
      QP_in                 : in  std_logic_vector (4 downto 0);
173
      chroma_in             : in  std_logic;
174
      clk                   : in  std_logic;
175
      data_dct_in           : in  std_logic_vector (DCT_inputw_co-1 downto 0);
176
      idct_ready4column_in  : in  std_logic;
177
      intra_in              : in  std_logic;
178
      loadQP_in             : in  std_logic;
179
      quant_ready4column_in : in  std_logic;
180
      rst_n                 : in  std_logic;
181
      wr_dct_in             : in  std_logic;
182
      data_idct_out         : out std_logic_vector (IDCT_resultw_co-1 downto 0);
183
      data_quant_out        : out std_logic_vector (QUANT_resultw_co-1 downto 0);
184
      dct_ready4column_out  : out std_logic;
185
      wr_idct_out           : out std_logic;
186
      wr_quant_out          : out std_logic);
187
  end component;
188
 
189
  signal QP                 : std_logic_vector (4 downto 0);
190
  signal chroma             : std_logic;
191
  signal data_dct           : std_logic_vector (DCT_inputw_co-1 downto 0);
192
  signal idct_ready4column  : std_logic;
193
  signal intra              : std_logic;
194
  signal loadQP             : std_logic;
195
  signal quant_ready4column : std_logic;
196
  signal wr_dct             : std_logic;
197
  signal data_idct          : std_logic_vector (IDCT_resultw_co-1 downto 0);
198
  signal data_quant         : std_logic_vector (QUANT_resultw_co-1 downto 0);
199
  signal dct_ready4column   : std_logic;
200
  signal wr_idct            : std_logic;
201
  signal wr_quant           : std_logic;
202
 
203
  component hibi_wrapper_r4_top
204
    generic (
205
      id_g                : integer;
206
      base_id_g           : integer;
207
      id_width_g          : integer;
208
      addr_width_g        : integer;
209
      data_width_g        : integer;
210
      comm_width_g        : integer;
211
      counter_width_g     : integer;
212
      rel_agent_freq_g    : integer;
213
      rel_bus_freq_g      : integer;
214
      rx_fifo_depth_g     : integer;
215
      rx_msg_fifo_depth_g : integer;
216
      tx_fifo_depth_g     : integer;
217
      tx_msg_fifo_depth_g : integer;
218
      addr_g              : integer;
219
      prior_g             : integer;
220
      inv_addr_en_g       : integer;
221
      max_send_g          : integer;
222
      n_agents_g          : integer;
223
      n_cfg_pages_g       : integer;
224
      n_time_slots_g      : integer;
225
      n_extra_params_g    : integer;
226
      multicast_en_g      : integer;
227
      cfg_re_g            : integer;
228
      cfg_we_g            : integer;
229
      syncmode_sel_g      : integer range 0 to 2);
230
    port (
231
      bus_clk         : in  std_logic;
232
      agent_clk       : in  std_logic;
233
      agent_synch_clk : in  std_logic;
234
      rst_n           : in  std_logic;
235
      bus_comm_in     : in  std_logic_vector (comm_width_g-1 downto 0);
236
      bus_data_in     : in  std_logic_vector (data_width_g-1 downto 0);
237
      bus_full_in     : in  std_logic;
238
      bus_lock_in     : in  std_logic;
239
      bus_av_in       : in  std_logic;
240
      agent_comm_in   : in  std_logic_vector (comm_width_g-1 downto 0);
241
      agent_data_in   : in  std_logic_vector (data_width_g-1 downto 0);
242
      agent_av_in     : in  std_logic;
243
      agent_we_in     : in  std_logic;
244
      agent_re_in     : in  std_logic;
245
      bus_comm_out    : out std_logic_vector (comm_width_g-1 downto 0);
246
      bus_data_out    : out std_logic_vector (data_width_g-1 downto 0);
247
      bus_full_out    : out std_logic;
248
      bus_lock_out    : out std_logic;
249
      bus_av_out      : out std_logic;
250
      agent_comm_out  : out std_logic_vector (comm_width_g-1 downto 0);
251
      agent_data_out  : out std_logic_vector (data_width_g-1 downto 0);
252
      agent_av_out    : out std_logic;
253
      agent_full_out  : out std_logic;
254
      agent_one_p_out : out std_logic;
255
      agent_empty_out : out std_logic;
256
      agent_one_d_out : out std_logic);
257
  end component;
258
 
259
  component tb_dct_cpu
260
    generic (
261
      data_width_g : integer;
262
      comm_width_g : integer);
263
    port (
264
      clk_dctqidct_fast : in  std_logic;
265
      clk               : in  std_logic;
266
      rst_n             : in  std_logic;
267
      data_in           : in  std_logic_vector(data_width_g-1 downto 0);
268
      comm_in           : in  std_logic_vector(comm_width_g-1 downto 0);
269
      av_in             : in  std_logic;
270
      re_out            : out std_logic;
271
      empty_in          : in  std_logic;
272
      data_out          : out std_logic_vector(data_width_g-1 downto 0);
273
      comm_out          : out std_logic_vector(comm_width_g-1 downto 0);
274
      av_out            : out std_logic;
275
      we_out            : out std_logic;
276
      full_in           : in  std_logic;
277
      dct_data_idct_in  : in  std_logic_vector(IDCT_resultw_co-1 downto 0);
278
      dct_data_quant_in : in  std_logic_vector(QUANT_resultw_co-1 downto 0);
279
      dct_wr_idct_in    : in  std_logic;
280
      dct_wr_quant_in   : in  std_logic;
281
      dct_wr_dct_in     : in  std_logic;
282
      dct_data_dct_in   : in  std_logic_vector(DCT_inputw_co-1 downto 0);
283
      dct_qp_in         : in  std_logic_vector(4 downto 0);
284
      dct_intra_in      : in  std_logic;
285
      dct_chroma_in     : in  std_logic;
286
      dct_loadqp_in     : in  std_logic
287
 
288
      );
289
  end component;
290
 
291
  component tb_pinger
292
    generic (
293
      data_width_g     : integer;
294
      comm_width_g     : integer;
295
      start_sending_g  : integer;
296
      own_hibi_addr_g  : integer;
297
      init_send_addr_g : integer );
298
    port (
299
      clk      : in  std_logic;
300
      rst_n    : in  std_logic;
301
      data_in  : in  std_logic_vector (data_width_g-1 downto 0);
302
      comm_in  : in  std_logic_vector (comm_width_g-1 downto 0);
303
      av_in    : in  std_logic;
304
      re_out   : out std_logic;
305
      empty_in : in  std_logic;
306
      data_out : out std_logic_vector (data_width_g-1 downto 0);
307
      comm_out : out std_logic_vector (comm_width_g-1 downto 0);
308
      av_out   : out std_logic;
309
      we_out   : out std_logic;
310
      full_in  : in  std_logic);
311
  end component;
312
 
313
 
314
begin  -- structural
315
 
316
--  dctqidct_top_1 : dctqidct_top
317
--    generic map (
318
--      data_width_g => data_width_c,
319
--      comm_width_g => comm_width_c,
320
--      fast_per_slow_g => fast_clk_divider_c)
321
--    port map (
322
--      clk_slow => clk,
323
--      clk_fast => clk_fast,
324
--      rst_n    => rst_n,
325
--      data_in  => dctqidct_data_in,
326
--      comm_in  => dctqidct_comm_in,
327
--      av_in    => dctqidct_av_in,
328
--      re_out   => dctqidct_re_out,
329
--      empty_in => dctqidct_empty_in,
330
--      data_out => dctqidct_data_out,
331
--      comm_out => dctqidct_comm_out,
332
--      av_out   => dctqidct_av_out,
333
--      we_out   => dctqidct_we_out,
334
--      full_in  => dctqidct_full_in);
335
 
336
 
337
  dct_to_hibi_1_12 : dct_to_hibi
338
    generic map (
339
      data_width_g   => data_width_c,
340
      comm_width_g   => comm_width_c,
341
      use_self_rel_g => use_self_rel_c,
342
      own_address_g  => hibi_addr_dct_c,
343
      rtm_address_g  => hibi_addr_cpu_rtm_c,
344
      dct_width_g    => DCT_inputw_co,
345
      quant_width_g  => QUANT_resultw_co,
346
      idct_width_g   => IDCT_resultw_co)
347
    port map (
348
      clk           => clk_dct,
349
      rst_n         => rst_n,
350
      hibi_av_out   => dctqidct_av_out,
351
      hibi_data_out => dctqidct_data_out,
352
      hibi_comm_out => dctqidct_comm_out,
353
      hibi_we_out   => dctqidct_we_out,
354
      hibi_re_out   => dctqidct_re_out,
355
      hibi_av_in    => dctqidct_av_in,
356
      hibi_data_in  => dctqidct_data_in,
357
      hibi_comm_in  => dctqidct_comm_in,
358
      hibi_empty_in => dctqidct_empty_in,
359
      hibi_full_in  => dctqidct_full_in,
360
 
361
      wr_dct_out          => wr_dct,
362
      quant_ready4col_out => quant_ready4column,
363
      idct_ready4col_out  => idct_ready4column,
364
      data_dct_out        => data_dct,
365
      intra_out           => intra,
366
      loadQP_out          => loadQP,
367
      QP_out              => QP,
368
      chroma_out          => chroma,
369
      data_idct_in        => data_idct,
370
      data_quant_in       => data_quant,
371
      dct_ready4col_in    => dct_ready4column,
372
      wr_idct_in          => wr_idct,
373
      wr_quant_in         => wr_quant);
374
 
375
  dctQidct_core_1 : dctQidct_core
376
    port map (
377
      QP_in                 => QP,
378
      chroma_in             => chroma,
379
      clk                   => clk_dct,
380
      data_dct_in           => data_dct,
381
      idct_ready4column_in  => idct_ready4column,
382
      intra_in              => intra,
383
      loadQP_in             => loadQP,
384
      quant_ready4column_in => quant_ready4column,
385
      rst_n                 => rst_n,
386
      wr_dct_in             => wr_dct,
387
      data_idct_out         => data_idct,
388
      data_quant_out        => data_quant,
389
      dct_ready4column_out  => dct_ready4column,
390
      wr_idct_out           => wr_idct,
391
      wr_quant_out          => wr_quant);
392
 
393
 
394
 
395
  hibi_wrapper_dctqidct : hibi_wrapper_r4_top
396
    generic map (
397
      id_g                => 3,
398
      base_id_g           => 2**id_width_c-1,
399
      id_width_g          => id_width_c,
400
      addr_width_g        => addr_width_c,
401
      data_width_g        => data_width_c,
402
      comm_width_g        => comm_width_c,
403
      counter_width_g     => counter_width_c,
404
      rel_agent_freq_g    => fast_clk_divider_c,
405
      rel_bus_freq_g      => 1,
406
      rx_fifo_depth_g     => hw_fifo_depth_g,--hw_fifo_depth_c,
407
      rx_msg_fifo_depth_g => 5,
408
      tx_fifo_depth_g     => hw_fifo_depth_g,--hw_fifo_depth_c,
409
      tx_msg_fifo_depth_g => 5,
410
      addr_g              => hibi_addr_dct_c,
411
      prior_g             => 3,
412
      inv_addr_en_g       => 0,
413
      max_send_g          => max_send_c,
414
      n_agents_g          => n_agents_c,
415
      n_cfg_pages_g       => 1,
416
      n_time_slots_g      => n_time_slots_c,
417
      n_extra_params_g    => n_extra_params_c,
418
      multicast_en_g      => 0,
419
      cfg_re_g            => 0,
420
      cfg_we_g            => 0,
421
      syncmode_sel_g      => 0)
422
    port map (
423
      bus_clk         => clk,
424
      agent_clk       => clk_dct,
425
      agent_synch_clk => clk,
426
      rst_n           => rst_n,
427
      bus_comm_in     => bus_comm_in,
428
      bus_data_in     => bus_data_in,
429
      bus_full_in     => bus_full_in,
430
      bus_lock_in     => bus_lock_in,
431
      bus_av_in       => bus_av_in,
432
 
433
      agent_comm_in => dctqidct_comm_out,
434
      agent_data_in => dctqidct_data_out,
435
      agent_av_in   => dctqidct_av_out,
436
      agent_we_in   => dctqidct_we_out,
437
      agent_re_in   => dctqidct_re_out,
438
 
439
      bus_comm_out => bus_comm_out_dctqidct,
440
      bus_data_out => bus_data_out_dctqidct,
441
      bus_full_out => bus_full_out_dctqidct,
442
      bus_lock_out => bus_lock_out_dctqidct,
443
      bus_av_out   => bus_av_out_dctqidct,
444
 
445
      agent_comm_out  => dctqidct_comm_in,
446
      agent_data_out  => dctqidct_data_in,
447
      agent_av_out    => dctqidct_av_in,
448
      agent_full_out  => dctqidct_full_in,
449
      agent_empty_out => dctqidct_empty_in);
450
 
451
  hibi_wrapper_cpu : hibi_wrapper_r4_top
452
    generic map (
453
      id_g                => 4,
454
      base_id_g           => 2**id_width_c-1,
455
      id_width_g          => id_width_c,
456
      addr_width_g        => addr_width_c,
457
      data_width_g        => data_width_c,
458
      comm_width_g        => comm_width_c,
459
      counter_width_g     => counter_width_c,
460
      rel_agent_freq_g    => 1,
461
      rel_bus_freq_g      => slow_clk_multiplier_c,
462
      rx_fifo_depth_g     => hw_fifo_depth_g,
463
      rx_msg_fifo_depth_g => 5,
464
      tx_fifo_depth_g     => hw_fifo_depth_g,
465
      tx_msg_fifo_depth_g => 5,
466
      addr_g              => hibi_addr_cpu_c,
467
      prior_g             => 4,
468
      inv_addr_en_g       => 0,
469
      max_send_g          => max_send_c,
470
      n_agents_g          => n_agents_c,
471
      n_cfg_pages_g       => 1,
472
      n_time_slots_g      => n_time_slots_c,
473
      n_extra_params_g    => n_extra_params_c,
474
      multicast_en_g      => 0,
475
      cfg_re_g            => 0,
476
      cfg_we_g            => 0,
477
      syncmode_sel_g      => 0)
478
    port map (
479
      bus_clk         => clk,
480
      agent_clk       => clk_cpu,
481
      agent_synch_clk => clk,
482
      rst_n           => rst_n,
483
 
484
      bus_comm_in => bus_comm_in,
485
      bus_data_in => bus_data_in,
486
      bus_full_in => bus_full_in,
487
      bus_lock_in => bus_lock_in,
488
      bus_av_in   => bus_av_in,
489
 
490
      agent_comm_in => cpu_comm_out,
491
      agent_data_in => cpu_data_out,
492
      agent_av_in   => cpu_av_out,
493
      agent_we_in   => cpu_we_out,
494
      agent_re_in   => cpu_re_out,
495
 
496
      bus_comm_out => bus_comm_out_cpu,
497
      bus_data_out => bus_data_out_cpu,
498
      bus_full_out => bus_full_out_cpu,
499
      bus_lock_out => bus_lock_out_cpu,
500
      bus_av_out   => bus_av_out_cpu,
501
 
502
      agent_comm_out  => cpu_comm_in,
503
      agent_data_out  => cpu_data_in,
504
      agent_av_out    => cpu_av_in,
505
      agent_full_out  => cpu_full_in,
506
      agent_empty_out => cpu_empty_in);
507
 
508
  tb_dct_cpu_i : tb_dct_cpu
509
    generic map (
510
      data_width_g => data_width_c,
511
      comm_width_g => comm_width_c)
512
    port map (
513
      clk               => clk_cpu,
514
      clk_dctqidct_fast => clk_dct,
515
      rst_n             => rst_n,
516
      data_in           => cpu_data_in,
517
      comm_in           => cpu_comm_in,
518
      av_in             => cpu_av_in,
519
      re_out            => cpu_re_out,
520
      empty_in          => cpu_empty_in,
521
      data_out          => cpu_data_out,
522
      comm_out          => cpu_comm_out,
523
      av_out            => cpu_av_out,
524
      we_out            => cpu_we_out,
525
      full_in           => cpu_full_in,
526
      dct_data_idct_in  => data_idct,
527
      dct_data_quant_in => data_quant,
528
      dct_wr_idct_in    => wr_idct,
529
      dct_wr_quant_in   => wr_quant,
530
      dct_wr_dct_in     => wr_dct,
531
      dct_data_dct_in   => data_dct,
532
      dct_qp_in         => QP,
533
      dct_intra_in      => intra,
534
      dct_chroma_in     => chroma,
535
      dct_loadqp_in     => loadQP
536
      );
537
 
538
 
539
  hibi_wrapper_pinger1 : hibi_wrapper_r4_top
540
    generic map (
541
      id_g                => 2,
542
      base_id_g           => 2**id_width_c-1,
543
      id_width_g          => id_width_c,
544
      addr_width_g        => addr_width_c,
545
      data_width_g        => data_width_c,
546
      comm_width_g        => comm_width_c,
547
      counter_width_g     => counter_width_c,
548
      rel_agent_freq_g    => 1,
549
      rel_bus_freq_g      => 1,
550
      rx_fifo_depth_g     => hw_fifo_depth_g,
551
      rx_msg_fifo_depth_g => 5,
552
      tx_fifo_depth_g     => hw_fifo_depth_g,
553
      tx_msg_fifo_depth_g => 5,
554
      addr_g              => hibi_addr_pinger1_c,
555
      prior_g             => 2,
556
      inv_addr_en_g       => 0,
557
      max_send_g          => max_send_c,
558
      n_agents_g          => n_agents_c,
559
      n_cfg_pages_g       => 1,
560
      n_time_slots_g      => n_time_slots_c,
561
      n_extra_params_g    => n_extra_params_c,
562
      multicast_en_g      => 0,
563
      cfg_re_g            => 0,
564
      cfg_we_g            => 0,
565
      syncmode_sel_g      => 0)
566
    port map (
567
      bus_clk         => clk,
568
      agent_clk       => clk,
569
      agent_synch_clk => clk,
570
      rst_n           => rst_n,
571
 
572
      bus_comm_in => bus_comm_in,
573
      bus_data_in => bus_data_in,
574
      bus_full_in => bus_full_in,
575
      bus_lock_in => bus_lock_in,
576
      bus_av_in   => bus_av_in,
577
 
578
      agent_comm_in => pinger1_comm_out,
579
      agent_data_in => pinger1_data_out,
580
      agent_av_in   => pinger1_av_out,
581
      agent_we_in   => pinger1_we_out,
582
      agent_re_in   => pinger1_re_out,
583
 
584
      bus_comm_out => bus_comm_out_pinger1,
585
      bus_data_out => bus_data_out_pinger1,
586
      bus_full_out => bus_full_out_pinger1,
587
      bus_lock_out => bus_lock_out_pinger1,
588
      bus_av_out   => bus_av_out_pinger1,
589
 
590
      agent_comm_out  => pinger1_comm_in,
591
      agent_data_out  => pinger1_data_in,
592
      agent_av_out    => pinger1_av_in,
593
      agent_full_out  => pinger1_full_in,
594
      agent_empty_out => pinger1_empty_in);
595
 
596
  hibi_wrapper_pinger2 : hibi_wrapper_r4_top
597
    generic map (
598
      id_g                => 1,
599
      base_id_g           => 2**id_width_c-1,
600
      id_width_g          => id_width_c,
601
      addr_width_g        => addr_width_c,
602
      data_width_g        => data_width_c,
603
      comm_width_g        => comm_width_c,
604
      counter_width_g     => counter_width_c,
605
      rel_agent_freq_g    => 1,
606
      rel_bus_freq_g      => 1,
607
      rx_fifo_depth_g     => 4,
608
      rx_msg_fifo_depth_g => 5,
609
      tx_fifo_depth_g     => 4,
610
      tx_msg_fifo_depth_g => 5,
611
      addr_g              => hibi_addr_pinger2_c,
612
      prior_g             => 1,
613
      inv_addr_en_g       => 0,
614
      max_send_g          => max_send_c,
615
      n_agents_g          => n_agents_c,
616
      n_cfg_pages_g       => 1,
617
      n_time_slots_g      => n_time_slots_c,
618
      n_extra_params_g    => n_extra_params_c,
619
      multicast_en_g      => 0,
620
      cfg_re_g            => 0,
621
      cfg_we_g            => 0,
622
      syncmode_sel_g      => 0)
623
    port map (
624
      bus_clk         => clk,
625
      agent_clk       => clk,
626
      agent_synch_clk => clk,
627
      rst_n           => rst_n,
628
 
629
      bus_comm_in => bus_comm_in,
630
      bus_data_in => bus_data_in,
631
      bus_full_in => bus_full_in,
632
      bus_lock_in => bus_lock_in,
633
      bus_av_in   => bus_av_in,
634
 
635
      agent_comm_in => pinger2_comm_out,
636
      agent_data_in => pinger2_data_out,
637
      agent_av_in   => pinger2_av_out,
638
      agent_we_in   => pinger2_we_out,
639
      agent_re_in   => pinger2_re_out,
640
 
641
      bus_comm_out => bus_comm_out_pinger2,
642
      bus_data_out => bus_data_out_pinger2,
643
      bus_full_out => bus_full_out_pinger2,
644
      bus_lock_out => bus_lock_out_pinger2,
645
      bus_av_out   => bus_av_out_pinger2,
646
 
647
      agent_comm_out  => pinger2_comm_in,
648
      agent_data_out  => pinger2_data_in,
649
      agent_av_out    => pinger2_av_in,
650
      agent_full_out  => pinger2_full_in,
651
      agent_empty_out => pinger2_empty_in);
652
 
653
 
654
 
655
  tb_pinger_1 : tb_pinger
656
    generic map (
657
      data_width_g     => data_width_c,
658
      comm_width_g     => comm_width_c,
659
      start_sending_g  => 1,
660
      own_hibi_addr_g  => hibi_addr_pinger1_c,
661
      init_send_addr_g => hibi_addr_pinger2_c)
662
    port map (
663
      clk      => clk,
664
      rst_n    => rst_n,
665
      data_in  => pinger1_data_in,
666
      comm_in  => pinger1_comm_in,
667
      av_in    => pinger1_av_in,
668
      re_out   => pinger1_re_out,
669
      empty_in => pinger1_empty_in,
670
      data_out => pinger1_data_out,
671
      comm_out => pinger1_comm_out,
672
      av_out   => pinger1_av_out,
673
      we_out   => pinger1_we_out,
674
      full_in  => pinger1_full_in);
675
 
676
  tb_pinger_2 : tb_pinger
677
    generic map (
678
      data_width_g     => data_width_c,
679
      comm_width_g     => comm_width_c,
680
      start_sending_g => 0,
681
      own_hibi_addr_g  => hibi_addr_pinger2_c,
682
      init_send_addr_g => hibi_addr_pinger1_c)
683
    port map (
684
      clk      => clk,
685
      rst_n    => rst_n,
686
      data_in  => pinger2_data_in,
687
      comm_in  => pinger2_comm_in,
688
      av_in    => pinger2_av_in,
689
      re_out   => pinger2_re_out,
690
      empty_in => pinger2_empty_in,
691
      data_out => pinger2_data_out,
692
      comm_out => pinger2_comm_out,
693
      av_out   => pinger2_av_out,
694
      we_out   => pinger2_we_out,
695
      full_in  => pinger2_full_in);
696
 
697
  clock_gen : process (clk)
698
  begin
699
    clk <= not clk after clk_period_c/2;
700
  end process clock_gen;
701
 
702
  clock_gen_dct : process (clk_dct)
703
  begin
704
    clk_dct <= not clk_dct after clk_period_c/(fast_clk_divider_c*2);
705
  end process clock_gen_dct;
706
 
707
  clock_gen_cpu : process (clk_cpu)
708
  begin
709
    clk_cpu <= not clk_cpu after clk_period_c/(2)*slow_clk_multiplier_c;
710
  end process clock_gen_cpu;
711
 
712
 
713
  rst_gen : process(rst_n)
714
  begin  -- process rst_gen
715
    if rst_n = '0' then
716
      rst_n <= '1' after reset_time_c;
717
    else
718
      rst_n <= '1';
719
    end if;
720
  end process rst_gen;
721
 
722
  bus_comm_in <= bus_comm_out_cpu or bus_comm_out_dctqidct or bus_comm_out_pinger1 or bus_comm_out_pinger2;
723
  bus_data_in <= bus_data_out_cpu or bus_data_out_dctqidct or bus_data_out_pinger1 or bus_data_out_pinger2;
724
  bus_full_in <= bus_full_out_cpu or bus_full_out_dctqidct or bus_full_out_pinger1 or bus_full_out_pinger2;
725
  bus_lock_in <= bus_lock_out_cpu or bus_lock_out_dctqidct or bus_lock_out_pinger1 or bus_lock_out_pinger2;
726
  bus_av_in   <= bus_av_out_cpu or bus_av_out_dctqidct or bus_av_out_pinger1 or bus_av_out_pinger2;
727
 
728
end structural;
729
 

powered by: WebSVN 2.1.0

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