Skip to content

Commit

Permalink
Merge pull request #62 from xmos/release/v2.0.0
Browse files Browse the repository at this point in the history
Release/v2.0.0
  • Loading branch information
keithm-xmos authored Apr 13, 2023
2 parents 4378d23 + e784fc7 commit d5eff02
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 39 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
default: 'no'

env:
XCORE_BUILDER_IMAGE: 'ghcr.io/xmos/xcore_builder:latest'
FWK_IO_TESTER_IMAGE: 'ghcr.io/xmos/fwk_io_tester:develop'

jobs:
# JOB to run change detection
Expand Down Expand Up @@ -79,11 +79,11 @@ jobs:

- name: Pull Docker builder image
run: |
docker pull ${XCORE_BUILDER_IMAGE}
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${XCORE_BUILDER_IMAGE} bash -l run_tests.sh lib_i2c
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_i2c
i2stests:
name: I2S tests
Expand All @@ -98,11 +98,11 @@ jobs:

- name: Pull Docker builder
run: |
docker pull ${XCORE_BUILDER_IMAGE}
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${XCORE_BUILDER_IMAGE} bash -l run_tests.sh lib_i2s
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_i2s
spitests:
name: SPI tests
Expand All @@ -117,11 +117,11 @@ jobs:

- name: Pull Docker builder image
run: |
docker pull ${XCORE_BUILDER_IMAGE}
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${XCORE_BUILDER_IMAGE} bash -l run_tests.sh lib_spi
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_spi
uarttests:
Expand All @@ -137,8 +137,8 @@ jobs:

- name: Pull Docker builder
run: |
docker pull ${XCORE_BUILDER_IMAGE}
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${XCORE_BUILDER_IMAGE} bash -l run_tests.sh lib_uart
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_uart
90 changes: 90 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Create and publish a Docker image

on:
push:
branches:
- 'develop'
tags:
- 'v*'
pull_request:
branches:
- 'develop'

# Allow manually triggering the workflow.
workflow_dispatch: {}


env:
REGISTRY: ghcr.io
IMAGE_NAME: xmos/fwk_io_tester

jobs:

