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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [soc/] [led_hibi_example/] [1.0/] [vhd/] [led_hibi_example.vhd] - Blame information for rev 180

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

Line No. Rev Author Line
1 145 lanttu
-- ***************************************************
2
-- File: led_hibi_example.vhd
3
-- Creation date: 16.03.2012
4
-- Creation time: 16:46:56
5
-- Description: 
6
-- Created by: ege
7
-- This file was generated with Kactus2 vhdl generator.
8
-- ***************************************************
9
library IEEE;
10
library work;
11
library hibi;
12
use IEEE.std_logic_1164.all;
13
use work.all;
14
use hibi.all;
15
 
16
entity led_hibi_example is
17
 
18
        port (
19
 
20
                -- Interface: clk_in
21
                clk_in : in std_logic;
22
 
23
                -- Interface: ddr2_ctrl_p
24
                agent_addr_in_17 : in std_logic_vector(31 downto 0);
25
                agent_comm_in_17 : in std_logic_vector(4 downto 0);
26
                agent_data_in_17 : in std_logic_vector(31 downto 0);
27
                agent_msg_addr_in_17 : in std_logic_vector(31 downto 0);
28
                agent_msg_comm_in_17 : in std_logic_vector(4 downto 0);
29
                agent_msg_data_in_17 : in std_logic_vector(31 downto 0);
30
                agent_msg_re_in_17 : in std_logic;
31
                agent_msg_we_in_17 : in std_logic;
32
                agent_re_in_17 : in std_logic;
33
                agent_we_in_17 : in std_logic;
34
                agent_addr_out_17 : out std_logic_vector(31 downto 0);
35
                agent_comm_out_17 : out std_logic_vector(4 downto 0);
36
                agent_data_out_17 : out std_logic_vector(31 downto 0);
37
                agent_empty_out_17 : out std_logic;
38
                agent_full_out_17 : out std_logic;
39
                agent_msg_addr_out_17 : out std_logic_vector(31 downto 0);
40
                agent_msg_comm_out_17 : out std_logic_vector(4 downto 0);
41
                agent_msg_data_out_17 : out std_logic_vector(31 downto 0);
42
                agent_msg_empty_out_17 : out std_logic;
43
                agent_msg_full_out_17 : out std_logic;
44
                agent_msg_one_p_out_17 : out std_logic;
45
                agent_one_p_out_17 : out std_logic;
46
 
47
                -- Interface: hibi_p3
48
                agent_av_in_3 : in std_logic;
49
                agent_comm_in_3 : in std_logic_vector(4 downto 0);
50
                agent_data_in_3 : in std_logic_vector(31 downto 0);
51
                agent_re_in_3 : in std_logic;
52
                agent_we_in_3 : in std_logic;
53
                agent_av_out_3 : out std_logic;
54
                agent_comm_out_3 : out std_logic_vector(4 downto 0);
55
                agent_data_out_3 : out std_logic_vector(31 downto 0);
56
                agent_empty_out_3 : out std_logic;
57
                agent_full_out_3 : out std_logic;
58
                agent_one_d_out_3 : out std_logic;
59
                agent_one_p_out_3 : out std_logic;
60
 
61
                -- Interface: led_0_out
62
                led_0_out : out std_logic;
63
 
64
                -- Interface: rst_n_in
65
                rst_n : in std_logic;
66
 
67
                -- Interface: switch_0_in
68
                switch_0_in : in std_logic
69
        );
70
 
71
end led_hibi_example;
72
 
73
 
74
architecture for_syn of led_hibi_example is
75
 
76
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_FROM_IP : std_logic;
77
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_FROM_IP : std_logic;
78
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_TO_IP : std_logic;
79
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_TO_IP : std_logic;
80
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0COMM_FROM_IP : std_logic_vector(4 downto 0);
81
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_FROM_IP : std_logic_vector(31 downto 0);
82
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_FROM_IP : std_logic_vector(31 downto 0);
83
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_TO_IP : std_logic_vector(31 downto 0);
84
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_TO_IP : std_logic_vector(31 downto 0);
85
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0EMPTY_TO_IP : std_logic;
86
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiEMPTY_TO_IP : std_logic;
87
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0FULL_TO_IP : std_logic;
88
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiFULL_TO_IP : std_logic;
89
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0RE_FROM_IP : std_logic;
90
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiRE_FROM_IP : std_logic;
91
        signal switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0WE_FROM_IP : std_logic;
92
        signal hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiWE_FROM_IP : std_logic;
93
 
94
        -- Shared bus for IP blocks
95
        component hibi_segment_small
