From 6f0c6f23ceb0e699e0712b4a74069fd599912c87 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 13 May 2021 17:18:38 -0700 Subject: [PATCH] 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 --- src/jtag/drivers/remote_bitbang.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 90451a7d4..2e7892c24 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 =