Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Nov 12, 2021
2 parents c9ae1dc + f9b0b15 commit 0cd0f80
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, windows-latest, macos-latest]
python-version: [2.7, 3.7]
os: [ubuntu-18.04, windows-latest, macos-latest]
python-version: [3.7]
example:
- "examples/native-asm"
- "examples/native-bare_c"
- "examples/psp-hello-world"
- "examples/rtosal-freertos"
# - "examples/zephyr-hello-world"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CHIPS Alliance: development platform for [PlatformIO](http://platformio.org)

![alt text](https://github.com/platformio/platform-chipsalliance/workflows/Examples/badge.svg "CHIPS Alliance development platform")
[![Build Status](https://github.com/platformio/platform-chipsalliance/workflows/Examples/badge.svg)](https://github.com/platformio/platform-chipsalliance/actions)

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)
Expand Down
11 changes: 8 additions & 3 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def run_verilator(target, source, env):
target_elf = env.BuildProgram()
target_bin = env.ElfToBin(os.path.join("$BUILD_DIR", "${PROGNAME}"), target_elf)
target_vh = env.BinToVh(os.path.join("$BUILD_DIR", "${PROGNAME}"), target_bin)
env.Depends(target_bin, "checkprogsize")

AlwaysBuild(env.Alias("nobuild", target_bin))
target_buildprog = env.Alias("buildprog", target_bin, target_bin)
Expand Down Expand Up @@ -178,6 +179,9 @@ def run_verilator(target, source, env):
bitstream_file = os.path.abspath(
board_config.get("build.bitstream_file", "swervolf_0.bit"))

if not os.path.isfile(bitstream_file):
bitstream_file = os.path.join(platform.get_dir(), "misc", "bitstream", "rvfpga.bit")

if "program_fpga" in COMMAND_LINE_TARGETS and not os.path.isfile(bitstream_file):
sys.stderr.write("Error: Couldn't find bitstream file.\n")
env.Exit(1)
Expand Down Expand Up @@ -316,9 +320,10 @@ def run_verilator(target, source, env):
)
openocd_args.extend(
[
"-c", "load_image {$SOURCE} %s" % board_config.get(
"upload").get("image_offset", ""),
"-c", "reset run",
"-c", "reset halt",
"-c", "load_image {$SOURCE} %s elf" % board_config.get(
"upload").get("image_offset", "0x0"),
"-c", "resume %s" % board_config.get("upload").get("image_offset", "0x0"),
"-c", "shutdown"
]
)
Expand Down
Binary file added misc/bitstream/rvfpga.bit
Binary file not shown.
4 changes: 2 additions & 2 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-chipsalliance.git"
},
"version": "1.0.3",
"version": "1.1.0",
"frameworks": {
"wd-riscv-sdk": {
"package": "framework-wd-riscv-sdk",
Expand Down Expand Up @@ -47,7 +47,7 @@
"tool-openocd-riscv-chipsalliance": {
"type": "uploader",
"owner": "platformio",
"version": "~1.1000.0"
"version": "~1.1100.0"
},
"tool-verilator-swervolf": {
"type": "debugger",
Expand Down
21 changes: 17 additions & 4 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from os.path import join
import os

from platformio.managers.platform import PlatformBase

Expand Down Expand Up @@ -50,7 +50,7 @@ def _add_default_debug_tools(self, board):
server_package = "tool-openocd-riscv-chipsalliance"
server_args = [
"-s",
join(
os.path.join(
self.get_package_dir("framework-wd-riscv-sdk") or "",
"board",
board.get("build.variant", ""),
Expand All @@ -69,7 +69,7 @@ def _add_default_debug_tools(self, board):
"end",
]
if tool == "verilator":
openocd_config = join(
openocd_config = os.path.join(
self.get_dir(),
"misc",
"openocd",
Expand All @@ -94,7 +94,7 @@ def _add_default_debug_tools(self, board):
"define pio_reset_run_target",
"end",
]
elif debug.get("openocd_config"):
elif debug.get("openocd_config", ""):
server_args.extend(["-f", debug.get("openocd_config")])
else:
assert debug.get("openocd_target"), (
Expand Down Expand Up @@ -129,3 +129,16 @@ 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]
)

return debug_options

0 comments on commit 0cd0f80

Please sign in to comment.