Skip to content

Commit

Permalink
[VTA][Runtime] clear sram index in reset (apache#5470)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhang Hao <[email protected]>
  • Loading branch information
2 people authored and trevor-m committed Jun 18, 2020
1 parent 10f8a26 commit 5043ace
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vta/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}

Expand Down Expand Up @@ -446,6 +449,13 @@ class UopQueue : public BaseQueue<VTAUop> {
}
/*! \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<VTAUop>::Reset();
Expand Down

0 comments on commit 5043ace

Please sign in to comment.