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/] [ase_mesh1/] [1.0/] [vhd/] [ase_mesh1_pkt_codec.vhd] - Blame information for rev 159

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : Ase mesh1 top with packet codecs
3
-- Project    : 
4
-------------------------------------------------------------------------------
5
-- File       : ase_mesh1_pkt_codec.vhd
6
-- Author     : Lasse Lehtonen
7
-- Company    : 
8
-- Created    : 2011-09-25
9 147 lanttu
-- Last update: 2012-06-14
10 145 lanttu
-- Platform   : 
11
-- Standard   : VHDL'93
12
-------------------------------------------------------------------------------
13
-- Description: Combines the mesh network with packetizers.
14
-------------------------------------------------------------------------------
15
-- Copyright (c) 2011 
16
-------------------------------------------------------------------------------
17
-- Revisions  :
18
-- Date        Version  Author  Description
19
-- 2011-01-18  1.0      ase     Created
20
-------------------------------------------------------------------------------
21
 
22
library ieee;
23
use ieee.std_logic_1164.all;
24
 
25
 
26
 
27
entity ase_mesh1_pkt_codec is
28
 
29
  generic (
30 147 lanttu
    data_width_g      : positive;       -- in bits
31
    cmd_width_g       : positive;       -- in bits
32
    agents_g          : positive;       -- num of terminals
33
    cols_g            : positive;       -- #terminals in x dimension
34
    rows_g            : positive;       -- #terminals in y dimension
35
    agent_ports_g     : positive;
36
    addr_flit_en_g    : natural;
37
    address_mode_g    : natural;
38
    clock_mode_g      : natural;
39
    rip_addr_g        : natural;
40
    ni_fifo_depth_g   : natural;
41
    link_fifo_depth_g : natural);
42 145 lanttu
 
43
  port (
44
    clk_ip    : in  std_logic;
45
    clk_net   : in  std_logic;
46
    rst_n     : in  std_logic;
47
    cmd_in    : in  std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
48
    data_in   : in  std_logic_vector(agents_g * data_width_g - 1 downto 0);
49
    stall_out : out std_logic_vector(agents_g - 1 downto 0);
50
 
51 147 lanttu
    cmd_out  : out std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
52
    data_out : out std_logic_vector(agents_g * data_width_g - 1 downto 0);
53
    stall_in : in  std_logic_vector(agents_g - 1 downto 0)
54 145 lanttu
    );
55
 
56
end entity ase_mesh1_pkt_codec;
57
 
58
 
59
 
60
architecture structural of ase_mesh1_pkt_codec is
61
 
62
  constant noc_type_g : natural := 1;
63 147 lanttu
 
64 145 lanttu
  -----------------------------------------------------------------------------
65
  -- MESH
66
  -----------------------------------------------------------------------------
67
 
68
  signal cmd_to_n     : std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
69
  signal data_to_n    : std_logic_vector(agents_g * data_width_g - 1 downto 0);
70
  signal stall_to_n   : std_logic_vector(agents_g - 1 downto 0);
71
  signal cmd_from_n   : std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
72
  signal data_from_n  : std_logic_vector(agents_g * data_width_g - 1 downto 0);
73
  signal stall_from_n : std_logic_vector(agents_g - 1 downto 0);
74
 
75
begin  -- architecture structural
76
 
77
 
78
  -----------------------------------------------------------------------------
79
  -- Instantiate the mesh top-level
80
  -----------------------------------------------------------------------------
81
  noc_top_1 : entity work.ase_mesh1
82
    generic map (
83 147 lanttu
      n_rows_g     => rows_g,
84
      n_cols_g     => cols_g,
85
      cmd_width_g  => cmd_width_g,
86
      bus_width_g  => data_width_g,
87
      fifo_depth_g => link_fifo_depth_g
88 145 lanttu
      )
89
    port map (
90 147 lanttu
      clk   => clk_net,
91
      rst_n => rst_n,
92
 
93 145 lanttu
      cmd_in    => cmd_to_n,
94
      data_in   => data_to_n,
95
      stall_out => stall_from_n,
96
 
97 147 lanttu
      cmd_out  => cmd_from_n,
98
      data_out => data_from_n,
99
      stall_in => stall_to_n
100 145 lanttu
      );
101
 
102
 
103
 
104
  -----------------------------------------------------------------------------
105 147 lanttu
  -- GENERATE PKT_CODEC_MK2s
106
  -----------------------------------------------------------------------------
107 145 lanttu
  codecs_g : for i in 0 to agents_g-1 generate
108
 
109
    packet_codec_1 : entity work.pkt_codec_mk2
110
      generic map (
111 147 lanttu
        my_id_g      => i,
112
        data_width_g => data_width_g,
113
        cmd_width_g  => cmd_width_g,
114
        agents_g     => agents_g,
115
        cols_g       => cols_g,
116
        rows_g       => rows_g,
117
 
118 145 lanttu
        agent_ports_g  => agent_ports_g,
119
        addr_flit_en_g => addr_flit_en_g,
120
        address_mode_g => address_mode_g,
121
        clock_mode_g   => clock_mode_g,
122
        rip_addr_g     => rip_addr_g,
123 147 lanttu
        noc_type_g     => noc_type_g,
124
        fifo_depth_g   => ni_fifo_depth_g
125 145 lanttu
        )
126
      port map (
127 147 lanttu
        clk_ip      => clk_ip,
128
        clk_net     => clk_net,
129
        rst_n       => rst_n,
130 145 lanttu
        -- IP side in/out
131 147 lanttu
        ip_cmd_out  => cmd_out((i+1)*cmd_width_g-1 downto i*cmd_width_g),
132
        ip_data_out => data_out((i+1)*data_width_g-1 downto i*data_width_g),
133
        ip_stall_in => stall_in(i),
134 145 lanttu
 
135 147 lanttu
        ip_cmd_in    => cmd_in((i+1)*cmd_width_g-1 downto i*cmd_width_g),
136
        ip_data_in   => data_in((i+1)*data_width_g-1 downto i*data_width_g),
137
        ip_stall_out => stall_out(i),
138 145 lanttu
 
139 147 lanttu
        ip_len_in => (others => '0'),
140
 
141 145 lanttu
        -- NoC side out/in
142 147 lanttu
        net_cmd_out  => cmd_to_n((i+1)*cmd_width_g-1 downto i*cmd_width_g),
143
        net_data_out => data_to_n((i+1)*data_width_g-1 downto i*data_width_g),
144
        net_stall_in => stall_from_n(i),
145 145 lanttu
 
146
        net_cmd_in    => cmd_from_n((i+1)*cmd_width_g-1 downto i*cmd_width_g),
147
        net_data_in   => data_from_n((i+1)*data_width_g-1 downto i*data_width_g),
148
        net_stall_out => stall_to_n(i)
149
        );
150
 
151
  end generate codecs_g;
152
 
153
 
154
end architecture structural;
155
 

powered by: WebSVN 2.1.0

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