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

sw: Switch to non-recursive Make build system #171

Merged
merged 3 commits into from
Aug 1, 2024
Merged

sw: Switch to non-recursive Make build system #171

merged 3 commits into from
Aug 1, 2024

Conversation

colluca
Copy link
Collaborator

@colluca colluca commented Jul 23, 2024

This PR implements a shift from the recursive Make paradigm to a non-recursive Make build system for Snitch software. The advantages of a non-recursive implementation are well-known.

The shift was triggered by a limitation which emerged in #147. As the dependency between an app and the snRuntime is not represented in the Makefiles (they are distinct subdirectories which are built recursively), the runtime has to be manually built before an application can be built. This dependency can be trivially encoded in a non-recursive implementation.

This PR preserves all the functionalities of the old build system, though the exact commands and API may have changed, namely:

  1. PHONY targets to build and clean all software artifacts (i.e. make sw, make clean-sw)
  2. PHONY targets to build and clean each individual software subdirectory (as defined in the old recursive implementation), i.e. each app, the runtime and all tests (e.g. make gemm, make runtime, make tests)
  3. possibility to build each app with a non-default data configuration, defined by an environment variable
  4. possibility to build each app in a non-default build directory, defined by an environment variable

The latter three, which are needed to implement extensive regression tests, are used e.g. in target/snitch_cluster/sw/apps/blas/gemm/test.

It further improves on code reuse, sharing common parts of Makefiles as much as possible.

The current implementation imposes a limitation: all software apps must have a unique name. It is not possible therefore to e.g. have a dnn/gemm and blas/gemm. This condition is currently satisfied. Note that the limitation can be removed, but we chose not to tackle this at the moment to simplify the implementation.

@colluca colluca marked this pull request as ready for review July 23, 2024 14:09
@fischeti
Copy link
Contributor

LGTM! The issue in #147 was also resolved this way👍

@fischeti
Copy link
Contributor

Does the tutorial need to be updated?

@colluca
Copy link
Collaborator Author

colluca commented Aug 1, 2024

Does the tutorial need to be updated?

I will follow with a tutorial update after merging #71, since it also affects the benchmarking utilities.

@colluca colluca merged commit 02ce1b9 into main Aug 1, 2024
25 checks passed
@colluca colluca deleted the non-rec-make branch August 1, 2024 12:06
colluca added a commit that referenced this pull request Aug 22, 2024
colluca added a commit that referenced this pull request Aug 22, 2024
colluca added a commit that referenced this pull request Aug 22, 2024
colluca added a commit that referenced this pull request Aug 23, 2024
colluca added a commit that referenced this pull request Aug 23, 2024
colluca added a commit that referenced this pull request Aug 28, 2024
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.

2 participants