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 |
|
|
-- Last update: 2011-12-02
|
10 |
|
|
-- 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 |
|
|
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 |
|
|
fifo_depth_g : natural);
|
41 |
|
|
|
42 |
|
|
port (
|
43 |
|
|
clk_ip : in std_logic;
|
44 |
|
|
clk_net : in std_logic;
|
45 |
|
|
rst_n : in std_logic;
|
46 |
|
|
cmd_in : in std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
|
47 |
|
|
data_in : in std_logic_vector(agents_g * data_width_g - 1 downto 0);
|
48 |
|
|
stall_out : out std_logic_vector(agents_g - 1 downto 0);
|
49 |
|
|
|
50 |
|
|
cmd_out : out std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
|
51 |
|
|
data_out : out std_logic_vector(agents_g * data_width_g - 1 downto 0);
|
52 |
|
|
stall_in : in std_logic_vector(agents_g - 1 downto 0)
|
53 |
|
|
);
|
54 |
|
|
|
55 |
|
|
end entity ase_mesh1_pkt_codec;
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
architecture structural of ase_mesh1_pkt_codec is
|
60 |
|
|
|
61 |
|
|
constant noc_type_g : natural := 1;
|
62 |
|
|
|
63 |
|
|
-----------------------------------------------------------------------------
|
64 |
|
|
-- MESH
|
65 |
|
|
-----------------------------------------------------------------------------
|
66 |
|
|
|
67 |
|
|
signal cmd_to_n : std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
|
68 |
|
|
signal data_to_n : std_logic_vector(agents_g * data_width_g - 1 downto 0);
|
69 |
|
|
signal stall_to_n : std_logic_vector(agents_g - 1 downto 0);
|
70 |
|
|
signal cmd_from_n : std_logic_vector(agents_g * cmd_width_g - 1 downto 0);
|
71 |
|
|
signal data_from_n : std_logic_vector(agents_g * data_width_g - 1 downto 0);
|
72 |
|
|
signal stall_from_n : std_logic_vector(agents_g - 1 downto 0);
|
73 |
|
|
|
74 |
|
|
begin -- architecture structural
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
-----------------------------------------------------------------------------
|
78 |
|
|
-- Instantiate the mesh top-level
|
79 |
|
|
-----------------------------------------------------------------------------
|
80 |
|
|
noc_top_1 : entity work.ase_mesh1
|
81 |
|
|
generic map (
|
82 |
|
|
n_rows_g => rows_g,
|
83 |
|
|
n_cols_g => cols_g,
|
84 |
|
|
cmd_width_g => cmd_width_g,
|
85 |
|
|
bus_width_g => data_width_g
|
86 |
|
|
)
|
87 |
|
|
port map (
|
88 |
|
|
clk => clk_net,
|
89 |
|
|
rst_n => rst_n,
|
90 |
|
|
|
91 |
|
|
cmd_in => cmd_to_n,
|
92 |
|
|
data_in => data_to_n,
|
93 |
|
|
stall_out => stall_from_n,
|
94 |
|
|
|
95 |
|
|
cmd_out => cmd_from_n,
|
96 |
|
|
data_out => data_from_n,
|
97 |
|
|
stall_in => stall_to_n
|
98 |
|
|
);
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
-----------------------------------------------------------------------------
|
103 |
|
|
-- GENERATE MESH
|
104 |
|
|
-----------------------------------------------------------------------------
|
105 |
|
|
codecs_g : for i in 0 to agents_g-1 generate
|
106 |
|
|
|
107 |
|
|
packet_codec_1 : entity work.pkt_codec_mk2
|
108 |
|
|
generic map (
|
109 |
|
|
my_id_g => i,
|
110 |
|
|
data_width_g => data_width_g,
|
111 |
|
|
cmd_width_g => cmd_width_g,
|
112 |
|
|
agents_g => agents_g,
|
113 |
|
|
cols_g => cols_g,
|
114 |
|
|
rows_g => rows_g,
|
115 |
|
|
|
116 |
|
|
agent_ports_g => agent_ports_g,
|
117 |
|
|
addr_flit_en_g => addr_flit_en_g,
|
118 |
|
|
address_mode_g => address_mode_g,
|
119 |
|
|
clock_mode_g => clock_mode_g,
|
120 |
|
|
rip_addr_g => rip_addr_g,
|
121 |
|
|
noc_type_g => noc_type_g
|
122 |
|
|
)
|
123 |
|
|
port map (
|
124 |
|
|
clk_ip => clk_ip,
|
125 |
|
|
clk_net => clk_net,
|
126 |
|
|
rst_n => rst_n,
|
127 |
|
|
-- IP side in/out
|
128 |
|
|
ip_cmd_out => cmd_out((i+1)*cmd_width_g-1 downto i*cmd_width_g),
|
129 |
|
|
ip_data_out => data_out((i+1)*data_width_g-1 downto i*data_width_g),
|
130 |
|
|
ip_stall_in => stall_in(i),
|
131 |
|
|
|
132 |
|
|
ip_cmd_in => cmd_in((i+1)*cmd_width_g-1 downto i*cmd_width_g),
|
133 |
|
|
ip_data_in => data_in((i+1)*data_width_g-1 downto i*data_width_g),
|
134 |
|
|
ip_stall_out => stall_out(i),
|
135 |
|
|
|
136 |
|
|
-- NoC side out/in
|
137 |
|
|
net_cmd_out => cmd_to_n((i+1)*cmd_width_g-1 downto i*cmd_width_g),
|
138 |
|
|
net_data_out => data_to_n((i+1)*data_width_g-1 downto i*data_width_g),
|
139 |
|
|
net_stall_in => stall_from_n(i),
|
140 |
|
|
|
141 |
|
|
net_cmd_in => cmd_from_n((i+1)*cmd_width_g-1 downto i*cmd_width_g),
|
142 |
|
|
net_data_in => data_from_n((i+1)*data_width_g-1 downto i*data_width_g),
|
143 |
|
|
net_stall_out => stall_to_n(i)
|
144 |
|
|
);
|
145 |
|
|
|
146 |
|
|
end generate codecs_g;
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
end architecture structural;
|
150 |
|
|
|