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

build(Other): Add Support for Native Windows Builds, Add RISCV_LOAD Support for MAX78000 and MAX78002 #653

Merged
merged 46 commits into from
Aug 2, 2023

Conversation

Jake-Carter
Copy link
Contributor

@Jake-Carter Jake-Carter commented Jul 7, 2023

Pull Request Template

Description

This removes dependencies on Linux utilities (sed, cut, rmdir, etc.) for builds on native Windows. Now, the only requirement to run a native Windows build is a native make executable.

The primary driver behind this was our upcoming integration with the ONE IDE installer. (see https://jira.analog.com/browse/DEVTOOLS-96)

How to Review: Check out this branch and run functional tests of your choice in your environment of your choice.

Tests

Functional Tests

MSYS2

Note: "MSYS2" = existing environment in MSDK.

  • : AI85 Hello_World (MSYS2) - PASS
  • : AI85 Hello_World_Cpp (MSYS2) - PASS
  • : AI85 Coremark (MSYS2) - PASS
SystemCoreClock 100000000
I-Cache enabled
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 13792893
Total time (secs): 13.792893
Iterations/Sec   : 290.004416
Iterations       : 4000
Compiler version : GCC10.3.1 20210824 (release)
Compiler flags   : 
Memory location  : STATIC
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 290.004416 / GCC10.3.1 20210824 (release)  / STATIC

ONE IDE

"ONE IDE" = building only with make supplied by the ONE IDE.

  • : AI85 Hello_World(ONE IDE) - PASS
  • : AI85 Hello_World_Cpp (ONE IDE) - PASS
  • : AI85 Coremark (ONE IDE) - PASS
SystemCoreClock 100000000
I-Cache enabled
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 13792893
Total time (secs): 13.792893
Iterations/Sec   : 290.004416
Iterations       : 4000
Compiler version : GCC10.3.1 20210824 (release)
Compiler flags   : 
Memory location  : STATIC
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 290.004416 / GCC10.3.1 20210824 (release)  / STATIC

Backwards Compatibility

The following projects were functionally tested from our existing MSYS2 environment with the changes proprosed in this PR. This confirms backwards compatibility with existing/legacy projects that use combined .elfs (Makefile/Makefile.ARM/Makefile.RISCV)

  • : AI87 ImageNet-RISCV - PASS
---- Opened the serial port COM20 ----

*** CNN Inference Test imagenet-riscv ***

*** PASS ***

Approximate inference time: 35155 us
  • : AI85 mnist-riscv - PASS
*** CNN Inference Test ***

*** PASS ***

Approximate inference time: 1418 us

Classification results:
[ -77992] -> Class 0: 0.0%
[  93377] -> Class 1: 0.0%
[  45484] -> Class 2: 0.0%
[  29850] -> Class 3: 0.0%
[ -36248] -> Class 4: 0.0%
[-130974] -> Class 5: 0.0%
[-272399] -> Class 6: 0.0%
[ 416616] -> Class 7: 100.0%
[-148783] -> Class 8: 0.0%
[  25073] -> Class 9: 0.0%

RV_ARM_Loader Functional Tests

The RV_ARM_Loader does its job. It loads the source code and starts the RISC-V core correctly. Our peripheral drivers themselves need some work for the RISC-V core.

  • : AI85 RV_ARM_Loader + Hello_World - PASS w/ caveat
    • The example runs, but the blink rate is too slow. There is an issue with the MXC_Delay implementation for the RISC-V core that needs to be addressed in a separate PR.
ARM: RV_ARM_Loader
Hello World!
count : 0
count : 1
count : 2
count : 3
  • : AI85 RV_ARM_Loader + Hello_World_Cpp - PASS w/ caveat
    • Slow blink-rate, see above.
ARM: RV_ARM_Loader
C++ Hello World Example
Number of blinks: 1
Number of blinks: 2
Number of blinks: 3
Number of blinks: 4
  • AI85 RV_ARM_Loader + Coremark - Pass w/ caveat
    • Coremark builds, flashes, and runs for the RISC-V core. But the results are incorrect. Source code of the example needs some tweaking for RISC-V.
ARM: RV_ARM_Loader


SystemCoreClock 443432905
I-Cache enabled
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 19726619
Total time (secs): 
Iterations/Sec   : 
Iterations       : 4000
Compiler version : GCC12.2.0
Compiler flags   : 
Memory location  : STATIC
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 :  / GCC12.2.0  / STATIC

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related Github issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

@github-actions github-actions bot added MAX32520 Related to the MAX32520 (ES17) MAX32570 Related to the MAX32570 (ME13) MAX32650 Related to the MAX32650 (ME10) MAX32655 Related to the MAX32655 (ME17) MAX32660 Related to the MAX32660 (ME11) MAX32665 Related to the MAX32665 (ME14) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87) MAX32662 Related to the MAX32662 (ME12) labels Jul 7, 2023
@Jake-Carter Jake-Carter added the WIP work in progress label Jul 7, 2023
@Jake-Carter
Copy link
Contributor Author

