aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-05-13 17:18:38 -0700
committerTim Newsome <tim@sifive.com>2021-05-13 17:25:46 -0700
commit6f0c6f23ceb0e699e0712b4a74069fd599912c87 (patch)
treefb8af2ef6de900c74a3df18a9d69c8f1feaf2d0b
parent726c06ca3da324cd521a2f7074ea339ec26259d5 (diff)
downloadriscv-openocd-6f0c6f23ceb0e699e0712b4a74069fd599912c87.zip
riscv-openocd-6f0c6f23ceb0e699e0712b4a74069fd599912c87.tar.gz
riscv-openocd-6f0c6f23ceb0e699e0712b4a74069fd599912c87.tar.bz2
Fill the buffer before blocking on 1-byte read.
Speeds up spike64-2 CheckMisa from 3.49s to 2.92s. Change-Id: Id4d4042b043f560ef90d58777d99cdcc41053b18 Signed-off-by: Tim Newsome <tim@sifive.com>
-rw-r--r--src/jtag/drivers/remote_bitbang.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c
index 90451a7..2e7892c 100644
--- a/src/jtag/drivers/remote_bitbang.c
+++ b/src/jtag/drivers/remote_bitbang.c
@@ -181,6 +181,10 @@ static int remote_bitbang_sample(void)
static bb_value_t remote_bitbang_read_sample(void)
{
+ if (remote_bitbang_start == remote_bitbang_end) {
+ if (remote_bitbang_fill_buf() != ERROR_OK)
+ return ERROR_FAIL;
+ }
if (remote_bitbang_start != remote_bitbang_end) {
int c = remote_bitbang_buf[remote_bitbang_start];
remote_bitbang_start =