pulp-platform / pulpissimo

This is the top-level project for the PULPissimo Platform. It instantiates a PULPissimo open-source system with a PULP SoC domain, but no cluster.
Other
376 stars 163 forks source link

The OpenOCD error on RTL simulation platform #60

Open shiner-chen opened 5 years ago

shiner-chen commented 5 years ago

Following the guide:https://github.com/pulp-platform/pulpissimo/blob/master/rtl/tb/README.md, I tried the OpenOCD to connect the RTL platform and get the errors below. on RTL platform side, continuously print the following log:

Write 1 0 0
Tick with: TCK=1 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 2
Write 0 1 0
Tick with: TCK=0 TMS=1 TDI=0 TRSTn=1 --> TDO=0
Received a command R
Read req
Tick with: TCK=0 TMS=1 TDI=0 TRSTn=1 --> TDO=0
Received a command 6
Write 1 1 0
Tick with: TCK=1 TMS=1 TDI=0 TRSTn=1 --> TDO=0
Received a command 2
Write 0 1 0
Tick with: TCK=0 TMS=1 TDI=0 TRSTn=1 --> TDO=0
Received a command 6
Write 1 1 0
Tick with: TCK=1 TMS=1 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 4
Write 1 0 0
Tick with: TCK=1 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 4
Write 1 0 0
Tick with: TCK=1 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 4
Write 1 0 0
Tick with: TCK=1 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 4
Write 1 0 0
Tick with: TCK=1 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command 0
Write 0 0 0
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command b
blink off
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Received a command Q
Quit req
Remote end disconnected
Tick with: TCK=0 TMS=0 TDI=0 TRSTn=1 --> TDO=0
Attempting to accept client socket

The OpenOCD side:

chenx@wangzhongping-All-Series:~/build/pulpissimo/rtl/tb$ /opt/openocd/bin/openocd -f pulpissimo_debug.cfg
Open On-Chip Debugger 0.10.0+dev-00529-g9fac2de (2019-07-11-17:23)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
User : 13 32 command.c:544 command_print(): debug_level: 4
Debug: 14 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
Debug: 15 32 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000
Debug: 17 32 core.c:1645 jtag_config_khz(): handle jtag khz
Debug: 18 32 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 19 32 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 20 32 command.c:544 command_print(): adapter speed: 1000 kHz
Debug: 21 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface remote_bitbang
Debug: 22 33 command.c:143 script_debug(): command - interface ocd_interface remote_bitbang
Debug: 24 33 command.c:364 register_command_handler(): registering 'ocd_remote_bitbang_port'...
Debug: 25 33 command.c:364 register_command_handler(): registering 'ocd_remote_bitbang_host'...
Warn : 26 33 adapter.c:160 handle_interface_command(): Adapter driver 'remote_bitbang' did not declare which transports it allows; assuming legacy JTAG-only
Info : 27 33 transport.c:117 allow_transports(): only one transport option; autoselect 'jtag'
Debug: 28 33 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 29 33 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 30 33 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 31 33 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 32 33 command.c:364 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 33 33 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 34 33 command.c:364 register_command_handler(): registering 'ocd_runtest'...
Debug: 35 33 command.c:364 register_command_handler(): registering 'ocd_irscan'...
Debug: 36 33 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 37 33 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 38 33 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 39 33 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 40 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 41 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 42 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 43 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 44 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 45 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 46 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 47 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 48 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 49 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 33 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 33 command.c:364 register_command_handler(): registering 'ocd_svf'...
Debug: 54 33 command.c:364 register_command_handler(): registering 'ocd_xsvf'...
Debug: 55 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_remote_bitbang_host localhost
Debug: 56 33 command.c:143 script_debug(): command - remote_bitbang_host ocd_remote_bitbang_host localhost
Debug: 58 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_remote_bitbang_port 46398
Debug: 59 33 command.c:143 script_debug(): command - remote_bitbang_port ocd_remote_bitbang_port 46398
Debug: 61 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv unknown0 -irlen 5 -expected-id 0x10102001
Debug: 62 33 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv unknown0 -irlen 5 -expected-id 0x10102001
Debug: 63 33 tcl.c:550 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: unknown0, Dotted: riscv.unknown0, 4 params
Debug: 64 33 tcl.c:574 jim_newtap_cmd(): Processing option: -irlen
Debug: 65 33 tcl.c:574 jim_newtap_cmd(): Processing option: -expected-id
Debug: 66 33 core.c:1304 jtag_tap_init(): Created Tap: riscv.unknown0 @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 67 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv cpu -irlen 5 -expected-id 0x249511C3
Debug: 68 33 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv cpu -irlen 5 -expected-id 0x249511C3
Debug: 69 33 tcl.c:550 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: cpu, Dotted: riscv.cpu, 4 params
Debug: 70 33 tcl.c:574 jim_newtap_cmd(): Processing option: -irlen
Debug: 71 33 tcl.c:574 jim_newtap_cmd(): Processing option: -expected-id
Debug: 72 33 core.c:1304 jtag_tap_init(): Created Tap: riscv.cpu @ abs position 1, irlen 5, capture: 0x1 mask: 0x3
Debug: 73 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag names
Debug: 74 33 command.c:143 script_debug(): command - ocd_jtag ocd_jtag names
TAP: riscv.unknown0

TAP: riscv.cpu