changes:
runs-on: ubuntu-latest
name: Change detection
# Set job outputs to values from filter step
outputs:
dockerfile: ${{ steps.filter.outputs.dockerfile }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Paths filter
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dockerfile:
- 'tools/docker/**'
build-and-push-image:
needs: changes
name: Build and push Docker image
if: ${{ needs.changes.outputs.dockerfile == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# vX.Y.Z vX.Y vX (on push tag)
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
# main/feature/etc
type=ref,event=branch
# pr-N
type=ref,event=pr
# sha-XXXXXXX
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
file: 'tools/docker/Dockerfile.tests'
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
workflow_dispatch: {}

env:
DOC_BUILDER_IMAGE: 'ghcr.io/xmos/doc_builder:v2.0.0'
DOC_BUILDER_IMAGE: 'ghcr.io/xmos/doc_builder:v3.0.0'

jobs:
build_documentation:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
IO Framework change log
=======================

2.0.0
-----

* CHANGE: Updated lib_xud to v2.2.2

1.0.0
-----

Expand Down
4 changes: 2 additions & 2 deletions doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pull the docker container:

.. code-block:: console
$ docker pull ghcr.io/xmos/doc_builder:latest
$ docker pull ghcr.io/xmos/doc_builder:v3.0.0
========
Building
Expand All @@ -26,5 +26,5 @@ To build the documentation, run the following command in the root of the reposit

.. code-block:: console
$ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build -e PDF=1 -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INPUT=ignore ghcr.io/xmos/doc_builder:latest
$ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build -e PDF=1 -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INPUT=ignore ghcr.io/xmos/doc_builder:v3.0.0
4 changes: 1 addition & 3 deletions doc/programming_guide/reference/i2c/i2c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ The library is compatible with multiple slave devices existing on the same bus.

The library can also be used to implement multiple |I2C| physical interfaces on a single xcore device simultaneously.

All signals are designed to comply with the timings in the |I2C| specification. Information on obtaining the |I2C| specification can be found here:

https://www.i2c-bus.org/specification/
All signals are designed to comply with the timings in the |I2C| specification.

Note that the following optional parts of the |I2C| specification are not supported:

Expand Down
2 changes: 1 addition & 1 deletion modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
add_subdirectory(i2c)
add_subdirectory(i2s)
if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A)
add_subdirectory(mic_array/lib_mic_array)
add_subdirectory(mic_array)
endif()
add_subdirectory(qspi_io)
add_subdirectory(spi)
Expand Down
1 change: 1 addition & 0 deletions modules/i2s/src/i2s_master.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <string.h>
#include <xclib.h>
#include <xcore/port.h>
#include <xcore/clock.h>
Expand Down
1 change: 1 addition & 0 deletions modules/i2s/src/i2s_slave.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2021-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <string.h>
#include <xclib.h>
#include <xcore/port.h>
#include <xcore/clock.h>
Expand Down
40 changes: 19 additions & 21 deletions modules/xud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
if((${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) OR (${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS2A))
## Source files
file(GLOB_RECURSE LIB_C_SOURCES lib_xud/lib_xud/src/*.c )
file(GLOB_RECURSE LIB_CXX_SOURCES lib_xud/lib_xud/src/*.cc)
file(GLOB_RECURSE LIB_XC_SOURCES lib_xud/lib_xud/src/*.xc)
file(GLOB_RECURSE LIB_ASM_SOURCES lib_xud/lib_xud/src/*.S )

list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_CrcAddrCheck.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_PidJumpTable.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_PidJumpTable_RxData.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_RxData.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_In.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_In_DI.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_Out.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_Out_DI.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_Ping.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_Setup.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_Setup_DI.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/included/XUD_Token_SOF.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_CrcAddrCheck.S)
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_G_Crc.S) # Not in XS3 branch
list(REMOVE_ITEM LIB_ASM_SOURCES ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_TokenJmp.S)

## cmake doesn't recognize .S files as assembly by default
Expand All @@ -27,8 +23,16 @@ if((${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) OR (${CMAKE_SYSTEM_NAME} STREQUAL
set(XCORE_XS3A_SOURCES ${LIB_ASM_SOURCES})

## Includes files
set(LIB_PUBLIC_INCLUDES lib_xud/lib_xud/api lib_xud/lib_xud/src/user)
set(LIB_PRIVATE_INCLUDES lib_xud/lib_xud/src lib_xud/lib_xud/src/core)
set(LIB_PUBLIC_INCLUDES
lib_xud/lib_xud/api
lib_xud/lib_xud/api/legacy
lib_xud/lib_xud/src/user
lib_xud/lib_xud/src/user/class
)
set(LIB_PRIVATE_INCLUDES
lib_xud/lib_xud/src
lib_xud/lib_xud/src/core
)

## Gather library sources
set(LIB_PUBLIC_SOURCES "")
Expand All @@ -41,19 +45,13 @@ if((${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) OR (${CMAKE_SYSTEM_NAME} STREQUAL
set_source_files_properties(${LIB_PRIVATE_SOURCES} DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTIES COMPILE_OPTIONS "-O3;-DREF_CLK_FREQ=100;-fasm-linenum;-fcomment-asm;-DXUD_FULL_PIDTABLE=1")

## Append file specific compile flags to sources at the top level directory because this is an INTERFACE library
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_IoLoop.S DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-fschedule -g0")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Main.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/user/client/XUD_SetDevAddr.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_DeviceAttach.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue;-Wno-return-type")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_PhyResetUser.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue") # Not in XS3 branch
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Support.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_IOLoopCall.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_PowerSig.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue;-Wno-return-type")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_TestMode.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_GetDone.c DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue") # Not in XS3 branch
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_SetCrcTableAddr.c DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_HAL.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-Wno-return-type")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Signalling.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-Wno-return-type")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_IoLoop.S DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-fschedule")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Main.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Support.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_Signalling.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-Wno-return-type")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_TestMode.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_SetCrcTableAddr.c DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue")
set_property(SOURCE ${CMAKE_CURRENT_LIST_DIR}/lib_xud/lib_xud/src/core/XUD_HAL.xc DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_OPTIONS "-mno-dual-issue") # Not in XS3 branch

## Create library target
## INTERFACE because we depend on the board target supplied usb tile and core speed
Expand Down
2 changes: 1 addition & 1 deletion modules/xud/lib_xud
Submodule lib_xud updated 283 files
2 changes: 1 addition & 1 deletion settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "XCORE Peripheral IO Framework",
"project": "fwk_io",
"version": "1.0.0"
"version": "2.0.0"
}
5 changes: 5 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -e

if [ -f /.dockerenv ]; then
# Docker workaround for: "fatal: detected dubious ownership in repository"
git config --global --add safe.directory /fwk_io
fi

if [ -z "$1" ] || [ "$1" == "all" ]
then
declare -a hil_test_libs=(
Expand Down
16 changes: 16 additions & 0 deletions tools/docker/Dockerfile.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/xmos/xcore_builder:latest

# This Dockerfile is for use by the XMOS fwk_io CI system
# It provides a minimal environment needed to build applications and run tests

# install dependencies
# RUN apt-get update && apt-get install -y \
# && apt-get clean autoclean

WORKDIR /test
ADD test/requirements.txt /test
ADD test/modules/test_support /test/modules/test_support
RUN pip3 install -r requirements.txt

# set login shell
SHELL ["/bin/bash", "-l", "-c"]
16 changes: 16 additions & 0 deletions tools/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tests Dockerfile

This dockerfile is used to build an image for testing. It build on top of the (private) base [xcore_builder](https://github.com/xmos/xcore_builder) image. Access to the private base image repository is not required to build this image.

## Build Image

To build the docker container locally, run the following command in the root of the repository:

docker build -t ghcr.io/xmos/fwk_io_tester:develop -f tools/docker/Dockerfile.tests .

## Run Container

To run the container:

docker run -it ghcr.io/xmos/fwk_io_tester:develop bash

0 comments on commit d5eff02

Please sign in to comment.