96
                port (
97
 
98
                        -- Interface: clk_in
99
                        clk_in : in std_logic;
100
 
101
                        -- Interface: ddr2_ctrl_p
102
                        agent_addr_in_16 : in std_logic_vector(31 downto 0);
103
                        agent_comm_in_16 : in std_logic_vector(4 downto 0);
104
                        agent_data_in_16 : in std_logic_vector(31 downto 0);
105
                        agent_msg_addr_in_16 : in std_logic_vector(31 downto 0);
106
                        agent_msg_comm_in_16 : in std_logic_vector(4 downto 0);
107
                        agent_msg_data_in_16 : in std_logic_vector(31 downto 0);
108
                        agent_msg_re_in_16 : in std_logic;
109
                        agent_msg_we_in_16 : in std_logic;
110
                        agent_re_in_16 : in std_logic;
111
                        agent_we_in_16 : in std_logic;
112
                        agent_addr_out_16 : out std_logic_vector(31 downto 0);
113
                        agent_comm_out_16 : out std_logic_vector(4 downto 0);
114
                        agent_data_out_16 : out std_logic_vector(31 downto 0);
115
                        agent_empty_out_16 : out std_logic;
116
                        agent_full_out_16 : out std_logic;
117
                        agent_msg_addr_out_16 : out std_logic_vector(31 downto 0);
118
                        agent_msg_comm_out_16 : out std_logic_vector(4 downto 0);
119
                        agent_msg_data_out_16 : out std_logic_vector(31 downto 0);
120
                        agent_msg_empty_out_16 : out std_logic;
121
                        agent_msg_full_out_16 : out std_logic;
122
                        agent_msg_one_p_out_16 : out std_logic;
123
                        agent_one_p_out_16 : out std_logic;
124
 
125
                        -- Interface: hibi_p0
126
                        agent_av_in_0 : in std_logic;
127
                        agent_comm_in_0 : in std_logic_vector(4 downto 0);
128
                        agent_data_in_0 : in std_logic_vector(31 downto 0);
129
                        agent_re_in_0 : in std_logic;
130
                        agent_we_in_0 : in std_logic;
131
                        agent_av_out_0 : out std_logic;
132
                        -- agent_comm_out_0 : out std_logic_vector(4 downto 0);
133
                        agent_data_out_0 : out std_logic_vector(31 downto 0);
134
                        agent_empty_out_0 : out std_logic;
135
                        agent_full_out_0 : out std_logic;
136
                        -- agent_one_d_out_0 : out std_logic;
137
                        -- agent_one_p_out_0 : out std_logic;
138
 
139
                        -- Interface: hibi_p1
140
                        agent_av_in_1 : in std_logic;
141
                        agent_comm_in_1 : in std_logic_vector(4 downto 0);
142
                        agent_data_in_1 : in std_logic_vector(31 downto 0);
143
                        agent_re_in_1 : in std_logic;
144
                        agent_we_in_1 : in std_logic;
145
                        agent_av_out_1 : out std_logic;
146
                        -- agent_comm_out_1 : out std_logic_vector(4 downto 0);
147
                        agent_data_out_1 : out std_logic_vector(31 downto 0);
148
                        agent_empty_out_1 : out std_logic;
149
                        agent_full_out_1 : out std_logic;
150
                        -- agent_one_d_out_1 : out std_logic;
151
                        -- agent_one_p_out_1 : out std_logic;
152
 
153
                        -- Interface: hibi_p2
154
                        agent_av_in_2 : in std_logic;
155
                        agent_comm_in_2 : in std_logic_vector(4 downto 0);
156
                        agent_data_in_2 : in std_logic_vector(31 downto 0);
157
                        agent_re_in_2 : in std_logic;
158
                        agent_we_in_2 : in std_logic;
159
                        agent_av_out_2 : out std_logic;
160
                        agent_comm_out_2 : out std_logic_vector(4 downto 0);
161
                        agent_data_out_2 : out std_logic_vector(31 downto 0);
162
                        agent_empty_out_2 : out std_logic;
163
                        agent_full_out_2 : out std_logic;
164
                        agent_one_d_out_2 : out std_logic;
165
                        agent_one_p_out_2 : out std_logic;
166
 
167
                        -- These ports are not in any interface
168
                        -- agent_one_d_out_7 : out std_logic;
169
                        -- agent_one_d_out_8 : out std_logic;
170
 
171
                        -- Interface: rst_n
172
                        rst_n_in : in std_logic
173
 
174
                );
175
        end component;
176
 
177
        -- Inverts the led output every time a message is received.