Debug: 75 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create riscv.cpu riscv -chain-position riscv.cpu -coreid 0x3e0
Debug: 76 33 command.c:143 script_debug(): command - ocd_target ocd_target create riscv.cpu riscv -chain-position riscv.cpu -coreid 0x3e0
Debug: 77 33 target.c:1941 target_free_all_working_areas_restore(): freeing all working areas
Debug: 78 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 79 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 80 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 81 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 82 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 83 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 84 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 85 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 86 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 87 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 88 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 89 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 90 33 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 91 33 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 92 33 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 93 33 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 94 33 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 95 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 96 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 97 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 98 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 99 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 100 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 101 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 102 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 103 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 104 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 105 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 106 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 107 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 108 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 109 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 110 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 111 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 112 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 113 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 114 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 115 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 116 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 117 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 118 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 119 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 120 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 121 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 122 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 123 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 124 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 125 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 126 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 127 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 128 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 129 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 130 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 131 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 132 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 133 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 134 33 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 135 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_reset_timeout_sec 2000
Debug: 136 33 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_reset_timeout_sec 2000
Debug: 138 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_command_timeout_sec 2000
Debug: 139 33 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_command_timeout_sec 2000
Debug: 141 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_prefer_sba on
Debug: 142 33 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_prefer_sba on
Debug: 144 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_scan_chain
Debug: 145 33 command.c:143 script_debug(): command - scan_chain ocd_scan_chain
User : 147 33 command.c:544 command_print():    TapName             Enabled  IdCode     Expected   IrLen IrCap IrMask
User : 148 33 command.c:544 command_print(): -- ------------------- -------- ---------- ---------- ----- ----- ------
User : 149 33 command.c:544 command_print():  0 riscv.unknown0         Y     0x00000000 0x10102001     5 0x01  0x03
User : 150 33 command.c:544 command_print():  1 riscv.cpu              Y     0x00000000 0x249511c3     5 0x01  0x03
Debug: 151 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 152 33 command.c:143 script_debug(): command - init ocd_init
Debug: 154 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 155 33 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 157 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 158 33 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 159 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 160 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 161 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 162 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 163 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 164 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 165 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 166 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 167 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-attach
Debug: 168 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-attach
Debug: 169 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-attach halt
Debug: 170 34 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-attach halt
Debug: 171 34 target.c:1404 handle_target_init_command(): Initializing targets...
Debug: 172 34 riscv.c:255 riscv_init_target(): riscv_init_target()
Debug: 173 34 semihosting_common.c:97 semihosting_common_init():  
Debug: 174 34 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 175 34 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 176 34 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 177 34 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 178 34 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 179 34 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 180 34 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 181 34 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 182 34 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 183 34 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 184 34 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 185 34 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 186 34 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 187 34 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 188 34 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 189 34 command.c:364 register_command_handler(): registering 'ocd_mdd'...
Debug: 190 34 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 191 34 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 192 34 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 193 34 command.c:364 register_command_handler(): registering 'ocd_mwd'...
Debug: 194 34 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 195 34 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 196 34 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 197 34 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 198 34 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 199 34 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 200 34 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 201 34 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 202 34 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 203 34 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 204 34 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 205 34 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 206 34 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 207 34 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 208 34 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Info : 209 34 remote_bitbang.c:283 remote_bitbang_init(): Initializing remote_bitbang driver
Info : 210 34 remote_bitbang.c:214 remote_bitbang_init_tcp(): Connecting to localhost:46398
Info : 211 34 remote_bitbang.c:299 remote_bitbang_init(): remote_bitbang driver initialized
Info : 212 34 core.c:1365 adapter_init(): This adapter doesn't support configurable speed
Debug: 213 35 openocd.c:142 handle_init_command(): Debug Adapter init complete
Debug: 214 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 215 35 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 217 35 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 218 35 core.c:729 jtag_add_reset(): SRST line released
Debug: 219 35 core.c:753 jtag_add_reset(): TRST line released
Debug: 220 35 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 221 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init
Debug: 222 35 command.c:143 script_debug(): command - ocd_jtag ocd_jtag arp_init
Debug: 223 35 core.c:1407 jtag_init_inner(): Init JTAG chain
Debug: 224 35 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 225 35 core.c:1060 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 226 35 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 227 244463 jep106.c:33 jep106_manufacturer(): BUG: Caller passed out-of-range JEP106 ID!
Info : 228 244463 core.c:959 jtag_examine_chain_display(): JTAG tap: riscv.unknown0 tap/device found: 0x10102001 (mfg: 0x000 (<invalid>), part: 0x0102, ver: 0x1)
Info : 229 244463 core.c:959 jtag_examine_chain_display(): JTAG tap: riscv.cpu tap/device found: 0x249511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x2)
Debug: 230 244463 core.c:1190 jtag_validate_ircapture(): IR capture validation scan
Debug: 231 252907 core.c:1248 jtag_validate_ircapture(): riscv.unknown0: IR capture 0x05
Debug: 232 252907 core.c:1248 jtag_validate_ircapture(): riscv.cpu: IR capture 0x05
Debug: 233 252907 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_dap init
Debug: 234 252907 command.c:143 script_debug(): command - ocd_dap ocd_dap init
Debug: 235 252907 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (252907). This may cause trouble with GDB connections.
Debug: 238 252907 arm_dap.c:105 dap_init_all(): Initializing all DAPs ...
Debug: 239 252907 openocd.c:159 handle_init_command(): Examining targets...
Debug: 240 252907 target.c:1591 target_call_event_callbacks(): target event 17 (examine-start) for core 992
Debug: 241 252907 riscv.c:785 riscv_examine(): riscv_examine()
Debug: 242 270447 riscv.c:227 dtmcontrol_scan(): DTMCONTROL: 0x0 -> 0x1071
Debug: 243 270447 riscv.c:795 riscv_examine(): dtmcontrol=0x1071
Debug: 244 270447 riscv.c:797 riscv_examine():   version=0x1
Debug: 245 270455 riscv-013.c:1622 init_target(): init
Debug: 246 291929 riscv-013.c:428 dtmcontrol_scan(): DTMCS: 0x0 -> 0x1071
Debug: 247 291929 riscv-013.c:1383 examine(): dtmcontrol=0x1071
Debug: 248 291929 riscv-013.c:1384 examine():   dmireset=0
Debug: 249 291929 riscv-013.c:1385 examine():   idle=1
Debug: 250 291929 riscv-013.c:1386 examine():   dmistat=0
Debug: 251 291929 riscv-013.c:1387 examine():   abits=7
Debug: 252 291929 riscv-013.c:1388 examine():   version=1
Debug: 253 316753 riscv-013.c:380 scan(): 41b 0i w 00000000 @10 -> + 00000000 @00
Debug: 254 333373 riscv-013.c:380 scan(): 41b 0i - 00000000 @10 -> + 00000000 @10
Debug: 255 354182 riscv-013.c:380 scan(): 41b 0i w 00000001 @10 -> + 00000000 @10
Debug: 256 354182 riscv-013.c:391 scan():  dmactive -> 
Debug: 257 370863 riscv-013.c:380 scan(): 41b 0i - 00000000 @10 -> + 00000001 @10
Debug: 258 370863 riscv-013.c:391 scan():  ->  dmactive
Debug: 259 391560 riscv-013.c:380 scan(): 41b 0i w 03ffffc1 @10 -> + 00000000 @10
Debug: 260 391560 riscv-013.c:391 scan():  hartselhi=1023 hartsello=1023 dmactive -> 
Debug: 261 408264 riscv-013.c:380 scan(): 41b 0i - 00000000 @10 -> + 03ffffc1 @10
Debug: 262 408264 riscv-013.c:391 scan():  ->  hartselhi=1023 hartsello=1023 dmactive
Debug: 263 428991 riscv-013.c:380 scan(): 41b 0i r 00000000 @10 -> + 00000000 @10
Debug: 264 445689 riscv-013.c:380 scan(): 41b 0i - 00000000 @10 -> b 00000000 @10
Debug: 265 445689 riscv-013.c:439 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=1, ac_busy_delay=0
Debug: 266 463218 riscv-013.c:428 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1c71
Debug: 267 484889 riscv-013.c:380 scan(): 41b 1i - 00000000 @10 -> + 03ffffc1 @10
Debug: 268 484889 riscv-013.c:391 scan():  ->  hartselhi=1023 hartsello=1023 dmactive
Debug: 269 505942 riscv-013.c:380 scan(): 41b 1i r 00000000 @11 -> + 00000000 @10
Debug: 270 523073 riscv-013.c:380 scan(): 41b 1i - 00000000 @11 -> b 00000000 @11
Debug: 271 523073 riscv-013.c:439 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=2, ac_busy_delay=0
Debug: 272 540883 riscv-013.c:428 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1071
Debug: 273 561636 riscv-013.c:380 scan(): 41b 2i - 00000000 @11 -> + 0000f082 @11
Debug: 274 561636 riscv-013.c:391 scan():  ->  allnonexistent anynonexistent allunavail anyunavail authenticated version=2
Debug: 275 561636 riscv-013.c:1426 examine(): dmstatus:  0x0000f082
Debug: 276 561636 riscv-013.c:1442 examine(): hartsellen=20
Debug: 277 583013 riscv-013.c:380 scan(): 41b 2i r 00000000 @12 -> + 00000000 @11
Debug: 278 600227 riscv-013.c:380 scan(): 41b 2i - 00000000 @12 -> b 00000000 @12
Debug: 279 600227 riscv-013.c:439 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=3, ac_busy_delay=0
Debug: 280 618424 riscv-013.c:428 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1071
Debug: 281 639159 riscv-013.c:380 scan(): 41b 3i - 00000000 @12 -> + 00000000 @12
Debug: 282 660743 riscv-013.c:380 scan(): 41b 3i r 00000000 @38 -> + 00000000 @12
Debug: 283 678257 riscv-013.c:380 scan(): 41b 3i - 00000000 @38 -> + 20040404 @38
Debug: 284 678257 riscv-013.c:391 scan():  ->  sbaccess=2 sbasize=32 sbaccess32
Debug: 285 699833 riscv-013.c:380 scan(): 41b 3i r 00000000 @16 -> + 00000000 @38
Debug: 286 717361 riscv-013.c:380 scan(): 41b 3i - 00000000 @16 -> + 08000002 @16
Debug: 287 717361 riscv-013.c:391 scan():  ->  progbufsize=8 datacount=2
Info : 288 717361 riscv-013.c:1473 examine(): datacount=2 progbufsize=8
Debug: 289 717361 riscv-013.c:1544 examine(): Enumerated 0 harts
Error: 290 717361 riscv-013.c:1547 examine(): No harts found!
Debug: 291 717361 openocd.c:161 handle_init_command(): target examination failed
Debug: 292 717361 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init
Debug: 293 717361 command.c:143 script_debug(): command - ocd_flash ocd_flash init
Debug: 294 717361 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (464454). This may cause trouble with GDB connections.
Debug: 297 717361 tcl.c:1225 handle_flash_init_command(): Initializing flash devices...
Debug: 298 717361 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init
Debug: 299 717361 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init
Debug: 301 717361 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices...
Debug: 302 717361 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init
Debug: 303 717361 command.c:143 script_debug(): command - ocd_nand ocd_nand init
Debug: 305 717361 tcl.c:497 handle_nand_init_command(): Initializing NAND devices...
Debug: 306 717361 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init
Debug: 307 717361 command.c:143 script_debug(): command - ocd_pld ocd_pld init
Debug: 309 717361 pld.c:205 handle_pld_init_command(): Initializing PLDs...
Debug: 310 717361 gdb_server.c:3412 gdb_target_start(): starting gdb server for riscv.cpu on 3333
Info : 311 717361 server.c:311 add_service(): Listening on port 3333 for gdb connections
Debug: 312 717361 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_halt
Debug: 313 717361 command.c:143 script_debug(): command - halt ocd_halt
Debug: 315 717361 target.c:3041 handle_halt_command(): -
Error: 316 717361 target.c:572 target_halt(): Target not examined yet
Debug: 317 717361 command.c:651 run_command(): Command 'halt' failed with error code -4
User : 318 717361 command.c:715 command_run_line(): 
Debug: 319 717361 riscv.c:276 riscv_deinit_target(): riscv_deinit_target()
Debug: 320 717361 riscv-013.c:1359 deinit_target(): riscv_deinit_target()
Debug: 321 717361 target.c:1941 target_free_all_working_areas_restore(): freeing all working areas
Info : 322 717361 remote_bitbang.c:120 remote_bitbang_quit(): remote_bitbang interface quit
chenx@wangzhongping-All-Series:~/build/pulpissimo/rtl/tb$ 

