Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][µTVM] Add OpenOCD Low-Level Device (RISC-V Support) #3756

Merged
merged 10 commits into from
Sep 2, 2019

Conversation

weberlo
Copy link
Contributor

@weberlo weberlo commented Aug 12, 2019

This PR adds a low-level device backend to µTVM (initial implementation here) that enables the use of any device which features a JTAG interface. In order to do so, OpenOCD is used to mediate a connection between µTVM and the device. In particular, OpenOCD exposes a TCP socket, which µTVM connects to and uses to send Tcl commands to the device.

There are still some unimplemented features:

  • Instructions for how to set up OpenOCD
  • A cleaner binutil interface
  • A better method for configuring the low-level device

CC @Mutinifni @u99127 @liangfu @ajtulloch @tqchen

`test_codegen_c_host_fadd.py` accidentally made it into the last
MicroTVM PR (and stole a test from `test_codegen_c_host.py`???).
@tqchen tqchen self-assigned this Aug 12, 2019
python/tvm/contrib/binutil.py Outdated Show resolved Hide resolved
python/tvm/micro/base.py Show resolved Hide resolved
src/runtime/micro/tcl_socket.cc Outdated Show resolved Hide resolved
src/runtime/micro/tcl_socket.cc Outdated Show resolved Hide resolved
src/runtime/micro/openocd_low_level_device.cc Outdated Show resolved Hide resolved
src/runtime/micro/openocd_low_level_device.cc Outdated Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Aug 26, 2019

See also comments. The main improvement that I think we could make here is to avoid repetitive creation of temporary std::string objects during command construction and receive, by making buffers as state of the tcl_socket .

For example, the API below makes cmd_stream and reply as part of the state. Although it won't eliminate all of creation deletion of std::string, it will somewhat reduces the cost.

socket_.cmd_stream() << "array unset output";
socket_.SendCommand();
res = socket_.last_reply();

@jroesch jroesch added the status: need update need update based on feedbacks label Sep 1, 2019
@tqchen tqchen merged commit 60de5be into apache:master Sep 2, 2019
@tqchen tqchen added status: accepted and removed status: need review status: need update need update based on feedbacks labels Sep 2, 2019
@tqchen
Copy link
Member

tqchen commented Sep 2, 2019

Thanks @weberlo this PR is now merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants