Add read buffer to bitbang, improving performance. 12/4312/9
authorTim Newsome <tim@sifive.com>
Wed, 13 Dec 2017 21:13:22 +0000 (13:13 -0800)
committerFreddie Chopin <freddie.chopin@gmail.com>
Thu, 25 Jan 2018 16:44:06 +0000 (16:44 +0000)
commit64f1f7b1c179dcce4e008bef6bf9515c47ae4100
treea794f86845ec6ed21d387f1970f6c86018fe1058
parent2428722a23d8a08b15331ab95884762e5f329a02
Add read buffer to bitbang, improving performance.

Previously for every bit scanned OpenOCD would write the bit, wait for
that bit to be scanned, and then read the result. This involves at least
2 context switches. Most of the time the next bit scanned does not
depend on the last bit we read, so with a buffer we now write a bunch of
bits to be scanned all at once, and then we wait for them all to be
scanned and have a result.

This reduces the time for one testcase where OpenOCD connects to a
simulator from 12.30s to 5.35s!

Running all our tests went from 13m13s to 3m55s.

Change-Id: Ie9fcea043ac1d7877a521125334ed47d4b3e1615
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4312
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/helper/replacements.h
src/jtag/drivers/at91rm9200.c
src/jtag/drivers/bcm2835gpio.c
src/jtag/drivers/bitbang.c
src/jtag/drivers/bitbang.h
src/jtag/drivers/dummy.c
src/jtag/drivers/ep93xx.c
src/jtag/drivers/imx_gpio.c
src/jtag/drivers/parport.c
src/jtag/drivers/remote_bitbang.c
src/jtag/drivers/sysfsgpio.c