From a515542adcd45543e9e14e0248f066a81cf56b6f Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Mon, 13 Jun 2022 16:59:21 +0200 Subject: [PATCH] Speed up tb/jtag_pkg.sv load_L2 task Use address autoincrementation to speed up loading of a binary when using the riscv-dbg module. --- rtl/tb/jtag_pkg.sv | 59 +++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/rtl/tb/jtag_pkg.sv b/rtl/tb/jtag_pkg.sv index 915bfdd2..f358fd9a 100644 --- a/rtl/tb/jtag_pkg.sv +++ b/rtl/tb/jtag_pkg.sv @@ -1502,11 +1502,11 @@ package jtag_pkg; jtag_data[0] = stimuli[num_stim][63:0]; // assign data this.set_sbreadonaddr(1'b0, s_tck, s_tms, s_trstn, s_tdi, s_tdo); - this.set_sbautoincrement(1'b0, s_tck, s_tms, s_trstn, s_tdi, s_tdo); + this.set_sbautoincrement(1'b1, s_tck, s_tms, s_trstn, s_tdi, s_tdo); $display("[JTAG] %t - Loading L2 with debug module jtag interface", $realtime); - spi_addr_old = spi_addr - 32'h8; + spi_addr_old = '1;//spi_addr - 32'h8; while (more_stim) begin // loop until we have no more stimuli @@ -1523,6 +1523,17 @@ package jtag_pkg; if (spi_addr != (spi_addr_old + 32'h8)) begin spi_addr_old = spi_addr - 32'h8; + this.set_dmi( + 2'b10, //write + 7'h39, //sbaddress0, + spi_addr[31:0], //bootaddress + {dm_addr, dm_data, dm_op}, + s_tck, + s_tms, + s_trstn, + s_tdi, + s_tdo + ); break; end else begin @@ -1530,17 +1541,17 @@ package jtag_pkg; end spi_addr_old = spi_addr; - this.set_dmi( - 2'b10, //write - 7'h39, //sbaddress0, - spi_addr[31:0], //bootaddress - {dm_addr, dm_data, dm_op}, - s_tck, - s_tms, - s_trstn, - s_tdi, - s_tdo - ); + // this.set_dmi( + // 2'b10, //write + // 7'h39, //sbaddress0, + // spi_addr[31:0], //bootaddress + // {dm_addr, dm_data, dm_op}, + // s_tck, + // s_tms, + // s_trstn, + // s_tdi, + // s_tdo + // ); this.set_dmi( 2'b10, //write @@ -1554,17 +1565,17 @@ package jtag_pkg; s_tdo ); //$display("[JTAG] Loading L2 - Written %x at %x (%t)", jtag_data[0], spi_addr[31:0], $realtime); - this.set_dmi( - 2'b10, //write - 7'h39, //sbaddress0, - spi_addr[31:0]+4, //bootaddress - {dm_addr, dm_data, dm_op}, - s_tck, - s_tms, - s_trstn, - s_tdi, - s_tdo - ); + // this.set_dmi( + // 2'b10, //write + // 7'h39, //sbaddress0, + // spi_addr[31:0]+4, //bootaddress + // {dm_addr, dm_data, dm_op}, + // s_tck, + // s_tms, + // s_trstn, + // s_tdi, + // s_tdo + // ); this.set_dmi( 2'b10, //write