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/] [Communication/] [ProNoC_jtag_uart.IP] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
#######################################################################
2
##      File: ProNoC_jtag_uart.IP
3
##
4
##      Copyright (C) 2014-2019  Alireza Monemi
5
##
6
##      This file is part of ProNoC 1.9.1
7
##
8
##      WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
9
##      MAY CAUSE UNEXPECTED BEHAIVOR.
10
################################################################################
11
 
12
$ipgen = bless( {
13
                  'system_h' => '
14
#define ${IP}_DATA_REG                                  (*((volatile unsigned int *) ($BASE)))
15
#define ${IP}_CONTROL_REG                               (*((volatile unsigned int *) ($BASE+4)))
16
#define ${IP}_CONTROL_WSPACE_MSK        0xFFFF0000
17
#define ${IP}_DATA_RVALID_MSK                   0x00008000
18
#define ${IP}_DATA_DATA_MSK                     0x000000FF
19
 
20
//////////////////////////////*basic function for jtag_uart*////////////////////////////////////////
21
void jtag_putchar(char ch);
22
char jtag_getchar(void);
23
void outbyte(char c); //called in printf();
24
char inbyte(void);
25
void jtag_putchar(char ch);
26
char jtag_getchar(void);
27
int jtag_scanstr(char* buf);
28
int jtag_scanint(int *num);
29
/////////////////////////////*END: basic function for jtag_uart*////////////////////////////////////
30
 
31
#define INCLUDE_${INCLUDE_SIM_PRINTF}
32
 
33
#ifdef INCLUDE_SIMPLE_PRINTF
34
        #include "simple-printf/printf.h"
35
#endif
36
 
37
#ifdef INCLUDE_SIMPLE_PRINTF_LONG
38
        #include "simple-printf/printf.h"
39
#endif',
40
                  'ports' => {
41
                               'wb_adr_i' => {
42
                                               'intfc_name' => 'plug:wb_slave[0]',
43
                                               'range' => '',
44
                                               'type' => 'input',
45
                                               'intfc_port' => 'adr_i'
46
                                             },
47
                               'wb_stb_i' => {
48
                                               'type' => 'input',
49
                                               'intfc_port' => 'stb_i',
50
                                               'intfc_name' => 'plug:wb_slave[0]',
51
                                               'range' => ''
52
                                             },
53
                               'clk' => {
54
                                          'intfc_name' => 'plug:clk[0]',
55
                                          'range' => '',
56
                                          'intfc_port' => 'clk_i',
57
                                          'type' => 'input'
58
                                        },
59
                               'wb_we_i' => {
60
                                              'range' => '',
61
                                              'intfc_name' => 'plug:wb_slave[0]',
62
                                              'intfc_port' => 'we_i',
63
                                              'type' => 'input'
64
                                            },
65
                               'wb_dat_o' => {
66
                                               'intfc_port' => 'dat_o',
67
                                               'type' => 'output',
68
                                               'intfc_name' => 'plug:wb_slave[0]',
69
                                               'range' => 'Dw-1: 0'
70
                                             },
71
                               'wb_to_jtag' => {
72
                                                 'range' => 'WB2Jw-1  : 0',
73
                                                 'intfc_name' => 'socket:jtag_to_wb[0]',
74
                                                 'intfc_port' => 'jwb_o',
75
                                                 'type' => 'output'
76
                                               },
77
                               'reset' => {
78
                                            'range' => '',
79
                                            'intfc_name' => 'plug:reset[0]',
80
                                            'intfc_port' => 'reset_i',
81
                                            'type' => 'input'
82
                                          },
83
                               'wb_ack_o' => {
84
                                               'intfc_port' => 'ack_o',
85
                                               'type' => 'output',
86
                                               'intfc_name' => 'plug:wb_slave[0]',
87
                                               'range' => ''
88
                                             },
89
                               'wb_cyc_i' => {
90
                                               'intfc_port' => 'cyc_i',
91
                                               'type' => 'input',
92
                                               'intfc_name' => 'plug:wb_slave[0]',
93
                                               'range' => ''
94
                                             },
95
                               'jtag_to_wb' => {
96
                                                 'range' => 'J2WBw-1 : 0',
97
                                                 'intfc_name' => 'socket:jtag_to_wb[0]',
98
                                                 'intfc_port' => 'jwb_i',
99
                                                 'type' => 'input'
100
                                               },
101
'RxD_wr_sim' => {
102
                                                 'intfc_port' => 'RxD_wr_sim',
103
                                                 'type' => 'input',
104
                                                 'range' => '',
105
                                                 'intfc_name' => 'socket:RxD_sim[0]'
106
                                               },
107
 'RxD_din_sim' => {
108
                                                  'intfc_port' => 'RxD_din_sim',
109
                                                  'type' => 'input',
110
                                                  'range' => '7:0 ',
111
                                                  'intfc_name' => 'socket:RxD_sim[0]'
112
                                                },
113
 'RxD_ready_sim' => {
114
                                                    'type' => 'output',
115
                                                    'intfc_port' => 'RxD_ready_sim',
116
                                                    'intfc_name' => 'socket:RxD_sim[0]',
117
                                                    'range' => ''
118
                                                  },
119
                               'wb_dat_i' => {
120
                                               'intfc_port' => 'dat_i',
121
                                               'type' => 'input',
122
                                               'range' => 'Dw-1: 0',
123
                                               'intfc_name' => 'plug:wb_slave[0]'
124
                                             }
125
                             },
126
                  'unused' => {
127
                                'plug:wb_slave[0]' => [
128
                                                        'tag_i',
129
                                                        'err_o',
130
                                                        'cti_i',
131
                                                        'bte_i',
132
                                                        'rty_o',
133
                                                        'sel_i'
134
                                                      ]
135
                              },
136
 
137
                  'category' => 'Communication',
138
                  'plugs' => {
139
                               'wb_slave' => {
140
                                               'type' => 'num',
141
                                               '0' => {
142
                                                        'addr' => '0x9000_0000  0x90ff_ffff             UART16550 Controller',
143
                                                        'width' => 4,
144
                                                        'name' => 'wb_slave'
145
                                                      },
146
                                               'value' => 1
147
                                             },
148
                               'clk' => {
149
                                          'type' => 'num',
150
                                          '0' => {
151
                                                   'name' => 'clk'
152
                                                 },
153
                                          'value' => 1
154
                                        },
155
                               'reset' => {
156
                                            '0' => {
157
                                                     'name' => 'reset'
158
                                                   },
159
                                            'type' => 'num',
160
                                            'value' => 1
161
                                          }
162
                             },
163
                  'file_name' => 'mpsoc/rtl/src_peripheral/jtag/jtag_uart/pronoc_jtag_uart.v',
164
                  'parameters' => {
165
                                    'JDw' => {
166
                                               'type' => 'Fixed',
167
                                               'global_param' => 'Parameter',
168
                                               'default' => '32',
169
                                               'info' => 'Parameter',
170
                                               'redefine_param' => 1,
171
                                               'content' => ''
172
                                             },
173
                                    'JINDEXw' => {
174
                                                   'info' => 'Parameter',
175
                                                   'default' => '8',
176
                                                   'content' => '',
177
                                                   'redefine_param' => 1,
178
                                                   'global_param' => 'Parameter',
179
                                                   'type' => 'Fixed'
180
                                                 },
181
                                    'J2WBw' => {
182
                                                 'type' => 'Fixed',
183
                                                 'global_param' => 'Parameter',
184
                                                 'redefine_param' => 1,
185
                                                 'content' => '',
186
                                                 'default' => '(JTAG_CONNECT== "XILINX_JTAG_WB") ? 1+1+JDw+JAw : 1',
187
                                                 'info' => undef
188
                                               },
189
                                    'Dw' => {
190
                                              'default' => '32',
191
                                              'info' => 'Parameter',
192
                                              'redefine_param' => 1,
193
                                              'content' => '',
194
                                              'type' => 'Fixed',
195
                                              'global_param' => 'Localparam'
196
                                            },
197
                                    'JAw' => {
198
                                               'global_param' => 'Parameter',
199
                                               'type' => 'Fixed',
200
                                               'info' => 'Parameter',
201
                                               'default' => '32',
202
                                               'content' => '',
203
                                               'redefine_param' => 1
204
                                             },
205
                                    'JSTATUSw' => {
206
                                                    'global_param' => 'Parameter',
207
                                                    'type' => 'Fixed',
208
                                                    'content' => '',
209
                                                    'redefine_param' => 1,
210
                                                    'info' => 'Parameter',
211
                                                    'default' => '8'
212
                                                  },
213
                                    'INCLUDE_SIM_PRINTF' => {
214
                                                              'redefine_param' => 0,
215
                                                              'content' => 'NONE,SIMPLE_PRINTF,SIMPLE_PRINTF_LONG',
216
                                                              'default' => 'SIMPLE_PRINTF',
217
                                                              'info' => 'Select source code for printf command:
218
    "NONE":  Do not include simple_printf source code. Select "NONE" In case printf command is supported in , or it is not needed in the software code.
219
    "SIMPLE_PRINTF" Include a source code of printf command which supports a subset of formatted data: %%d, %%i, %%u, %%x, %%c, and %%s. long and floating formats are not supported.
220
    "SIMPLE_PRINTF_LONG" Include a source code of printf command which supports a subset of formatted data: %%d, %%i, %%u, %%x, %%c, %%l, and %%s.  floating format is not supported.',
221
                                                              'type' => 'Combo-box',
222
                                                              'global_param' => 'Don\'t include'
223
                                                            },
224
                                    'Aw' => {
225
                                              'type' => 'Fixed',
226
                                              'global_param' => 'Localparam',
227
                                              'redefine_param' => 1,
228
                                              'content' => '',
229
                                              'default' => '1',
230
                                              'info' => 'Parameter'
231
                                            },
232
                                    'JTAG_CONNECT' => {
233
                                                        'content' => '"XILINX_JTAG_WB","ALTERA_JTAG_WB"',
234
                                                        'redefine_param' => 1,
235
                                                        'info' => 'For Altera FPGAs define it as "ALTERA_JTAG_WB". In this case, the UART uses Virtual JTAG tap IP core from Altera lib to communicate with the Host PC.
236
 
237
For XILINX FPGAs define it as "XILINX_JTAG_WB". In this case, the UART uses BSCANE2 JTAG tap IP core from XILINX lib to communicate with the Host PC.',
238
                                                        'default' => '"XILINX_JTAG_WB"',
239
                                                        'global_param' => 'Parameter',
240
                                                        'type' => 'Combo-box'
241
                                                      },
242
                                    'JTAG_INDEX' => {
243
                                                      'content' => '',
244
                                                      'redefine_param' => 1,
245
                                                      'info' => 'The index number id used for communicating with this IP. all modules connected to the same jtag tab should have a unique JTAG index number. The default value is 126-CORE_ID. The core ID is the tile number in MPSoC. So if each tile has a UART, then each UART index would be different.',
246
                                                      'default' => '126-CORE_ID',
247
                                                      'global_param' => 'Parameter',
248
                                                      'type' => 'Entry'
249
                                                    },
250
                                    'BUFF_Aw' => {
251
                                                   'global_param' => 'Localparam',
252
                                                   'type' => 'Spin-button',
253
                                                   'content' => '2,16,1',
254
                                                   'redefine_param' => 1,
255
                                                   'info' => 'UART internal fifo buffer address width shared equally for send and recive FIFOs. Each of send and recive fifo buffers have 2^(BUFF_Aw-1) entry.',
256
                                                   'default' => '6'
257
                                                 },
258
                                    'SELw' => {
259
                                                'global_param' => 'Localparam',
260
                                                'type' => 'Fixed',
261
                                                'info' => 'Parameter',
262
                                                'default' => '4',
263
                                                'content' => '',
264
                                                'redefine_param' => 1
265
                                              },
266
                                    'JTAG_CHAIN' => {
267
                                                      'global_param' => 'Parameter',
268
                                                      'type' => 'Combo-box',
269
                                                      'info' => 'Only used for Virtex 4/5 devices. May be 1, 2, 3, or 4. It is the  BSCANE2 JTAG tap number. The default Jtag tap numbers are:
270
    4: JTAG runtime memory programmers.
271
    3: UART
272
    1,2: reserved',
273
                                                      'default' => '3',
274
                                                      'content' => '1,2,3,4',
275
                                                      'redefine_param' => 0
276
                                                    },
277
                                    'WB2Jw' => {
278
                                                 'content' => '',
279
                                                 'redefine_param' => 1,
280
                                                 'info' => '',
281
                                                 'default' => '(JTAG_CONNECT== "XILINX_JTAG_WB") ? 1+JSTATUSw+JINDEXw+1+JDw  : 1',
282
                                                 'global_param' => 'Parameter',
283
                                                 'type' => 'Fixed'
284
                                               },
285
                                    'TAGw' => {
286
                                                'type' => 'Fixed',
287
                                                'global_param' => 'Localparam',
288
                                                'default' => '3',
289
                                                'info' => 'Parameter',
290
                                                'redefine_param' => 1,
291
                                                'content' => ''
292
                                              }
293
                                  },
294
                  'gui_status' => {
295
                                    'status' => 'ideal',
296
                                    'timeout' => 0
297
                                  },
298
                  'ip_name' => 'ProNoC_jtag_uart',
299
                  'ports_order' => [
300
                                     'clk',
301
                                     'reset',
302
                                     'wb_dat_o',
303
                                     'wb_ack_o',
304
                                     'wb_adr_i',
305
                                     'wb_stb_i',
306
                                     'wb_cyc_i',
307
                                     'wb_we_i',
308
                                     'wb_dat_i',
309
                                     'wb_to_jtag',
310
                                     'jtag_to_wb',
311
                                                                         'RxD_din_sim',
312
                                     'RxD_wr_sim',
313
                                     'RxD_ready_sim'
314
                                   ],
315
                  'version' => 11,
316
                  'description' => 'A jtag uart module. Controled using Altera Vjtag or Xilinx BSCANE2.',
317
                  'parameters_order' => [
318
                                          'Aw',
319
                                          'SELw',
320
                                          'TAGw',
321
                                          'Dw',
322
                                          'BUFF_Aw',
323
                                          'JTAG_INDEX',
324
                                          'JDw',
325
                                          'JAw',
326
                                          'JINDEXw',
327
                                          'JSTATUSw',
328
                                          'JTAG_CHAIN',
329
                                          'JTAG_CONNECT',
330
                                          'J2WBw',
331
                                          'WB2Jw',
332
                                          'INCLUDE_SIM_PRINTF'
333
                                        ],
334
                  'hdl_files' => [
335
                                   '/mpsoc/rtl/src_peripheral/jtag/jtag_uart/pronoc_jtag_uart.v',
336
                                   '/mpsoc/rtl/src_peripheral/jtag/jtag_uart/altera_uart_simulator.v'
337
                                 ],
338
                  'sw_files' => [
339
                                  '/mpsoc/src_processor/src_lib/simple-printf'
340
                                ],
341
                  'sockets' => {
342
 'RxD_sim' => {
343
                                                'connection_num' => 'single connection',
344
                                                'value' => 1,
345
                                                'type' => 'num',
346
                                                '0' => {
347
                                                         'name' => 'RxD_sim'
348
                                                       }
349
                                              },
350
 
351
'jtag_to_wb' => {
352
                                                   'value' => 1,
353
                                                   'type' => 'num',
354
                                                   '0' => {
355
                                                            'name' => 'jtag_to_wb'
356
                                                          },
357
                                                   'connection_num' => 'single connection'
358
                                                 }
359
                               },
360
                  'modules' => {
361
                                 'uart_dual_port_ram' => {},
362
                                 'pronoc_jtag_uart' => {}
363
                               },
364
                  'system_c' => '
365
void outbyte(char c){jtag_putchar(c);} //called in printf();
366
 
367
char inbyte(){return jtag_getchar();}
368
 
369
void jtag_putchar(char ch){ //print one char from jtag_uart
370
        while((${IP}_CONTROL_REG&${IP}_CONTROL_WSPACE_MSK)==0);
371
        ${IP}_DATA_REG=ch;
372
}
373
 
374
char jtag_getchar(void){ //get one char from jtag_uart
375
        unsigned int data;
376
        data=${IP}_DATA_REG;
377
        while(!(data & ${IP}_DATA_RVALID_MSK)) //wait for terminal input
378
                data=${IP}_DATA_REG;
379
        return (data & ${IP}_DATA_DATA_MSK);
380
}
381
 
382
int jtag_scanstr(char* buf){ //scan string until  to buf, return str length
383
        char ch; unsigned int i=0;
384
        while(1){
385
                ch=jtag_getchar();
386
                if(ch==\'\\n\') { buf[i]=0; jtag_putchar(ch); i++; break; } //ENTER
387
                else if(ch==127) { printf("\\b \\b"); if(i>0) i--; } //backspace
388
                else { jtag_putchar(ch); buf[i]=ch; i++; } //valid
389
        }
390
        return i;
391
}
392
 
393
int jtag_scanint(int *num){ //return the scanned integer
394
        unsigned int curr_num,strlen,i=0;
395
        char str[11];
396
        strlen=jtag_scanstr(str); //scan str
397
        if(strlen>11) { printf("overflows 32-bit integer value\\n");return 1; } //check overflow
398
        *num=0;
399
        for(i=0;i
400
                curr_num=(unsigned int)str[i]-\'0\';
401
                if(curr_num>9); //not integer: do nothing
402
                else *num=*num*10+curr_num;  //is integer
403
        }
404
        return 0;
405
}
406
 
407
#ifdef INCLUDE_SIMPLE_PRINTF
408
        #include "simple-printf/printf.c"
409
#endif
410
 
411
#ifdef INCLUDE_SIMPLE_PRINTF_LONG
412
        #include "simple-printf/prinf_long.c"
413
#endif
414
 
415
 
416
',
417
                  'module_name' => 'pronoc_jtag_uart'
418
                }, 'ip_gen' );

powered by: WebSVN 2.1.0

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