178
        component led_packet_codec
179
                generic (
180
                        data_width_g : integer := 32;
181
                        tx_len_width_g : integer := 16
182
 
183
                );
184
                port (
185
 
186
                        -- Interface: clk
187
                        clk : in std_logic;
188
 
189
                        -- Interface: led
190
                        led_out : out std_logic;
191
 
192
                        -- Interface: pkt_codec
193
                        -- tx_txlen_out : out std_logic_vector(15 downto 0);
194
 
195
                        -- Interface: rst_n
196
                        rst_n : in std_logic;
197
 
198
                        -- There ports are contained in many interfaces
199
                        rx_av_in : in std_logic;
200
                        rx_data_in : in std_logic_vector(31 downto 0);
201
                        rx_empty_in : in std_logic;
202
                        tx_full_in : in std_logic;
203
                        rx_re_out : out std_logic;
204
                        tx_av_out : out std_logic;
205
                        tx_data_out : out std_logic_vector(31 downto 0);
206
                        tx_we_out : out std_logic
207
 
208
                );
209
        end component;
210
 
211
        -- Converts a toggle of a switch into constant one-word transfer.
212
        component switch_packet_codec
213
                generic (
214
                        data_width_g : integer := 32;
215
                        my_id_g : integer := 0; -- To which terminal the message is sent
216
                        tx_len_width_g : integer := 16
217
 
218
                );
219
                port (
220
 
221
                        -- Interface: clk
222
                        clk : in std_logic;
223
 
224
                        -- Interface: pkt_codec
225
                        -- tx_txlen_out : out std_logic_vector(15 downto 0);
226
 
227
                        -- Interface: rst_n
228
                        rst_n : in std_logic;
229
 
230
                        -- There ports are contained in many interfaces
231
                        rx_av_in : in std_logic;
232
                        rx_data_in : in std_logic_vector(31 downto 0);
233
                        rx_empty_in : in std_logic;
234
                        tx_full_in : in std_logic;
235
                        rx_re_out : out std_logic;
236
                        tx_av_out : out std_logic;
237
                        tx_data_out : out std_logic_vector(31 downto 0);
238
                        tx_we_out : out std_logic;
239
 
240
                        -- Interface: switch
241
                        switch_in : in std_logic;
242
 
243
                        -- Interface: to_hibi
244
                        tx_comm_out : out std_logic_vector(4 downto 0)
245
 
246
                );
247
        end component;
248
 
249
        -- You can write vhdl code after this tag and it is saved through the generator.
250
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_BEGIN##
251
 
252
        signal wr_cmd_c : std_logic_vector ( 4 downto 0) := "00010";
253
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_END##
254
        -- Stop writing your code after this tag.
255
 
256
 
257
begin
258
 
259
        -- You can write vhdl code after this tag and it is saved through the generator.
260
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_BEGIN##
261
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_END##
262
        -- Stop writing your code after this tag.
263
 
264
        hibi_segment_small_1 : hibi_segment_small
