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][ARM][Zephyr] Add CMSIS dependencies in Zephyr project build #11362

Merged
merged 7 commits into from
May 31, 2022

Conversation

mehrdadh
Copy link
Member

@mehrdadh mehrdadh commented May 18, 2022

This PR does the following:

  • Adds CMSIS dependencies in Zephyr project API and a test to check this
  • Change TempDirectory interface to keep it for debugging

cc @areusch @gromero

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.

thanks @mehrdadh , couple questions

def _load_cmsis(self, lib_path: Union[str, pathlib.Path]):
"""Copy CMSIS header files to generated project."""

cmsis_path = pathlib.Path(os.environ["CMSIS_PATH"])
Copy link
Contributor

Choose a reason for hiding this comment

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

why not make this a project option for now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that should be a project options that I missed. Done!

@@ -455,6 +476,15 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
os.makedirs(extract_path)
tf.extractall(path=extract_path)

# Add CMSIS libraries if required.
if options["project_type"] == "host_driven":
Copy link
Contributor

Choose a reason for hiding this comment

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

why only for host-driven?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to support both and different module names.

tests/micro/zephyr/test_zephyr.py Show resolved Hide resolved
Copy link
Member Author

@mehrdadh mehrdadh left a comment

Choose a reason for hiding this comment

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

PTKL, thanks!

def _load_cmsis(self, lib_path: Union[str, pathlib.Path]):
"""Copy CMSIS header files to generated project."""

cmsis_path = pathlib.Path(os.environ["CMSIS_PATH"])
Copy link
Member Author

Choose a reason for hiding this comment

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

I think that should be a project options that I missed. Done!

tests/micro/zephyr/test_zephyr.py Show resolved Hide resolved
@@ -455,6 +476,15 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
os.makedirs(extract_path)
tf.extractall(path=extract_path)

# Add CMSIS libraries if required.
if options["project_type"] == "host_driven":
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to support both and different module names.

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.

thanks @mehrdadh ! one final question

disabled conv2d_nhwc_dsp.arm_cpu for non integers workloads

added debugging feature to TempDirectory
@@ -70,6 +69,8 @@

ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")

CMSIS_PATH = os.getenv("CMSIS_PATH")
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, used it as default if project option is not passed

Copy link
Contributor

Choose a reason for hiding this comment

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

i think it might be good to avoid hidden env variable dependencies. they can be hard to track down. what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, I removed the default value.

tests/scripts/task_python_microtvm.sh Show resolved Hide resolved
@mehrdadh mehrdadh merged commit 2252f95 into apache:main May 31, 2022
@mehrdadh mehrdadh deleted the microtvm/fix_cmsis_dep branch May 31, 2022 20:27
def pytest_configure(config):
config.addinivalue_line(
"markers",
"skip_by_board(board): skip test for the given board",
Copy link
Contributor

Choose a reason for hiding this comment

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

@mehrdadh does this need to be skip_boards?
"skip_boards(board): skip test for the given board",

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