It seems that the RTL platform does not support the target_halt()? How to resolve it ?

bluewww commented 5 years ago
Info : 288 717361 riscv-013.c:1473 examine(): datacount=2 progbufsize=8
Debug: 289 717361 riscv-013.c:1544 examine(): Enumerated 0 harts
Error: 290 717361 riscv-013.c:1547 examine(): No harts found!

RISC-V OpenOCD assumes at most 32 harts exists and that the harts are numbered 0 to 31. Currently PULPissimo uses the hartid 992 which is totally conformant to the debug specification but not supported out of the box. I raised the issue on riscv-openocd but there is no real solution yet.

A hacky workaround is compiling riscv-openocd with the MAX_HARTID macro set to 1024 or more

I'm looking for a better way to do this.

edit: We have amended the FPGA section. You can now use the inbuilt OpenOCD version provided by pulp-sdk. Have a look at https://github.com/pulp-platform/pulpissimo/tree/fpga#gdb-and-openocd.

shiner-chen commented 5 years ago

@bluewww Thank you for your reply, I tried the patch for openocd, but openocd still cannot work. It entered the loop for scan all hartid, because of the dm->hart_count < 0. please see the code below in riscv-013.c

 LOG_ERROR("hart count =%d\n", dm->hart_count);  //Added by me to display the hart count
1555     /* Before doing anything else we must first enumerate the harts. */
1556     if (dm->hart_count < 0) {
1557         for (int i = 0; i < MIN(RISCV_MAX_HARTS, 1 << info->hartsellen); ++i) {
1558             r->current_hartid = i;
1559             if (riscv013_select_current_hart(target) != ERROR_OK)
1560                 return ERROR_FAIL;
1561
1562             uint32_t s;
1563             if (dmstatus_read(target, &s, true) != ERROR_OK)
1564                 return ERROR_FAIL;
1565             if (get_field(s, DMI_DMSTATUS_ANYNONEXISTENT))
1566                 break;
1567             dm->hart_count = i + 1;
1568
1569             if (get_field(s, DMI_DMSTATUS_ANYHAVERESET))
1570                 dmi_write(target, DMI_DMCONTROL,
1571                         set_hartsel(DMI_DMCONTROL_DMACTIVE | DMI_DMCONTROL_ACKHAVERESET, i));
1572         }
1573
1574         LOG_DEBUG("Detected %d harts.", dm->hart_count);
1575     }

The following log is outputted by openocd.

