Skip to content

Commit ba2d59a

Browse files
committed
Merge branch 'xnevrk03-fix-mem-tester' into 'devel'
Fix mem tester See merge request ndk/ndk-fpga!146
2 parents 67acd05 + 0717b22 commit ba2d59a

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

comp/debug/mem_tester/sw/mem_tester.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ def config_test(
205205
}
206206

207207
def check_test_result(self, config, status, stats):
208+
burst = status['burst_cnt']
208209
errs = ""
209210
if status["err_cnt"] != 0 and not config["rand_addr"]:
210211
errs += f"{status['err_cnt']} words were wrong\n"
211212
if status["ecc_err_occ"]:
212213
errs += "ECC error occurred\n"
213-
if stats['Requests']["rd req words"] != stats['Requests']["rd resp words"]:
214-
errs += f"{stats['Requests']['rd req words'] - stats['Requests']['rd resp words']} words were not received\n"
214+
if stats['Requests']["rd req cnt"][-1] * burst != stats['Requests']["rd resp words"][-1]:
215+
errs += f"{stats['Requests']['rd req cnt'][-1] * burst - stats['Requests']['rd resp words'][-1]} words were not received\n"
215216
if not status["test_succ"] and errs == "" and not config["rand_addr"]:
216217
errs += "Unknown error occurred\n"
217218
return errs

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)