-
Notifications
You must be signed in to change notification settings - Fork 57
Description
The kernel conv2d_3x3_unrolled2_i8_xpulpv2 from software/runtime/xpulp/conv_2d.h used in the application software/apps/onv2d_i8/main.c will result in out of bounds memory accesses. This was discovered by running the benchmark in the hardware folder with snitch_tracing enabled. The trace will contain X values which hardware/scripts/gen_trace.py cannot handle at the moment.
Steps to reproduce problem:
-
In
hardware/Makefilesetsnitch_trace?=1(l. 49) and change l. 271 tobenchmark: log simcvcs. -
In
software/runtime/crt0.Sreplace l.88-89 withwfi. (This step might be optional) -
In the
softwarefolder, runmake apps xpulpimg=1 config=mempool. -
If necessary, do
unset CC && unset CXX. In thehardwarefolder, runmake benchmark config=mempool xpulpimg=1 app=conv2d_i8.
--> this will result inhardware/scripts/gen_trace.pyfailing
TRACE:
python3 /scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py -p --csv build/traces/results.csv build/traces/trace_hart_0x0000 > build/trace_hart_0x0000.trace
Traceback (most recent call last):
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 910, in <module> sys.exit(main()
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 828, in main args.permissive)
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 541, in annotate_insn permissive)
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 374, in annotate_snitch int_lit(extras['ld_result_32'])))
KeyError: 'ld_result_32'
make[1]: *** [build/trace_hart_0x0000.trace] Error 1 -
When looking at the end of the file
hardware/build/trace_hart_0x0000.traceit is clear that the last few instructions try to load values from an out of bound address0x0040400. The address is defined insoftware/bin/conv2d_i8.dumpas<out>. -
Further when looking in
hardware/build/trace_hart_0x0000.dasmand searching for the number in the first column oftrace_hart_0x0000.tracewhere the problem occurs, one can find values which contain X's. These are the reason whygen_trace.pyfails.