On Thu, Mar 8, 2012 at 10:45 PM, Franck Jullien
<[email protected]> wrote:
> Hi,
>
> I'm working on using openOCD on an Altera target using the Virtual
> JTAG. It is working but it is very very slow
> This is the log from the -d 3 output when issuing a x/4xw 0 command with gdb:

Hi,

This sounds good. I'm happy to see the OpenOCD port being put to use.

>
> Info : 508 201633 server.c:80 add_connection(): accepting 'gdb'
> connection from 50001
>
>        (time in ms)
>             |
> Debug: 509 201634 breakpoints.c:201
> breakpoint_clear_target_internal(): Delete all breakpoints for target:
> altera.cpu
> Debug: 510 201634 breakpoints.c:356 watchpoint_clear_target(): Delete
> all watchpoints for target: altera.cpu
> Debug: 511 201634 target.c:1065 target_call_event_callbacks(): target
> event 25 (gdb-attach)
> Debug: 512 201634 gdb_server.c:884 gdb_new_connection(): New GDB
> Connection: 1, Target altera.cpu, state: halted
> Debug: 513 201634 gdb_server.c:2209 gdb_input_inner(): received
> packet: 'qSupported:qRelocInsn+'
> Debug: 514 201635 gdb_server.c:2209 gdb_input_inner(): received
> packet: 'QStartNoAckMode'
> Warn : 515 203596 gdb_server.c:658 gdb_get_packet_inner():
> acknowledgment received, but no packet pending
> Debug: 516 203596 gdb_server.c:2209 gdb_input_inner(): received packet: 'Hg0'
> Debug: 517 203597 gdb_server.c:2209 gdb_input_inner(): received packet: '?'
> Debug: 518 205490 gdb_server.c:2209 gdb_input_inner(): received packet: 'Hc-1'
> Debug: 519 207372 gdb_server.c:2209 gdb_input_inner(): received packet: 'qC'
> Debug: 520 209261 gdb_server.c:2209 gdb_input_inner(): received
> packet: 'qAttached'
> Debug: 521 211176 gdb_server.c:2209 gdb_input_inner(): received packet: 'g'
> Debug: 522 211176 or1k.c:924 or1k_get_gdb_reg_list():  -
> Debug: 523 211176 or1k.c:91 or1k_save_context():  -
> Debug: 524 213095 gdb_server.c:2209 gdb_input_inner(): received
> packet: 'qTStatus'
> Debug: 525 394767 gdb_server.c:2209 gdb_input_inner(): received packet: 'm0,4'
> Debug: 526 394767 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000000, len: 0x00000004
> Debug: 527 394767 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000000
> Debug: 528 394767 or1k.c:759 or1k_read_memory(): address: 0x00000000,
> size: 0x00000004, count: 0x00000001
> Debug: 529 394767 or1k_jtag.c:219
> or1k_jtag_mohor_debug_select_module():  setting mohor debug IF module:
> 0
> Debug: 530 395875 or1k_jtag.c:260
> or1k_jtag_mohor_debug_select_module():  setting mohor debug IF OK
>
> Debug: 531 395875 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000000 LEN:4
> Debug: 532 397776 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> ----------> 2 seconds

This is odd, because it looks like the communication with the JTAG TAP
was fine. At least writing was OK.

