Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane

From: Freddie Chopin <freddie_chopin-FWhLrETftxM <at> public.gmane.org>
Subject: Investigating speed penalty of fixes to working area regression & ultimate battle between ftdi.c and ft2232.c drivers
Newsgroups: gmane.comp.debugging.openocd.devel
Date: Friday 5th October 2012 13:45:51 UTC (over 6 years ago)
Hi!

This message serves two purposes:
1. Investigate the alleged speed penalty imposed by this fix:

All tests were carried out using LPC1769 chip.

---

TEST 1A

core @ 4MHz, CCLK == 4000, USB 1.0 adapter (JTAG-lock-pick 1)

a. ft2232.c driver, adapter_khz == 500
- fix applied
wrote 524288 bytes from file d:/load.hex in 102.592773s (4.991 KiB/s)
wrote 524288 bytes from file d:/load.hex in 102.516602s (4.994 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 101.890625s (5.025 KiB/s)
wrote 524288 bytes from file d:/load.hex in 101.892578s (5.025 KiB/s)

b. ftdi.c driver, adapter_khz == 500
* this driver does not work reliably for LPC1769 with adapter at 500kHz

c. ft2232.c driver, adapter_khz == 250
- fix applied
wrote 524288 bytes from file d:/load.hex in 115.712891s (4.425 KiB/s)
wrote 524288 bytes from file d:/load.hex in 115.690430s (4.426 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 115.155273s (4.446 KiB/s)
wrote 524288 bytes from file d:/load.hex in 115.226562s (4.443 KiB/s)

d. ftdi.c driver, adapter_khz == 250
- fix applied
wrote 524288 bytes from file d:/load.hex in 74.364258s (6.885 KiB/s)
wrote 524288 bytes from file d:/load.hex in 74.273438s (6.893 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 73.831055s (6.935 KiB/s)
wrote 524288 bytes from file d:/load.hex in 73.829102s (6.935 KiB/s)

---

TEST 1B

core @ 4MHz, CCLK == 4000, USB 2.0 adapter (JTAG-lock-pick Tiny 2)

a. ft2232.c driver, adapter_khz == 500
- fix applied
wrote 524288 bytes from file d:/load.hex in 58.613281s (8.735 KiB/s)
wrote 524288 bytes from file d:/load.hex in 58.629883s (8.733 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 58.229492s (8.793 KiB/s)
wrote 524288 bytes from file d:/load.hex in 58.210938s (8.796 KiB/s)

b. ftdi.c driver, adapter_khz == 500
* this driver does not work reliably for LPC1769 with adapter at 500kHz

c. ft2232.c driver, adapter_khz == 250
- fix applied
wrote 524288 bytes from file d:/load.hex in 72.180664s (7.093 KiB/s)
wrote 524288 bytes from file d:/load.hex in 72.190430s (7.092 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 71.818359s (7.129 KiB/s)
wrote 524288 bytes from file d:/load.hex in 71.820312s (7.129 KiB/s)

d. ftdi.c driver, adapter_khz == 250
- fix applied
wrote 524288 bytes from file d:/load.hex in 57.686523s (8.876 KiB/s)
wrote 524288 bytes from file d:/load.hex in 57.723633s (8.870 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 57.459961s (8.911 KiB/s)
wrote 524288 bytes from file d:/load.hex in 57.467773s (8.909 KiB/s)

e. ft2232.c driver, jtag_rclk
- fix applied
wrote 524288 bytes from file d:/load.hex in 59.276367s (8.638 KiB/s)
wrote 524288 bytes from file d:/load.hex in 59.256836s (8.640 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 58.910156s (8.691 KiB/s)
wrote 524288 bytes from file d:/load.hex in 58.856445s (8.699 KiB/s)

f. ftdi.c driver, jtag_rclk
- fix applied
wrote 524288 bytes from file d:/load.hex in 58.623047s (8.734 KiB/s)
wrote 524288 bytes from file d:/load.hex in 58.862305s (8.698 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 58.413086s (8.765 KiB/s)
wrote 524288 bytes from file d:/load.hex in 58.418945s (8.764 KiB/s)

---

TEST 2A

core @ 120MHz, CCLK == 120000, USB 1.0 adapter (JTAG-lock-pick 1)

a. ft2232.c driver, adapter_khz == 6000
- fix applied
wrote 524288 bytes from file d:/load.hex in 89.126953s (5.745 KiB/s)
wrote 524288 bytes from file d:/load.hex in 89.171875s (5.742 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 88.877930s (5.761 KiB/s)
wrote 524288 bytes from file d:/load.hex in 88.857422s (5.762 KiB/s)

b. ftdi.c driver, adapter_khz == 6000
- fix applied
wrote 524288 bytes from file d:/load.hex in 27.361328s (18.713 KiB/s)
wrote 524288 bytes from file d:/load.hex in 27.367188s (18.709 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 27.081055s (18.906 KiB/s)
wrote 524288 bytes from file d:/load.hex in 27.106445s (18.888 KiB/s)

---

TEST 2B

core @ 120MHz, CCLK == 120000, USB 2.0 adapter (JTAG-lock-pick Tiny 2)

a. ft2232.c driver, adapter_khz == 6000
- fix applied
wrote 524288 bytes from file d:/load.hex in 45.307617s (11.301 KiB/s)
wrote 524288 bytes from file d:/load.hex in 45.303711s (11.302 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 44.911133s (11.400 KiB/s)
wrote 524288 bytes from file d:/load.hex in 44.922852s (11.397 KiB/s)

b. ftdi.c driver, adapter_khz == 6000
- fix applied
wrote 524288 bytes from file d:/load.hex in 10.327148s (49.578 KiB/s)
wrote 524288 bytes from file d:/load.hex in 10.294922s (49.733 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 10.448242s (49.003 KiB/s)
wrote 524288 bytes from file d:/load.hex in 10.274414s (49.833 KiB/s)

c. ft2232.c driver, adapter_khz == 15000 (fastest for 120MHz core)
- fix applied
wrote 524288 bytes from file d:/load.hex in 44.667969s (11.462 KiB/s)
wrote 524288 bytes from file d:/load.hex in 44.678711s (11.460 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 44.429688s (11.524 KiB/s)
wrote 524288 bytes from file d:/load.hex in 44.417969s (11.527 KiB/s)

d. ftdi.c driver, adapter_khz == 15000 (fastest for 120MHz core)
- fix applied
wrote 524288 bytes from file d:/load.hex in 8.908204s (57.475 KiB/s)
wrote 524288 bytes from file d:/load.hex in 8.761718s (58.436 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 8.709961s (58.783 KiB/s)
wrote 524288 bytes from file d:/load.hex in 8.766602s (58.403 KiB/s)

e. ft2232.c driver, jtag_rclk
- fix applied
wrote 524288 bytes from file d:/load.hex in 71.053711s (7.206 KiB/s)
wrote 524288 bytes from file d:/load.hex in 71.046875s (7.207 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 70.862305s (7.225 KiB/s)
wrote 524288 bytes from file d:/load.hex in 70.917969s (7.220 KiB/s)

f. ftdi.c driver, jtag_rclk
- fix applied
wrote 524288 bytes from file d:/load.hex in 57.305664s (8.935 KiB/s)
wrote 524288 bytes from file d:/load.hex in 57.230469s (8.946 KiB/s)
- revert applied
wrote 524288 bytes from file d:/load.hex in 57.043945s (8.976 KiB/s)
wrote 524288 bytes from file d:/load.hex in 57.604492s (8.888 KiB/s)

---

As a reward for this pretty long and boring test I allowed myself to 
give some comments.

First of all - the fix for working area problem from:
http://openocd.zylin.com/#/c/860/
does not impede speed in noticeable way - the general difference is 
below 1%, and - believe me - I can slow down the transfers way more 
(10-20%) by just browsing websites while flashing, not mentioning doing 
something really heavy on CPU. Bu just typing this email while doing 
some last tests the speed dropped from 8.6 to 7 (I repeated the tests 
doing nothing). That's why I think that other fixes for the problem may 
pose similar "speed penalty" - which I would call "none".

Second of all - ft2232.c driver does not scale with adapter_khz at all! 
With 60x the adapter_khz, the speed gain is about 50% - compare to 
ftdi.c gain which for that case is over 650%...

Third thing - when using RCLK the gain of using ftdi.c over ft2232.c is 
much smaller - at most 20%, at worst case (core @ 4MHz) it's slower or 
comparable.

Four - general gain of using ftdi.c over ft2232.c (excluging RCLK case) 
is at least 23%, at most over 50%) - for LPC17xx.

Last thing - Using USB 2.0 adapter in place of USB 1.0 one gives drastic 
improvement, the smallest gain is for ftdi.c and 250kHz - under 30%, for 
ftdi.c and 6MHz the gain is over 270%!

Anyway - I've come up with an idea of "fixing" lpc2xxx/17xx driver 
without ANY speed penalty, so stay tuned (;

4\/3!!

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
 
CD: 17ms