diff --git a/corev_apu/tb/ariane_tb.sv b/corev_apu/tb/ariane_tb.sv index ce85ecdaf99..5808f94351d 100644 --- a/corev_apu/tb/ariane_tb.sv +++ b/corev_apu/tb/ariane_tb.sv @@ -136,7 +136,7 @@ module ariane_tb; // Note that we are loosing the capabilities to use risc-fesvr though initial begin automatic logic [7:0][7:0] mem_row; - longint address, len; + longint address, load_address, last_load_address, len; byte buffer[]; void'(uvcl.get_arg_value("+elf_file=", binary)); @@ -147,6 +147,7 @@ module ariane_tb; // wait with preloading, otherwise randomization will overwrite the existing value wait(clk_i); + last_load_address = 'hFFFFFFFF; // while there are more sections to process while (get_section(address, len)) begin automatic int num_words = (len+7)/8; @@ -160,7 +161,14 @@ module ariane_tb; for (int j = 0; j < 8; j++) begin mem_row[j] = buffer[i*8 + j]; end - `MAIN_MEM((address[23:0] >> 3) + i) = mem_row; + load_address = (address[23:0] >> 3) + i; + if (load_address != last_load_address) begin + `MAIN_MEM(load_address) = mem_row; + last_load_address = load_address; + end else begin + `uvm_info( "Debug info", $sformatf(" Address: %x Already Loaded! ELF file might have less than 64 bits granularity on segments.", load_address), UVM_LOW) + end + end end end diff --git a/verif/tb/uvmt/cva6_tb_wrapper.sv b/verif/tb/uvmt/cva6_tb_wrapper.sv index 8656815831a..1241d8b3b6a 100644 --- a/verif/tb/uvmt/cva6_tb_wrapper.sv +++ b/verif/tb/uvmt/cva6_tb_wrapper.sv @@ -241,7 +241,7 @@ module cva6_tb_wrapper import uvmt_cva6_pkg::*; #( ); if(!axi_switch_vif.active) begin automatic logic [7:0][7:0] mem_row; - longint address; + longint address, load_address, last_load_address; longint len; byte buffer[]; void'(uvcl.get_arg_value("+elf_file=", binary)); @@ -251,6 +251,7 @@ module cva6_tb_wrapper import uvmt_cva6_pkg::*; #( void'(read_elf(binary)); wait(clk_i); + last_load_address = 'hFFFFFFFF; // while there are more sections to process while (get_section(address, len)) begin automatic int num_words0 = (len+7)/8; @@ -264,7 +265,13 @@ module cva6_tb_wrapper import uvmt_cva6_pkg::*; #( for (int j = 0; j < 8; j++) begin mem_row[j] = buffer[i*8 + j]; end - `MAIN_MEM((address[23:0] >> 3) + i) = mem_row; + load_address = (address[23:0] >> 3) + i; + if (load_address != last_load_address) begin + `MAIN_MEM(load_address) = mem_row; + last_load_address = load_address; + end else begin + `uvm_info( "Debug info", $sformatf(" Address: %x Already Loaded! ELF file might have less than 64 bits granularity on segments.", load_address), UVM_LOW) + end end end end