Skip to content

Commit 6f7b081

Browse files
committed
fix(mem_tester): fix latency histogram
1 parent 903299e commit 6f7b081

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

comp/debug/mem_tester/sw/report_gen.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,20 @@ def latency_table(pdf, bursts, data):
276276
req_cnt = np.array(data['Requests']["rd req cnt"]).reshape(-1, 1)
277277

278278
hist_arr = hist_arr / req_cnt
279-
offset = hist_x[1] - hist_x[0]
279+
hist_arr = hist_arr.T
280+
281+
# Delete all empty rows
282+
# But leave last one empty row for better visuals
283+
while hist_arr.shape[0] > 0 and np.all(hist_arr[-2:] <= 0):
284+
hist_arr = hist_arr[:-1]
285+
hist_x = hist_x[:-1]
286+
280287
limits = (
281288
min(burst_seq_b), max(burst_seq_b),
282-
min(data['Values']['latency']['min']) - offset,
283-
max(data['Values']['latency']['max']) - offset
289+
hist_x[0], hist_x[-1]
284290
)
285291

286-
graph_gen.init_plots() # title="Read latency")
292+
graph_gen.init_plots()
287293
graph_gen.basic_plot(burst_seq_b, [
288294
data['Values']['latency']["min"],
289295
data['Values']['latency']["max"],
@@ -293,15 +299,6 @@ def latency_table(pdf, bursts, data):
293299
graph_gen.set_ylabel("latency [ns]")
294300
graph_gen.plot_save(f"{index}_latency_" + type)
295301

296-
#zoom_burst = 0
297-
#x = list(data['latency']['hist_ns'].keys())
298-
#y = [i[zoom_burst] for i in data['latency']['hist_ns'].values()]
299-
#graph_gen.init_plots() #title="Read latency")
300-
#graph_gen.histogram_plot(x, [y], log=True)
301-
#graph_gen.set_xlabel("latency [ns]")
302-
#graph_gen.set_ylabel("occurrence")
303-
#graph_gen.plot_save(f"{index}_latency_" + type + f'_zoom_{zoom_burst}')
304-
305302
## Generate PDF ##
306303
print_progress(progress, 'generating report')
307304
pdf.heading(1, "Memory tester report")

0 commit comments

Comments
 (0)