1 |
42 |
lmaarsen |
--------------------------------------------------------------------------------
|
2 |
53 |
lmaarsen |
--
|
3 |
|
|
-- This VHDL file was generated by EASE/HDL 7.4 Revision 4 from HDL Works B.V.
|
4 |
|
|
--
|
5 |
|
|
-- Ease library : work
|
6 |
|
|
-- HDL library : work
|
7 |
|
|
-- Host name : S212065
|
8 |
|
|
-- User name : df768
|
9 |
|
|
-- Time stamp : Tue Aug 19 08:05:18 2014
|
10 |
|
|
--
|
11 |
|
|
-- Designed by : L.Maarsen
|
12 |
|
|
-- Company : LogiXA
|
13 |
|
|
-- Project info : eSoC
|
14 |
|
|
--
|
15 |
42 |
lmaarsen |
--------------------------------------------------------------------------------
|
16 |
53 |
lmaarsen |
|
17 |
42 |
lmaarsen |
--------------------------------------------------------------------------------
|
18 |
|
|
-- Object : Entity work.esoc_port_storage
|
19 |
|
|
-- Last modified : Mon Apr 14 12:49:43 2014.
|
20 |
|
|
--------------------------------------------------------------------------------
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
library ieee, std, work;
|
25 |
|
|
use ieee.std_logic_1164.all;
|
26 |
|
|
use std.textio.all;
|
27 |
|
|
use ieee.numeric_std.all;
|
28 |
|
|
use work.package_esoc_configuration.all;
|
29 |
|
|
|
30 |
|
|
entity esoc_port_storage is
|
31 |
|
|
port(
|
32 |
|
|
clk_control : in std_logic;
|
33 |
|
|
clk_data : in std_logic;
|
34 |
|
|
clk_search : in std_logic;
|
35 |
|
|
inbound_port_data : in std_logic_vector(31 downto 0);
|
36 |
|
|
inbound_port_data_full : out std_logic;
|
37 |
|
|
inbound_port_data_write : in std_logic;
|
38 |
|
|
inbound_port_header : in std_logic_vector(111 downto 0);
|
39 |
|
|
inbound_port_header_write : in std_logic;
|
40 |
|
|
inbound_port_info : in std_logic_vector(31 downto 0);
|
41 |
|
|
inbound_port_info_write : in std_logic;
|
42 |
|
|
inbound_proc_data : out std_logic_vector(63 downto 0);
|
43 |
|
|
inbound_proc_data_full : out std_logic;
|
44 |
|
|
inbound_proc_data_read : in std_logic;
|
45 |
|
|
inbound_proc_header : out std_logic_vector(111 downto 0);
|
46 |
|
|
inbound_proc_header_empty : out std_logic;
|
47 |
|
|
inbound_proc_header_read : in std_logic;
|
48 |
|
|
inbound_proc_info : out std_logic_vector(31 downto 0);
|
49 |
|
|
inbound_proc_info_empty : out std_logic;
|
50 |
|
|
inbound_proc_info_read : in std_logic;
|
51 |
|
|
outbound_port_data : out std_logic_vector(31 downto 0);
|
52 |
|
|
outbound_port_data_read : in std_logic;
|
53 |
|
|
outbound_port_info : out std_logic_vector(15 downto 0);
|
54 |
|
|
outbound_port_info_empty : out std_logic;
|
55 |
|
|
outbound_port_info_read : in std_logic;
|
56 |
|
|
outbound_proc_data : in std_logic_vector(63 downto 0);
|
57 |
|
|
outbound_proc_data_full : out std_logic;
|
58 |
|
|
outbound_proc_data_write : in std_logic;
|
59 |
|
|
outbound_proc_info : in std_logic_vector(15 downto 0);
|
60 |
|
|
outbound_proc_info_write : in std_logic;
|
61 |
|
|
reset : in std_logic);
|
62 |
|
|
end entity esoc_port_storage;
|
63 |
|
|
|
64 |
|
|
--------------------------------------------------------------------------------
|
65 |
|
|
-- Object : Architecture work.esoc_port_storage.structure
|
66 |
|
|
-- Last modified : Mon Apr 14 12:49:43 2014.
|
67 |
|
|
--------------------------------------------------------------------------------
|
68 |
|
|
|
69 |
|
|
architecture structure of esoc_port_storage is
|
70 |
|
|
|
71 |
|
|
signal inbound_wrusedw : STD_LOGIC_VECTOR(10 downto 0);
|
72 |
|
|
signal inbound_rdusedw : STD_LOGIC_VECTOR(9 downto 0);
|
73 |
|
|
|
74 |
|
|
component esoc_fifo_256x32
|
75 |
|
|
port(
|
76 |
|
|
aclr : in STD_LOGIC := '0';
|
77 |
|
|
data : in STD_LOGIC_VECTOR(31 downto 0);
|
78 |
|
|
rdclk : in STD_LOGIC;
|
79 |
|
|
rdreq : in STD_LOGIC;
|
80 |
|
|
wrclk : in STD_LOGIC;
|
81 |
|
|
wrreq : in STD_LOGIC;
|
82 |
|
|
q : out STD_LOGIC_VECTOR(31 downto 0);
|
83 |
|
|
rdempty : out STD_LOGIC;
|
84 |
|
|
rdusedw : out STD_LOGIC_VECTOR(7 downto 0);
|
85 |
|
|
wrfull : out STD_LOGIC;
|
86 |
|
|
wrusedw : out STD_LOGIC_VECTOR(7 downto 0));
|
87 |
|
|
end component esoc_fifo_256x32;
|
88 |
|
|
|
89 |
|
|
component esoc_fifo_256x112
|
90 |
|
|
port(
|
91 |
|
|
aclr : in STD_LOGIC := '0';
|
92 |
|
|
data : in STD_LOGIC_VECTOR(111 downto 0);
|
93 |
|
|
rdclk : in STD_LOGIC;
|
94 |
|
|
rdreq : in STD_LOGIC;
|
95 |
|
|
wrclk : in STD_LOGIC;
|
96 |
|
|
wrreq : in STD_LOGIC;
|
97 |
|
|
q : out STD_LOGIC_VECTOR(111 downto 0);
|
98 |
|
|
rdempty : out STD_LOGIC;
|
99 |
|
|
rdusedw : out STD_LOGIC_VECTOR(7 downto 0);
|
100 |
|
|
wrfull : out STD_LOGIC;
|
101 |
|
|
wrusedw : out STD_LOGIC_VECTOR(7 downto 0));
|
102 |
|
|
end component esoc_fifo_256x112;
|
103 |
|
|
|
104 |
|
|
component esoc_fifo_256x16
|
105 |
|
|
port(
|
106 |
|
|
aclr : in STD_LOGIC := '0';
|
107 |
|
|
data : in STD_LOGIC_VECTOR(15 downto 0);
|
108 |
|
|
rdclk : in STD_LOGIC;
|
109 |
|
|
rdreq : in STD_LOGIC;
|
110 |
|
|
wrclk : in STD_LOGIC;
|
111 |
|
|
wrreq : in STD_LOGIC;
|
112 |
|
|
q : out STD_LOGIC_VECTOR(15 downto 0);
|
113 |
|
|
rdempty : out STD_LOGIC;
|
114 |
|
|
rdusedw : out STD_LOGIC_VECTOR(7 downto 0);
|
115 |
|
|
wrfull : out STD_LOGIC;
|
116 |
|
|
wrusedw : out STD_LOGIC_VECTOR(7 downto 0));
|
117 |
|
|
end component esoc_fifo_256x16;
|
118 |
|
|
|
119 |
|
|
component esoc_fifo_2kx32x64
|
120 |
|
|
port(
|
121 |
|
|
aclr : in STD_LOGIC := '0';
|
122 |
|
|
data : in STD_LOGIC_VECTOR(31 downto 0);
|
123 |
|
|
rdclk : in STD_LOGIC;
|
124 |
|
|
rdreq : in STD_LOGIC;
|
125 |
|
|
wrclk : in STD_LOGIC;
|
126 |
|
|
wrreq : in STD_LOGIC;
|
127 |
|
|
q : out STD_LOGIC_VECTOR(63 downto 0);
|
128 |
|
|
rdempty : out STD_LOGIC;
|
129 |
|
|
rdusedw : out STD_LOGIC_VECTOR(9 downto 0);
|
130 |
|
|
wrfull : out STD_LOGIC;
|
131 |
|
|
wrusedw : out STD_LOGIC_VECTOR(10 downto 0));
|
132 |
|
|
end component esoc_fifo_2kx32x64;
|
133 |
|
|
|
134 |
|
|
component esoc_fifo_2kx64x32
|
135 |
|
|
port(
|
136 |
|
|
aclr : in STD_LOGIC := '0';
|
137 |
|
|
data : in STD_LOGIC_VECTOR(63 downto 0);
|
138 |
|
|
rdclk : in STD_LOGIC;
|
139 |
|
|
rdreq : in STD_LOGIC;
|
140 |
|
|
wrclk : in STD_LOGIC;
|
141 |
|
|
wrreq : in STD_LOGIC;
|
142 |
|
|
q : out STD_LOGIC_VECTOR(31 downto 0);
|
143 |
|
|
rdempty : out STD_LOGIC;
|
144 |
|
|
rdusedw : out STD_LOGIC_VECTOR(10 downto 0);
|
145 |
|
|
wrfull : out STD_LOGIC;
|
146 |
|
|
wrusedw : out STD_LOGIC_VECTOR(9 downto 0));
|
147 |
|
|
end component esoc_fifo_2kx64x32;
|
148 |
|
|
|
149 |
|
|
begin
|
150 |
|
|
--Inbound FIFO's
|
151 |
|
|
--- Data Fifo
|
152 |
|
|
--- Info Fifo
|
153 |
|
|
--- Header Fifo
|
154 |
|
|
--Outbound FIFO's
|
155 |
|
|
--- Data Fifo
|
156 |
|
|
--- Info Fifo
|
157 |
|
|
u1: esoc_fifo_256x32
|
158 |
|
|
port map(
|
159 |
|
|
aclr => reset,
|
160 |
|
|
data => inbound_port_info,
|
161 |
|
|
rdclk => clk_data,
|
162 |
|
|
rdreq => inbound_proc_info_read,
|
163 |
|
|
wrclk => clk_control,
|
164 |
|
|
wrreq => inbound_port_info_write,
|
165 |
|
|
q => inbound_proc_info,
|
166 |
|
|
rdempty => inbound_proc_info_empty,
|
167 |
|
|
rdusedw => open,
|
168 |
|
|
wrfull => open,
|
169 |
|
|
wrusedw => open);
|
170 |
|
|
|
171 |
|
|
u4: esoc_fifo_256x112
|
172 |
|
|
port map(
|
173 |
|
|
aclr => reset,
|
174 |
|
|
data => inbound_port_header,
|
175 |
|
|
rdclk => clk_search,
|
176 |
|
|
rdreq => inbound_proc_header_read,
|
177 |
|
|
wrclk => clk_control,
|
178 |
|
|
wrreq => inbound_port_header_write,
|
179 |
|
|
q => inbound_proc_header,
|
180 |
|
|
rdempty => inbound_proc_header_empty,
|
181 |
|
|
rdusedw => open,
|
182 |
|
|
wrfull => open,
|
183 |
|
|
wrusedw => open);
|
184 |
|
|
|
185 |
|
|
u5: esoc_fifo_256x16
|
186 |
|
|
port map(
|
187 |
|
|
aclr => reset,
|
188 |
|
|
data => outbound_proc_info,
|
189 |
|
|
rdclk => clk_control,
|
190 |
|
|
rdreq => outbound_port_info_read,
|
191 |
|
|
wrclk => clk_data,
|
192 |
|
|
wrreq => outbound_proc_info_write,
|
193 |
|
|
q => outbound_port_info,
|
194 |
|
|
rdempty => outbound_port_info_empty,
|
195 |
|
|
rdusedw => open,
|
196 |
|
|
wrfull => open,
|
197 |
|
|
wrusedw => open);
|
198 |
|
|
|
199 |
|
|
u6: esoc_fifo_2kx32x64
|
200 |
|
|
port map(
|
201 |
|
|
aclr => reset,
|
202 |
|
|
data => inbound_port_data,
|
203 |
|
|
rdclk => clk_data,
|
204 |
|
|
rdreq => inbound_proc_data_read,
|
205 |
|
|
wrclk => clk_control,
|
206 |
|
|
wrreq => inbound_port_data_write,
|
207 |
|
|
q => inbound_proc_data,
|
208 |
|
|
rdempty => open,
|
209 |
|
|
rdusedw => inbound_rdusedw,
|
210 |
|
|
wrfull => open,
|
211 |
|
|
wrusedw => inbound_wrusedw);
|
212 |
|
|
|
213 |
|
|
u0: esoc_fifo_2kx64x32
|
214 |
|
|
port map(
|
215 |
|
|
aclr => reset,
|
216 |
|
|
data => outbound_proc_data,
|
217 |
|
|
rdclk => clk_control,
|
218 |
|
|
rdreq => outbound_port_data_read,
|
219 |
|
|
wrclk => clk_data,
|
220 |
|
|
wrreq => outbound_proc_data_write,
|
221 |
|
|
q => outbound_port_data,
|
222 |
|
|
rdempty => open,
|
223 |
|
|
rdusedw => open,
|
224 |
|
|
wrfull => outbound_proc_data_full,
|
225 |
|
|
wrusedw => open);
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
-- FIFO Behaviour: ST to Write FIFO latency is 1 clock cycle, take this into account
|
229 |
|
|
-- WRUSEDW latency is 1 clock cycle, take this into account
|
230 |
|
|
-- WRUSEDW becomes 2047 -> 0 when FIFO is completely full, take this into account
|
231 |
|
|
-- WRUSEDW must end on an even number of words due to 32/64 conversion, take this into account
|
232 |
|
|
-- Conclusion: set Almost Full threshold offset on 3
|
233 |
|
|
--
|
234 |
|
|
-- Ready Latency @ ST Interface is 2
|
235 |
|
|
--
|
236 |
|
|
-- Required Almost Full threshold: 1 + 1 + 1 + 1 + 2 = 6
|
237 |
|
|
--
|
238 |
|
|
inbound_port_data_full <= '1' when (2**inbound_wrusedw'length - to_integer(unsigned(inbound_wrusedw))) <= 6 else '0';
|
239 |
|
|
|
240 |
|
|
--
|
241 |
|
|
inbound_proc_data_full <= '1' when to_integer(unsigned(inbound_rdusedw)) = ((2**inbound_rdusedw'length)-1) else '0';
|
242 |
|
|
end architecture structure ; -- of esoc_port_storage
|
243 |
|
|
|