265
                port map (
266
                        agent_addr_in_16(31 downto 0) => agent_addr_in_17(31 downto 0),
267
                        agent_addr_out_16(31 downto 0) => agent_addr_out_17(31 downto 0),
268
                        agent_av_in_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_FROM_IP,
269
                        agent_av_in_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_FROM_IP,
270
                        agent_av_in_2 => agent_av_in_3,
271
                        agent_av_out_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_TO_IP,
272
                        agent_av_out_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_TO_IP,
273
                        agent_av_out_2 => agent_av_out_3,
274
                        agent_comm_in_0(4 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0COMM_FROM_IP(4 downto 0),
275
                        agent_comm_in_1 => (others => '0'),
276
                        agent_comm_in_16(4 downto 0) => agent_comm_in_17(4 downto 0),
277
                        agent_comm_in_2(4 downto 0) => agent_comm_in_3(4 downto 0),
278
                        agent_comm_out_16(4 downto 0) => agent_comm_out_17(4 downto 0),
279
                        agent_comm_out_2(4 downto 0) => agent_comm_out_3(4 downto 0),
280
                        agent_data_in_0(31 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_FROM_IP(31 downto 0),
281
                        agent_data_in_1(31 downto 0) => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_FROM_IP(31 downto 0),
282
                        agent_data_in_16(31 downto 0) => agent_data_in_17(31 downto 0),
283
                        agent_data_in_2(31 downto 0) => agent_data_in_3(31 downto 0),
284
                        agent_data_out_0(31 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_TO_IP(31 downto 0),
285
                        agent_data_out_1(31 downto 0) => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_TO_IP(31 downto 0),
286
                        agent_data_out_16(31 downto 0) => agent_data_out_17(31 downto 0),
287
                        agent_data_out_2(31 downto 0) => agent_data_out_3(31 downto 0),
288
                        agent_empty_out_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0EMPTY_TO_IP,
289
                        agent_empty_out_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiEMPTY_TO_IP,
290
                        agent_empty_out_16 => agent_empty_out_17,
291
                        agent_empty_out_2 => agent_empty_out_3,
292
                        agent_full_out_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0FULL_TO_IP,
293
                        agent_full_out_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiFULL_TO_IP,
294
                        agent_full_out_16 => agent_full_out_17,
295
                        agent_full_out_2 => agent_full_out_3,
296
                        agent_msg_addr_in_16(31 downto 0) => agent_msg_addr_in_17(31 downto 0),
297
                        agent_msg_addr_out_16(31 downto 0) => agent_msg_addr_out_17(31 downto 0),
298
                        agent_msg_comm_in_16(4 downto 0) => agent_msg_comm_in_17(4 downto 0),
299
                        agent_msg_comm_out_16(4 downto 0) => agent_msg_comm_out_17(4 downto 0),
300
                        agent_msg_data_in_16(31 downto 0) => agent_msg_data_in_17(31 downto 0),
301
                        agent_msg_data_out_16(31 downto 0) => agent_msg_data_out_17(31 downto 0),
302
                        agent_msg_empty_out_16 => agent_msg_empty_out_17,
303
                        agent_msg_full_out_16 => agent_msg_full_out_17,
304
                        agent_msg_one_p_out_16 => agent_msg_one_p_out_17,
305
                        agent_msg_re_in_16 => agent_msg_re_in_17,
306
                        agent_msg_we_in_16 => agent_msg_we_in_17,
307
                        agent_one_d_out_2 => agent_one_d_out_3,
308
                        agent_one_p_out_16 => agent_one_p_out_17,
309
                        agent_one_p_out_2 => agent_one_p_out_3,
310
                        agent_re_in_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0RE_FROM_IP,
311
                        agent_re_in_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiRE_FROM_IP,
312
                        agent_re_in_16 => agent_re_in_17,
313
                        agent_re_in_2 => agent_re_in_3,
314
                        agent_we_in_0 => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0WE_FROM_IP,
315
                        agent_we_in_1 => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiWE_FROM_IP,
316
                        agent_we_in_16 => agent_we_in_17,
317
                        agent_we_in_2 => agent_we_in_3,
318
                        clk_in => clk_in,
319
                        rst_n_in => rst_n
320
                );
321
 
322
        led_packet_codec_1 : led_packet_codec
323
                port map (
324
                        clk => clk_in,
325
                        led_out => led_0_out,
326
                        rst_n => rst_n,
327
                        rx_av_in => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_TO_IP,
328
                        rx_data_in(31 downto 0) => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_TO_IP(31 downto 0),
329
                        rx_empty_in => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiEMPTY_TO_IP,
330
                        rx_re_out => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiRE_FROM_IP,
331
                        tx_av_out => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiAV_FROM_IP,
332
                        tx_data_out(31 downto 0) => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiDATA_FROM_IP(31 downto 0),
333
                        tx_full_in => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiFULL_TO_IP,
334
                        tx_we_out => hibi_segment_small_1_hibi_p1_to_led_packet_codec_1_from_hibiWE_FROM_IP
335
                );
336
 
337
        switch_packet_codec_1 : switch_packet_codec
338
                generic map (
339
                        my_id_g => 16#03000000#
340
                )
341
                port map (
342
                        clk => clk_in,
343
                        rst_n => rst_n,
344
                        rx_av_in => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_TO_IP,
345
                        rx_data_in(31 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_TO_IP(31 downto 0),
346
                        rx_empty_in => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0EMPTY_TO_IP,
347
                        rx_re_out => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0RE_FROM_IP,
348
                        switch_in => switch_0_in,
349
                        tx_av_out => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0AV_FROM_IP,
350
                        tx_comm_out(4 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0COMM_FROM_IP(4 downto 0),
351
                        tx_data_out(31 downto 0) => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0DATA_FROM_IP(31 downto 0),
352
                        tx_full_in => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0FULL_TO_IP,
353
                        tx_we_out => switch_packet_codec_1_to_hibi_to_hibi_segment_small_1_hibi_p0WE_FROM_IP
354
                );
355
 
356
end for_syn;
357
 

powered by: WebSVN 2.1.0

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