From 684f2d7b89e29b92cdac5389df58ba5a70782c2a Mon Sep 17 00:00:00 2001 From: ZHANG Hao Date: Thu, 30 Apr 2020 08:54:57 +0800 Subject: [PATCH] [VTA][Runtime] clear sram index in reset (#5470) Co-authored-by: Zhang Hao --- vta/runtime/runtime.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vta/runtime/runtime.cc b/vta/runtime/runtime.cc index 038d5cf..0e48e16 100644 --- a/vta/runtime/runtime.cc +++ b/vta/runtime/runtime.cc @@ -351,6 +351,9 @@ class BaseQueue { */ virtual void Reset() { dram_buffer_.clear(); + // reset to 0 as we always copy data to area starting from fpga_buff base + // we do mem copy for every DeviceRun + sram_end_ = 0; sram_begin_ = sram_end_; } @@ -446,6 +449,13 @@ class UopQueue : public BaseQueue { } /*! \brief clear cache and reset base queue buffer.*/ void Reset() { + // unmark "cached" status + // as we cannot assume it is still in SRAM across DeviceRun + for (UopKernel* kernel : cache_) { + kernel->sram_begin_ = 0; + kernel->sram_end_ = 0; + } + cache_.clear(); cache_idx_ = 0; BaseQueue::Reset(); -- 2.7.4