Interleaving-mapping: a novel data layout in scratchpad memory
lingling zeng, Dunbo Zhang, Li Shen, Qiang Dou · 2023
Although linear address space is very simple, it forces a two-dimensional matrix to be stored using either row-major mode or column-major mode. These two modes lead to non-uniform memory access latencies because of their different data localities. A common solution to improve the efficiency of column-major accesses is matrix transposition. However, transposition not only introduces extra data transfer operations but also increases the memory space consumption which is used to hold the transposed matrix or columns. If the column-major accesses can be performed as efficient as the row-major accesses, the transposition will be unnecessary. This paper proposes an interleaving-mapping data layout. With this method, both the row-major and the column-major accesses can be implemented with customized read/write instructions. The interleaving-mapping data layout have been implemented in scratchpad memory. The experimental results show that interleaving-mapping scratchpad memory can provide 1.4x speedup on average with only 1.73% extra area overhead.