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

[microTVM] Zephyr: RISCV support for Zephyr QEMU RISCV-32/64 #7804

Merged
merged 43 commits into from
Apr 8, 2021

Conversation

mehrdadh
Copy link
Member

@mehrdadh mehrdadh commented Apr 7, 2021

This PR adds following changes:

Note: test_zephyr.py fully passes on qemu_riscv64 using the zephyr 2.5. However, for qemu_riscv32 you need to update zephyr to latest master branch. This issue is mentioned on zephyr: zephyrproject-rtos/zephyr#34026

We will update this when we update our zephyr to next version.

@mehrdadh mehrdadh marked this pull request as ready for review April 7, 2021 00:13
@mehrdadh
Copy link
Member Author

mehrdadh commented Apr 7, 2021

cc @areusch

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work @mehrdadh ! just a couple small things to address.

cc @JosseVanDelm @Dream-math

apps/microtvm/reference-vm/base-box-tool.py Outdated Show resolved Hide resolved
apps/microtvm/reference-vm/base-box-tool.py Outdated Show resolved Hide resolved
apps/microtvm/zephyr/demo_runtime/boards/qemu_riscv32.conf Outdated Show resolved Hide resolved
apps/microtvm/zephyr/demo_runtime/boards/qemu_riscv32.conf Outdated Show resolved Hide resolved
apps/microtvm/zephyr/demo_runtime/src/main.c Outdated Show resolved Hide resolved
python/tvm/micro/contrib/zephyr.py Outdated Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Apr 7, 2021

BTW @mehrdadh here are some git tips that might be useful(try to rebase to bring the code back instead of merge) https://tvm.apache.org/docs/contribute/git_howto.html

@mehrdadh
Copy link
Member Author

mehrdadh commented Apr 7, 2021

@tqchen Thanks for the tips! I will follow the guideline.

@areusch
Copy link
Contributor

areusch commented Apr 7, 2021

@tqchen, this method unfortunately makes the review much harder because GH loses the old commits after force-push. If you're trying to decide whether an open comment has been addressed, it's really helpful to be able to be able to see the context which generated that comment and a diff.

I think the strategy adopted by me (and a few others) has been to rebase and force-push until a comment is placed on the PR, then do merges. If we want to consider improving the situation, I think we unfortunately may have to look into a different code review tool e.g. Gerrit (unless I misunderstand repository config settings on GH).

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry couple more small things

apps/microtvm/reference-vm/base-box-tool.py Outdated Show resolved Hide resolved
@@ -59,7 +66,7 @@ def _make_sess_from_op(model, zephyr_board, west_cmd, op_name, sched, arg_bufs):


def _make_session(model, target, zephyr_board, west_cmd, mod):
test_name = f"{os.path.splitext(os.path.abspath(__file__))[0]}_{model}"
test_name = f"{os.path.splitext(os.path.abspath(__file__))[0]}_{zephyr_board}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change? seems like we should put both in the path, if anything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@areusch so we distinguish the test based on the zephyr_board. For ex. qemu_x86, qemu_riscv32 and qemu_riscv64 all use the same model which is host, but they have different zephyr_board. zephyr_board will always be unique.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I was misreading. this looks good

@@ -59,7 +66,7 @@ def _make_sess_from_op(model, zephyr_board, west_cmd, op_name, sched, arg_bufs):


def _make_session(model, target, zephyr_board, west_cmd, mod):
test_name = f"{os.path.splitext(os.path.abspath(__file__))[0]}_{model}"
test_name = f"{os.path.splitext(os.path.abspath(__file__))[0]}_{zephyr_board}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I was misreading. this looks good

@areusch areusch merged commit 4d13733 into apache:main Apr 8, 2021
tmoreau89 pushed a commit to tmoreau89/tvm that referenced this pull request Apr 11, 2021
…7804)

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* testing

* pass riscv64

* fix merge

* small fix

* update vm_name

* add zephyr version

* add comment for riscv32 issue

* remove debug messages

* cleanup

* cleanup

* change workspace

* fix zephyr version

* cleanup

* change to symlink

* fix flag

* add comment

* lint check

* lint fix

* fix format

* rename debugger

* rework args

Co-authored-by: Mehrdad Hessar <[email protected]>
Co-authored-by: Andrew Reusch <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…7804)

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* testing

* pass riscv64

* fix merge

* small fix

* update vm_name

* add zephyr version

* add comment for riscv32 issue

* remove debug messages

* cleanup

* cleanup

* change workspace

* fix zephyr version

* cleanup

* change to symlink

* fix flag

* add comment

* lint check

* lint fix

* fix format

* rename debugger

* rework args

Co-authored-by: Mehrdad Hessar <[email protected]>
Co-authored-by: Andrew Reusch <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…7804)

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* testing

* pass riscv64

* fix merge

* small fix

* update vm_name

* add zephyr version

* add comment for riscv32 issue

* remove debug messages

* cleanup

* cleanup

* change workspace

* fix zephyr version

* cleanup

* change to symlink

* fix flag

* add comment

* lint check

* lint fix

* fix format

* rename debugger

* rework args

Co-authored-by: Mehrdad Hessar <[email protected]>
Co-authored-by: Andrew Reusch <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…7804)

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* testing

* pass riscv64

* fix merge

* small fix

* update vm_name

* add zephyr version

* add comment for riscv32 issue

* remove debug messages

* cleanup

* cleanup

* change workspace

* fix zephyr version

* cleanup

* change to symlink

* fix flag

* add comment

* lint check

* lint fix

* fix format

* rename debugger

* rework args

Co-authored-by: Mehrdad Hessar <[email protected]>
Co-authored-by: Andrew Reusch <[email protected]>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
…7804)

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* working on qemu

* debugging

* riscv hacks

* config added

* change target platforms

* fix merge

* debugging issue with zephyr 2.5

* cleanup

* testing

* pass riscv64

* fix merge

* small fix

* update vm_name

* add zephyr version

* add comment for riscv32 issue

* remove debug messages

* cleanup

* cleanup

* change workspace

* fix zephyr version

* cleanup

* change to symlink

* fix flag

* add comment

* lint check

* lint fix

* fix format

* rename debugger

* rework args

Co-authored-by: Mehrdad Hessar <[email protected]>
Co-authored-by: Andrew Reusch <[email protected]>
@mehrdadh mehrdadh deleted the riscv branch November 11, 2021 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants