Commit Graph

1 Commits

Author SHA1 Message Date
Andrew Reusch f956c38cd7 [µTVM] Add serial transport, parameterize µTVM Zephyr test, run on physical HW (#6789)
* [BUGFIX] Respect infinite-timed session start timeouts.

 * When debugging, the intended behavior is to set the session start
   timeout to infinite to allow the user to configure the debugger.
 * At present, if a session start retry timeout is defined, the
   current logic will bail after the retry timeout expires.
 * This change makes the session start logic retry forever, once per
   retry timeout.

* Document RPCEndpoint::Create.

* Add stm32f746xx to tvm.target.micro() call; fix parameter name.

 * This API is expected to just be used with positional args, not
   kwargs, so this change isn't expected to cause any breakage.
 * model is more inline with the rest of the file, given TVM Target
   Specification RFC.

* [BUGFIX] If session start fails, exit transport context manager.

 * If an error occurred during session setup, then complex transports
   e.g. DebugWrapperTransport would not de-initialize.

* Align transport writes/reads in TransportLogger

* fix syntax errors which were not exercised in previous PR

* Remove microTVM logic from standard RPC server, add debug shell.

 * microTVM uses the host RPC server as a way to launch a debugger in
   a dedicated, separate terminal window. microTVM needs to be able to
   launch the debugger itself, because its model of the device
   flash/debug flow separates these two things into distinct
   operations implemented by shell commands (for maximum portability
   across frameworks).
 * microTVM can be configured to launch the debugger (e.g. GDB) in the
   same terminal as is used for flashing, but this is sub-optimal
   because then it hides any logs emitted by the device.
 * Using the standard RPC server was hard because GDB expects the user
   to issue SIGINT to interrupt program flow, but due to the RPC
   server's necessary use of multiprocessing, multiple signal handlers
   needed to be SIG_IGN'd, and further, because libtvm.so is
   intentionally frontend-agnostic, it's difficult to include signal
   handling directly in that binary (Python expects you to call
   PyErr_CheckSignals, but we don't require and don't want to require
   python-dev to compile libtvm.so, and this is the only such case
   where libtvm.so is expected to block the main thread for a long
   period of time).
 * Here we implement a separate microTVM debug shell python script
   using the non-blocking server implementation.

* Add serial transport, parameterize test_zephyr to work on real hardware

* add pytest test fixture, missed from previous change.

 * this test fixture helps to parameterize the test case

* address leandron@ comment from #6703
2020-10-31 09:24:01 -04:00