-
Notifications
You must be signed in to change notification settings - Fork 41
Automatic On-Board GAP9 Deployment #178
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
Open
Victor-Jung
wants to merge
12
commits into
pulp-platform:devel
Choose a base branch
from
Victor-Jung:pr/auto-gap9-board-deployment
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
11b0dab
Add option to deploy on the board for the GAP9 platform
Victor-Jung 55f9902
Add proper D flag for GAP9 board
Victor-Jung fb29c4a
Make pane name agnostic of the config
Victor-Jung 2b4f4d4
Fix usbip host resolve for Linux platforms
Victor-Jung a995c28
Fix hostname resolution for Macos
Victor-Jung 7769697
Live print of the simulator cmd
Victor-Jung 69f90e6
Revert gap9 docker link
Victor-Jung 461bd5c
Add optional GPIO toggling for power measurements for GAP9
Victor-Jung 880254a
Format
Victor-Jung 629fe13
Cleanup file handles to avoid unhandled exeception in pytest
Victor-Jung 0959f0e
format
Victor-Jung 312c6b9
Remove unused GPIO and update gitignore
Victor-Jung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,3 +57,5 @@ CHANGELOG_GEN.md | |
| # Container Artifacts | ||
| .pyusbip/ | ||
| .cache/ | ||
|
|
||
| CLAUDE.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| CONFIG_BOARD_GAP9MOD_V1_0_B=y | ||
| CONFIG_BOARD_GAP9EVK_V1_3=y | ||
|
|
||
| CONFIG_DRIVER_CLUSTER=y | ||
| CONFIG_DRIVER_CLUSTER_CONF_PROPERTY_ICACHE_CONF=0x7FF | ||
|
|
||
| CONFIG_DRIVER_TYPE_FLASH=y | ||
| CONFIG_DRIVER_TYPE_RAM=y | ||
|
|
||
| CONFIG_DRIVER_MRAM=y | ||
| CONFIG_READFS_FLASH_TYPE_OSPI=y | ||
|
|
||
| CONFIG_DRIVER_READFS=y | ||
| # CONFIG_READFS_FLASH_TYPE_MRAM=y | ||
|
|
||
| CONFIG_DRIVER_APS256XXN=y | ||
| CONFIG_DRIVER_RAM_API=y | ||
|
|
||
| CONFIG_ENABLE_LIBMATH=y | ||
|
|
||
| # OS float printf | ||
| CONFIG_IO_PRINTF_FLOAT_ENABLE=y | ||
| CONFIG_IO_PRINTF_FLOAT_EXPONENT_ENABLE=y | ||
|
|
||
| # CONFIG_PLATFORM_GVSOC=y | ||
| CONFIG_PLATFORM_BOARD=y | ||
| # CONFIG_DRIVER_CLUSTERDECOMPRESSOR=n | ||
|
|
||
| #CONFIG_CL_MASTER_CORE_STACK_SIZE=14000 | ||
| #CONFIG_CL_SLAVE_CORE_STACK_SIZE=1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| macro(add_board_deployment name target) | ||
Victor-Jung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if(NOT DEFINED GVSOC_INSTALL_DIR) | ||
| message(FATAL_ERROR "Environment variable GVSOC_INSTALL_DIR not set") | ||
| endif() | ||
|
|
||
| message(STATUS "[Deeploy GAP9] Running on Board") | ||
|
|
||
| set(BOARD_WORKDIR ${CMAKE_BINARY_DIR}/board_workdir) | ||
| set(DEEPLOY_BINARY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}") | ||
| set(GAP9_SDK_HOME $ENV{GAP_SDK_HOME}) | ||
| set(GAPY "${GAP9_SDK_HOME}/utils/gapy_v2/bin/gapy") | ||
| set(FLASH_LAYOUT "${GAP9_SDK_HOME}/utils/layouts/default_layout_multi_readfs.json") | ||
| set(FSBL_BINARY "${GAP9_SDK_HOME}/install/target/bin/fsbl") | ||
| set(SSBL_BINARY "${GAP9_SDK_HOME}/install/target/bin/ssbl") | ||
|
|
||
| make_directory(${BOARD_WORKDIR}) | ||
|
|
||
| if(NOT DEFINED GAP9_SDK_HOME) | ||
| message(FATAL_ERROR "Environment variable GAP_SDK_HOME not set") | ||
| endif() | ||
Victor-Jung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Command to run on board | ||
| set(GAPY_CMD | ||
| ${GAPY} | ||
| --target=gap9.evk | ||
| --platform=board | ||
| --target-property=boot.flash_device=mram | ||
| --target-property=boot.mode=flash | ||
| --target-dir=${GAP9_SDK_HOME}/utils/gapy_v2/targets | ||
| --openocd-cable=${GAP9_SDK_HOME}/utils/openocd_tools/tcl/gapuino_ftdi.cfg | ||
| --openocd-script=${GAP9_SDK_HOME}/utils/openocd_tools/tcl/gap9revb.tcl | ||
| --openocd-tools=${GAP9_SDK_HOME}/utils/openocd_tools | ||
| --binary=${DEEPLOY_BINARY} | ||
| --work-dir=${BOARD_WORKDIR} | ||
| --multi-flash-content=${FLASH_LAYOUT} | ||
| --flash-size=67108864 | ||
| --flash-property=${FSBL_BINARY}@mram:fsbl:binary | ||
| --flash-property=${SSBL_BINARY}@mram:ssbl:binary | ||
| --flash-property=${DEEPLOY_BINARY}@mram:app:binary run | ||
| --py-stack | ||
| ) | ||
|
|
||
| # Add readfs files if provided | ||
| if(GAPY_RUNNER_ARGS) | ||
| list(LENGTH GAPY_RUNNER_ARGS num_readfs_files) | ||
| message(STATUS "[Deeploy GAP9] Adding ${num_readfs_files} readfs file(s)") | ||
| list(APPEND GAPY_CMD ${GAPY_RUNNER_ARGS}) | ||
| endif() | ||
|
|
||
| # Convert list to string for printing | ||
| string(REPLACE ";" " " GAPY_CMD_STR "${GAPY_CMD}") | ||
|
|
||
| add_custom_target(board_${name} | ||
| DEPENDS ${name} | ||
| WORKING_DIRECTORY ${BOARD_WORKDIR} | ||
| COMMAND bash -c "${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/*.bin ${BOARD_WORKDIR}/ 2>/dev/null || true" | ||
| COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
| ${GAP9_SDK_HOME}/utils/efuse/GAP9/efuse_hyper_preload.data | ||
| ${BOARD_WORKDIR}/chip.efuse_preload.data | ||
| COMMAND ${CMAKE_COMMAND} -E echo "==========================================" | ||
| COMMAND ${CMAKE_COMMAND} -E echo "[Deeploy GAP9] Executing gapy command to run on board:" | ||
| COMMAND ${CMAKE_COMMAND} -E echo "${GAPY_CMD_STR}" | ||
| COMMAND ${CMAKE_COMMAND} -E echo "==========================================" | ||
| COMMAND ${GAPY_CMD} | ||
| COMMENT "Running ${name} with gapy on GAP9 board" | ||
| POST_BUILD | ||
| USES_TERMINAL | ||
| VERBATIM | ||
| ) | ||
| endmacro() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.