From 5043aced66e1593d10df2b8e3c71079aecd8d813 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 038d5cfa398c..0e48e165958b 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();