Debug: 232 240825 core.c:1190 jtag_validate_ircapture(): IR capture validation scan
Debug: 233 249192 core.c:1248 jtag_validate_ircapture(): riscv.unknown0: IR capture 0x05
Debug: 234 249192 core.c:1248 jtag_validate_ircapture(): riscv.cpu: IR capture 0x05
Debug: 235 249192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_dap init
Debug: 236 249192 command.c:143 script_debug(): command - ocd_dap ocd_dap init
Debug: 237 249192 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (249192). This may cause trouble with GDB connections.
Debug: 240 249192 arm_dap.c:105 dap_init_all(): Initializing all DAPs ...
Debug: 241 249192 openocd.c:159 handle_init_command(): Examining targets...
Debug: 242 249192 target.c:1609 target_call_event_callbacks(): target event 17 (examine-start) for core 992
Debug: 243 249192 riscv.c:916 riscv_examine(): riscv_examine()
Debug: 244 266484 riscv.c:356 dtmcontrol_scan(): DTMCONTROL: 0x0 -> 0x1071
Debug: 245 266484 riscv.c:926 riscv_examine(): dtmcontrol=0x1071
Debug: 246 266484 riscv.c:928 riscv_examine():   version=0x1
Debug: 247 266484 riscv-013.c:1702 init_target(): init
Debug: 248 287699 riscv-013.c:448 dtmcontrol_scan(): DTMCS: 0x0 -> 0x1071
Debug: 249 287699 riscv-013.c:1447 examine(): dtmcontrol=0x1071
Debug: 250 287699 riscv-013.c:1448 examine():   dmireset=0
Debug: 251 287699 riscv-013.c:1449 examine():   idle=1
Debug: 252 287699 riscv-013.c:1450 examine():   dmistat=0
Debug: 253 287699 riscv-013.c:1451 examine():   abits=7
Debug: 254 287699 riscv-013.c:1452 examine():   version=1
Debug: 255 287699 riscv-013.c:259 get_dm(): [992] Allocating new DM
Debug: 256 312158 riscv-013.c:393 scan(): 41b 0i w 00000000 @10 -> + 00000000 @00
Debug: 257 328491 riscv-013.c:393 scan(): 41b 0i - 00000000 @10 -> + 00000000 @10
Debug: 258 349049 riscv-013.c:393 scan(): 41b 0i w 00000001 @10 -> + 00000000 @10
Debug: 259 349049 riscv-013.c:404 scan():  dmactive -> 
Debug: 260 365536 riscv-013.c:393 scan(): 41b 0i - 00000000 @10 -> + 00000001 @10
Debug: 261 365536 riscv-013.c:404 scan():  ->  dmactive
Debug: 262 385984 riscv-013.c:393 scan(): 41b 0i w 07ffffc1 @10 -> + 00000000 @10
Debug: 263 385984 riscv-013.c:404 scan():  hasel hartselhi=1023 hartsello=1023 dmactive -> 
Debug: 264 402421 riscv-013.c:393 scan(): 41b 0i - 00000000 @10 -> + 07ffffc1 @10
Debug: 265 402421 riscv-013.c:404 scan():  ->  hasel hartselhi=1023 hartsello=1023 dmactive
Debug: 266 422823 riscv-013.c:393 scan(): 41b 0i r 00000000 @10 -> + 00000000 @10
Debug: 267 439253 riscv-013.c:393 scan(): 41b 0i - 00000000 @10 -> b 00000000 @10
Debug: 268 439253 riscv-013.c:459 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=1, ac_busy_delay=0
Debug: 269 456520 riscv-013.c:448 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1c71
Debug: 270 476974 riscv-013.c:393 scan(): 41b 1i - 00000000 @10 -> + 03ffffc1 @10
Debug: 271 476974 riscv-013.c:404 scan():  ->  hartselhi=1023 hartsello=1023 dmactive
Debug: 272 497732 riscv-013.c:393 scan(): 41b 1i r 00000000 @11 -> + 00000000 @10
Debug: 273 514587 riscv-013.c:393 scan(): 41b 1i - 00000000 @11 -> b 00000000 @11
Debug: 274 514587 riscv-013.c:459 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=2, ac_busy_delay=0
Debug: 275 532096 riscv-013.c:448 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1071
Debug: 276 552520 riscv-013.c:393 scan(): 41b 2i - 00000000 @11 -> + 0000f082 @11
Debug: 277 552520 riscv-013.c:404 scan():  ->  allnonexistent anynonexistent allunavail anyunavail authenticated version=2
Debug: 278 552520 riscv-013.c:1495 examine(): dmstatus:  0x0000f082
Debug: 279 552520 riscv-013.c:1511 examine(): hartsellen=20
Debug: 280 573588 riscv-013.c:393 scan(): 41b 2i r 00000000 @12 -> + 00000000 @11
Debug: 281 590541 riscv-013.c:393 scan(): 41b 2i - 00000000 @12 -> b 00000000 @12
Debug: 282 590541 riscv-013.c:459 increase_dmi_busy_delay(): dtmcs_idle=1, dmi_busy_delay=3, ac_busy_delay=0
Debug: 283 608443 riscv-013.c:448 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x1071
Debug: 284 629861 riscv-013.c:393 scan(): 41b 3i - 00000000 @12 -> + 00000000 @12
Debug: 285 651096 riscv-013.c:393 scan(): 41b 3i r 00000000 @38 -> + 00000000 @12
Debug: 286 668358 riscv-013.c:393 scan(): 41b 3i - 00000000 @38 -> + 20040404 @38
Debug: 287 668358 riscv-013.c:404 scan():  ->  sbversion=1 sbaccess=2 sbasize=32 sbaccess32
Debug: 288 689608 riscv-013.c:393 scan(): 41b 3i r 00000000 @16 -> + 00000000 @38
Debug: 289 706857 riscv-013.c:393 scan(): 41b 3i - 00000000 @16 -> + 08000002 @16
Debug: 290 706857 riscv-013.c:404 scan():  ->  progbufsize=8 datacount=2
Info : 291 706857 riscv-013.c:1542 examine(): datacount=2 progbufsize=8
Error: 292 706857 riscv-013.c:1554 examine(): hart count =-1
Debug: 293 728217 riscv-013.c:393 scan(): 41b 3i r 00000000 @10 -> + 00000000 @16
Debug: 294 745384 riscv-013.c:393 scan(): 41b 3i - 00000000 @10 -> + 03ffffc1 @10
Debug: 295 745384 riscv-013.c:404 scan():  ->  hartselhi=1023 hartsello=1023 dmactive

In addition, I found a error on RTL simulate platform side when openocd connected the RTL platform. Please check the log below. Does this error cause the openocd issue?

This emulator compiled with JTAG Remote Bitbang client. To enable, use +jtag_rbb_enable=1.
Listening on port 43913
Attempting to accept client socket
Accepted successfully.Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command B
*BLINK*
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command r
r-reset
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command b
blink off
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command B
*BLINK*
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command b
blink off
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
Received a command B
*BLINK*
Tick with: TCK=1 TMS=1 TDI=1 TRSTn=1 --> TDO=0
# ** Warning: (vsim-PLI-3407) Too many data words read on line 2049 of file "./boot/boot_code.cde". (Current address [2048], address range [0:2047])    : /home/chenx/build/pulpissimo/sim/../ips/tech_cells_generic/generic_rom.sv(31)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/boot_rom_i/rom_mem_i
# [CORE] Core settings: PULP_SECURE =           1, N_PMP_ENTRIES =          16, N_PMP_CFG           4
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# START_ADDR[0] = 0x1a100000; END_ADDR[0] = 0X1a400000
# START_ADDR[1] = 0x10000000; END_ADDR[1] = 0X10400000
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# [TB]       0ns - Asserting hard reset
# ** Warning: (vsim-3533) [FOFIW] - Failed to open file "fs/file_0_0.txt" for writing.
# No such file or directory. (errno = ENOENT)    : /home/chenx/build/pulpissimo/sim/../rtl/tb/tb_fs_handler.sv(269)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_fs_handler/FS_PRINTF_CLUSTER
# ** Warning: (vsim-3533) [FOFIW] - Failed to open file "fs/file_31_0.txt" for writing.
# No such file or directory. (errno = ENOENT)    : /home/chenx/build/pulpissimo/sim/../rtl/tb/tb_fs_handler.sv(269)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_fs_handler/FS_PRINTF_FC
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 1  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 1  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 2  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 12  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# [TB]       1ns - Releasing hard reset
Received a command 2
shiner-chen commented 5 years ago

After I update to latest code of pulpissimo as below:

chenx@wangzhongping-All-Series:~/build/pulpissimo$ git log
commit eb4f4ee77e2d16354c0cc92c3dcee016f4f5e7fe
Merge: ff1c2c6 33edf56
Author: bluew <bluewww@users.noreply.github.com>
Date:   Wed Jul 10 19:36:42 2019 +0200

    Merge pull request #59 from pulp-platform/openocd

    OpenOCD

commit 33edf56a0599744d68aaa0f4bce00345d6699e2a
Author: bluew <bluewww@users.noreply.github.com>
Date:   Wed Jul 10 19:27:17 2019 +0200

    Import new bitbang server version

    This makes the server a bit more quiet when running, but the previous
    behaviour can be obtained by defining VERBOSE.

    Furthermore there is a small bug fix: When the remote hangs up we
    can get stuck in an infinite loop.

commit 275ea311ab47f835ce12522bf43063137b3aa501
Author: bluew <bluewww@users.noreply.github.com>
Date:   Wed Jul 10 19:26:43 2019 +0200

    Make toplevel makefile build the bitbang server. Update README

commit 7e894fb352d9ae0fad4c04982f958106a48c9eca
Author: bluew <bluewww@users.noreply.github.com>
Date:   Wed Jul 10 19:26:28 2019 +0200

    Add instruction for using openocd + tb

When run the hello demo on RTL platform, I got different error: "Port number of out range: -265478504" .

