[Bugfix] [VTA] VTA DRAM Have A Logic Issue May Cause GEMM Output Wrong. (#3278)
authorHua <allenhjiang@outlook.com>
Tue, 4 Jun 2019 16:47:29 +0000 (09:47 -0700)
committerThierry Moreau <moreau@uw.edu>
Tue, 4 Jun 2019 16:47:29 +0000 (09:47 -0700)
commit38604d92657f1c6bc82e4f92bf6d50c9b8096f9c
treefbf88918e785d5f3905303fd7125228fc03f1997
parent58e15fe10fb47876d5706c1b075c8ba4fe309004
[Bugfix] [VTA] VTA DRAM Have A Logic Issue May Cause GEMM Output Wrong. (#3278)

* [Bugfix] [VTA] VTA DRAM Have A Logic Issue May Cause GEMM Output Wrong.

Symptom:
after change “LOG_BLOCK_IN” and “LOG_BLOCK_OUT” from vta_config.json
into 7, run vta "Simple Matrix Multiply" in "simulator", the vta
calculate result for GEMM is wrong.

Sometime VTA crash with error “Check failed: phy_addr != 0 (0 vs. 0) :
trying to get address that is nullptr”

Analysis:
Simulator hardcode kPageSize into 1<<12 and physical address calculate
based on this size, when doing “insn->dram_base” calculation , because
GetElemBytes(dst_memory_type) larger than page size, different physcial
address may get same dram_base, than caused logic issue and finally
trigger GEMM out put is wrong.

Solution:
add logic to check if PAGE SIZE larger then "GetElemBytes" return value.

* address review comments.
vta/include/vta/driver.h
vta/src/runtime.cc
vta/src/sim/sim_driver.cc