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 34

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
##      This file is part of ProNoC 1.6.0
7
##
8
##      WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
9
##      MAY CAUSE UNEXPECTED BEHAIVOR.
10
################################################################################
11
 
12
$ni_master = bless( {
13
                      'plugs' => {
14
                                   'interrupt_peripheral' => {
15
                                                               'type' => 'num',
16
                                                               'value' => 1,
17
                                                               '0' => {
18
                                                                        'name' => 'interrupt'
19
                                                                      },
20
                                                               'interrupt_peripheral' => {}
21
                                                             },
22
                                   'wb_slave' => {
23
                                                   'wb_slave' => {},
24
                                                   'type' => 'num',
25
                                                   'value' => 1,
26
                                                   '0' => {
27
                                                            'addr' => '0xb800_0000      0xbfff_ffff             custom devices',
28
                                                            'name' => 'wb_slave',
29
                                                            'width' => 10
30
                                                          }
31
                                                 },
32
                                   'reset' => {
33
                                                'reset' => {},
34
                                                '0' => {
35
                                                         'name' => 'reset'
36
                                                       },
37
                                                'type' => 'num',
38
                                                'value' => 1
39
                                              },
40
                                   'clk' => {
41
                                              'clk' => {},
42
                                              '0' => {
43
                                                       'name' => 'clk'
44
                                                     },
45
                                              'value' => 1,
46
                                              'type' => 'num'
47
                                            },
48
                                   'wb_master' => {
49
                                                    '1' => {
50
                                                             'name' => 'wb_receive'
51
                                                           },
52
                                                    'type' => 'num',
53
                                                    'wb_master' => {},
54
                                                    'value' => 2,
55
                                                    '0' => {
56
                                                             'name' => 'wb_send'
57
                                                           }
58
                                                  }
59
                                 },
60
                      'sockets' => {
61
                                     'ni' => {
62
                                               'connection_num' => 'single connection',
63
                                               'value' => 1,
64
                                               'type' => 'num',
65
                                               'ni' => {},
66
                                               '0' => {
67
                                                        'name' => 'ni'
68
                                                      }
69
                                             }
70
                                   },
71
                      'unused' => {
72
                                    'plug:wb_master[1]' => [
73
                                                             'bte_o',
74
                                                             'dat_i',
75
                                                             'err_i',
76
                                                             'tag_o',
77
                                                             'rty_i'
78
                                                           ],
79
                                    'plug:wb_slave[0]' => [
80
                                                            'tag_i',
81
                                                            'err_o',
82
                                                            'rty_o',
83
                                                            'bte_i'
84
                                                          ],
85
                                    'plug:wb_master[0]' => [
86
                                                             'bte_o',
87
                                                             'err_i',
88
                                                             'tag_o',
89
                                                             'dat_o',
90
                                                             'rty_i'
91
                                                           ]
92
                                  },
93
                      'ip_name' => 'ni_master',
94
                      'description' => '',
95
                      'hdl_files' => [
96
                                       '/mpsoc/src_noc/arbiter.v',
97
                                       '/mpsoc/src_noc/flit_buffer.v',
98
                                       '/mpsoc/src_noc/input_ports.v',
99
                                       '/mpsoc/src_noc/main_comp.v',
100
                                       '/mpsoc/src_noc/route_mesh.v',
101
                                       '/mpsoc/src_noc/route_torus.v',
102
                                       '/mpsoc/src_noc/routing.v',
103
                                       '/mpsoc/src_peripheral/ni/ni_vc_dma.v',
104
                                       '/mpsoc/src_peripheral/ni/ni_vc_wb_slave_regs.v',
105
                                       '/mpsoc/src_peripheral/ni/ni_master.v',
106
                                       '/mpsoc/src_peripheral/ni/ni_crc32.v'
107
                                     ],
108
                      'parameters' => {
109
                                        'B' => {
110
                                                 'global_param' => 'Parameter',
111
                                                 'type' => 'Fixed',
112
                                                 'content' => '',
113
                                                 'deafult' => ' 4',
114
                                                 'redefine_param' => 1,
115
                                                 'info' => 'Parameter'
116
                                               },
117
                                        'CRC_EN' => {
118
                                                      'redefine_param' => 1,
119
                                                      'deafult' => '"NO"',
120
                                                      'content' => '"YES","NO"',
121
                                                      'info' => 'The parameter can be selected as "YES" or "NO".
122
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. ',
123
                                                      'global_param' => 'Localparam',
124
                                                      'type' => 'Combo-box'
125
                                                    },
126
                                        'DEBUG_EN' => {
127
                                                        'type' => 'Fixed',
128
                                                        'global_param' => 'Parameter',
129
                                                        'info' => 'Parameter',
130
                                                        'deafult' => ' 1',
131
                                                        'content' => '',
132
                                                        'redefine_param' => 1
133
                                                      },
134
                                        'Yw' => {
135
                                                  'info' => undef,
136
                                                  'redefine_param' => 0,
137
                                                  'content' => '',
138
                                                  'deafult' => 'log2(NY)',
139
                                                  'type' => 'Fixed',
140
                                                  'global_param' => 'Localparam'
141
                                                },
142
                                        'NY' => {
143
                                                  'info' => 'Parameter',
144
                                                  'redefine_param' => 1,
145
                                                  'deafult' => ' 4',
146
                                                  'content' => '',
147
                                                  'type' => 'Fixed',
148
                                                  'global_param' => 'Parameter'
149
                                                },
150
                                        'C' => {
151
                                                 'type' => 'Fixed',
152
                                                 'global_param' => 'Parameter',
153
                                                 'info' => 'Parameter',
154
                                                 'content' => '',
155
                                                 'deafult' => ' 4',
156
                                                 'redefine_param' => 1
157
                                               },
158
                                        'SELw' => {
159
                                                    'global_param' => 'Localparam',
160
                                                    'type' => 'Fixed',
161
                                                    'redefine_param' => 1,
162
                                                    'content' => '',
163
                                                    'deafult' => '4',
164
                                                    'info' => 'Parameter'
165
                                                  },
166
                                        'Fpay' => {
167
                                                    'redefine_param' => 1,
168
                                                    'deafult' => ' 32',
169
                                                    'content' => '',
170
                                                    'info' => 'Parameter',
171
                                                    'global_param' => 'Parameter',
172
                                                    'type' => 'Fixed'
173
                                                  },
174
                                        'MAX_TRANSACTION_WIDTH' => {
175
                                                                     'info' => 'maximum packet size width  in words.
176
The maximum data that can be sent via one packet will be 2 power of MAX_DMA_TRANSACTION_WIDTH in words.',
177
                                                                     'content' => '4,32,1',
178
                                                                     'deafult' => '13',
179
                                                                     'redefine_param' => 1,
180
                                                                     'type' => 'Spin-button',
181
                                                                     'global_param' => 'Localparam'
182
                                                                   },
183
                                        'SRC_ADR_HDR_WIDTH' => {
184
                                                                 'redefine_param' => 1,
185
                                                                 'content' => '',
186
                                                                 'deafult' => '8',
187
                                                                 'info' => 'Parameter',
188
                                                                 'global_param' => 'Localparam',
189
                                                                 'type' => 'Fixed'
190
                                                               },
191
                                        'ROUTING_HDR_WIDTH' => {
192
                                                                 'type' => 'Fixed',
193
                                                                 'global_param' => 'Localparam',
194
                                                                 'info' => 'Parameter',
195
                                                                 'content' => '',
196
                                                                 'deafult' => '8',
197
                                                                 'redefine_param' => 1
198
                                                               },
199
                                        'Fw' => {
200
                                                  'global_param' => 'Localparam',
201
                                                  'type' => 'Fixed',
202
                                                  'redefine_param' => 0,
203
                                                  'deafult' => '2+V+Fpay',
204
                                                  'content' => '',
205
                                                  'info' => undef
206
                                                },
207
                                        'DST_ADR_HDR_WIDTH' => {
208
                                                                 'global_param' => 'Localparam',
209
                                                                 'type' => 'Fixed',
210
                                                                 'redefine_param' => 1,
211
                                                                 'deafult' => '8',
212
                                                                 'content' => '',
213
                                                                 'info' => 'Parameter'
214
                                                               },
215
                                        'Xw' => {
216
                                                  'global_param' => 'Localparam',
217
                                                  'type' => 'Fixed',
218
                                                  'deafult' => 'log2(NX)',
219
                                                  'content' => '',
220
                                                  'redefine_param' => 0,
221
                                                  'info' => undef
222
                                                },
223
                                        'M_Aw' => {
224
                                                    'redefine_param' => 1,
225
                                                    'deafult' => '32',
226
                                                    'content' => 'Dw',
227
                                                    'info' => 'Parameter',
228
                                                    'global_param' => 'Localparam',
229
                                                    'type' => 'Fixed'
230
                                                  },
231
                                        'P' => {
232
                                                 'global_param' => 'Parameter',
233
                                                 'type' => 'Fixed',
234
                                                 'redefine_param' => 1,
235
                                                 'deafult' => '5',
236
                                                 'content' => '',
237
                                                 'info' => 'Parameter'
238
                                               },
239
                                        'ROUTE_TYPE' => {
240
                                                          'info' => 'Parameter',
241
                                                          'redefine_param' => 1,
242
                                                          'deafult' => '   ',
243
                                                          'content' => '',
244
                                                          'type' => 'Fixed',
245
                                                          'global_param' => 'Parameter'
246
                                                        },
247
                                        'MAX_BURST_SIZE' => {
248
                                                              'type' => 'Combo-box',
249
                                                              'global_param' => 'Localparam',
250
                                                              'info' => 'Maximum burst size in words.
251
The NI release 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 desired data is transferred. ',
252
                                                              'redefine_param' => 1,
253
                                                              'content' => '2,4,8,16,32,64,128,256,512,1024,2048',
254
                                                              'deafult' => '16'
255
                                                            },
256
                                        'Dw' => {
257
                                                  'type' => 'Spin-button',
258
                                                  'global_param' => 'Localparam',
259
                                                  'info' => 'wishbone_bus data width in bits.',
260
                                                  'redefine_param' => 1,
261
                                                  'content' => '32,256,8',
262
                                                  'deafult' => '32'
263
                                                },
264
                                        'ROUTE_NAME' => {
265
                                                          'deafult' => '"XY"   ',
266
                                                          'content' => '',
267
                                                          'redefine_param' => 1,
268
                                                          'info' => 'Parameter',
269
                                                          'global_param' => 'Parameter',
270
                                                          'type' => 'Fixed'
271
                                                        },
272
                                        'NX' => {
273
                                                  'content' => '',
274
                                                  'deafult' => ' 4',
275
                                                  'redefine_param' => 1,
276
                                                  'info' => 'Parameter',
277
                                                  'global_param' => 'Parameter',
278
                                                  'type' => 'Fixed'
279
                                                },
280
                                        'CLASS_HDR_WIDTH' => {
281
                                                               'global_param' => 'Localparam',
282
                                                               'type' => 'Fixed',
283
                                                               'redefine_param' => 1,
284
                                                               'deafult' => '8',
285
                                                               'content' => '',
286
                                                               'info' => 'Parameter'
287
                                                             },
288
                                        'TOPOLOGY' => {
289
                                                        'info' => 'Parameter',
290
                                                        'redefine_param' => 1,
291
                                                        'content' => '',
292
                                                        'deafult' => '"MESH"',
293
                                                        'type' => 'Fixed',
294
                                                        'global_param' => 'Parameter'
295
                                                      },
296
                                        'S_Aw' => {
297
                                                    'global_param' => 'Localparam',
298
                                                    'type' => 'Fixed',
299
                                                    'redefine_param' => 1,
300
                                                    'content' => '',
301
                                                    'deafult' => '8',
302
                                                    'info' => 'Parameter'
303
                                                  },
304
                                        'V' => {
305
                                                 'global_param' => 'Parameter',
306
                                                 'type' => 'Fixed',
307
                                                 'content' => '',
308
                                                 'deafult' => '4',
309
                                                 'redefine_param' => 1,
310
                                                 'info' => 'Parameter'
311
                                               },
312
                                        'TAGw' => {
313
                                                    'global_param' => 'Localparam',
314
                                                    'type' => 'Fixed',
315
                                                    'deafult' => '3',
316
                                                    'content' => '',
317
                                                    'redefine_param' => 1,
318
                                                    'info' => 'Parameter'
319
                                                  }
320
                                      },
321
                      'version' => 37,
322
                      'category' => 'NoC',
323
                      'description_pdf' => '/mpsoc/src_peripheral/ni/NI_master.pdf',
324
                      'ports' => {
325
                                   's_addr_i' => {
326
                                                   'range' => 'S_Aw-1     :   0',
327
                                                   'type' => 'input',
328
                                                   'intfc_name' => 'plug:wb_slave[0]',
329
                                                   'intfc_port' => 'adr_i'
330
                                                 },
331
                                   'm_send_cti_o' => {
332
                                                       'intfc_port' => 'cti_o',
333
                                                       'intfc_name' => 'plug:wb_master[0]',
334
                                                       'type' => 'output',
335
                                                       'range' => 'TAGw-1          :   0'
336
                                                     },
337
                                   'm_send_sel_o' => {
338
                                                       'type' => 'output',
339
                                                       'intfc_port' => 'sel_o',
340
                                                       'intfc_name' => 'plug:wb_master[0]',
341
                                                       'range' => 'SELw-1          :   0'
342
                                                     },
343
                                   'm_receive_ack_i' => {
344
                                                          'range' => '',
345
                                                          'type' => 'input',
346
                                                          'intfc_name' => 'plug:wb_master[1]',
347
                                                          'intfc_port' => 'ack_i'
348
                                                        },
349
                                   'm_send_cyc_o' => {
350
                                                       'range' => '',
351
                                                       'type' => 'output',
352
                                                       'intfc_port' => 'cyc_o',
353
                                                       'intfc_name' => 'plug:wb_master[0]'
354
                                                     },
355
                                   'm_receive_sel_o' => {
356
                                                          'range' => 'SELw-1          :   0',
357
                                                          'type' => 'output',
358
                                                          'intfc_port' => 'sel_o',
359
                                                          'intfc_name' => 'plug:wb_master[1]'
360
                                                        },
361
                                   's_dat_i' => {
362
                                                  'type' => 'input',
363
                                                  'intfc_port' => 'dat_i',
364
                                                  'intfc_name' => 'plug:wb_slave[0]',
365
                                                  'range' => 'Dw-1       :   0'
366
                                                },
367
                                   'flit_out' => {
368
                                                   'range' => 'Fw-1   :   0',
369
                                                   'type' => 'output',
370
                                                   'intfc_name' => 'socket:ni[0]',
371
                                                   'intfc_port' => 'flit_out'
372
                                                 },
373
                                   'm_receive_cyc_o' => {
374
                                                          'intfc_name' => 'plug:wb_master[1]',
375
                                                          'intfc_port' => 'cyc_o',
376
                                                          'type' => 'output',
377
                                                          'range' => ''
378
                                                        },
379
                                   'current_x' => {
380
                                                    'range' => 'Xw-1   :   0',
381
                                                    'type' => 'input',
382
                                                    'intfc_port' => 'current_x',
383
                                                    'intfc_name' => 'socket:ni[0]'
384
                                                  },
385
                                   'm_receive_we_o' => {
386
                                                         'intfc_port' => 'we_o',
387
                                                         'intfc_name' => 'plug:wb_master[1]',
388
                                                         'type' => 'output',
389
                                                         'range' => ''
390
                                                       },
391
                                   'flit_out_wr' => {
392
                                                      'range' => '',
393
                                                      'intfc_name' => 'socket:ni[0]',
394
                                                      'intfc_port' => 'flit_out_wr',
395
                                                      'type' => 'output'
396
                                                    },
397
                                   's_cyc_i' => {
398
                                                  'intfc_port' => 'cyc_i',
399
                                                  'intfc_name' => 'plug:wb_slave[0]',
400
                                                  'type' => 'input',
401
                                                  'range' => ''
402
                                                },
403
                                   'm_receive_addr_o' => {
404
                                                           'range' => 'M_Aw-1          :   0',
405
                                                           'type' => 'output',
406
                                                           'intfc_name' => 'plug:wb_master[1]',
407
                                                           'intfc_port' => 'adr_o'
408
                                                         },
409
                                   's_sel_i' => {
410
                                                  'range' => 'SELw-1     :   0',
411
                                                  'type' => 'input',
412
                                                  'intfc_name' => 'plug:wb_slave[0]',
413
                                                  'intfc_port' => 'sel_i'
414
                                                },
415
                                   'm_send_ack_i' => {
416
                                                       'type' => 'input',
417
                                                       'intfc_port' => 'ack_i',
418
                                                       'intfc_name' => 'plug:wb_master[0]',
419
                                                       'range' => ''
420
                                                     },
421
                                   'reset' => {
422
                                                'type' => 'input',
423
                                                'intfc_name' => 'plug:reset[0]',
424
                                                'intfc_port' => 'reset_i',
425
                                                'range' => ''
426
                                              },
427
                                   'm_send_stb_o' => {
428
                                                       'range' => '',
429
                                                       'intfc_name' => 'plug:wb_master[0]',
430
                                                       'intfc_port' => 'stb_o',
431
                                                       'type' => 'output'
432
                                                     },
433
                                   'm_send_dat_i' => {
434
                                                       'intfc_port' => 'dat_i',
435
                                                       'intfc_name' => 'plug:wb_master[0]',
436
                                                       'type' => 'input',
437
                                                       'range' => 'Dw-1           :  0'
438
                                                     },
439
                                   'credit_in' => {
440
                                                    'type' => 'input',
441
                                                    'intfc_name' => 'socket:ni[0]',
442
                                                    'intfc_port' => 'credit_in',
443
                                                    'range' => 'V-1    :   0'
444
                                                  },
445
                                   'irq' => {
446
                                              'range' => '',
447
                                              'type' => 'output',
448
                                              'intfc_port' => 'int_o',
449
                                              'intfc_name' => 'plug:interrupt_peripheral[0]'
450
                                            },
451
                                   's_stb_i' => {
452
                                                  'range' => '',
453
                                                  'type' => 'input',
454
                                                  'intfc_port' => 'stb_i',
455
                                                  'intfc_name' => 'plug:wb_slave[0]'
456
                                                },
457
                                   'm_send_we_o' => {
458
                                                      'range' => '',
459
                                                      'intfc_name' => 'plug:wb_master[0]',
460
                                                      'intfc_port' => 'we_o',
461
                                                      'type' => 'output'
462
                                                    },
463
                                   'flit_in' => {
464
                                                  'range' => 'Fw-1   :   0',
465
                                                  'type' => 'input',
466
                                                  'intfc_name' => 'socket:ni[0]',
467
                                                  'intfc_port' => 'flit_in'
468
                                                },
469
                                   'm_send_addr_o' => {
470
                                                        'intfc_port' => 'adr_o',
471
                                                        'intfc_name' => 'plug:wb_master[0]',
472
                                                        'type' => 'output',
473
                                                        'range' => 'M_Aw-1          :   0'
474
                                                      },
475
                                   'credit_out' => {
476
                                                     'range' => 'V-1    :   0',
477
                                                     'type' => 'output',
478
                                                     'intfc_port' => 'credit_out',
479
                                                     'intfc_name' => 'socket:ni[0]'
480
                                                   },
481
                                   'm_receive_stb_o' => {
482
                                                          'intfc_name' => 'plug:wb_master[1]',
483
                                                          'intfc_port' => 'stb_o',
484
                                                          'type' => 'output',
485
                                                          'range' => ''
486
                                                        },
487
                                   'clk' => {
488
                                              'range' => '',
489
                                              'intfc_name' => 'plug:clk[0]',
490
                                              'intfc_port' => 'clk_i',
491
                                              'type' => 'input'
492
                                            },
493
                                   's_we_i' => {
494
                                                 'intfc_port' => 'we_i',
495
                                                 'intfc_name' => 'plug:wb_slave[0]',
496
                                                 'type' => 'input',
497
                                                 'range' => ''
498
                                               },
499
                                   's_ack_o' => {
500
                                                  'intfc_port' => 'ack_o',
501
                                                  'intfc_name' => 'plug:wb_slave[0]',
502
                                                  'type' => 'output',
503
                                                  'range' => ''
504
                                                },
505
                                   'm_receive_cti_o' => {
506
                                                          'range' => 'TAGw-1          :   0',
507
                                                          'type' => 'output',
508
                                                          'intfc_port' => 'cti_o',
509
                                                          'intfc_name' => 'plug:wb_master[1]'
510
                                                        },
511
                                   's_cti_i' => {
512
                                                  'range' => 'TAGw-1     :   0',
513
                                                  'type' => 'input',
514
                                                  'intfc_name' => 'plug:wb_slave[0]',
515
                                                  'intfc_port' => 'cti_i'
516
                                                },
517
                                   'current_y' => {
518
                                                    'range' => 'Yw-1   :   0',
519
                                                    'type' => 'input',
520
                                                    'intfc_port' => 'current_y',
521
                                                    'intfc_name' => 'socket:ni[0]'
522
                                                  },
523
                                   's_dat_o' => {
524
                                                  'range' => 'Dw-1       :   0',
525
                                                  'intfc_port' => 'dat_o',
526
                                                  'intfc_name' => 'plug:wb_slave[0]',
527
                                                  'type' => 'output'
528
                                                },
529
                                   'flit_in_wr' => {
530
                                                     'type' => 'input',
531
                                                     'intfc_name' => 'socket:ni[0]',
532
                                                     'intfc_port' => 'flit_in_wr',
533
                                                     'range' => ''
534
                                                   },
535
                                   'm_receive_dat_o' => {
536
                                                          'range' => 'Dw-1            :   0',
537
                                                          'intfc_port' => 'dat_o',
538
                                                          'intfc_name' => 'plug:wb_master[1]',
539
                                                          'type' => 'output'
540
                                                        }
541
                                 },
542
                      'modules' => {
543
                                     'ni_vc_dma' => {},
544
                                     'header_flit_generator' => {},
545
                                     'ni_master' => {},
546
                                     'ovc_status' => {},
547
                                     'vc_wb_slave_registers' => {}
548
                                   },
549
                      'gui_status' => {
550
                                        'timeout' => 0,
551
                                        'status' => 'ideal'
552
                                      },
553
                      'system_h' => ' /*            NI wb registers addresses
554
 
555
            1   :   STATUS2_WB_ADDR           // status2:
556
            2   :   BURST_SIZE_WB_ADDR       // The busrt size in words
557
 
558
            3   :   SEND_DATA_SIZE_WB_ADDR,  // The size of data to be sent in byte
559
            4   :   SEND_STRT_WB_ADDR,       // The address of data to be sent   in byte
560
            5   :   SEND_DEST_WB_ADDR        // The destination router address
561
            6   :   SEND_CTRL_WB_ADDR
562
 
563
            7   :   RECEIVE_DATA_SIZE_WB_ADDR // The size of recieved data in byte
564
            8   :   RECEIVE_STRT_WB_ADDR      // The address pointer of reciever memory in byte
565
            9   :   RECEIVE_SRC_WB_ADDR       // The source router (the router which is sent this packet).
566
            10  :   RECEIVE_CTRL_WB_ADDR      // The NI reciever control register
567
            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
568
 
569
*/
570
 
571
 
572
 
573
#define ${IP}_STATUS1_REG   (*((volatile unsigned int *) ($BASE)))   //0
574
#define ${IP}_STATUS2_REG   (*((volatile unsigned int *) ($BASE+4)))   //1
575
#define ${IP}_BURST_SIZE_REG  (*((volatile unsigned int *) ($BASE+8))) //2
576
 
577
 
578
#define ${IP}_NUM_VCs   ${V}
579
 
580
#define ${IP}_SEND_DATA_SIZE_REG(v)  (*((volatile unsigned int *) ($BASE+12+(v<<6))))  //3
581
#define ${IP}_SEND_START_ADDR_REG(v)   (*((volatile unsigned int *) ($BASE+16+(v<<6))))  //4
582
#define ${IP}_SEND_DEST_REG(v)   (*((volatile unsigned int *) ($BASE+20+(v<<6)))) //5
583
#define ${IP}_SEND_CTRL_REG(v)    (*((volatile unsigned int *) ($BASE+24+(v<<6)))) //6
584
 
585
#define ${IP}_RECEIVE_DATA_SIZE_REG(v)  (*((volatile unsigned int *) ($BASE+28+(v<<6)))) //7
586
#define ${IP}_RECEIVE_STRT_ADDR_REG(v)   (*((volatile unsigned int *) ($BASE+32+(v<<6)))) //8
587
#define ${IP}_RECEIVE_CTRL_REG(v)    (*((volatile unsigned int *) ($BASE+36+(v<<6))))  //9
588
#define ${IP}_RECEIVE_MAX_BUFF_SIZ_REG(v)    (*((volatile unsigned int *) ($BASE+40+(v<<6)))) //10
589
#define ${IP}_RECEIVE_CRC_MATCH_REG(v)    (*((volatile unsigned int *) ($BASE+44+(v<<6)))) //11
590
 
591
 
592
 
593
// assign status1= {send_vc_is_busy,receive_vc_is_busy,receive_vc_packet_is_saved,receive_vc_got_packet};
594
// assign status2= {send_enable_binarry,receive_enable_binarry,crc_miss_match,got_pck_isr, save_done_isr,send_done_isr,got_pck_int_en, save_done_int_en,send_done_int_en};
595
 
596
 
597
#define ${IP}_got_packet(v)     ((${IP}_STATUS1_REG >> (v)) & 0x1)
598
#define ${IP}_packet_is_saved(v) ((${IP}_STATUS1_REG >> (${V}+v)) & 0x1)
599
#define ${IP}_receive_is_busy(v)        ((${IP}_STATUS1_REG >> (2*${V}+v)) & 0x1)
600
#define ${IP}_send_is_busy(v)   ((${IP}_STATUS1_REG >> (3*${V}+v)) & 0x1)
601
 
602
 
603
 
604
void ${IP}_initial (unsigned int burst_size) {
605
         ${IP}_BURST_SIZE_REG  =  burst_size;
606
}
607
 
608
 
609
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){
610
         while (${IP}_send_is_busy(v)); // wait until VC is busy sending previous packet
611
 
612
        ${IP}_SEND_DATA_SIZE_REG(v)  = data_size;
613
        ${IP}_SEND_START_ADDR_REG(v)  = data_start_addr;
614
        ${IP}_SEND_DEST_REG(v)   = dest_x | (dest_y<<4)| (class_num<<8) ;
615
 
616
}
617
 
618
void ${IP}_receive (unsigned int v, unsigned int data_start_addr,  unsigned int max_buffer_size){
619
         while (${IP}_receive_is_busy(v)); // wait until VC is busy saving previous packet
620
 
621
        ${IP}_RECEIVE_STRT_ADDR_REG(v)  = data_start_addr;
622
        ${IP}_RECEIVE_MAX_BUFF_SIZ_REG(v) = max_buffer_size;
623
        ${IP}_RECEIVE_CTRL_REG(v)   = 1;
624
 
625
 
626
}',
627
                      'ports_order' => [
628
                                         'reset',
629
                                         'clk',
630
                                         'current_x',
631
                                         'current_y',
632
                                         'flit_out',
633
                                         'flit_out_wr',
634
                                         'credit_in',
635
                                         'flit_in',
636
                                         'flit_in_wr',
637
                                         'credit_out',
638
                                         's_dat_i',
639
                                         's_sel_i',
640
                                         's_addr_i',
641
                                         's_cti_i',
642
                                         's_stb_i',
643
                                         's_cyc_i',
644
                                         's_we_i',
645
                                         's_dat_o',
646
                                         's_ack_o',
647
                                         'm_send_sel_o',
648
                                         'm_send_addr_o',
649
                                         'm_send_cti_o',
650
                                         'm_send_stb_o',
651
                                         'm_send_cyc_o',
652
                                         'm_send_we_o',
653
                                         'm_send_dat_i',
654
                                         'm_send_ack_i',
655
                                         'm_receive_sel_o',
656
                                         'm_receive_dat_o',
657
                                         'm_receive_addr_o',
658
                                         'm_receive_cti_o',
659
                                         'm_receive_stb_o',
660
                                         'm_receive_cyc_o',
661
                                         'm_receive_we_o',
662
                                         'm_receive_ack_i',
663
                                         'irq'
664
                                       ],
665
                      'module_name' => 'ni_master',
666
                      'file_name' => '/home/alireza/mywork/mpsoc/src_peripheral/ni/ni_master.v',
667
                      'parameters_order' => [
668
                                              'CLASS_HDR_WIDTH',
669
                                              'ROUTING_HDR_WIDTH',
670
                                              'DST_ADR_HDR_WIDTH',
671
                                              'SRC_ADR_HDR_WIDTH',
672
                                              'TOPOLOGY',
673
                                              'ROUTE_NAME',
674
                                              'NX',
675
                                              'NY',
676
                                              'C',
677
                                              'V',
678
                                              'B',
679
                                              'Fpay',
680
                                              'MAX_TRANSACTION_WIDTH',
681
                                              'MAX_BURST_SIZE',
682
                                              'DEBUG_EN',
683
                                              'Dw',
684
                                              'S_Aw',
685
                                              'M_Aw',
686
                                              'TAGw',
687
                                              'SELw',
688
                                              'Xw',
689
                                              'Yw',
690
                                              'Fw',
691
                                              'CRC_EN'
692
                                            ]
693
                    }, 'ip_gen' );

powered by: WebSVN 2.1.0

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