chenx@wangzhongping-All-Series:~/build/pulp-rt-examples/hello$ make conf CONFIG_OPT="vsim/tcl_args=-sv_lib vsim/tcl_args="${VSIM_PATH}"/../rtl/tb/remote_bitbang/librbs vsim/tcl_args=-gENABLE_OPENOCD=1" clean all run
plpflags gen --input=pulpissimo@config_file=chips/pulpissimo/pulpissimo.json  --config=platform=rtl  --config=vsim/tcl_args=-sv_lib  --config=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config=vsim/tcl_args=-gENABLE_OPENOCD=1  --config=**/rt/type=pulp-rt --output-dir=/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo --makefile=/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/config.mk    --app=test 
plpconf --input=pulpissimo@config_file=chips/pulpissimo/pulpissimo.json  --config=platform=rtl  --config=vsim/tcl_args=-sv_lib  --config=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config=vsim/tcl_args=-gENABLE_OPENOCD=1  --config=**/rt/type=pulp-rt --output=/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/config.json 
rm -rf /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/test /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc/test.o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_conf.o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_pad_conf.o  
/opt/riscv/bin/riscv32-unknown-elf-gcc  -march=rv32imfcxpulpv2 -mfdiv -D__riscv__ -O3 -g  -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include/io -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include -include /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/fc_config.h    -MMD -MP -c test.c -o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc/test.o
/opt/riscv/bin/riscv32-unknown-elf-gcc  -march=rv32imfcxpulpv2 -mfdiv -D__riscv__ -O3 -g  -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include/io -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include -include /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/fc_config.h    -MMD -MP -c /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_conf.c -o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_conf.o
/opt/riscv/bin/riscv32-unknown-elf-gcc  -march=rv32imfcxpulpv2 -mfdiv -D__riscv__ -O3 -g  -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include/io -I/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/include -include /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/fc_config.h    -MMD -MP -c /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_pad_conf.c -o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_pad_conf.o
mkdir -p `dirname /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/test`
/opt/riscv/bin/riscv32-unknown-elf-gcc -march=rv32imfcxpulpv2 -mfdiv -D__riscv__ -MMD -MP -o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/test /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc/test.o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_conf.o /home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/test/fc//home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/rt_pad_conf.o  -nostartfiles -nostdlib -Wl,--gc-sections -L/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/rules -Tpulpissimo/link.ld -L/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/lib/pulpissimo -L/home/chenx/build/pulp-sdk/pkg/sdk/dev/install/lib/pulpissimo/pulpissimo -lrt -lrtio -lrt -lgcc
pulp-run --config-file=pulpissimo@config_file=chips/pulpissimo/pulpissimo.json  --config-opt=platform=rtl  --config-opt=vsim/tcl_args=-sv_lib  --config-opt=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config-opt=vsim/tcl_args=-gENABLE_OPENOCD=1  --config-opt=**/rt/type=pulp-rt  --config-opt=vsim/tcl_args=-sv_lib  --config-opt=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config-opt=vsim/tcl_args=-gENABLE_OPENOCD=1  --config-opt=**/rt/type=pulp-rt --dir=/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo --binary=test/test prepare
pulp-run --config-file=pulpissimo@config_file=chips/pulpissimo/pulpissimo.json  --config-opt=platform=rtl  --config-opt=vsim/tcl_args=-sv_lib  --config-opt=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config-opt=vsim/tcl_args=-gENABLE_OPENOCD=1  --config-opt=**/rt/type=pulp-rt  --config-opt=vsim/tcl_args=-sv_lib  --config-opt=vsim/tcl_args=/home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs  --config-opt=vsim/tcl_args=-gENABLE_OPENOCD=1  --config-opt=**/rt/type=pulp-rt --dir=/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo --binary=test/test
Launching simulator with command:
export VSIM_RUNNER_FLAGS="-sv_lib /home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs -gENABLE_OPENOCD=1 -sv_lib /home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs -gENABLE_OPENOCD=1 -gLOAD_L2=JTAG -permit_unmatched_virtual_intf -gBAUDRATE=115200" && vsim -64 -c -do 'source /home/chenx/build/pulpissimo/sim/tcl_files/config/run_and_exit.tcl' -do 'source /home/chenx/build/pulpissimo/sim/tcl_files/disable_tcheck_fll.do' -do 'source /home/chenx/build/pulpissimo/sim/tcl_files/run.tcl; set_tcheck; run_and_exit;'
Reading pref.tcl

# 10.6d_1

# source /home/chenx/build/pulpissimo/sim/tcl_files/config/run_and_exit.tcl
# source /home/chenx/build/pulpissimo/sim/tcl_files/disable_tcheck_fll.do
# couldn't read file "/home/chenx/build/pulpissimo/sim/tcl_files/disable_tcheck_fll.do": no such file or directory
# source /home/chenx/build/pulpissimo/sim/tcl_files/run.tcl
# vsim -c -quiet vopt_tb -L models_lib -L vip_lib -t ps "+nowarnTRAN" "+nowarnTSCALE" "+nowarnTFMPC" "+TB_PATH=/home/chenx/build/pulpissimo/sim" "+UVM_NO_RELNOTES" -sv_lib /home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs -sv_lib /home/chenx/build/pulpissimo/sim/../rtl/tb/remote_bitbang/librbs -permit_unmatched_virtual_intf "+VSIM_PATH=/home/chenx/build/pulpissimo/sim" -gUSE_SDVT_SPI=0 -gUSE_SDVT_CPI=0 -gBAUDRATE=115200 -gENABLE_DEV_DPI=0 -gLOAD_L2=JTAG -gUSE_SDVT_I2S=0 -gENABLE_OPENOCD=1 
# Start time: 16:05:22 on Jul 17,2019
# //  Questa Sim-64
# //  Version 10.6d_1 linux_x86_64 Apr 11 2018
# //
# //  Copyright 1991-2018 Mentor Graphics Corporation
# //  All Rights Reserved.
# //
# //  QuestaSim and its associated documentation contain trade
# //  secrets and commercial or financial information that are the property of
# //  Mentor Graphics Corporation and are privileged, confidential,
# //  and exempt from disclosure under the Freedom of Information Act,
# //  5 U.S.C. Section 552. Furthermore, this information
# //  is prohibited from disclosure under the Trade Secrets Act,
# //  18 U.S.C. Section 1905.
# //
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/pulp_soc.sv(526): [PCDPC] - Port size (43) does not match connection size (32) for port 'gpio_in'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(75).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/pulp_soc.sv(526): [PCDPC] - Port size (43) does not match connection size (32) for port 'gpio_out'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(76).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/pulp_soc.sv(526): [PCDPC] - Port size (43) does not match connection size (32) for port 'gpio_dir'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(77).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/pulp_soc.sv(526): [PCDPC] - Port size (172) does not match connection size (192) for port 'gpio_padcfg'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(78).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/pulp_soc.sv(526): [PCDPC] - Port size (256) does not match connection size (384) for port 'pad_cfg_o'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(81).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(328): [PCDPC] - Port size (43) does not match connection size (32) for port 'gpio_in_sync'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/apb/apb_gpio/./rtl/apb_gpio.sv(62).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i/apb_gpio_i File: /home/chenx/build/pulpissimo/sim/../ips/apb/apb_gpio/./rtl/apb_gpio.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(367): [PCDPC] - Port size (2) does not match connection size (1) for port 'i2c_scl_oe'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/udma_subsystem/udma_subsystem.sv(72).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i/i_udma File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/udma_subsystem/udma_subsystem.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(367): [PCDPC] - Port size (2) does not match connection size (1) for port 'i2c_sda_oe'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/udma_subsystem/udma_subsystem.sv(75).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i/i_udma File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/udma_subsystem/udma_subsystem.sv
# ** Warning: (vsim-3015) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/pulp_soc/soc_peripherals.sv(460): [PCDPC] - Port size (384) does not match connection size (256) for port 'pad_cfg'. The port definition is at: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/apb_soc_ctrl.sv(85).
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/soc_peripherals_i/apb_soc_ctrl_i File: /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/apb_soc_ctrl.sv
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_soc/i_FLL_digital/TQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_soc/i_FLL_digital/JTQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_per/i_FLL_digital/TQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_per/i_FLL_digital/JTQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_cluster/i_FLL_digital/TQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-8683) Uninitialized out port /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/i_clk_rst_gen/i_fll_cluster/i_FLL_digital/JTQ has no driver.
# This port will contribute value (U) to the signal network.
# ** Warning: (vsim-3040) Command line generic/parameter "USE_SDVT_I2S" not found in design.
# ** Warning: (vsim-3040) Command line generic/parameter "USE_SDVT_SPI" not found in design.
#  set_tcheck
# invalid command name "set_tcheck"
#  run_and_exit
Port number of out range: -265478504
JTAG remote bitbang server is ready
Listening on port 7832
Attempting to accept client socket

