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.communication/] [hibi/] [3.0/] [vhd/] [transmitter.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : HIBI Transmitter
3
-- Project    : Nocbench, Funbase
4
-------------------------------------------------------------------------------
5
-- File       : transmitter.vhd
6
-- Authors    : Erno Salminen
7
-- Company    : Tampere University of Technology
8
-- Created    :
9
-- Last update: 2011-11-28
10
-- Platform   : 
11
-- Standard   : VHDL'93
12
-------------------------------------------------------------------------------
13
-- Description: Transmitter block just instantiates tx control and
14
--              configuration memory
15
-- 
16
--
17
-------------------------------------------------------------------------------
18
-- Copyright (c) 2010 Tampere University of Technology
19
--
20
-- 
21
-------------------------------------------------------------------------------
22
-- Revisions  :
23
-- Date        Version  Author  Description
24
-- 2002-07-23  1.0      ege     Created
25
-------------------------------------------------------------------------------
26
-- Funbase IP library Copyright (C) 2011 TUT Department of Computer Systems
27
--
28
-- This file is part of HIBI
29
--
30
-- This source file may be used and distributed without
31
-- restriction provided that this copyright statement is not
32
-- removed from the file and that any derivative work contains
33
-- the original copyright notice and the associated disclaimer.
34
--
35
-- This source file is free software; you can redistribute it
36
-- and/or modify it under the terms of the GNU Lesser General
37
-- Public License as published by the Free Software Foundation;
38
-- either version 2.1 of the License, or (at your option) any
39
-- later version.
40
--
41
-- This source is distributed in the hope that it will be
42
-- useful, but WITHOUT ANY WARRANTY; without even the implied
43
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
44
-- PURPOSE.  See the GNU Lesser General Public License for more
45
-- details.
46
--
47
-- You should have received a copy of the GNU Lesser General
48
-- Public License along with this source; if not, download it
49
-- from http://www.opencores.org/lgpl.shtml
50
-------------------------------------------------------------------------------
51
 
52
library ieee;
53
use ieee.std_logic_1164.all;
54
 
55
 
56
entity transmitter is
57
 
58
  generic (
59
    id_g            : integer;
60
    addr_g          : integer;
61
    id_width_g      : integer;
62
    data_width_g    : integer;
63
    addr_width_g    : integer;
64
    comm_width_g    : integer;
65
    counter_width_g : integer;
66
 
67
    cfg_addr_width_g : integer;
68
    prior_g          : integer;
69
    inv_addr_en_g    : integer;
70
    max_send_g       : integer;
71
    arb_type_g       : integer;
72
 
73
    n_agents_g       : integer;
74
    n_cfg_pages_g    : integer;
75
    n_time_slots_g   : integer;
76
    keep_slot_g      : integer;
77
    n_extra_params_g : integer;
78
    cfg_we_g         : integer;
79
    cfg_re_g         : integer;
80
    separate_addr_g  : integer;
81
    debug_width_g    : integer := 0
82
    );
83
  port (
84
    clk   : in std_logic;
85
    rst_n : in std_logic;
86
 
87
    -- from bus
88
    lock_in : in std_logic;
89
    full_in : in std_logic;
90
 
91
    -- from rx
92
    cfg_data_in     : in std_logic_vector
93
    (data_width_g-1-(separate_addr_g*addr_width_g) downto 0);
94
    cfg_addr_in     : in std_logic_vector(cfg_addr_width_g -1 downto 0);
95
    cfg_ret_addr_in : in std_logic_vector(addr_width_g -1 downto 0);
96
    cfg_re_in       : in std_logic;
97
    cfg_we_in       : in std_logic;
98
 
99
    -- from fifo
100
    av_in    : in std_logic;
101
    data_in  : in std_logic_vector(data_width_g-1 downto 0);
102
    comm_in  : in std_logic_vector(comm_width_g-1 downto 0);
103
    empty_in : in std_logic;
104
    one_d_in : in std_logic;
105
 
106
    -- to bus
107
    av_out   : out std_logic;
108
    data_out : out std_logic_vector(data_width_g-1 downto 0);
109
    comm_out : out std_logic_vector(comm_width_g-1 downto 0);
110
    lock_out : out std_logic;
111
 
112
    -- to rx
113
    cfg_rd_rdy_out : out std_logic;
114
 
115
    -- to fifo
116
    re_out : out std_logic
117
 
118
    -- synthesis translate_off
119
    -- pragma sythesis_off
120
    -- pragma translate_off
121
    ;
122
 
123
    debug_out : out std_logic_vector(debug_width_g-1 downto 0);
124
    debug_in  : in  std_logic_vector(debug_width_g-1 downto 0)
125
    -- pragma translate_on
126
    -- pragma synthesis_on
127
    -- synthesis translate_on      
128
 
129
    );
130
end transmitter;
131
 
132
 
133
-- **********
134
-- 19.08.2004
135
-- These must be connected from cfg_mem to tx_ctrl!
136
--  signal Power_Mode_cm_tx        : std_logic_vector( 1 downto 0);
137
--  signal Competition_Type_cm_tx  : std_logic_vector( 1 downto 0); 
138
-- **********
139
 
140
 
141
 
142
 
143
architecture structural of transmitter is
144
 
145
 
146
  signal curr_slot_ends_cm_tx   : std_logic;
147
  signal curr_slot_own_cm_tx    : std_logic;
148
  signal next_slot_starts_cm_tx : std_logic;
149
  signal next_slot_own_cm_tx    : std_logic;
150
 
151
  signal n_agents_cm_tx : std_logic_vector(id_width_g-1 downto 0);
152
  signal max_send_cm_tx : std_logic_vector(counter_width_g-1 downto 0);
153
  signal prior_cm_tx    : std_logic_vector(id_width_g-1 downto 0);
154
  signal data_cm_tx     : std_logic_vector
155
    (data_width_g-1-(separate_addr_g*addr_width_g) downto 0);
156
 
157
  -- These must be connected to tx_ctrl!
158
  signal pwr_mode_cm_tx : std_logic_vector(1 downto 0);
159
  signal arb_type_cm_tx : std_logic_vector(1 downto 0);
160
 
161
 
162
  component tx_control
163
    generic (
164
      counter_width_g : integer;
165
      id_width_g      : integer;
166
      data_width_g    : integer;
167
      addr_width_g    : integer;
168
      comm_width_g    : integer;
169
      n_agents_g      : integer;
170
      cfg_re_g        : integer;
171
      keep_slot_g     : integer;
172
      separate_addr_g : integer
173
      );
174
    port (
175
      clk                 : in  std_logic;
176
      rst_n               : in  std_logic;
177
      lock_in             : in  std_logic;
178
      full_in             : in  std_logic;
179
      cfg_ret_addr_in     : in  std_logic_vector(addr_width_g-1 downto 0);
180
      cfg_data_in         : in  std_logic_vector
181
      (data_width_g-1-(separate_addr_g*addr_width_g) downto 0);
182
      cfg_re_in           : in  std_logic;
183
      curr_slot_own_in    : in  std_logic;
184
      curr_slot_ends_in   : in  std_logic;
185
      next_slot_own_in    : in  std_logic;
186
      next_slot_starts_in : in  std_logic;
187
      max_send_in         : in  std_logic_vector(counter_width_g-1 downto 0);
188
      n_agents_in         : in  std_logic_vector(id_width_g-1 downto 0);
189
      prior_in            : in  std_logic_vector(id_width_g-1 downto 0);
190
      -- *********************************************************
191
      -- new ports: Power_Mode and Competition_Type must be added!
192
      -- *********************************************************
193
      arb_type_in         : in  std_logic_vector(1 downto 0);
194
      av_in               : in  std_logic;
195
      data_in             : in  std_logic_vector(data_width_g-1 downto 0);
196
      comm_in             : in  std_logic_vector(comm_width_g-1 downto 0);
197
      one_d_in            : in  std_logic;
198
      empty_in            : in  std_logic;
199
      av_out              : out std_logic;
200
      data_out            : out std_logic_vector(data_width_g-1 downto 0);
201
      comm_out            : out std_logic_vector(comm_width_g-1 downto 0);
202
      lock_out            : out std_logic;
203
      cfg_rd_rdy_out      : out std_logic;
204
      re_out              : out std_logic
205
      );
206
  end component;  --tx_control;
207
 
208
  component cfg_mem
209
    generic (
210
      id_width_g       : integer := 4;
211
      id_g             : integer := 5;
212
      data_width_g     : integer := 16;
213
      counter_width_g  : integer := 8;
214
      arb_type_g       : integer := 0;
215
      cfg_addr_width_g : integer := 7;
216
      inv_addr_en_g    : integer := 0;   -- not used?
217
      addr_g           : integer := 46;
218
      prior_g          : integer := 2;
219
      max_send_g       : integer := 50;
220
      n_agents_g       : integer := 4;
221
      n_cfg_pages_g    : integer := 1;
222
      n_time_slots_g   : integer := 0;
223
      cfg_re_g         : integer := 0;
224
      cfg_we_g         : integer := 0
225
      );
226
    port (
227
      clk   : in std_logic;
228
      rst_n : in std_logic;
229
 
230
      addr_in              : in  std_logic_vector(cfg_addr_width_g -1 downto 0);
231
      data_in              : in  std_logic_vector(data_width_g-1 downto 0);
232
      re_in                : in  std_logic;
233
      we_in                : in  std_logic;
234
      curr_slot_ends_out   : out std_logic;
235
      curr_slot_own_out    : out std_logic;
236
      next_slot_starts_out : out std_logic;
237
      next_slot_own_out    : out std_logic;
238
      dbg_out              : out integer range 0 to 100;  -- For debug
239
      data_out             : out std_logic_vector(data_width_g-1 downto 0);
240
      arb_type_out         : out std_logic_vector(1 downto 0);
241
      n_agents_out         : out std_logic_vector(id_width_g-1 downto 0);
242
      max_send_out         : out std_logic_vector(counter_width_g-1 downto 0);
243
      prior_out            : out std_logic_vector(id_width_g-1 downto 0);
244
      pwr_mode_out         : out std_logic_vector(1 downto 0)
245
      );
246
  end component;  --cfg_mem;
247
 
248
 
249
 
250
begin  -- structural
251
 
252
  -- Design compiler ei ymmärrä alempaa esittelyä
253
  tx_c : tx_control
254
    -- tx_c : entity work.tx_control
255
    generic map(
256
      counter_width_g => counter_width_g,  --19.05
257
      id_width_g      => id_width_g,
258
      data_width_g    => data_width_g,
259
      addr_width_g    => addr_width_g,
260
      comm_width_g    => comm_width_g,
261
      n_agents_g      => n_agents_g,       -- 2009-04-08
262
      cfg_re_g        => cfg_re_g,
263
      keep_slot_g     => keep_slot_g,
264
      separate_addr_g => separate_addr_g
265
      )
266
    port map(
267
      clk   => clk,
268
      rst_n => rst_n,
269
 
270
      lock_in         => lock_in,
271
      full_in         => full_in,
272
      cfg_data_in     => data_cm_tx,
273
      cfg_ret_addr_in => cfg_ret_addr_in,
274
      cfg_re_in       => cfg_re_in,
275
 
276
      curr_slot_own_in    => curr_slot_own_cm_tx,
277
      curr_slot_ends_in   => curr_slot_ends_cm_tx,
278
      next_slot_own_in    => next_slot_own_cm_tx,
279
      next_slot_starts_in => next_slot_starts_cm_tx,
280
      max_send_in         => max_send_cm_tx,
281
      prior_in            => prior_cm_tx,
282
      n_agents_in         => n_agents_cm_tx,
283
      arb_type_in         => arb_type_cm_tx,
284
 
285
      av_in    => av_in,
286
      data_in  => data_in,
287
      comm_in  => comm_in,
288
      empty_in => empty_in,
289
      one_d_in => one_d_in,
290
 
291
      data_out       => data_out,
292
      comm_out       => comm_out,
293
      av_out         => av_out,
294
      lock_out       => lock_out,
295
      cfg_rd_rdy_out => cfg_rd_rdy_out,
296
 
297
      re_out => re_out
298
      );
299
 
300
 
301
  -- Design compiler ei ymmärrä alempaa esittelyä
302
  cm : cfg_mem
303
    --cm : entity work.cfg_mem
304
    generic map(
305
      counter_width_g => counter_width_g,
306
      id_g            => id_g,
307
      id_width_g      => id_width_g,
308
 
309
      data_width_g => data_width_g-(separate_addr_g*addr_width_g),
310
 
311
      cfg_addr_width_g => cfg_addr_width_g,  --16.12.05
312
 
313
      addr_g        => addr_g,
314
      prior_g       => prior_g,
315
      inv_addr_en_g => inv_addr_en_g,
316
      max_send_g    => max_send_g,
317
      arb_type_g    => arb_type_g,
318
 
319
      n_agents_g     => n_agents_g,
320
      n_cfg_pages_g  => n_cfg_pages_g,
321
      n_time_slots_g => n_time_slots_g,
322
      cfg_re_g       => cfg_re_g,
323
      cfg_we_g       => cfg_we_g
324
      )
325
    port map(
326
      clk   => clk,
327
      rst_n => rst_n,
328
 
329
      re_in    => cfg_re_in,
330
      we_in    => cfg_we_in,
331
      data_in  => cfg_data_in,
332
      addr_in  => cfg_addr_in,
333
      data_out => data_cm_tx,
334
 
335
      curr_slot_ends_out   => curr_slot_ends_cm_tx,
336
      curr_slot_own_out    => curr_slot_own_cm_tx,
337
      next_slot_starts_out => next_slot_starts_cm_tx,
338
      next_slot_own_out    => next_slot_own_cm_tx,
339
 
340
      arb_type_out => arb_type_cm_tx,
341
      n_agents_out => n_agents_cm_tx,
342
      max_send_out => max_send_cm_tx,
343
      prior_out    => prior_cm_tx,
344
      pwr_mode_out => pwr_mode_cm_tx
345
 
346
      );
347
 
348
 
349
end structural;

powered by: WebSVN 2.1.0

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