1 |
39 |
julius |
/*$$HEADER*/
|
2 |
|
|
/******************************************************************************/
|
3 |
|
|
/* */
|
4 |
|
|
/* H E A D E R I N F O R M A T I O N */
|
5 |
|
|
/* */
|
6 |
|
|
/******************************************************************************/
|
7 |
|
|
|
8 |
|
|
// Project Name : OpenRISC Debug Proxy
|
9 |
|
|
// File Name : or_debug_proxy.c
|
10 |
|
|
// Prepared By : jb
|
11 |
|
|
// Project Start : 2008-10-01
|
12 |
|
|
|
13 |
|
|
/*$$COPYRIGHT NOTICE*/
|
14 |
|
|
/******************************************************************************/
|
15 |
|
|
/* */
|
16 |
|
|
/* C O P Y R I G H T N O T I C E */
|
17 |
|
|
/* */
|
18 |
|
|
/******************************************************************************/
|
19 |
|
|
/*
|
20 |
|
|
This library is free software; you can redistribute it and/or
|
21 |
|
|
modify it under the terms of the GNU Lesser General Public
|
22 |
|
|
License as published by the Free Software Foundation;
|
23 |
|
|
version 2.1 of the License, a copy of which is available from
|
24 |
|
|
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt.
|
25 |
|
|
|
26 |
|
|
This library is distributed in the hope that it will be useful,
|
27 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
28 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
29 |
|
|
Lesser General Public License for more details.
|
30 |
|
|
|
31 |
|
|
You should have received a copy of the GNU Lesser General Public
|
32 |
|
|
License along with this library; if not, write to the Free Software
|
33 |
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
34 |
|
|
*/
|
35 |
|
|
|
36 |
|
|
/*$$DESCRIPTION*/
|
37 |
|
|
/******************************************************************************/
|
38 |
|
|
/* */
|
39 |
|
|
/* D E S C R I P T I O N */
|
40 |
|
|
/* */
|
41 |
|
|
/******************************************************************************/
|
42 |
|
|
//
|
43 |
|
|
// The entry point for the OpenRISC debug proxy console application. Is
|
44 |
|
|
// compilable under both Linux/Unix systems and Cygwin Windows.
|
45 |
|
|
//
|
46 |
|
|
|
47 |
|
|
#include <assert.h>
|
48 |
|
|
#include <stdio.h>
|
49 |
|
|
#include <ctype.h>
|
50 |
|
|
#include <string.h>
|
51 |
|
|
#include <stdlib.h>
|
52 |
|
|
#include <unistd.h>
|
53 |
|
|
#include <stdarg.h>
|
54 |
|
|
#include <sys/stat.h>
|
55 |
|
|
#include <sys/types.h>
|
56 |
|
|
|
57 |
|
|
// Windows includes
|
58 |
|
|
#ifdef CYGWIN_COMPILE
|
59 |
|
|
#include <windows.h>
|
60 |
|
|
#include "win_FTCJTAG.h"
|
61 |
|
|
#include "win_FTCJTAG_ptrs.h"
|
62 |
|
|
#else
|
63 |
|
|
#include <signal.h>
|
64 |
|
|
void catch_sigint(int sig_num); // First param must be "int"
|
65 |
|
|
#endif
|
66 |
|
|
|
67 |
|
|
#include "gdb.h"
|
68 |
|
|
|
69 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
70 |
|
|
#include "usb_functions.h"
|
71 |
|
|
#endif
|
72 |
|
|
|
73 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
74 |
|
|
#include "vpi_functions.h"
|
75 |
|
|
#endif
|
76 |
|
|
|
77 |
|
|
#include "or_debug_proxy.h"
|
78 |
|
|
|
79 |
|
|
// Defines of endpoint numbers
|
80 |
|
|
#define ENDPOINT_TARGET_NONE 0
|
81 |
|
|
#define ENDPOINT_TARGET_USB 1
|
82 |
|
|
#define ENDPOINT_TARGET_VPI 2
|
83 |
|
|
|
84 |
|
|
static int endpoint_target; // Either VPI interface via sockets, or the USB device
|
85 |
|
|
|
86 |
|
|
#define GDB_PROTOCOL_JTAG 1
|
87 |
|
|
#define GDB_PROTOCOL_RSP 2
|
88 |
|
|
#define GDB_PROTOCOL_NONE 3
|
89 |
|
|
|
90 |
|
|
int err; // Global error value
|
91 |
|
|
|
92 |
|
|
/* Currently selected scan chain - just to prevent unnecessary transfers. */
|
93 |
|
|
int current_chain = -1;
|
94 |
|
|
|
95 |
|
|
/* The chain that should be currently selected. */
|
96 |
|
|
int dbg_chain = -1;
|
97 |
|
|
|
98 |
|
|
int main(int argc, char *argv[]) {
|
99 |
|
|
|
100 |
|
|
char *s;
|
101 |
|
|
int gdb_protocol = GDB_PROTOCOL_NONE;
|
102 |
|
|
endpoint_target = ENDPOINT_TARGET_NONE;
|
103 |
|
|
int inp_arg = 1;
|
104 |
|
|
|
105 |
|
|
// Check we were compiled with at least one endpoint enabled
|
106 |
|
|
#ifndef USB_ENDPOINT_ENABLED
|
107 |
|
|
#ifndef VPI_ENDPOINT_ENABLED
|
108 |
|
|
printf("No endpoints enabled.\nRecompile the proxy with at least one endpoint enabled\n");
|
109 |
|
|
exit(0);
|
110 |
|
|
#endif
|
111 |
|
|
#endif
|
112 |
|
|
|
113 |
|
|
// init our global error number
|
114 |
|
|
err = DBG_ERR_OK;
|
115 |
|
|
|
116 |
|
|
// Parse input options
|
117 |
|
|
if (argc < 3)
|
118 |
|
|
{
|
119 |
|
|
print_usage();
|
120 |
|
|
exit(1);
|
121 |
|
|
}
|
122 |
|
|
|
123 |
|
|
err = DBG_ERR_OK;
|
124 |
|
|
srand(getpid());
|
125 |
|
|
|
126 |
|
|
// Parse through the input, check what we've been given
|
127 |
|
|
|
128 |
|
|
while ( argv[inp_arg] != NULL )
|
129 |
|
|
{
|
130 |
46 |
julius |
if(strcmp(argv[inp_arg], "-r") == 0)
|
131 |
39 |
julius |
{
|
132 |
|
|
gdb_protocol = GDB_PROTOCOL_RSP;
|
133 |
|
|
endpoint_target = ENDPOINT_TARGET_USB;
|
134 |
|
|
}
|
135 |
|
|
else if(strcmp(argv[inp_arg], "-v") == 0)
|
136 |
|
|
{
|
137 |
|
|
gdb_protocol = GDB_PROTOCOL_RSP;
|
138 |
|
|
endpoint_target = ENDPOINT_TARGET_VPI;
|
139 |
|
|
}
|
140 |
|
|
else
|
141 |
|
|
{
|
142 |
|
|
serverPort = strtol(argv[2],&s,10);
|
143 |
|
|
}
|
144 |
|
|
|
145 |
|
|
inp_arg++;
|
146 |
|
|
}
|
147 |
|
|
|
148 |
|
|
if(endpoint_target == ENDPOINT_TARGET_NONE || gdb_protocol == GDB_PROTOCOL_NONE || serverPort > 65535 || *s != '\0')
|
149 |
|
|
{
|
150 |
|
|
print_usage();
|
151 |
|
|
exit(1);
|
152 |
|
|
}
|
153 |
|
|
|
154 |
|
|
#ifdef CYGWIN_COMPILE
|
155 |
|
|
// Load the FTCJTAG DLL function pointers
|
156 |
|
|
if (getFTDIJTAGFunctions() < 0){
|
157 |
|
|
exit(-1);
|
158 |
|
|
}
|
159 |
|
|
#endif
|
160 |
|
|
|
161 |
|
|
#ifndef CYGWIN_COMPILE
|
162 |
|
|
// Install a signal handler to exit gracefully
|
163 |
|
|
// when we receive a sigint
|
164 |
|
|
signal(SIGINT, catch_sigint);
|
165 |
|
|
#endif
|
166 |
|
|
|
167 |
|
|
/* Initialise connection to our OR1k system */
|
168 |
|
|
current_chain = -1;
|
169 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
170 |
|
|
/* USB Endpoint */
|
171 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB)
|
172 |
|
|
{
|
173 |
|
|
printf("\nConnecting to OR1k via USB debug cable\n\n");
|
174 |
|
|
if ((err = usb_dbg_reset())) goto JtagIfError;
|
175 |
|
|
dbg_test(); // Perform some tests
|
176 |
|
|
}
|
177 |
|
|
#endif
|
178 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
179 |
|
|
/* RTL simulation endpoint */
|
180 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI){
|
181 |
|
|
printf("\nConnecting to OR1k RTL simulation\n\n");
|
182 |
|
|
// Connect to the (hopefully) already running RTL simulation server running via VPI
|
183 |
|
|
vpi_fd = vpi_connect();
|
184 |
|
|
|
185 |
|
|
if ((err = vpi_dbg_reset())) goto JtagIfError;
|
186 |
|
|
vpi_dbg_test(); // Perform some tests
|
187 |
|
|
}
|
188 |
|
|
#endif
|
189 |
|
|
|
190 |
|
|
/* We have a connection to the target system. Now establish server connection. */
|
191 |
46 |
julius |
if(gdb_protocol == GDB_PROTOCOL_RSP)
|
192 |
|
|
{ // Connect to RSP server
|
193 |
|
|
/* RSP always starts stalled as though we have just reset the processor. */
|
194 |
|
|
// rsp_exception (EXCEPT_TRAP);
|
195 |
|
|
handle_rsp ();
|
196 |
39 |
julius |
// if((server_fd = GetServerSocket("or1ksim","tcp", serverPort))) {
|
197 |
46 |
julius |
}else {
|
198 |
39 |
julius |
fprintf(stderr,"Cannot start RSP Proxy server on port %d\n", serverPort);
|
199 |
|
|
exit(-1);
|
200 |
|
|
}
|
201 |
|
|
|
202 |
|
|
|
203 |
|
|
JtagIfError:
|
204 |
|
|
fprintf(stderr,"Connection via USB debug cable failed (err = %d).\nPlease ensure the device is attached and correctly installed\n\n", err);
|
205 |
|
|
exit(-1);
|
206 |
|
|
return 0;
|
207 |
|
|
}
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
int dbg_reset()
|
211 |
|
|
{
|
212 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
213 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_reset();
|
214 |
|
|
#endif
|
215 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
216 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_reset();
|
217 |
|
|
#endif
|
218 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
219 |
|
|
}
|
220 |
|
|
|
221 |
|
|
void dbg_test() {
|
222 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
223 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) usb_dbg_test();
|
224 |
|
|
#endif
|
225 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
226 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) vpi_dbg_test();
|
227 |
|
|
#endif
|
228 |
|
|
}
|
229 |
|
|
|
230 |
|
|
/* Set TAP instruction register */
|
231 |
|
|
int dbg_set_tap_ir(uint32_t ir) {
|
232 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
233 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) usb_set_tap_ir(ir);
|
234 |
|
|
#endif
|
235 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
236 |
|
|
}
|
237 |
|
|
|
238 |
|
|
/* Sets scan chain. */
|
239 |
|
|
int dbg_set_chain(uint32_t chain) {
|
240 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
241 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_set_chain(chain);
|
242 |
|
|
#endif
|
243 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
244 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_set_chain(chain);
|
245 |
|
|
#endif
|
246 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
247 |
|
|
}
|
248 |
|
|
|
249 |
|
|
/* sends out a command with 32bit address and 16bit length, if len >= 0 */
|
250 |
|
|
int dbg_command(uint32_t type, uint32_t adr, uint32_t len) {
|
251 |
|
|
// This is never called by any of the VPI functions, so only USB endpoint
|
252 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
253 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_command(type,adr,len);
|
254 |
|
|
#endif
|
255 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
256 |
|
|
}
|
257 |
|
|
|
258 |
|
|
/* writes a ctrl reg */
|
259 |
|
|
int dbg_ctrl(uint32_t reset, uint32_t stall) {
|
260 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
261 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_ctrl(reset, stall);
|
262 |
|
|
#endif
|
263 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
264 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_ctrl(reset, stall);
|
265 |
|
|
#endif
|
266 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
267 |
|
|
}
|
268 |
|
|
|
269 |
|
|
/* reads control register */
|
270 |
|
|
int dbg_ctrl_read(uint32_t *reset, uint32_t *stall) {
|
271 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
272 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_ctrl_read(reset, stall);
|
273 |
|
|
#endif
|
274 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
275 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_ctrl_read(reset, stall);
|
276 |
|
|
#endif
|
277 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
278 |
|
|
}
|
279 |
|
|
|
280 |
|
|
/* issues a burst read/write */
|
281 |
|
|
int dbg_go(unsigned char *data, uint16_t len, uint32_t read) {
|
282 |
|
|
// Only USB endpouint32_t option here
|
283 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
284 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_go(data, len, read);
|
285 |
|
|
#endif
|
286 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
287 |
|
|
}
|
288 |
|
|
|
289 |
|
|
/* read a word from wishbone */
|
290 |
|
|
int dbg_wb_read32(uint32_t adr, uint32_t *data) {
|
291 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
292 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_wb_read32(adr, data);
|
293 |
|
|
#endif
|
294 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
295 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_wb_read32(adr, data);
|
296 |
|
|
#endif
|
297 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
298 |
|
|
}
|
299 |
|
|
|
300 |
46 |
julius |
/* write a word to wishbone */
|
301 |
|
|
int dbg_wb_write8(uint32_t adr, uint8_t data) {
|
302 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
303 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_wb_write8( adr, data);
|
304 |
|
|
#endif
|
305 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
306 |
|
|
}
|
307 |
39 |
julius |
|
308 |
|
|
/* write a word to wishbone */
|
309 |
|
|
int dbg_wb_write32(uint32_t adr, uint32_t data) {
|
310 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
311 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_wb_write32( adr, data);
|
312 |
|
|
#endif
|
313 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
314 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_wb_write32( adr, data);
|
315 |
|
|
#endif
|
316 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
317 |
|
|
}
|
318 |
|
|
|
319 |
|
|
/* read a block from wishbone */
|
320 |
|
|
int dbg_wb_read_block32(uint32_t adr, uint32_t *data, uint32_t len) {
|
321 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
322 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_wb_read_block32( adr, data, len);
|
323 |
|
|
#endif
|
324 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
325 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_wb_read_block32( adr, data, len);
|
326 |
|
|
#endif
|
327 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
328 |
|
|
}
|
329 |
|
|
|
330 |
|
|
/* write a block to wishbone */
|
331 |
|
|
int dbg_wb_write_block32(uint32_t adr, uint32_t *data, uint32_t len) {
|
332 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
333 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_wb_write_block32( adr, data, len);
|
334 |
|
|
#endif
|
335 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
336 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_wb_write_block32( adr, data, len);
|
337 |
|
|
#endif
|
338 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
339 |
|
|
}
|
340 |
|
|
|
341 |
|
|
/* read a register from cpu */
|
342 |
47 |
julius |
int dbg_cpu0_read(uint32_t adr, uint32_t *data, uint32_t length) {
|
343 |
39 |
julius |
#ifdef USB_ENDPOINT_ENABLED
|
344 |
47 |
julius |
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_cpu0_read( adr, data, length);
|
345 |
39 |
julius |
#endif
|
346 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
347 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_cpu0_read( adr, data);
|
348 |
|
|
#endif
|
349 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
350 |
|
|
}
|
351 |
|
|
|
352 |
|
|
/* write a cpu register */
|
353 |
47 |
julius |
int dbg_cpu0_write(uint32_t adr, uint32_t *data, uint32_t length) {
|
354 |
39 |
julius |
#ifdef USB_ENDPOINT_ENABLED
|
355 |
47 |
julius |
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_cpu0_write( adr, data, length);
|
356 |
39 |
julius |
#endif
|
357 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
358 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_cpu0_write( adr, data);
|
359 |
|
|
#endif
|
360 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
361 |
|
|
}
|
362 |
|
|
|
363 |
|
|
/* write a cpu module register */
|
364 |
|
|
int dbg_cpu0_write_ctrl(uint32_t adr, unsigned char data) {
|
365 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
366 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_cpu0_write_ctrl( adr, data);
|
367 |
|
|
#endif
|
368 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
369 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_cpu0_write_ctrl( adr, data);
|
370 |
|
|
#endif
|
371 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
372 |
|
|
}
|
373 |
|
|
|
374 |
|
|
|
375 |
|
|
/* read a register from cpu module */
|
376 |
|
|
int dbg_cpu0_read_ctrl(uint32_t adr, unsigned char *data) {
|
377 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
378 |
|
|
if (endpoint_target == ENDPOINT_TARGET_USB) return usb_dbg_cpu0_read_ctrl( adr, data);
|
379 |
|
|
#endif
|
380 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
381 |
|
|
if (endpoint_target == ENDPOINT_TARGET_VPI) return vpi_dbg_cpu0_read_ctrl( adr, data);
|
382 |
|
|
#endif
|
383 |
|
|
return DBG_ERR_INVALID_ENDPOINT;
|
384 |
|
|
}
|
385 |
|
|
|
386 |
|
|
|
387 |
|
|
void test_sdram(void) {
|
388 |
|
|
return;
|
389 |
|
|
}
|
390 |
|
|
|
391 |
|
|
// Close down gracefully when we receive any kill signals
|
392 |
|
|
void catch_sigint(int sig_num)
|
393 |
|
|
{
|
394 |
|
|
// Close down any potentially open sockets and USB handles
|
395 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
396 |
|
|
if (vpi_fd) close(vpi_fd);
|
397 |
|
|
#endif
|
398 |
|
|
if (server_fd) close(server_fd);
|
399 |
|
|
gdb_close();
|
400 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
401 |
|
|
usb_close_device_handle();
|
402 |
|
|
#endif
|
403 |
|
|
printf("\nInterrupt signal received. Closing down connections and exiting\n\n");
|
404 |
|
|
exit(0);
|
405 |
|
|
}
|
406 |
|
|
|
407 |
|
|
void print_usage()
|
408 |
|
|
{
|
409 |
|
|
printf("Invalid or insufficient arguments\n");
|
410 |
|
|
printf("\n");
|
411 |
|
|
printf("OpenRISC GDB proxy server usage: or_debug_proxy -server_type port\n");
|
412 |
|
|
printf("\n");
|
413 |
|
|
printf("server_type:\n");
|
414 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
415 |
|
|
printf("\t-r Start a server using RSP, connection to hadware target via\n\t USB\n");
|
416 |
|
|
printf("\t-j Start a server using legacy OR remote JTAG protocol, to\n\t hardware target via USB\n");
|
417 |
|
|
#endif
|
418 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
419 |
|
|
printf("\t-v Start a server using RSP, connection to RTL sim. VPI server\n\t target via sockets\n");
|
420 |
|
|
#endif
|
421 |
|
|
printf("\n");
|
422 |
|
|
printf("port:\n");
|
423 |
|
|
printf("\tAny free port within the usable range of 0 - 65535\n");
|
424 |
|
|
printf("\n");
|
425 |
|
|
printf("Example:\n");
|
426 |
|
|
#ifdef USB_ENDPOINT_ENABLED
|
427 |
|
|
printf("\tStart a GDB server on port 5555, using RSP, connecting to\n\thardware target via USB\n");
|
428 |
|
|
printf("\tor_debug_proxy -r 5555\n");
|
429 |
|
|
printf("\n");
|
430 |
|
|
#endif
|
431 |
|
|
#ifdef VPI_ENDPOINT_ENABLED
|
432 |
|
|
printf("\tStart a GDB server on port 5555, using RSP, connecting to\n\trtl target via VPI\n");
|
433 |
|
|
printf("\tor_debug_proxy -v 5555\n");
|
434 |
|
|
printf("\n");
|
435 |
|
|
#endif
|
436 |
|
|
fflush (stdout);
|
437 |
|
|
}
|