#152285 - simonjhall - Thu Mar 13, 2008 10:36 am
I've gone back to developing my debugger for the DS.
First thing I want to address is the crap speed. Due to the way gdb works, in order to step a line of code lots of comms has to happen with the target, and due to the round-trip time this makes stepping kinda sluggish.
To find the bottleneck a bit I've made the test a bit more replicatable - get gdb to download 64k of data from the target to disk. The comms goes like this:
GDB asks stub for ~128b of data
Stub asks DS for the data
DS sends data to stub
Stub sends data to GDB.
This'll happen over and over until the data has been copied.
If I snoop all the packets with a packet sniffer, it seems that once the message gets sent to the DS the DS won't respond with a packet for nearly 50ms. The DS is sitting in a tight loop waiting for messages (with a small delay if no message) and once one shows it'll reply straight away.
Profiling the DS-side of the code says that most of the time the machine is idling waiting for a message and when the reply message is actually sent only a small amount of time is spent doing the sending.
So what can I do to improve the latency? I've changed the ARM9 wifi stuff from the default timer of 50ms to 20ms - no change. I've put the ARM7 Wifi_Update call into the hblank - no change. Is there some kind of internal buffering going on that I need to flush? What can I do?! Does anyone else get poor round-trip times?
_________________
Big thanks to everyone who donated for Quake2
First thing I want to address is the crap speed. Due to the way gdb works, in order to step a line of code lots of comms has to happen with the target, and due to the round-trip time this makes stepping kinda sluggish.
To find the bottleneck a bit I've made the test a bit more replicatable - get gdb to download 64k of data from the target to disk. The comms goes like this:
GDB asks stub for ~128b of data
Stub asks DS for the data
DS sends data to stub
Stub sends data to GDB.
This'll happen over and over until the data has been copied.
If I snoop all the packets with a packet sniffer, it seems that once the message gets sent to the DS the DS won't respond with a packet for nearly 50ms. The DS is sitting in a tight loop waiting for messages (with a small delay if no message) and once one shows it'll reply straight away.
Profiling the DS-side of the code says that most of the time the machine is idling waiting for a message and when the reply message is actually sent only a small amount of time is spent doing the sending.
So what can I do to improve the latency? I've changed the ARM9 wifi stuff from the default timer of 50ms to 20ms - no change. I've put the ARM7 Wifi_Update call into the hblank - no change. Is there some kind of internal buffering going on that I need to flush? What can I do?! Does anyone else get poor round-trip times?
_________________
Big thanks to everyone who donated for Quake2