OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [ip/] [NoC/] [ni_master.IP] - Blame information for rev 42

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

Line No. Rev Author Line
1 34 alirezamon
#######################################################################
2
##      File: ni_master.IP
3
##
4
##      Copyright (C) 2014-2016  Alireza Monemi
5
##
6 42 alirezamon
##      This file is part of ProNoC 1.8.1
7 34 alirezamon
##
8
##      WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
9
##      MAY CAUSE UNEXPECTED BEHAIVOR.
10
################################################################################
11
 
12 38 alirezamon
$ipgen = bless( {
13 42 alirezamon
                  'ports' => {
14
                               's_cti_i' => {
15
                                              'type' => 'input',
16
                                              'intfc_port' => 'cti_i',
17
                                              'range' => 'TAGw-1     :   0',
18
                                              'intfc_name' => 'plug:wb_slave[0]'
19
                                            },
20
                               'm_send_sel_o' => {
21
                                                   'intfc_port' => 'sel_o',
22
                                                   'type' => 'output',
23
                                                   'range' => 'SELw-1          :   0',
24
                                                   'intfc_name' => 'plug:wb_master[0]'
25
                                                 },
26
                               'm_receive_cyc_o' => {
27
                                                      'intfc_port' => 'cyc_o',
28
                                                      'type' => 'output',
29
                                                      'range' => '',
30
                                                      'intfc_name' => 'plug:wb_master[1]'
31
                                                    },
32
                               'm_send_ack_i' => {
33
                                                   'intfc_port' => 'ack_i',
34
                                                   'type' => 'input',
35
                                                   'intfc_name' => 'plug:wb_master[0]',
36
                                                   'range' => ''
37
                                                 },
38
                               'flit_out_wr' => {
39
                                                  'range' => '',
40
                                                  'intfc_name' => 'socket:ni[0]',
41
                                                  'intfc_port' => 'flit_out_wr',
42
                                                  'type' => 'output'
43
                                                },
44
                               'm_send_stb_o' => {
45
                                                   'intfc_port' => 'stb_o',
46
                                                   'type' => 'output',
47
                                                   'range' => '',
48
                                                   'intfc_name' => 'plug:wb_master[0]'
49
                                                 },
50
                               'm_receive_addr_o' => {
51
                                                       'range' => 'M_Aw-1          :   0',
52
                                                       'intfc_name' => 'plug:wb_master[1]',
53
                                                       'intfc_port' => 'adr_o',
54
                                                       'type' => 'output'
55
                                                     },
56
                               'flit_in' => {
57
                                              'intfc_name' => 'socket:ni[0]',
58
                                              'range' => 'Fw-1   :   0',
59
                                              'intfc_port' => 'flit_in',
60
                                              'type' => 'input'
61
                                            },
62
                               'reset' => {
63
                                            'intfc_name' => 'plug:reset[0]',
64
                                            'range' => '',
65
                                            'intfc_port' => 'reset_i',
66
                                            'type' => 'input'
67
                                          },
68
                               's_dat_o' => {
69
                                              'type' => 'output',
70
                                              'intfc_port' => 'dat_o',
71
                                              'range' => 'Dw-1       :   0',
72
                                              'intfc_name' => 'plug:wb_slave[0]'
73
                                            },
74
                               's_stb_i' => {
75
                                              'intfc_port' => 'stb_i',
76
                                              'type' => 'input',
77
                                              'intfc_name' => 'plug:wb_slave[0]',
78
                                              'range' => ''
79
                                            },
80
                               'current_x' => {
81
                                                'intfc_name' => 'socket:ni[0]',
82
                                                'range' => 'Xw-1   :   0',
83
                                                'type' => 'input',
84
                                                'intfc_port' => 'current_x'
85 34 alirezamon
                                              },
86 42 alirezamon
                               'm_receive_cti_o' => {
87
                                                      'type' => 'output',
88
                                                      'intfc_port' => 'cti_o',
89
                                                      'range' => 'TAGw-1          :   0',
90
                                                      'intfc_name' => 'plug:wb_master[1]'
91
                                                    },
92
                               's_we_i' => {
93
                                             'intfc_port' => 'we_i',
94
                                             'type' => 'input',
95
                                             'intfc_name' => 'plug:wb_slave[0]',
96
                                             'range' => ''
97
                                           },
98
                               'm_receive_we_o' => {
99
                                                     'type' => 'output',
100
                                                     'intfc_port' => 'we_o',
101
                                                     'range' => '',
102
                                                     'intfc_name' => 'plug:wb_master[1]'
103
                                                   },
104
                               'm_send_dat_i' => {
105
                                                   'type' => 'input',
106
                                                   'intfc_port' => 'dat_i',
107
                                                   'range' => 'Dw-1           :  0',
108
                                                   'intfc_name' => 'plug:wb_master[0]'
109
                                                 },
110
                               'flit_in_wr' => {
111
                                                 'type' => 'input',
112
                                                 'intfc_port' => 'flit_in_wr',
113
                                                 'range' => '',
114
                                                 'intfc_name' => 'socket:ni[0]'
115
                                               },
116
                               's_sel_i' => {
117
                                              'range' => 'SELw-1     :   0',
118
                                              'intfc_name' => 'plug:wb_slave[0]',
119
                                              'type' => 'input',
120
                                              'intfc_port' => 'sel_i'
121
                                            },
122
                               'm_send_we_o' => {
123
                                                  'intfc_name' => 'plug:wb_master[0]',
124
                                                  'range' => '',
125
                                                  'type' => 'output',
126
                                                  'intfc_port' => 'we_o'
127
                                                },
128
                               'flit_out' => {
129
                                               'intfc_port' => 'flit_out',
130
                                               'type' => 'output',
131
                                               'intfc_name' => 'socket:ni[0]',
132
                                               'range' => 'Fw-1   :   0'
133 38 alirezamon
                                             },
134 42 alirezamon
                               'm_send_cti_o' => {
135
                                                   'range' => 'TAGw-1          :   0',
136
                                                   'intfc_name' => 'plug:wb_master[0]',
137
                                                   'intfc_port' => 'cti_o',
138
                                                   'type' => 'output'
139
                                                 },
140
                               'm_receive_stb_o' => {
141
                                                      'type' => 'output',
142
                                                      'intfc_port' => 'stb_o',
143
                                                      'range' => '',
144
                                                      'intfc_name' => 'plug:wb_master[1]'
145
                                                    },
146
                               'm_send_cyc_o' => {
147
                                                   'type' => 'output',
148
                                                   'intfc_port' => 'cyc_o',
149
                                                   'range' => '',
150
                                                   'intfc_name' => 'plug:wb_master[0]'
151
                                                 },
152
                               's_cyc_i' => {
153
                                              'intfc_port' => 'cyc_i',
154
                                              'type' => 'input',
155
                                              'range' => '',
156
                                              'intfc_name' => 'plug:wb_slave[0]'
157
                                            },
158
                               'm_send_addr_o' => {
159
                                                    'range' => 'M_Aw-1          :   0',
160
                                                    'intfc_name' => 'plug:wb_master[0]',
161
                                                    'type' => 'output',
162
                                                    'intfc_port' => 'adr_o'
163
                                                  },
164
                               'm_receive_dat_o' => {
165
                                                      'intfc_name' => 'plug:wb_master[1]',
166
                                                      'range' => 'Dw-1            :   0',
167
                                                      'type' => 'output',
168
                                                      'intfc_port' => 'dat_o'
169
                                                    },
170
                               's_dat_i' => {
171
                                              'intfc_name' => 'plug:wb_slave[0]',
172
                                              'range' => 'Dw-1       :   0',
173
                                              'type' => 'input',
174
                                              'intfc_port' => 'dat_i'
175
                                            },
176
                               'm_receive_sel_o' => {
177
                                                      'intfc_port' => 'sel_o',
178
                                                      'type' => 'output',
179
                                                      'intfc_name' => 'plug:wb_master[1]',
180
                                                      'range' => 'SELw-1          :   0'
181
                                                    },
182 38 alirezamon
                               'clk' => {
183 42 alirezamon
                                          'intfc_port' => 'clk_i',
184
                                          'type' => 'input',
185
                                          'intfc_name' => 'plug:clk[0]',
186
                                          'range' => ''
187 38 alirezamon
                                        },
188 42 alirezamon
                               'current_y' => {
189
                                                'type' => 'input',
190
                                                'intfc_port' => 'current_y',
191
                                                'range' => 'Yw-1   :   0',
192
                                                'intfc_name' => 'socket:ni[0]'
193
                                              },
194
                               'm_receive_ack_i' => {
195
                                                      'range' => '',
196
                                                      'intfc_name' => 'plug:wb_master[1]',
197
                                                      'type' => 'input',
198
                                                      'intfc_port' => 'ack_i'
199
                                                    },
200
                               's_addr_i' => {
201
                                               'intfc_port' => 'adr_i',
202
                                               'type' => 'input',
203
                                               'range' => 'S_Aw-1     :   0',
204
                                               'intfc_name' => 'plug:wb_slave[0]'
205
                                             },
206
                               'credit_out' => {
207
                                                 'range' => 'V-1    :   0',
208
                                                 'intfc_name' => 'socket:ni[0]',
209
                                                 'intfc_port' => 'credit_out',
210
                                                 'type' => 'output'
211
                                               },
212
                               's_ack_o' => {
213
                                              'intfc_name' => 'plug:wb_slave[0]',
214
                                              'range' => '',
215
                                              'type' => 'output',
216
                                              'intfc_port' => 'ack_o'
217
                                            },
218
                               'irq' => {
219
                                          'type' => 'output',
220
                                          'intfc_port' => 'int_o',
221
                                          'range' => '',
222
                                          'intfc_name' => 'plug:interrupt_peripheral[0]'
223
                                        },
224
                               'credit_in' => {
225
                                                'type' => 'input',
226
                                                'intfc_port' => 'credit_in',
227
                                                'intfc_name' => 'socket:ni[0]',
228
                                                'range' => 'V-1    :   0'
229
                                              }
230 38 alirezamon
                             },
231
                  'ports_order' => [
232
                                     'reset',
233
                                     'clk',
234
                                     'current_x',
235
                                     'current_y',
236
                                     'flit_out',
237
                                     'flit_out_wr',
238
                                     'credit_in',
239
                                     'flit_in',
240
                                     'flit_in_wr',
241
                                     'credit_out',
242
                                     's_dat_i',
243
                                     's_sel_i',
244
                                     's_addr_i',
245
                                     's_cti_i',
246
                                     's_stb_i',
247
                                     's_cyc_i',
248
                                     's_we_i',
249
                                     's_dat_o',
250
                                     's_ack_o',
251
                                     'm_send_sel_o',
252
                                     'm_send_addr_o',
253
                                     'm_send_cti_o',
254
                                     'm_send_stb_o',
255
                                     'm_send_cyc_o',
256
                                     'm_send_we_o',
257
                                     'm_send_dat_i',
258
                                     'm_send_ack_i',
259
                                     'm_receive_sel_o',
260
                                     'm_receive_dat_o',
261
                                     'm_receive_addr_o',
262
                                     'm_receive_cti_o',
263
                                     'm_receive_stb_o',
264
                                     'm_receive_cyc_o',
265
                                     'm_receive_we_o',
266
                                     'm_receive_ack_i',
267
                                     'irq'
268
                                   ],
269 42 alirezamon
                  'sockets' => {
270
                                 'ni' => {
271
                                           '0' => {
272
                                                    'name' => 'ni'
273
                                                  },
274
                                           'value' => 1,
275
                                           'ni' => {},
276
                                           'type' => 'num',
277
                                           'connection_num' => 'single connection'
278
                                         }
279
                               },
280
                  'module_name' => 'ni_master',
281 38 alirezamon
                  'hdl_files' => [
282
                                   '/mpsoc/src_noc/arbiter.v',
283
                                   '/mpsoc/src_noc/flit_buffer.v',
284
                                   '/mpsoc/src_noc/input_ports.v',
285
                                   '/mpsoc/src_noc/main_comp.v',
286
                                   '/mpsoc/src_noc/route_mesh.v',
287
                                   '/mpsoc/src_noc/route_torus.v',
288
                                   '/mpsoc/src_noc/routing.v',
289
                                   '/mpsoc/src_peripheral/ni/ni_vc_dma.v',
290
                                   '/mpsoc/src_peripheral/ni/ni_vc_wb_slave_regs.v',
291
                                   '/mpsoc/src_peripheral/ni/ni_master.v',
292
                                   '/mpsoc/src_peripheral/ni/ni_crc32.v'
293
                                 ],
294 42 alirezamon
                  'unused' => {
295
                                'plug:wb_slave[0]' => [
296
                                                        'err_o',
297
                                                        'rty_o',
298
                                                        'tag_i',
299
                                                        'bte_i'
300
                                                      ],
301
                                'plug:wb_master[1]' => [
302
                                                         'tag_o',
303
                                                         'rty_i',
304
                                                         'bte_o',
305
                                                         'err_i',
306
                                                         'dat_i'
307
                                                       ],
308
                                'plug:wb_master[0]' => [
309
                                                         'tag_o',
310
                                                         'rty_i',
311
                                                         'dat_o',
312
                                                         'bte_o',
313
                                                         'err_i'
314
                                                       ]
315
                              },
316
                  'description_pdf' => '/mpsoc/src_peripheral/ni/NI.pdf',
317 38 alirezamon
                  'parameters' => {
318 42 alirezamon
                                    'C' => {
319
                                             'content' => '',
320
                                             'info' => 'Parameter',
321
                                             'default' => ' 4',
322
                                             'global_param' => 'Parameter',
323
                                             'type' => 'Fixed',
324
                                             'redefine_param' => 1
325
                                           },
326
                                    'Dw' => {
327
                                              'type' => 'Spin-button',
328
                                              'global_param' => 'Localparam',
329
                                              'default' => '32',
330
                                              'info' => 'wishbone_bus data width in bits.',
331
                                              'content' => '32,256,8',
332
                                              'redefine_param' => 1
333
                                            },
334
                                    'SRC_ADR_HDR_WIDTH' => {
335
                                                             'global_param' => 'Localparam',
336
                                                             'type' => 'Fixed',
337
                                                             'content' => '',
338
                                                             'default' => '8',
339
                                                             'info' => 'Parameter',
340
                                                             'redefine_param' => 1
341
                                                           },
342
                                    'SELw' => {
343
                                                'redefine_param' => 1,
344
                                                'type' => 'Fixed',
345
                                                'global_param' => 'Localparam',
346
                                                'info' => 'Parameter',
347
                                                'default' => '4',
348
                                                'content' => ''
349
                                              },
350
                                    'DEBUG_EN' => {
351
                                                    'redefine_param' => 1,
352
                                                    'type' => 'Fixed',
353
                                                    'global_param' => 'Parameter',
354
                                                    'default' => ' 1',
355
                                                    'info' => 'Parameter',
356
                                                    'content' => ''
357
                                                  },
358
                                    'NY' => {
359
                                              'content' => '',
360
                                              'info' => 'Parameter',
361
                                              'default' => ' 4',
362
                                              'global_param' => 'Parameter',
363
                                              'type' => 'Fixed',
364
                                              'redefine_param' => 1
365
                                            },
366 38 alirezamon
                                    'TOPOLOGY' => {
367
                                                    'default' => '"MESH"',
368 34 alirezamon
                                                    'info' => 'Parameter',
369 42 alirezamon
                                                    'content' => '',
370
                                                    'type' => 'Fixed',
371 34 alirezamon
                                                    'global_param' => 'Parameter',
372 42 alirezamon
                                                    'redefine_param' => 1
373 34 alirezamon
                                                  },
374 42 alirezamon
                                    'Fpay' => {
375
                                                'type' => 'Fixed',
376
                                                'global_param' => 'Parameter',
377
                                                'info' => 'Parameter',
378
                                                'default' => ' 32',
379
                                                'content' => '',
380
                                                'redefine_param' => 1
381
                                              },
382 38 alirezamon
                                    'S_Aw' => {
383
                                                'content' => '',
384 42 alirezamon
                                                'default' => '8',
385
                                                'info' => 'Parameter',
386 38 alirezamon
                                                'global_param' => 'Localparam',
387
                                                'type' => 'Fixed',
388 42 alirezamon
                                                'redefine_param' => 1
389 38 alirezamon
                                              },
390 42 alirezamon
                                    'CLASS_HDR_WIDTH' => {
391
                                                           'redefine_param' => 1,
392
                                                           'global_param' => 'Localparam',
393
                                                           'type' => 'Fixed',
394
                                                           'content' => '',
395
                                                           'default' => '8',
396
                                                           'info' => 'Parameter'
397
                                                         },
398 38 alirezamon
                                    'DST_ADR_HDR_WIDTH' => {
399 42 alirezamon
                                                             'redefine_param' => 1,
400 38 alirezamon
                                                             'type' => 'Fixed',
401 42 alirezamon
                                                             'global_param' => 'Localparam',
402
                                                             'default' => '8',
403 38 alirezamon
                                                             'info' => 'Parameter',
404 42 alirezamon
                                                             'content' => ''
405 38 alirezamon
                                                           },
406
                                    'NX' => {
407
                                              'type' => 'Fixed',
408 42 alirezamon
                                              'global_param' => 'Parameter',
409 38 alirezamon
                                              'info' => 'Parameter',
410 42 alirezamon
                                              'default' => ' 4',
411
                                              'content' => '',
412
                                              'redefine_param' => 1
413 38 alirezamon
                                            },
414
                                    'ROUTE_NAME' => {
415 42 alirezamon
                                                      'redefine_param' => 1,
416 38 alirezamon
                                                      'info' => 'Parameter',
417 42 alirezamon
                                                      'default' => '"XY"   ',
418 38 alirezamon
                                                      'content' => '',
419 42 alirezamon
                                                      'type' => 'Fixed',
420
                                                      'global_param' => 'Parameter'
421 38 alirezamon
                                                    },
422 42 alirezamon
                                    'MAX_BURST_SIZE' => {
423
                                                          'type' => 'Combo-box',
424
                                                          'global_param' => 'Localparam',
425
                                                          'default' => '16',
426
                                                          'info' => 'Maximum burst size in words.
427
The NI releases the wishbone bus  each time one burst is completed or when the VC\'s internal FIFO becomes full.  The bus will be released for one clock cycle. Then in case, there are other active VCs, another active VC will get access to the bus using round robin arbiter.  This process will be continued until all of the desired data is transferred. ',
428
                                                          'content' => '2,4,8,16,32,64,128,256,512,1024,2048',
429
                                                          'redefine_param' => 1
430
                                                        },
431
                                    'M_Aw' => {
432
                                                'default' => '32',
433
                                                'info' => 'Parameter',
434
                                                'content' => 'Dw',
435
                                                'type' => 'Fixed',
436
                                                'global_param' => 'Localparam',
437
                                                'redefine_param' => 1
438
                                              },
439
                                    'Fw' => {
440 38 alirezamon
                                              'content' => '',
441 42 alirezamon
                                              'default' => '2+V+Fpay',
442 38 alirezamon
                                              'info' => undef,
443 42 alirezamon
                                              'global_param' => 'Localparam',
444 38 alirezamon
                                              'type' => 'Fixed',
445 42 alirezamon
                                              'redefine_param' => 0
446 38 alirezamon
                                            },
447
                                    'TAGw' => {
448 42 alirezamon
                                                'global_param' => 'Localparam',
449 38 alirezamon
                                                'type' => 'Fixed',
450 42 alirezamon
                                                'content' => '',
451 38 alirezamon
                                                'info' => 'Parameter',
452
                                                'default' => '3',
453
                                                'redefine_param' => 1
454
                                              },
455 42 alirezamon
                                    'ROUTING_HDR_WIDTH' => {
456
                                                             'redefine_param' => 1,
457
                                                             'default' => '8',
458
                                                             'info' => 'Parameter',
459
                                                             'content' => '',
460
                                                             'type' => 'Fixed',
461
                                                             'global_param' => 'Localparam'
462
                                                           },
463
                                    'Xw' => {
464
                                              'type' => 'Fixed',
465 38 alirezamon
                                              'global_param' => 'Localparam',
466 42 alirezamon
                                              'info' => undef,
467
                                              'default' => 'log2(NX)',
468
                                              'content' => '',
469
                                              'redefine_param' => 0
470 38 alirezamon
                                            },
471 42 alirezamon
                                    'CRC_EN' => {
472
                                                  'redefine_param' => 1,
473
                                                  'global_param' => 'Localparam',
474
                                                  'type' => 'Combo-box',
475
                                                  'content' => '"YES","NO"',
476
                                                  'default' => '"NO"',
477
                                                  'info' => 'The parameter can be selected as "YES" or "NO".
478
If CRC is enabled, then two CRC32 generator modules will be added to the NI. One CRC generator for calculating CRC of sending packets and another for receiving packets.   The CRC32 value of each packet is send via tail flit and at destination NI, is will be compared with received packet generated CRC32. The matching results can be used for error-detection and can be read via NI slave interface. '
479
                                                },
480
                                    'Yw' => {
481
                                              'redefine_param' => 0,
482 38 alirezamon
                                              'content' => '',
483 42 alirezamon
                                              'info' => undef,
484
                                              'default' => 'log2(NY)',
485
                                              'global_param' => 'Localparam',
486 38 alirezamon
                                              'type' => 'Fixed'
487
                                            },
488 42 alirezamon
                                    'V' => {
489
                                             'content' => '',
490
                                             'default' => '4',
491
                                             'info' => 'Parameter',
492 38 alirezamon
                                             'global_param' => 'Parameter',
493
                                             'type' => 'Fixed',
494
                                             'redefine_param' => 1
495
                                           },
496 42 alirezamon
                                    'B' => {
497 38 alirezamon
                                             'content' => '',
498
                                             'info' => 'Parameter',
499 42 alirezamon
                                             'default' => ' 4',
500 38 alirezamon
                                             'global_param' => 'Parameter',
501 42 alirezamon
                                             'type' => 'Fixed',
502
                                             'redefine_param' => 1
503 38 alirezamon
                                           },
504
                                    'MAX_TRANSACTION_WIDTH' => {
505 42 alirezamon
                                                                 'content' => '4,32,1',
506
                                                                 'default' => '13',
507
                                                                 'info' => 'maximum packet size width  in words.
508
The maximum data that can be sent via one packet will be 2 power of MAX_DMA_TRANSACTION_WIDTH in words.',
509 38 alirezamon
                                                                 'global_param' => 'Localparam',
510
                                                                 'type' => 'Spin-button',
511
                                                                 'redefine_param' => 1
512 42 alirezamon
                                                               }
513 38 alirezamon
                                  },
514 42 alirezamon
                  'modules' => {
515
                                 'vc_wb_slave_registers' => {},
516
                                 'ovc_status' => {},
517
                                 'header_flit_generator' => {},
518
                                 'ni_master' => {},
519
                                 'ni_vc_dma' => {}
520
                               },
521
                  'category' => 'NoC',
522
                  'parameters_order' => [
523
                                          'CLASS_HDR_WIDTH',
524
                                          'ROUTING_HDR_WIDTH',
525
                                          'DST_ADR_HDR_WIDTH',
526
                                          'SRC_ADR_HDR_WIDTH',
527
                                          'TOPOLOGY',
528
                                          'ROUTE_NAME',
529
                                          'NX',
530
                                          'NY',
531
                                          'C',
532
                                          'V',
533
                                          'B',
534
                                          'Fpay',
535
                                          'MAX_TRANSACTION_WIDTH',
536
                                          'MAX_BURST_SIZE',
537
                                          'DEBUG_EN',
538
                                          'Dw',
539
                                          'S_Aw',
540
                                          'M_Aw',
541
                                          'TAGw',
542
                                          'SELw',
543
                                          'Xw',
544
                                          'Yw',
545
                                          'Fw',
546
                                          'CRC_EN'
547
                                        ],
548
                  'plugs' => {
549 38 alirezamon
                               'clk' => {
550 42 alirezamon
                                          '0' => {
551
                                                   'name' => 'clk'
552
                                                 },
553
                                          'clk' => {},
554
                                          'type' => 'num',
555
                                          'value' => 1
556 38 alirezamon
                                        },
557 42 alirezamon
                               'reset' => {
558
                                            '0' => {
559
                                                     'name' => 'reset'
560 34 alirezamon
                                                   },
561 42 alirezamon
                                            'type' => 'num',
562
                                            'reset' => {},
563
                                            'value' => 1
564
                                          },
565
                               'wb_slave' => {
566
                                               'wb_slave' => {},
567
                                               'type' => 'num',
568
                                               'value' => 1,
569
                                               '0' => {
570
                                                        'name' => 'wb_slave',
571
                                                        'width' => 10,
572
                                                        'addr' => '0xb800_0000  0xbfff_ffff             custom devices'
573
                                                      }
574 38 alirezamon
                                             },
575 42 alirezamon
                               'interrupt_peripheral' => {
576
                                                           'value' => 1,
577
                                                           'type' => 'num',
578
                                                           '0' => {
579
                                                                    'name' => 'interrupt'
580
                                                                  },
581
                                                           'interrupt_peripheral' => {}
582
                                                         },
583
                               'wb_master' => {
584
                                                '0' => {
585
                                                         'name' => 'wb_send'
586
                                                       },
587
                                                'wb_master' => {},
588
                                                'type' => 'num',
589
                                                'value' => 2,
590
                                                '1' => {
591
                                                         'name' => 'wb_receive'
592
                                                       }
593
                                              }
594 38 alirezamon
                             },
595 42 alirezamon
                  'file_name' => '/home/alireza/mywork/mpsoc/src_peripheral/ni/ni_master.v',
596
                  'version' => 40,
597
                  'ip_name' => 'ni_master',
598 38 alirezamon
                  'system_h' => ' /*        NI wb registers addresses
599 42 alirezamon
 
600
            1   :   STATUS2_WB_ADDR           // status2:  {send_enable_binary,receive_enable_binary,vc_got_error,any_error_isr,got_pck_isr, save_done_isr,send_done_isr,any_error_int_en,got_pck_int_en, save_done_int_en,send_done_int_en};
601 34 alirezamon
            2   :   BURST_SIZE_WB_ADDR       // The busrt size in words
602
 
603
            3   :   SEND_DATA_SIZE_WB_ADDR,  // The size of data to be sent in byte
604
            4   :   SEND_STRT_WB_ADDR,       // The address of data to be sent   in byte
605
            5   :   SEND_DEST_WB_ADDR        // The destination router address
606
            6   :   SEND_CTRL_WB_ADDR
607
 
608
            7   :   RECEIVE_DATA_SIZE_WB_ADDR // The size of recieved data in byte
609
            8   :   RECEIVE_STRT_WB_ADDR      // The address pointer of reciever memory in byte
610
            9   :   RECEIVE_SRC_WB_ADDR       // The source router (the router which is sent this packet).
611
            10  :   RECEIVE_CTRL_WB_ADDR      // The NI reciever control register
612
            11  :   RECEIVE_MAX_BUFF_SIZ      // The receiver\'s  allocated buffer size in words. If the packet size is bigger tha the buffer size the rest of will be discarred
613 42 alirezamon
            12  :   ERROR_FLAGS // errors:  {crc_miss_match,burst_size_error,send_data_size_error,rcive_buff_ovrflw_err};
614 34 alirezamon
 
615
*/
616 42 alirezamon
#define CORID   ${CORE_ID}
617
#define MAX_X_ADDR      ${NX}
618
#define MAX_Y_ADDR      ${NY}
619 34 alirezamon
 
620 42 alirezamon
#define Y_ADDR  (CORID / MAX_X_ADDR)
621
#define X_ADDR  (CORID % MAX_X_ADDR)
622 34 alirezamon
 
623
 
624 42 alirezamon
 
625 34 alirezamon
#define ${IP}_STATUS1_REG   (*((volatile unsigned int *) ($BASE)))   //0
626
#define ${IP}_STATUS2_REG   (*((volatile unsigned int *) ($BASE+4)))   //1
627
#define ${IP}_BURST_SIZE_REG  (*((volatile unsigned int *) ($BASE+8))) //2
628
 
629
 
630
#define ${IP}_NUM_VCs   ${V}
631
 
632
#define ${IP}_SEND_DATA_SIZE_REG(v)  (*((volatile unsigned int *) ($BASE+12+(v<<6))))  //3
633
#define ${IP}_SEND_START_ADDR_REG(v)   (*((volatile unsigned int *) ($BASE+16+(v<<6))))  //4
634
#define ${IP}_SEND_DEST_REG(v)   (*((volatile unsigned int *) ($BASE+20+(v<<6)))) //5
635
#define ${IP}_SEND_CTRL_REG(v)    (*((volatile unsigned int *) ($BASE+24+(v<<6)))) //6
636
 
637
#define ${IP}_RECEIVE_DATA_SIZE_REG(v)  (*((volatile unsigned int *) ($BASE+28+(v<<6)))) //7
638
#define ${IP}_RECEIVE_STRT_ADDR_REG(v)   (*((volatile unsigned int *) ($BASE+32+(v<<6)))) //8
639 42 alirezamon
#define ${IP}_RECEIVE_SRC_REG(v)    (*((volatile unsigned int *) ($BASE+36+(v<<6))))  //9
640
#define ${IP}_RECEIVE_CTRL_REG(v)    (*((volatile unsigned int *) ($BASE+40+(v<<6)))) //10
641
#define ${IP}_RECEIVE_MAX_BUFF_SIZ_REG(v)    (*((volatile unsigned int *) ($BASE+44+(v<<6)))) //11
642
#define ${IP}_ERROR_FLAGS_REG(v)    (*((volatile unsigned int *) ($BASE+48+(v<<6)))) //12
643 34 alirezamon
 
644
 
645
 
646
// assign status1= {send_vc_is_busy,receive_vc_is_busy,receive_vc_packet_is_saved,receive_vc_got_packet};
647 42 alirezamon
// assign status2= {send_enable_binary,receive_enable_binary,vc_got_error,any_error_isr,got_pck_isr, save_done_isr,send_done_isr,any_error_int_en,got_pck_int_en, save_done_int_en,send_done_int_en};
648 34 alirezamon
 
649
 
650
#define ${IP}_got_packet(v)     ((${IP}_STATUS1_REG >> (v)) & 0x1)
651
#define ${IP}_packet_is_saved(v) ((${IP}_STATUS1_REG >> (${V}+v)) & 0x1)
652
#define ${IP}_receive_is_busy(v)        ((${IP}_STATUS1_REG >> (2*${V}+v)) & 0x1)
653
#define ${IP}_send_is_busy(v)   ((${IP}_STATUS1_REG >> (3*${V}+v)) & 0x1)
654 42 alirezamon
#define ${IP}_got_any_error(v)  ((${IP}_STATUS2_REG >> (8+v)) & 0x1)
655 34 alirezamon
 
656 42 alirezamon
#define SEND_DONE_INT_EN  (1<<0)
657
#define SAVE_DONE_INT_EN  (1<<1)
658
#define GOT_PCK_INT_EN  (1<<2)
659
#define ERRORS_INT_EN  (1<<3)
660
#define ALL_INT_EN  (SEND_DONE_INT_EN | SAVE_DONE_INT_EN | GOT_PCK_INT_EN  | ERRORS_INT_EN)
661 34 alirezamon
 
662 42 alirezamon
#define SEND_DONE_ISR (1<<4)
663
#define SAVE_DONE_ISR (1<<5)
664
#define GOT_PCK_ISR (1<<6)
665
#define ERRORS_ISR (1<<7)
666 34 alirezamon
 
667 42 alirezamon
 
668
 
669
//errors = {crc_miss_match,illegal_send_req,burst_size_error,send_data_size_error,rcive_buff_ovrflw_err};
670
#define BUFF_OVER_FLOW_ERR  (1<<0)  // This error happens when the receiver allocated buffer size is smaller than the received packet size
671
#define SEND_DATA_SIZE_ERR  (1<<1)  // This error happens when the send data size is not set
672
#define BURST_SIZE_ERR      (1<<2)  // This error happens when the burst size is not set
673
#define ILLEGAL_SEND_REQ    (1<<3)  // This error happens when a new send request is received while the DMA is still busy sending previous packet
674
#define CRC_MISS_MATCH      (1<<4)  // This error happens when the received packet CRC miss match
675
 
676
//ack intrrupts functions
677
#define ${IP}_ack_send_done_isr()  (${IP}_STATUS2_REG &= (ALL_INT_EN |SEND_DONE_ISR))
678
#define ${IP}_ack_save_done_isr()  (${IP}_STATUS2_REG &= (ALL_INT_EN | SAVE_DONE_ISR))
679
#define ${IP}_ack_got_pck_isr()    (${IP}_STATUS2_REG &= (ALL_INT_EN | GOT_PCK_ISR))
680
#define ${IP}_ack_errors_isr()    (${IP}_STATUS2_REG &= (ALL_INT_EN | ERRORS_ISR))
681
 
682
#define ${IP}_ack_all_isr()  (${IP}_STATUS2_REG = ${IP}_STATUS2_REG)
683
 
684
 
685
struct SRC_INFOS{
686
        unsigned char r; // reserved
687
        unsigned char c;  // message  class
688
        unsigned char y;  //y address
689
        unsigned char x ;  //x address
690
} ;
691
 
692
inline struct SRC_INFOS get_src_info(unsigned char v){
693
        struct SRC_INFOS  src_info =*(struct SRC_INFOS *) (&ni_RECEIVE_SRC_REG(v));
694
        return  src_info;
695
}
696
 
697
/*
698
        The NI initializing function.
699
        The burst_size must be  <= $MAX_BURST_SIZE
700
        send_int_en :1: enable the intrrupt when a packet is sent 0 : This intrrupt is disabled
701
        save_int_en : 1: enable the intrrupt when a recived packet is saved on internal buffer  0 : This intrrupt is disabled
702
        got_pck_int_en : 1: enable the intrrupt when a packet is recived in NI. 0 : This intrrupt is disabled
703
 
704
*/
705
void ${IP}_initial (unsigned int burst_size, unsigned char errors_int_en, unsigned char send_int_en, unsigned char save_int_en, unsigned char got_pck_int_en) {
706
        ${IP}_BURST_SIZE_REG  =  burst_size;
707
        if(errors_int_en) ${IP}_STATUS2_REG |= ERRORS_INT_EN;
708
        if(send_int_en) ${IP}_STATUS2_REG |= SEND_DONE_INT_EN;
709
        if(save_int_en) ${IP}_STATUS2_REG |= SAVE_DONE_INT_EN;
710
        if(got_pck_int_en) ${IP}_STATUS2_REG |= GOT_PCK_INT_EN;
711 34 alirezamon
}
712
 
713 42 alirezamon
/*
714
        The NI message sent function:
715
        v: virtual channel number which this packet should be sent to
716
        class_num: message class number. Diffrent message classes can be sent via isolated network resources to avoid protocol deadlock
717
        data_start_addr : The address pointer to the start location of the packet to be sent in the memory
718
        data_size: the message data size in words
719
        dest_x: the x address of destination core
720
        dest_y: the y address of destination core
721 34 alirezamon
 
722 42 alirezamon
*/
723
 
724 34 alirezamon
void ${IP}_transfer (unsigned int v, unsigned int class_num, unsigned int data_start_addr,  unsigned int data_size, unsigned int dest_x,unsigned int dest_y){
725
         while (${IP}_send_is_busy(v)); // wait until VC is busy sending previous packet
726
 
727
        ${IP}_SEND_DATA_SIZE_REG(v)  = data_size;
728
        ${IP}_SEND_START_ADDR_REG(v)  = data_start_addr;
729
        ${IP}_SEND_DEST_REG(v)   = dest_x | (dest_y<<4)| (class_num<<8) ;
730
 
731
}
732
 
733 42 alirezamon
/*
734
        The NI message receiver function:
735
        v: virtual channel number of the received packet
736
        data_start_addr : The address pointer to the start location of the memory where the newly arrived packet must be stored by NI in.
737
        max_buffer_size : The allocated receive-memory buffer size in words.
738
*/
739
 
740 34 alirezamon
void ${IP}_receive (unsigned int v, unsigned int data_start_addr,  unsigned int max_buffer_size){
741
         while (${IP}_receive_is_busy(v)); // wait until VC is busy saving previous packet
742
 
743
        ${IP}_RECEIVE_STRT_ADDR_REG(v)  = data_start_addr;
744
        ${IP}_RECEIVE_MAX_BUFF_SIZ_REG(v) = max_buffer_size;
745
        ${IP}_RECEIVE_CTRL_REG(v)   = 1;
746
 
747
 
748
}',
749 42 alirezamon
                  'description' => '',
750
                  'gui_status' => {
751
                                    'timeout' => 0,
752
                                    'status' => 'ideal'
753
                                  }
754 38 alirezamon
                }, 'ip_gen' );

powered by: WebSVN 2.1.0

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