This is complete for M4-core builds targeted via gcc.mk. Adding WIP for the RISC-V builds that have some other sed dependencies scattered around that I need to address.

@andrewmclachlanadi
Copy link
Collaborator

Awesome. Thanks for the update. Tag @mharringADI. Will give it a try out.

@andrewmclachlanadi
Copy link
Collaborator

Thanks!

@Jake-Carter Jake-Carter force-pushed the feat/crossplatform-mk branch 2 times, most recently from 0426753 to a4c44b0 Compare July 17, 2023 22:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- Use native Windows mkdir/rmdir command prompt instructions
- Safely check uname to detect MSYS2
@Jake-Carter Jake-Carter changed the title build(Other): Add Support for Native Windows Builds build(Other): Add Support for Native Windows Builds, Add RISCV_LOAD Support for MAX78000 and MAX78002 Aug 1, 2023
@Jake-Carter Jake-Carter marked this pull request as ready for review August 1, 2023 18:57
@Jake-Carter Jake-Carter removed the WIP work in progress label Aug 1, 2023
@Jake-Carter Jake-Carter force-pushed the feat/crossplatform-mk branch from 878f695 to d1a84a1 Compare August 1, 2023 20:43
Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

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

The prophesized native windows build

@sihyung-maxim
Copy link
Contributor

The new Build scope was also merged into main if you want to add that to your PR title.

@Jake-Carter
Copy link
Contributor Author

@andrewmclachlanadi FYI the following projects still require some Unix utilities. I'm leaving them for now since they represent legacy projects in our build tests. The MSDK repo isn't ready to remove them just yet, but they'll be updated before the next release.

  • Examples/MAX32655/Hello_World-riscv
  • Examples/MAX32680/Hello_World-riscv
  • Examples/MAX78000/CNN/faceid_evkit-riscv
  • Examples/MAX78000/CNN/kws20_demo-riscv
  • Examples/MAX78000/CNN/mnist-riscv
  • Examples/MAX78002/CNN/imagenet-riscv

@Jake-Carter Jake-Carter merged commit 063424b into analogdevicesinc:main Aug 2, 2023
@Jake-Carter Jake-Carter deleted the feat/crossplatform-mk branch August 2, 2023 02:12
@Jake-Carter
Copy link
Contributor Author

The prophesized native windows build

and there was much rejoicing

@Analog-Devices-MSDK/msdk_developers FYI this is merged

@Jake-Carter Jake-Carter added the build system This issue or pull request is related to the MSDK build system label Aug 7, 2023
@Jake-Carter Jake-Carter linked an issue Sep 21, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLE Related to Bluetooth build system This issue or pull request is related to the MSDK build system MAX32520 Related to the MAX32520 (ES17) MAX32570 Related to the MAX32570 (ME13) MAX32650 Related to the MAX32650 (ME10) MAX32655 Related to the MAX32655 (ME17) MAX32660 Related to the MAX32660 (ME11) MAX32662 Related to the MAX32662 (ME12) MAX32665 Related to the MAX32665 (ME14) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87)
Projects
None yet
4 participants