This is an automated email from the ASF dual-hosted git repository.

moreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm-vta.git


The following commit(s) were added to refs/heads/master by this push:
     new 21937a0  [pynq_driver] fix device early return (#7)
21937a0 is described below

commit 21937a067fe0e831244766b41ae915c833ff15ba
Author: ZHANG Hao <[email protected]>
AuthorDate: Fri May 1 13:42:48 2020 +0800

    [pynq_driver] fix device early return (#7)
    
    Co-authored-by: Zhang Hao <[email protected]>
---
 src/pynq/pynq_driver.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/pynq/pynq_driver.cc b/src/pynq/pynq_driver.cc
index a37bb4e..518b6c3 100644
--- a/src/pynq/pynq_driver.cc
+++ b/src/pynq/pynq_driver.cc
@@ -22,6 +22,7 @@
 
 #include <vta/driver.h>
 #include <thread>
+#include <time.h>
 #include "pynq_driver.h"
 
 
@@ -126,6 +127,10 @@ class VTADevice {
     VTAWriteMappedReg(vta_compute_handle_, 0x0, VTA_AUTORESTART);
     VTAWriteMappedReg(vta_store_handle_, 0x0, VTA_AUTORESTART);
 
+    // Allow device to respond
+    struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000 };
+    nanosleep(&ts, &ts);
+
     // Loop until the VTA is done
     unsigned t, flag = 0;
     for (t = 0; t < wait_cycles; ++t) {

Reply via email to