diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 140109e..f0fa930 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,8 +7,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] - python-version: [3.7] + os: [ubuntu-latest, windows-latest, macos-latest] example: - "examples/native-asm" - "examples/native-bare_c" @@ -17,18 +16,17 @@ jobs: # - "examples/zephyr-hello-world" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - name: Set up Python + uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip - platformio platform install file://. + pio pkg install --global --platform symlink://. - name: Build examples run: | platformio run -d ${{ matrix.example }} diff --git a/README.md b/README.md index 027c79f..7690147 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ CHIPS Alliance brings the power of open source and software automation to the semiconductor industry, making it possible to develop new hardware faster and more affordably than ever before. -* [Home](http://platformio.org/platforms/chipsalliance) (home page in PlatformIO Platform Registry) -* [Documentation](http://docs.platformio.org/page/platforms/chipsalliance.html) (advanced usage, packages, boards, frameworks, etc.) +* [Home](https://registry.platformio.org/platforms/platformio/chipsalliance) (home page in the PlatformIO Registry) +* [Documentation](https://docs.platformio.org/page/platforms/chipsalliance.html) (advanced usage, packages, boards, frameworks, etc.) # Usage 1. [Install PlatformIO](http://platformio.org) -2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: +2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version @@ -32,4 +32,4 @@ board = ... # Configuration -Please navigate to [documentation](http://docs.platformio.org/page/platforms/chipsalliance.html). +Please navigate to [documentation](https://docs.platformio.org/page/platforms/chipsalliance.html). diff --git a/builder/compat.py b/builder/compat.py deleted file mode 100644 index b8dfe3d..0000000 --- a/builder/compat.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014-present PlatformIO -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from SCons.Script import AlwaysBuild, Import - - -Import("env") - - -# Added in PIO Core 4.4.0 -if not hasattr(env, "AddPlatformTarget"): - - def AddPlatformTarget( - env, - name, - dependencies, - actions, - title=None, - description=None, - always_build=True, - ): - target = env.Alias(name, dependencies, actions) - if always_build: - AlwaysBuild(target) - return target - - env.AddMethod(AddPlatformTarget) diff --git a/builder/frameworks/_bare.py b/builder/frameworks/_bare.py index 85a7fcc..58e176d 100644 --- a/builder/frameworks/_bare.py +++ b/builder/frameworks/_bare.py @@ -8,8 +8,11 @@ env.Append( ASFLAGS=[ + "-march=%s" % board.get("build.march"), + "-mabi=%s" % board.get("build.mabi"), + ], + ASPPFLAGS=[ "-x", "assembler-with-cpp", - "-Wa,-march=%s" % board.get("build.march") ], CCFLAGS=[ @@ -56,10 +59,3 @@ "-Wl,--defsym=__comrv_cache_size=0", ] ) - -# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) -env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) - -# -# Target: Build libraries -# diff --git a/builder/main.py b/builder/main.py index eb7e366..eb55e5e 100644 --- a/builder/main.py +++ b/builder/main.py @@ -90,7 +90,6 @@ def run_verilator(target, source, env): env = DefaultEnvironment() -env.SConscript("compat.py", exports="env") platform = env.PioPlatform() board_config = env.BoardConfig() diff --git a/examples/native-asm/.travis.yml b/examples/native-asm/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/native-asm/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/native-asm/README.md b/examples/native-asm/README.md new file mode 100644 index 0000000..e37d77d --- /dev/null +++ b/examples/native-asm/README.md @@ -0,0 +1,36 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-chipsalliance/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-chipsalliance/examples/native-blink_asm + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Upload bitstream +$ pio run --target program_fpga + +# Generate trace for GTKWave +$ pio run --target generate_trace + +# Start verilator as JTAG server for OpenOCD +$ pio run --target start_verilator + +# Generate bistream for SweRV Core using Xilinx Vivado +$ pio run --target generate_bitstream + +# Upload firmware for the specific environment +$ pio run -e swervolf_nexys --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/native-asm/README.rst b/examples/native-asm/README.rst deleted file mode 100644 index 0981dd7..0000000 --- a/examples/native-asm/README.rst +++ /dev/null @@ -1,47 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-chipsalliance/examples/native-blink_asm - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Upload bitstream - > platformio run --target program_fpga - - # Generate trace for GTKWave - > platformio run --target generate_trace - - # Start verilator as JTAG server for OpenOCD - > platformio run --target start_verilator - - # Generate bistream for SweRV Core using Xilinx Vivado - > platformio run --target generate_bitstream - - # Upload firmware for the specific environment - > platformio run -e swervolf_nexys --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/native-asm/platformio.ini b/examples/native-asm/platformio.ini index 53020de..f7897de 100644 --- a/examples/native-asm/platformio.ini +++ b/examples/native-asm/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:rvfpga] platform = chipsalliance diff --git a/examples/native-asm/src/main.S b/examples/native-asm/src/main.S deleted file mode 100644 index f619bbc..0000000 --- a/examples/native-asm/src/main.S +++ /dev/null @@ -1,16 +0,0 @@ -#define LEDs_ADDR 0x80001010 -#define SWs_ADDR 0x80001012 - -.globl _start -_start: - -next: - li a1, SWs_ADDR # Read the Switches - lw t0, 0(a1) - - li a0, LEDs_ADDR # Write the LEDs - sw t0, 0(a0) - - beq zero, zero, next # infinite loop - -.end diff --git a/examples/native-asm/src/main.s b/examples/native-asm/src/main.s new file mode 100644 index 0000000..e1609d1 --- /dev/null +++ b/examples/native-asm/src/main.s @@ -0,0 +1,13 @@ +.globl _start +_start: + +next: + li a1, 0x80001012 # Read the Switches + lw t0, 0(a1) + + li a0, 0x80001010 # Write the LEDs + sw t0, 0(a0) + + beq zero, zero, next # infinite loop + +.end diff --git a/examples/native-bare_c/.travis.yml b/examples/native-bare_c/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/native-bare_c/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/native-bare_c/README.md b/examples/native-bare_c/README.md new file mode 100644 index 0000000..e37d77d --- /dev/null +++ b/examples/native-bare_c/README.md @@ -0,0 +1,36 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-chipsalliance/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-chipsalliance/examples/native-blink_asm + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Upload bitstream +$ pio run --target program_fpga + +# Generate trace for GTKWave +$ pio run --target generate_trace + +# Start verilator as JTAG server for OpenOCD +$ pio run --target start_verilator + +# Generate bistream for SweRV Core using Xilinx Vivado +$ pio run --target generate_bitstream + +# Upload firmware for the specific environment +$ pio run -e swervolf_nexys --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/native-bare_c/README.rst b/examples/native-bare_c/README.rst deleted file mode 100644 index 0981dd7..0000000 --- a/examples/native-bare_c/README.rst +++ /dev/null @@ -1,47 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-chipsalliance/examples/native-blink_asm - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Upload bitstream - > platformio run --target program_fpga - - # Generate trace for GTKWave - > platformio run --target generate_trace - - # Start verilator as JTAG server for OpenOCD - > platformio run --target start_verilator - - # Generate bistream for SweRV Core using Xilinx Vivado - > platformio run --target generate_bitstream - - # Upload firmware for the specific environment - > platformio run -e swervolf_nexys --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/native-bare_c/platformio.ini b/examples/native-bare_c/platformio.ini index 54bad19..5a9bf2e 100644 --- a/examples/native-bare_c/platformio.ini +++ b/examples/native-bare_c/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:rvfpga] platform = chipsalliance diff --git a/examples/psp-hello-world/.travis.yml b/examples/psp-hello-world/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/psp-hello-world/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/psp-hello-world/README.md b/examples/psp-hello-world/README.md new file mode 100644 index 0000000..fb5009e --- /dev/null +++ b/examples/psp-hello-world/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-chipsalliance/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-chipsalliance/examples/psp-hello-world + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e swervolf_nexys + +# Upload firmware for the specific environment +$ pio run -e swervolf_nexys --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/psp-hello-world/README.rst b/examples/psp-hello-world/README.rst deleted file mode 100644 index bd38b11..0000000 --- a/examples/psp-hello-world/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-chipsalliance/examples/psp-hello-world - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e swervolf_nexys - - # Upload firmware for the specific environment - > platformio run -e swervolf_nexys --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/psp-hello-world/platformio.ini b/examples/psp-hello-world/platformio.ini index a0bc46f..ac47519 100644 --- a/examples/psp-hello-world/platformio.ini +++ b/examples/psp-hello-world/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:rvfpga] platform = chipsalliance diff --git a/examples/rtosal-freertos/.travis.yml b/examples/rtosal-freertos/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/rtosal-freertos/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/rtosal-freertos/README.md b/examples/rtosal-freertos/README.md new file mode 100644 index 0000000..621452c --- /dev/null +++ b/examples/rtosal-freertos/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-chipsalliance/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-chipsalliance/examples/rtosal-freertos + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e swervolf_nexys + +# Upload firmware for the specific environment +$ pio run -e swervolf_nexys --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/rtosal-freertos/README.rst b/examples/rtosal-freertos/README.rst deleted file mode 100644 index b96d407..0000000 --- a/examples/rtosal-freertos/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-chipsalliance/examples/rtosal-freertos - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e swervolf_nexys - - # Upload firmware for the specific environment - > platformio run -e swervolf_nexys --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/rtosal-freertos/platformio.ini b/examples/rtosal-freertos/platformio.ini index e9e762d..e35ac0a 100644 --- a/examples/rtosal-freertos/platformio.ini +++ b/examples/rtosal-freertos/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:rvfpga] platform = chipsalliance diff --git a/platform.json b/platform.json index 545e72e..473ac60 100644 --- a/platform.json +++ b/platform.json @@ -1,5 +1,6 @@ { "name": "chipsalliance", + "version": "1.2.0", "title": "CHIPS Alliance", "description": "The CHIPS Alliance develops high-quality, open source hardware designs relevant to silicon devices and FPGAs.", "homepage": "https://chipsalliance.org", @@ -11,13 +12,12 @@ "RISC-V" ], "engines": { - "platformio": "^5" + "platformio": "^6" }, "repository": { "type": "git", "url": "https://github.com/platformio/platform-chipsalliance.git" }, - "version": "1.1.0", "frameworks": { "wd-riscv-sdk": { "package": "framework-wd-riscv-sdk", diff --git a/platform.py b/platform.py index 74eb150..1106486 100644 --- a/platform.py +++ b/platform.py @@ -14,18 +14,18 @@ import os -from platformio.managers.platform import PlatformBase +from platformio.public import PlatformBase class ChipsalliancePlatform(PlatformBase): def get_boards(self, id_=None): - result = PlatformBase.get_boards(self, id_) + result = super().get_boards(id_) if not result: return result if id_: return self._add_default_debug_tools(result) else: - for key, value in result.items(): + for key in result: result[key] = self._add_default_debug_tools(result[key]) return result @@ -130,15 +130,9 @@ def _add_default_debug_tools(self, board): board.manifest["debug"] = debug return board - def configure_debug_options(self, initial_debug_options, ide_data): - debug_options = copy.deepcopy(initial_debug_options) - adapter_speed = initial_debug_options.get("speed") - if adapter_speed: - server_options = debug_options.get("server") or {} - server_executable = server_options.get("executable", "").lower() - if "openocd" in server_executable: - debug_options["server"]["arguments"].extend( - ["-c", "adapter speed %s" % adapter_speed] + def configure_debug_session(self, debug_config): + if debug_config.speed: + if "openocd" in (debug_config.server or {}).get("executable", ""): + debug_config.server["arguments"].extend( + ["-c", "adapter speed %s" % debug_config.speed] ) - - return debug_options