Skip to content

Commit

Permalink
Updated tb_util for new memory bank organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît Denkinger committed Nov 29, 2023
1 parent 82ac80b commit 6d29d6a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tb/tb_util.svh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ task tb_loadHEX;
stimuli[i+3], stimuli[i+2], stimuli[i+1], stimuli[i]
};

wait (heepsilon_top_i.x_heep_system_i.core_v_mini_mcu_i.debug_subsystem_i.dm_obi_top_i.master_gnt_i);

@(posedge heepsilon_top_i.x_heep_system_i.core_v_mini_mcu_i.clk_i);
while(!heepsilon_top_i.x_heep_system_i.core_v_mini_mcu_i.debug_subsystem_i.dm_obi_top_i.master_gnt_i)
@(posedge heepsilon_top_i.x_heep_system_i.core_v_mini_mcu_i.clk_i);

#1;
force heepsilon_top_i.x_heep_system_i.core_v_mini_mcu_i.debug_subsystem_i.dm_obi_top_i.master_req_o = 1'b0;
Expand All @@ -74,13 +73,22 @@ task tb_loadHEX;
`else

stimuli_counter = 0;
% for bank in range(ram_numbanks):
% for bank in range(ram_numbanks_cont):
for (i = 0; i < NumBytes / NumBanks; i = i + 4) begin
tb_writetoSram${bank}(i / 4, stimuli[stimuli_counter+3], stimuli[stimuli_counter+2],
stimuli[stimuli_counter+1], stimuli[stimuli_counter]);
stimuli_counter = stimuli_counter + 4;
end
% endfor
% if ram_numbanks_il != 0:
for (i = 0; i < NumBytes / NumBanks; i = i + 4) begin
% for bank in range(ram_numbanks_il):
tb_writetoSram${int(ram_numbanks_cont) + bank}(i / 4, stimuli[stimuli_counter+3], stimuli[stimuli_counter+2],
stimuli[stimuli_counter+1], stimuli[stimuli_counter]);
stimuli_counter = stimuli_counter + 4;
% endfor
end
% endif

`endif

Expand Down

0 comments on commit 6d29d6a

Please sign in to comment.