OpenOCD connected it, the following error is outputted in screen.

Port number of out range: -265478504
JTAG remote bitbang server is ready
Listening on port 7832
Attempting to accept client socket
Accepted successfully.# Attempting stack trace sig 11
# Signal caught: signo [11]
# vsim_stacktrace.vstf written
# Current time Wed Jul 17 16:06:58 2019
# Program = vsim
# Id = "10.6d_1"
# Version = "2018.04"
# Date = "Apr 11 2018"
# Platform = linux_x86_64
# Signature = 5d0396e3c04a0c9cca2ed3b42c497a31
# End of Stack Trace

# ** Warning: (vsim-PLI-3407) Too many data words read on line 2049 of file "./boot/boot_code.cde". (Current address [2048], address range [0:2047])    : /home/chenx/build/pulpissimo/sim/../ips/tech_cells_generic/generic_rom.sv(31)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/boot_rom_i/rom_mem_i
# [CORE] Core settings: PULP_SECURE =           1, N_PMP_ENTRIES =          16, N_PMP_CFG           4
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# START_ADDR[0] = 0x1a100000; END_ADDR[0] = 0X1a400000
# START_ADDR[1] = 0x10000000; END_ADDR[1] = 0X10400000
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# [TB]       0ns - Asserting hard reset
# ** Warning: (vsim-3533) [FOFIW] - Failed to open file "fs/file_0_0.txt" for writing.
# No such file or directory. (errno = ENOENT)    : /home/chenx/build/pulpissimo/sim/../rtl/tb/tb_fs_handler.sv(269)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_fs_handler/FS_PRINTF_CLUSTER
# ** Warning: (vsim-3533) [FOFIW] - Failed to open file "fs/file_31_0.txt" for writing.
# No such file or directory. (errno = ENOENT)    : /home/chenx/build/pulpissimo/sim/../rtl/tb/tb_fs_handler.sv(269)
#    Time: 0 ps  Iteration: 0  Instance: /tb_pulp/i_fs_handler/FS_PRINTF_FC
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 1  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 1  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/riscv/./rtl/riscv_pmp.sv(677): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 2  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/fc_subsystem_i/FC_CORE/lFC_CORE/RISCY_PMP/pmp_unit_i
# ** Warning: (vsim-8315) /home/chenx/build/pulpissimo/sim/../ips/pulp_soc/rtl/components/tcdm_arbiter_2x1.sv(45): No condition is true in the unique/priority if/case statement.
#    Time: 0 ps  Iteration: 12  Instance: /tb_pulp/i_dut/soc_domain_i/pulp_soc_i/jtag_lint_arbiter_i
# [TB]       1ns - Releasing hard reset
# ** Fatal: (SIGSEGV) Bad handle or reference.
#    Time: 152585 ns  Iteration: 2  Process: /tb_pulp/i_sim_jtag/#ALWAYS#61 File: /home/chenx/build/pulpissimo/sim/../rtl/tb/SimJTAG.sv
# Fatal error at /home/chenx/build/pulpissimo/sim/../rtl/tb/SimJTAG.sv line 61
# 
# HDL call sequence:
# Stopped at /home/chenx/build/pulpissimo/sim/../rtl/tb/SimJTAG.sv 61  
# 
# End time: 16:06:58 on Jul 17,2019, Elapsed time: 0:01:36
# Errors: 3, Warnings: 26
Simulator reported an error, leaving
/home/chenx/build/pulp-rt-examples/hello/build/pulpissimo/__rules.mk:135: recipe for target 'run' failed
make: *** [run] Error 1

The openocd side error is below.

chenx@wangzhongping-All-Series:~/build/pulpissimo/rtl/tb$ $OPENOCD/bin/openocd -f pulpissimo_debug.cfg 
Open On-Chip Debugger 0.10.0+dev-00615-g2ab21a8 (2019-07-16-14:02)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
User : 13 1 command.c:544 command_print(): debug_level: 4
Debug: 14 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 10000
Debug: 15 1 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 10000
Debug: 17 1 core.c:1645 jtag_config_khz(): handle jtag khz
Debug: 18 1 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 19 1 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 20 1 command.c:544 command_print(): adapter speed: 10000 kHz
Debug: 21 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface remote_bitbang
Debug: 22 1 command.c:143 script_debug(): command - interface ocd_interface remote_bitbang
Debug: 24 1 command.c:364 register_command_handler(): registering 'ocd_remote_bitbang_port'...
Debug: 25 1 command.c:364 register_command_handler(): registering 'ocd_remote_bitbang_host'...
Warn : 26 1 adapter.c:160 handle_interface_command(): Adapter driver 'remote_bitbang' did not declare which transports it allows; assuming legacy JTAG-only
Info : 27 1 transport.c:117 allow_transports(): only one transport option; autoselect 'jtag'
Debug: 28 1 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 29 1 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 30 1 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 31 1 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 32 1 command.c:364 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 33 1 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 34 1 command.c:364 register_command_handler(): registering 'ocd_runtest'...
Debug: 35 1 command.c:364 register_command_handler(): registering 'ocd_irscan'...
Debug: 36 1 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 37 1 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 38 1 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 39 1 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 40 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 41 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 42 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 43 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 44 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 45 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 46 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 47 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 48 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 49 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 1 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 1 command.c:364 register_command_handler(): registering 'ocd_svf'...
Debug: 54 1 command.c:364 register_command_handler(): registering 'ocd_xsvf'...
Debug: 55 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_remote_bitbang_host localhost
Debug: 56 1 command.c:143 script_debug(): command - remote_bitbang_host ocd_remote_bitbang_host localhost
Debug: 58 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_remote_bitbang_port 7832
Debug: 59 1 command.c:143 script_debug(): command - remote_bitbang_port ocd_remote_bitbang_port 7832
Debug: 61 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv unknown0 -irlen 5 -expected-id 0x10102001
Debug: 62 1 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv unknown0 -irlen 5 -expected-id 0x10102001
Debug: 63 1 tcl.c:550 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: unknown0, Dotted: riscv.unknown0, 4 params
Debug: 64 1 tcl.c:574 jim_newtap_cmd(): Processing option: -irlen
Debug: 65 1 tcl.c:574 jim_newtap_cmd(): Processing option: -expected-id
Debug: 66 2 core.c:1304 jtag_tap_init(): Created Tap: riscv.unknown0 @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 67 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv cpu -irlen 5 -expected-id 0x249511C3
Debug: 68 2 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv cpu -irlen 5 -expected-id 0x249511C3
Debug: 69 2 tcl.c:550 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: cpu, Dotted: riscv.cpu, 4 params
Debug: 70 2 tcl.c:574 jim_newtap_cmd(): Processing option: -irlen
Debug: 71 2 tcl.c:574 jim_newtap_cmd(): Processing option: -expected-id
Debug: 72 2 core.c:1304 jtag_tap_init(): Created Tap: riscv.cpu @ abs position 1, irlen 5, capture: 0x1 mask: 0x3
Debug: 73 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag names
Debug: 74 2 command.c:143 script_debug(): command - ocd_jtag ocd_jtag names
TAP: riscv.unknown0

