From 78b56e25c217338519d51818dce663742c783da9 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Mon, 11 Apr 2022 16:58:35 +0200 Subject: [PATCH] riscv: Increase batch allocation size to improve transfer speed. (#689) Change-Id: I4cd1479f4d2f7b63cd594f5cef9d6b3d877d9015 Signed-off-by: Charles Papon --- src/target/riscv/riscv-013.c | 6 +++--- src/target/riscv/riscv.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index b719fa4f5..63b40c687 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -3151,7 +3151,7 @@ static int read_memory_progbuf_inner(struct target *target, target_addr_t addres * dm_data0 contains[read_addr-size*2] */ - struct riscv_batch *batch = riscv_batch_alloc(target, 32, + struct riscv_batch *batch = riscv_batch_alloc(target, RISCV_BATCH_ALLOC_SIZE, info->dmi_busy_delay + info->ac_busy_delay); if (!batch) return ERROR_FAIL; @@ -3649,7 +3649,7 @@ static int write_memory_bus_v1(struct target *target, target_addr_t address, struct riscv_batch *batch = riscv_batch_alloc( target, - 32, + RISCV_BATCH_ALLOC_SIZE, info->dmi_busy_delay + info->bus_master_write_delay); if (!batch) return ERROR_FAIL; @@ -3843,7 +3843,7 @@ static int write_memory_progbuf(struct target *target, target_addr_t address, struct riscv_batch *batch = riscv_batch_alloc( target, - 32, + RISCV_BATCH_ALLOC_SIZE, info->dmi_busy_delay + info->ac_busy_delay); if (!batch) goto error; diff --git a/src/target/riscv/riscv.h b/src/target/riscv/riscv.h index 5dc2152c6..f3b753038 100644 --- a/src/target/riscv/riscv.h +++ b/src/target/riscv/riscv.h @@ -29,6 +29,8 @@ struct riscv_program; #define RISCV_NUM_MEM_ACCESS_METHODS 3 +#define RISCV_BATCH_ALLOC_SIZE 128 + extern struct target_type riscv011_target; extern struct target_type riscv013_target;