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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
#######################################################################
2
##      File: altera_jtag_uart.IP
3
##
4
##      Copyright (C) 2014-2019  Alireza Monemi
5
##
6
##      This file is part of ProNoC 2.0.0
7
##
8
##      WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
9
##      MAY CAUSE UNEXPECTED BEHAIVOR.
10
################################################################################
11
 
12
$ipgen = bless( {
13
                  'parameters_order' => [
14
                                          'SIM_BUFFER_SIZE',
15
                                          'SIM_WAIT_COUNT',
16
                                          'INCLUDE_SIM_PRINTF'
17
                                        ],
18
                  'ip_name' => 'altera_jtag_uart',
19
                  'modules' => {
20
                                 'altera_jtag_uart' => {}
21
                               },
22
                  'system_h' => '
23
 
24
#define ${IP}_DATA_REG                                  (*((volatile unsigned int *) ($BASE)))
25
#define ${IP}_CONTROL_REG                               (*((volatile unsigned int *) ($BASE+4)))
26
#define ${IP}_CONTROL_WSPACE_MSK        0xFFFF0000
27
#define ${IP}_DATA_RVALID_MSK                   0x00008000
28
#define ${IP}_DATA_DATA_MSK                     0x000000FF
29
 
30
//////////////////////////////*basic function for jtag_uart*////////////////////////////////////////
31
void jtag_putchar(char ch);
32
char jtag_getchar(void);
33
void outbyte(char c); //called in printf();
34
char inbyte(void);
35
void jtag_putchar(char ch);
36
char jtag_getchar(void);
37
int jtag_scanstr(char* buf);
38
int jtag_scanint(int *num);
39
/////////////////////////////*END: basic function for jtag_uart*////////////////////////////////////
40
 
41
#define INCLUDE_${INCLUDE_SIM_PRINTF}
42
 
43
#ifdef INCLUDE_SIMPLE_PRINTF
44
        #include "simple-printf/printf.h"
45
#endif
46
 
47
#ifdef INCLUDE_SIMPLE_PRINTF_LONG
48
        #include "simple-printf/printf.h"
49
#endif',
50
                  'file_name' => 'mpsoc/rtl/src_peripheral/jtag/jtag_uart/altera_jtag_uart.v',
51
                  'module_name' => 'altera_jtag_uart',
52
                  'ports' => {
53
                               's_cyc_i' => {
54
                                              'intfc_name' => 'plug:wb_slave[0]',
55
                                              'range' => '',
56
                                              'type' => 'input',
57
                                              'intfc_port' => 'cyc_i'
58
                                            },
59
                               's_cti_i' => {
60
                                              'range' => '2    :   0',
61
                                              'intfc_name' => 'plug:wb_slave[0]',
62
                                              'intfc_port' => 'cti_i',
63
                                              'type' => 'input'
64
                                            },
65
                               's_dat_i' => {
66
                                              'intfc_port' => 'dat_i',
67
                                              'type' => 'input',
68
                                              'range' => '31       :   0',
69
                                              'intfc_name' => 'plug:wb_slave[0]'
70
                                            },
71
                               'RxD_wr_sim' => {
72
                                                 'intfc_port' => 'RxD_wr_sim',
73
                                                 'type' => 'input',
74
                                                 'range' => '',
75
                                                 'intfc_name' => 'socket:RxD_sim[0]'
76
                                               },
77
                               's_we_i' => {
78
                                             'intfc_port' => 'we_i',
79
                                             'type' => 'input',
80
                                             'range' => '',
81
                                             'intfc_name' => 'plug:wb_slave[0]'
82
                                           },
83
                               'RxD_din_sim' => {
84
                                                  'intfc_port' => 'RxD_din_sim',
85
                                                  'type' => 'input',
86
                                                  'range' => '7:0 ',
87
                                                  'intfc_name' => 'socket:RxD_sim[0]'
88
                                                },
89
                               'clk' => {
90
                                          'intfc_port' => 'clk_i',
91
                                          'type' => 'input',
92
                                          'range' => '',
93
                                          'intfc_name' => 'plug:clk[0]'
94
                                        },
95
                               's_stb_i' => {
96
                                              'intfc_port' => 'stb_i',
97
                                              'type' => 'input',
98
                                              'range' => '',
99
                                              'intfc_name' => 'plug:wb_slave[0]'
100
                                            },
101
                               'reset' => {
102
                                            'intfc_port' => 'reset_i',
103
                                            'type' => 'input',
104
                                            'range' => '',
105
                                            'intfc_name' => 'plug:reset[0]'
106
                                          },
107
                               's_addr_i' => {
108
                                               'range' => '',
109
                                               'intfc_name' => 'plug:wb_slave[0]',
110
                                               'intfc_port' => 'adr_i',
111
                                               'type' => 'input'
112
                                             },
113
                               'irq' => {
114
                                          'range' => '',
115
                                          'intfc_name' => 'plug:interrupt_peripheral[0]',
116
                                          'intfc_port' => 'int_o',
117
                                          'type' => 'output'
118
                                        },
119
                               's_dat_o' => {
120
                                              'range' => '31      :   0',
121
                                              'intfc_name' => 'plug:wb_slave[0]',
122
                                              'intfc_port' => 'dat_o',
123
                                              'type' => 'output'
124
                                            },
125
                               'RxD_ready_sim' => {
126
                                                    'type' => 'output',
127
                                                    'intfc_port' => 'RxD_ready_sim',
128
                                                    'intfc_name' => 'socket:RxD_sim[0]',
129
                                                    'range' => ''
130
                                                  },
131
                               's_sel_i' => {
132
                                              'intfc_port' => 'sel_i',
133
                                              'type' => 'input',
134
                                              'range' => '3    :   0',
135
                                              'intfc_name' => 'plug:wb_slave[0]'
136
                                            },
137
                               's_ack_o' => {
138
                                              'range' => '',
139
                                              'intfc_name' => 'plug:wb_slave[0]',
140
                                              'intfc_port' => 'ack_o',
141
                                              'type' => 'output'
142
                                            }
143
                             },
144
                  'sw_files' => [
145
                                  '/mpsoc/src_processor/src_lib/simple-printf'
146
                                ],
147
                  'gui_status' => {
148
                                    'timeout' => 0,
149
                                    'status' => 'ideal'
150
                                  },
151
                  'system_c' => '
152
 
153
void outbyte(char c){jtag_putchar(c);} //called in printf();
154
 
155
char inbyte(){return jtag_getchar();}
156
 
157
void jtag_putchar(char ch){ //print one char from jtag_uart
158
        while((${IP}_CONTROL_REG&${IP}_CONTROL_WSPACE_MSK)==0);
159
        ${IP}_DATA_REG=ch;
160
}
161
 
162
char jtag_getchar(void){ //get one char from jtag_uart
163
        unsigned int data;
164
        data=${IP}_DATA_REG;
165
        while(!(data & ${IP}_DATA_RVALID_MSK)) //wait for terminal input
166
                data=${IP}_DATA_REG;
167
        return (data & ${IP}_DATA_DATA_MSK);
168
}
169
 
170
int jtag_scanstr(char* buf){ //scan string until  to buf, return str length
171
        char ch; unsigned int i=0;
172
        while(1){
173
                ch=jtag_getchar();
174
                if(ch==\'\\n\') { buf[i]=0; jtag_putchar(ch); i++; break; } //ENTER
175
                else if(ch==127) { printf("\\b \\b"); if(i>0) i--; } //backspace
176
                else { jtag_putchar(ch); buf[i]=ch; i++; } //valid
177
        }
178
        return i;
179
}
180
 
181
int jtag_scanint(int *num){ //return the scanned integer
182
        unsigned int curr_num,strlen,i=0;
183
        char str[11];
184
        strlen=jtag_scanstr(str); //scan str
185
        if(strlen>11) { printf("overflows 32-bit integer value\\n");return 1; } //check overflow
186
        *num=0;
187
        for(i=0;i
188
                curr_num=(unsigned int)str[i]-\'0\';
189
                if(curr_num>9); //not integer: do nothing
190
                else *num=*num*10+curr_num;  //is integer
191
        }
192
        return 0;
193
}
194
 
195
#ifdef INCLUDE_SIMPLE_PRINTF
196
        #include "simple-printf/printf.c"
197
#endif
198
 
199
#ifdef INCLUDE_SIMPLE_PRINTF_LONG
200
        #include "simple-printf/prinf_long.c"
201
#endif
202
 
203
 
204
',
205
                  'category' => 'Communication',
206
                  'parameters' => {
207
                                    'SIM_WAIT_COUNT' => {
208
                                                          'global_param' => 'Localparam',
209
                                                          'info' => 'This parameter is valid only in simulation.
210
If internal buffer has a data, the internal timer incremented by one in each clock cycle. If the timer reaches the WAIT_COUNT value, it writes the buffer value on the simulator terminal.',
211
                                                          'content' => '2,100000,1',
212
                                                          'redefine_param' => 1,
213
                                                          'default' => '1000',
214
                                                          'type' => 'Spin-button'
215
                                                        },
216
                                    'SIM_BUFFER_SIZE' => {
217
                                                           'info' => 'Internal buffer size.
218
This parameter is valid only in simulation.
219
If internal buffer overflows, the buffer content are displayed on simulator terminal.',
220
                                                           'content' => '10,10000,1',
221
                                                           'global_param' => 'Localparam',
222
                                                           'type' => 'Spin-button',
223
                                                           'default' => '100',
224
                                                           'redefine_param' => 1
225
                                                         },
226
                                    'INCLUDE_SIM_PRINTF' => {
227
                                                              'info' => 'Select source code for printf command:
228
    "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.
229
    "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.
230
    "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.
231
        ',
232
                                                              'content' => 'NONE,SIMPLE_PRINTF,SIMPLE_PRINTF_LONG',
233
                                                              'global_param' => 'Don\'t include',
234
                                                              'redefine_param' => 0,
235
                                                              'default' => 'SIMPLE_PRINTF',
236
                                                              'type' => 'Combo-box'
237
                                                            },
238
 
239
                                  },
240
                  'ports_order' => [
241
                                     'reset',
242
                                     'clk',
243
                                     'irq',
244
                                     's_dat_i',
245
                                     's_sel_i',
246
                                     's_addr_i',
247
                                     's_cti_i',
248
                                     's_stb_i',
249
                                     's_cyc_i',
250
                                     's_we_i',
251
                                     's_dat_o',
252
                                     's_ack_o',
253
                                     'RxD_din_sim',
254
                                     'RxD_wr_sim',
255
                                     'RxD_ready_sim'
256
                                   ],
257
                  'description' => 'The Altera JTAG UART IP core (qsys_jtag_uart) with Wishbone bus interface.',
258
                  'version' => 20,
259
                  'unused' => {
260
                                'plug:wb_slave[0]' => [
261
                                                        'tag_i',
262
                                                        'bte_i',
263
                                                        'rty_o',
264
                                                        'err_o'
265
                                                      ]
266
                              },
267
                  'sockets' => {
268
                                 'RxD_sim' => {
269
                                                'connection_num' => 'single connection',
270
                                                'value' => 1,
271
                                                'type' => 'num',
272
                                                '0' => {
273
                                                         'name' => 'RxD_sim'
274
                                                       }
275
                                              }
276
                               },
277
                  'plugs' => {
278
                               'interrupt_peripheral' => {
279
                                                           'value' => 1,
280
                                                           'type' => 'num',
281
                                                           '0' => {
282
                                                                    'name' => 'interrupt_peripheral'
283
                                                                  }
284
                                                         },
285
                               'reset' => {
286
                                            'value' => 1,
287
                                            'type' => 'num',
288
                                            '0' => {
289
                                                     'name' => 'reset'
290
                                                   }
291
                                          },
292
                               'clk' => {
293
                                          'value' => 1,
294
                                          'type' => 'num',
295
                                          '0' => {
296
                                                   'name' => 'clk'
297
                                                 }
298
                                        },
299
                               'wb_slave' => {
300
                                               'value' => 1,
301
                                               'type' => 'num',
302
                                               '0' => {
303
                                                        'addr' => '0x9000_0000  0x90ff_ffff             UART16550 Controller',
304
                                                        'width' => 5,
305
                                                        'name' => 'wb_slave'
306
                                                      }
307
                                             }
308
                             },
309
                  'hdl_files' => [
310
                                   '/mpsoc/rtl/src_peripheral/jtag/jtag_uart/altera_jtag_uart.v',
311
                                   '/mpsoc/rtl/src_peripheral/jtag/jtag_uart/altera_uart_simulator.v'
312
                                 ]
313
                }, 'ip_gen' );

powered by: WebSVN 2.1.0

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