>
> Debug: 533 397776 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 534 399364 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> ----------> 2 seconds
>
> Debug: 535 399364 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 01
> Debug: 536 399364 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): d5
> Debug: 537 399364 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): c4
> Warn : 538 399365 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Warn : 539 399365 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 540 399365 gdb_server.c:2209 gdb_input_inner(): received packet: 'm4,4'
> Debug: 541 399365 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000004, len: 0x00000004
> Debug: 542 399365 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000004
> Debug: 543 399365 or1k.c:759 or1k_read_memory(): address: 0x00000004,
> size: 0x00000004, count: 0x00000001
>
> Debug: 544 399365 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000004 LEN:4
> Debug: 545 401251 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> ---------------> 2 seconds...and so one
>
> Debug: 546 401251 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 547 402840 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 548 402840 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 549 402840 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 550 402840 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 551 402840 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 552 402841 gdb_server.c:2209 gdb_input_inner(): received packet: 'm8,4'
> Debug: 553 402841 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000008, len: 0x00000004
> Debug: 554 402841 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000008
> Debug: 555 402841 or1k.c:759 or1k_read_memory(): address: 0x00000008,
> size: 0x00000004, count: 0x00000001
> Debug: 556 402841 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000008 LEN:4
> Debug: 557 404769 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 558 404769 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 559 406369 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 560 406369 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 561 406369 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 562 406369 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 563 406369 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 564 406370 gdb_server.c:2209 gdb_input_inner(): received packet: 'mc,4'
> Debug: 565 406370 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x0000000c, len: 0x00000004
> Debug: 566 406370 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x0000000c
> Debug: 567 406370 or1k.c:759 or1k_read_memory(): address: 0x0000000c,
> size: 0x00000004, count: 0x00000001
> Debug: 568 406370 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x0000000c LEN:4
> Debug: 569 408269 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 570 408269 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 571 409855 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 572 409855 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 573 409855 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 574 409855 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 575 409856 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 576 409856 gdb_server.c:2209 gdb_input_inner(): received packet: 
> 'm10,4'
> Debug: 577 409856 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000010, len: 0x00000004
> Debug: 578 409856 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000010
> Debug: 579 409857 or1k.c:759 or1k_read_memory(): address: 0x00000010,
> size: 0x00000004, count: 0x00000001
> Debug: 580 409857 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000010 LEN:4
> Debug: 581 411783 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 582 411783 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 583 413404 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 584 413404 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 585 413404 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 586 413404 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 587 413404 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 588 413405 gdb_server.c:2209 gdb_input_inner(): received packet: 
> 'm14,4'
> Debug: 589 413405 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000014, len: 0x00000004
> Debug: 590 413405 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000014
> Debug: 591 413405 or1k.c:759 or1k_read_memory(): address: 0x00000014,
> size: 0x00000004, count: 0x00000001
> Debug: 592 413405 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000014 LEN:4
> Debug: 593 415337 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 594 415337 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 595 416951 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 596 416952 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 597 416952 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 598 416952 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 599 416952 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 600 416953 gdb_server.c:2209 gdb_input_inner(): received packet: 
> 'm18,4'
> Debug: 601 416953 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x00000018, len: 0x00000004
> Debug: 602 416953 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x00000018
> Debug: 603 416953 or1k.c:759 or1k_read_memory(): address: 0x00000018,
> size: 0x00000004, count: 0x00000001
> Debug: 604 416953 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x00000018 LEN:4
> Debug: 605 418842 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 606 418842 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 607 420426 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 608 420426 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 609 420426 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 610 420426 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 611 420426 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Debug: 612 420427 gdb_server.c:2209 gdb_input_inner(): received packet: 
> 'm1c,4'
> Debug: 613 420427 gdb_server.c:1282 gdb_read_memory_packet(): addr:
> 0x0000001c, len: 0x00000004
> Debug: 614 420427 target.c:1446 target_read_buffer(): reading buffer
> of 4 byte at 0x0000001c
> Debug: 615 420427 or1k.c:759 or1k_read_memory(): address: 0x0000001c,
> size: 0x00000004, count: 0x00000001
> Debug: 616 420427 or1k_jtag.c:281 or1k_jtag_mohor_debug_set_command():
> Setting mohor debug command. TYPE:0x6 ADR:0x0000001c LEN:4
> Debug: 617 422318 or1k_jtag.c:425
> or1k_jtag_mohor_debug_single_read_go(): Doing mohor debug read go for
> 4 bytes
> Debug: 618 422318 or1k_jtag.c:448
> or1k_jtag_mohor_debug_single_read_go(): Number of data fields: 4
> Debug: 619 423903 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 620 423903 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 621 423903 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Debug: 622 423903 or1k_jtag.c:524 or1k_jtag_mohor_debug_single_read_go(): 00
> Warn : 623 423903 gdb_server.c:661 gdb_get_packet_inner(): negative
> acknowledgment, but no packet pending
> Warn : 624 424905 log.c:432 keep_alive(): keep_alive() was not invoked
> in the 1000ms timelimit. GDB alive packet not sent! (1002).
> Workaround: increase "set remotetimeout" in GDB
> Debug: 626 424905 or1k_jtag.c:219
> or1k_jtag_mohor_debug_select_module():  setting mohor debug IF module:
> 1
> Debug: 627 426042 or1k_jtag.c:260
> or1k_jtag_mohor_debug_select_module():  setting mohor debug IF OK
>
>
> So if you (julius ?) have an idea to save me some time debugging this
> (full log here http://pastebin.com/NxxNnrSy) .....
> How fast it is when using your JTAG chain ?

I think I cranked it up to the maximum, maybe 6MHz.

>
> Thanks,
> Franck.
>
> BTW: using the vjtag, the data from dbg_if were always 1 bit shifted.
> I used this fix:
>
> always @ (tdo_tmp/*negedge tck_i*/)
> begin
>  tdo_o <=  tdo_tmp;
> end

Aha! This could be the issue.

I presume there's 2 TAPs in the chain before the mohor debug unit
(debug_if) unit, right?

So you'll need to clock everything once more on the way in and on the
way out, to compensate for the additional TAP. Your hack you've shown
here will be skipping a stage of registering on the way out which is
making it work, I guess. But i'm surprised it's working on the way in,
unless there's something which is giving it an extra clock.

I would advise to undo this change to the RTL and address it with the
proxy software instead.

There must be a way to describe to OpenOCD that there's another TAP in the way.

    Julius
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to