TAP: riscv.cpu

Debug: 75 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create riscv.cpu riscv -chain-position riscv.cpu -coreid 0x3e0
Debug: 76 2 command.c:143 script_debug(): command - ocd_target ocd_target create riscv.cpu riscv -chain-position riscv.cpu -coreid 0x3e0
Debug: 77 2 target.c:1959 target_free_all_working_areas_restore(): freeing all working areas
Debug: 78 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 79 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 80 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 81 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 82 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 83 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 84 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 85 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 86 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 87 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 88 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 89 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 90 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 91 2 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 92 2 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 93 2 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 94 2 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 95 2 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 96 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 97 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 98 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 99 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 100 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 101 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 102 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 103 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 104 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 105 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 106 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 107 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 108 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 109 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 110 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 111 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 112 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 113 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 114 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 115 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 116 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 117 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 118 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 119 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 120 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 121 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 122 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 123 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 124 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 125 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 126 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 127 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 128 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 129 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 130 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 131 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 132 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 133 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 134 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 135 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 136 2 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 137 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_reset_timeout_sec 2000
Debug: 138 2 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_reset_timeout_sec 2000
Debug: 140 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_command_timeout_sec 2000
Debug: 141 2 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_command_timeout_sec 2000
Debug: 143 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_prefer_sba on
Debug: 144 2 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_prefer_sba on
Debug: 146 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_scan_chain
Debug: 147 2 command.c:143 script_debug(): command - scan_chain ocd_scan_chain
User : 149 2 command.c:544 command_print():    TapName             Enabled  IdCode     Expected   IrLen IrCap IrMask
User : 150 2 command.c:544 command_print(): -- ------------------- -------- ---------- ---------- ----- ----- ------
User : 151 2 command.c:544 command_print():  0 riscv.unknown0         Y     0x00000000 0x10102001     5 0x01  0x03
User : 152 2 command.c:544 command_print():  1 riscv.cpu              Y     0x00000000 0x249511c3     5 0x01  0x03
Debug: 153 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 154 2 command.c:143 script_debug(): command - init ocd_init
Debug: 156 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 157 2 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 159 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 160 2 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 161 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 162 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 163 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 164 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 165 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 166 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 167 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 168 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 169 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-attach
Debug: 170 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-attach
Debug: 171 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-attach halt
Debug: 172 2 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-attach halt
Debug: 173 2 target.c:1421 handle_target_init_command(): Initializing targets...
Debug: 174 2 riscv.c:384 riscv_init_target(): riscv_init_target()
Debug: 175 9 semihosting_common.c:97 semihosting_common_init():  
Debug: 176 9 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 177 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 178 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 179 9 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 180 9 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 181 9 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 182 9 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 183 9 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 184 9 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 185 9 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 186 9 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 187 9 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 188 9 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 189 9 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 190 9 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 191 9 command.c:364 register_command_handler(): registering 'ocd_mdd'...
Debug: 192 9 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 193 9 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 194 9 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 195 9 command.c:364 register_command_handler(): registering 'ocd_mwd'...
Debug: 196 9 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 197 9 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 198 9 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 199 9 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 200 9 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 201 9 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 202 9 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 203 9 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 204 9 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 205 9 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 206 9 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 207 9 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 208 9 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 209 9 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 210 9 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Info : 211 9 remote_bitbang.c:283 remote_bitbang_init(): Initializing remote_bitbang driver
Info : 212 9 remote_bitbang.c:214 remote_bitbang_init_tcp(): Connecting to localhost:7832
Info : 213 9 remote_bitbang.c:299 remote_bitbang_init(): remote_bitbang driver initialized
Info : 214 9 core.c:1365 adapter_init(): This adapter doesn't support configurable speed
Debug: 215 9 openocd.c:142 handle_init_command(): Debug Adapter init complete
Debug: 216 9 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 217 9 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 219 9 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 220 9 core.c:729 jtag_add_reset(): SRST line released
Debug: 221 9 core.c:753 jtag_add_reset(): TRST line released
Debug: 222 9 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 223 9 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init
Debug: 224 9 command.c:143 script_debug(): command - ocd_jtag ocd_jtag arp_init
Debug: 225 10 core.c:1407 jtag_init_inner(): Init JTAG chain
Debug: 226 10 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 227 10 core.c:1060 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 228 10 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 229 124 server.c:609 sig_handler(): Terminating on Signal 13
Error: 230 124 remote_bitbang.c:106 remote_bitbang_quit(): fflush: Broken pipe
Error: 231 124 remote_bitbang.c:155 remote_bitbang_rread(): read: count=-1, error=Broken pipe
Error: 232 124 core.c:1452 jtag_init_inner(): Trying to use configured scan chain anyway...
Debug: 233 124 core.c:1190 jtag_validate_ircapture(): IR capture validation scan
Debug: 234 124 server.c:611 sig_handler(): Ignored extra Signal 13
Debug: 235 124 server.c:611 sig_handler(): Ignored extra Signal 13
Error: 236 124 remote_bitbang.c:106 remote_bitbang_quit(): fflush: Broken pipe
Error: 237 124 remote_bitbang.c:143 remote_bitbang_rread(): fflush: Broken pipe
Debug: 238 124 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Warn : 239 124 core.c:1475 jtag_init_inner(): Bypassing JTAG setup events due to errors
Debug: 240 124 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_dap init
Debug: 241 125 command.c:143 script_debug(): command - ocd_dap ocd_dap init
Debug: 243 125 arm_dap.c:105 dap_init_all(): Initializing all DAPs ...
Debug: 244 125 openocd.c:159 handle_init_command(): Examining targets...
Debug: 245 125 target.c:1609 target_call_event_callbacks(): target event 17 (examine-start) for core 992
Debug: 246 125 riscv.c:916 riscv_examine(): riscv_examine()
Debug: 247 125 server.c:611 sig_handler(): Ignored extra Signal 13
Debug: 248 125 server.c:611 sig_handler(): Ignored extra Signal 13
Error: 249 125 remote_bitbang.c:106 remote_bitbang_quit(): fflush: Broken pipe
Error: 250 125 remote_bitbang.c:143 remote_bitbang_rread(): fflush: Broken pipe
Error: 251 125 riscv.c:351 dtmcontrol_scan(): failed jtag scan: -4
Debug: 252 125 riscv.c:926 riscv_examine(): dtmcontrol=0xfffffffc
Debug: 253 125 riscv.c:928 riscv_examine():   version=0xc
Error: 254 125 riscv.c:376 get_target_type(): Unsupported DTM version: 12
Debug: 255 125 openocd.c:161 handle_init_command(): target examination failed
Debug: 256 125 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init
Debug: 257 125 command.c:143 script_debug(): command - ocd_flash ocd_flash init
Debug: 259 125 tcl.c:1222 handle_flash_init_command(): Initializing flash devices...
Debug: 260 125 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init
Debug: 261 125 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init
Debug: 263 125 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices...
Debug: 264 125 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init
Debug: 265 125 command.c:143 script_debug(): command - ocd_nand ocd_nand init
Debug: 267 125 tcl.c:497 handle_nand_init_command(): Initializing NAND devices...
Debug: 268 125 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init
Debug: 269 125 command.c:143 script_debug(): command - ocd_pld ocd_pld init
Debug: 271 125 pld.c:205 handle_pld_init_command(): Initializing PLDs...
Debug: 272 125 gdb_server.c:3425 gdb_target_start(): starting gdb server for riscv.cpu on 3333
Info : 273 125 server.c:311 add_service(): Listening on port 3333 for gdb connections
Debug: 274 125 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_halt
Debug: 275 125 command.c:143 script_debug(): command - halt ocd_halt
Debug: 277 125 target.c:3059 handle_halt_command(): -
Error: 278 125 target.c:573 target_halt(): Target not examined yet
Debug: 279 125 command.c:651 run_command(): Command 'halt' failed with error code -4
User : 280 125 command.c:715 command_run_line(): 
Debug: 281 125 riscv.c:411 riscv_deinit_target(): riscv_deinit_target()
Error: 282 125 riscv.c:376 get_target_type(): Unsupported DTM version: 12
Debug: 283 125 target.c:1959 target_free_all_working_areas_restore(): freeing all working areas
Debug: 284 125 server.c:611 sig_handler(): Ignored extra Signal 13
Error: 285 125 remote_bitbang.c:106 remote_bitbang_quit(): fflush: Broken pipe
Error: 286 125 core.c:1487 adapter_quit(): failed: -4
bluewww commented 5 years ago

