You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/05/22 05:22:03 UTC

[GitHub] [incubator-tvm] areusch opened a new pull request #5648: µtvm debug improvements

areusch opened a new pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648


   A couple of patches to improve the debugging experience for µTVM:
   1. Make UTVMDone noreturn, so that the device doesn't jump to arbitrary code locations after stopping the debugger. This was causing it to often execute from peripheral memory and HardFault.
   
   2. Make debug mode extendable using a PackedFunc. This allows scripts to accept a --debug parameter and allows them to be selective about which runs to debug.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] tom-gall commented on pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
tom-gall commented on pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648#issuecomment-632824516


   LGTM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] areusch commented on pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648#issuecomment-632754557


   @tqchen @tmoreau89 @liangfu @weberlo @u99127 @tom-gall


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648#discussion_r430249638



##########
File path: src/runtime/micro/host_driven/utvm_runtime.c
##########
@@ -101,7 +101,7 @@ void UTVMMain() {
 
 // We use a dummy function to signal execution is finished for device
 // backends which require breakpoints.
-void __attribute__((noinline)) UTVMDone() { utvm_done = 1; }
+void __attribute__((noinline,noreturn)) UTVMDone() { utvm_done = 1; for (;;) ; }

Review comment:
       fair enough, lgtm.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] tmoreau89 merged pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
tmoreau89 merged pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] areusch commented on a change in pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648#discussion_r429446488



##########
File path: src/runtime/micro/host_driven/utvm_runtime.c
##########
@@ -101,7 +101,7 @@ void UTVMMain() {
 
 // We use a dummy function to signal execution is finished for device
 // backends which require breakpoints.
-void __attribute__((noinline)) UTVMDone() { utvm_done = 1; }
+void __attribute__((noinline,noreturn)) UTVMDone() { utvm_done = 1; for (;;) ; }

Review comment:
       I think at the moment, since we aren't installing a predictable ISR vector table, we should avoid triggering those. but we can revisit approaches like this when we switch to on-device runtime.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5648: µtvm debug improvements

Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5648:
URL: https://github.com/apache/incubator-tvm/pull/5648#discussion_r429357376



##########
File path: src/runtime/micro/host_driven/utvm_runtime.c
##########
@@ -101,7 +101,7 @@ void UTVMMain() {
 
 // We use a dummy function to signal execution is finished for device
 // backends which require breakpoints.
-void __attribute__((noinline)) UTVMDone() { utvm_done = 1; }
+void __attribute__((noinline,noreturn)) UTVMDone() { utvm_done = 1; for (;;) ; }

Review comment:
       Would we want this to trap ever in which case a __builtin_trap might be a trick to play ? 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org