Thanks I'm trying to fix this on the fix_dm_rtl branch, there I reverted the offending commit. Also I'm running simulations testing pulpissimo_compliance_test.cfg and pulpissimo_debug.cfg to figure out if and when the tb gets stuck

irays18 commented 3 years ago

Hi I am not able to locate the fix_dm_rtl branch. Is there any other way to fix this issue ? I see the same output as in @shiner-chen 's last comment.

shivampotdar commented 3 years ago

@bluewww can you please point to the fix_dm_rtl branch or give some idea for solving this issue. Thank you!

shivampotdar commented 3 years ago

I just realised there are changes to SimJTAG.sv in the current master branch which seems to solve the above issue. (I was 20 commits behind master and merged all with my local)

openocd proceeds from there but I ran it for an hour and still didn't get a prompt for gdb. Am I missing something here? Is "a while" supposed to be more than hour in https://github.com/pulp-platform/pulpissimo/blob/master/rtl/tb/README.md#jtag-taps-and-flash

Thanks!

bluewww commented 3 years ago

It is indeed extremly slow since openocd scans through 992 harts before finding the correct (working) one.

shivampotdar commented 3 years ago

Got it. It does eventually reach to 992 but with GDB I am not able to connect -

From GDB -

(gdb) target remote localhost:3333
Remote debugging using localhost:3333
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

From OpenOCD log -

Info : 13320 64559856 server.c:100 add_connection(): accepting 'gdb' connection on tcp/3333
Debug: 13321 64559856 breakpoints.c:358 breakpoint_clear_target_internal(): Delete all breakpoints for target: riscv.cpu
Debug: 13322 64559856 breakpoints.c:543 watchpoint_clear_target(): Delete all watchpoints for target: riscv.cpu
Debug: 13323 64559856 target.c:1609 target_call_event_callbacks(): target event 19 (gdb-attach) for core 992
Debug: 13324 64559856 target.c:4569 target_handle_event(): target(0): riscv.cpu (riscv) event: 19 (gdb-attach) action: halt
Debug: 13325 64559856 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_halt
Debug: 13326 64559856 command.c:143 script_debug(): command - halt ocd_halt
Debug: 13327 64559856 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (306022). This may cause trouble with GDB connections.
Debug: 13329 64559856 riscv.c:1550 riscv_openocd_poll(): polling all harts
Debug: 13330 64559856 riscv.c:2385 riscv_set_current_hartid(): setting hartid to 992, was 992
Debug: 13331 64559856 riscv.c:1504 riscv_poll_hart(): polling hart 992, target->state=2
Debug: 13332 64600784 riscv-013.c:393 scan(): 41b 3i r 00000000 @11 -> + 00000000 @11
Debug: 13333 64634049 riscv-013.c:393 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 13334 64634049 riscv-013.c:404 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 13336 64634049 target.c:3059 handle_halt_command(): -
Debug: 13337 64634049 riscv.c:1030 riscv_halt(): [992] halting all harts
Debug: 13338 64634049 riscv.c:963 halt_prep(): prep hart 992
Debug: 13339 64634050 riscv.c:2385 riscv_set_current_hartid(): setting hartid to 992, was 992
Debug: 13340 64675079 riscv-013.c:393 scan(): 41b 3i r 00000000 @11 -> + 00000000 @11
Debug: 13341 64709032 riscv-013.c:393 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 13342 64709032 riscv-013.c:404 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 13343 64709032 riscv.c:967 halt_prep(): Hart 992 is already halted.
Debug: 13344 64709032 riscv.c:2385 riscv_set_current_hartid(): setting hartid to 992, was 992
Debug: 13345 64751258 riscv-013.c:393 scan(): 41b 3i r 00000000 @11 -> + 00000000 @11
Debug: 13346 64786276 riscv-013.c:393 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 13347 64786276 riscv-013.c:404 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 13348 64786276 riscv.c:987 riscv_halt_go_all_harts(): Hart 992 is already halted.
Debug: 13349 64786276 riscv.c:2401 riscv_invalidate_register_cache(): [992]
Debug: 13350 64786276 target.c:1609 target_call_event_callbacks(): target event 0 (gdb-halt) for core 992
Debug: 13351 64786276 target.c:1609 target_call_event_callbacks(): target event 1 (halted) for core 992
Debug: 13352 64786276 riscv.c:1550 riscv_openocd_poll(): polling all harts
Debug: 13353 64786276 riscv.c:2385 riscv_set_current_hartid(): setting hartid to 992, was 992
Debug: 13354 64786276 riscv.c:1504 riscv_poll_hart(): polling hart 992, target->state=2
Debug: 13355 64830336 riscv-013.c:393 scan(): 41b 3i r 00000000 @11 -> + 00000000 @11
Debug: 13356 64864447 riscv-013.c:393 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 13357 64864447 riscv-013.c:404 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 13358 64864447 gdb_server.c:1014 gdb_new_connection(): New GDB Connection: 1, Target riscv.cpu, state: halted
Debug: 13359 64864447 gdb_server.c:1046 gdb_connection_closed(): GDB Close, Target: riscv.cpu, state: halted, gdb_actual_connections=0
Debug: 13360 64864447 target.c:1609 target_call_event_callbacks(): target event 6 (gdb-end) for core 992
Debug: 13361 64864447 target.c:1609 target_call_event_callbacks(): target event 20 (gdb-detach) for core 992
Info : 13362 64864447 server.c:577 server_loop(): dropped 'gdb' connection
Debug: 13363 64864447 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (304591). This may cause trouble with GDB connections.
Debug: 13365 64864447 riscv.c:1550 riscv_openocd_poll(): polling all harts
Debug: 13366 64864447 riscv.c:2385 riscv_set_current_hartid(): setting hartid to 992, was 992
shivampotdar commented 3 years ago

I found this https://github.com/pulp-platform/pulpino/issues/140 and with this version of gdb, the log says :

(gdb) target remote localhost:3333
Remote debugging using localhost:3333
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Bogus trace status reply from target: timeout