From 0e8cf6d9f0ea80b204011c52b9f943ce9eebfcab Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 22 Aug 2024 14:32:05 +0200 Subject: [PATCH 01/22] github workflow for Patmos platform added --- .github/workflows/c-embedded.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/c-embedded.yml b/.github/workflows/c-embedded.yml index f36bf3c73b..20c26019d1 100644 --- a/.github/workflows/c-embedded.yml +++ b/.github/workflows/c-embedded.yml @@ -23,3 +23,7 @@ jobs: # Run the C FlexPRET integration tests. flexpret: uses: ./.github/workflows/c-flexpret-tests.yml + + # Run the C Patmos integration tests. + patmos: + uses: ./.github/workflows/c-patmos-tests.yml From 587ebffaf7415f41722dace5755a172f7122d241 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 22 Aug 2024 14:33:39 +0200 Subject: [PATCH 02/22] github workflow for Patmos platform added 2 --- .github/actions/setup-patmos/action.yml | 17 ++++++++ .github/workflows/c-patmos-tests.yml | 53 +++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/actions/setup-patmos/action.yml create mode 100644 .github/workflows/c-patmos-tests.yml diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml new file mode 100644 index 0000000000..d640876b9a --- /dev/null +++ b/.github/actions/setup-patmos/action.yml @@ -0,0 +1,17 @@ +name: Install Patmos and dependencies (Linux only) +description: Install Patmos and dependencies (Linux only) +runs: + using: "composite" + steps: + - name: Setup + run: | + # Clone the Patmos repository + mkdir ~/t-crest + cd ~/t-crest + git clone https://github.com/t-crest/patmos-misc.git misc + ./misc/build.sh + + # Save location in PATH + export PATH=$PATH:$HOME/t-crest/misc + shell: bash + diff --git a/.github/workflows/c-patmos-tests.yml b/.github/workflows/c-patmos-tests.yml new file mode 100644 index 0000000000..5cffb01ce9 --- /dev/null +++ b/.github/workflows/c-patmos-tests.yml @@ -0,0 +1,53 @@ +name: C Patmos tests + +on: + workflow_call: + inputs: + compiler-ref: + required: false + type: string + runtime-ref: + required: false + type: string + use-cpp: + required: false + type: boolean + default: false + scheduler: + required: false + type: string + all-platforms: + required: false + default: true + type: boolean + +jobs: + Patmos-tests: + runs-on: ubuntu-latest + steps: + - name: Check out lingua-franca repository + uses: actions/checkout@v3 + with: + repository: lf-lang/lingua-franca + submodules: true + ref: ${{ inputs.compiler-ref }} + fetch-depth: 0 + - name: Prepare build environment + uses: ./.github/actions/prepare-build-env + - name: Setup and build Patmos + uses: ./.github/actions/setup-patmos + - name: Check out specific ref of reactor-c + uses: actions/checkout@v3 + with: + repository: lf-lang/reactor-c + path: core/src/main/resources/lib/c/reactor-c + ref: ${{ inputs.runtime-ref }} + if: ${{ inputs.runtime-ref }} + - name: Run Patmos smoke tests + run: | + rm -rf test/C/src-gen + - name: Report to CodeCov + uses: ./.github/actions/report-code-coverage + with: + files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml + if: ${{ github.repository == 'lf-lang/lingua-franca' }} From e3cef42339eab54755333353412572f152419373 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Fri, 23 Aug 2024 13:31:32 +0200 Subject: [PATCH 03/22] Pushes the RTI image to Docker Hub when the repo owner is lf-lang --- .github/workflows/rti-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rti-docker.yml b/.github/workflows/rti-docker.yml index e7132ebbbb..5f2cca5b3d 100644 --- a/.github/workflows/rti-docker.yml +++ b/.github/workflows/rti-docker.yml @@ -30,7 +30,7 @@ jobs: latest: false DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: ${{ endsWith(env.lf_version, '-snapshot') }} + if: ${{ endsWith(env.lf_version, '-snapshot') && github.repository_owner == 'lf-lang'}} - name: Update latest (released versions only) uses: ./.github/actions/push-rti-docker @@ -39,4 +39,4 @@ jobs: latest: true DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: ${{ !endsWith(env.lf_version, '-snapshot') }} + if: ${{ !endsWith(env.lf_version, '-snapshot') && github.repository_owner == 'lf-lang'}} From 2ba7cda5c534fbcbb53f5a2d992dee0fc36ebe2b Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 26 Aug 2024 12:50:40 +0200 Subject: [PATCH 04/22] install needed tools added to setup-patmos/action.yml --- .github/actions/setup-patmos/action.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index d640876b9a..00a5c4c61b 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -5,7 +5,24 @@ runs: steps: - name: Setup run: | + # install needed tools + sudo apt install git openjdk-8-jdk gitk cmake make g++ texinfo flex bison \ + subversion libelf-dev graphviz libboost-dev libboost-program-options-dev ruby-full \ + liblpsolve55-dev zlib1g-dev gtkwave gtkterm scala autoconf libfl2 expect verilator curl + + # install sbt + + sudo apt-get update + sudo apt-get install apt-transport-https curl gnupg -yqq + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import + sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg + sudo apt-get update + sudo apt-get install sbt + # Clone the Patmos repository + mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc From 55e4323a67cb1cf403f82d487c8411d654546c8f Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Tue, 27 Aug 2024 11:52:26 +0200 Subject: [PATCH 05/22] spotless + gitk installation removed --- .github/actions/setup-patmos/action.yml | 9 ++++----- .github/workflows/c-embedded.yml | 2 +- test/C/src/patmos/HelloPatmos.lf | 21 ++++++++++----------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 00a5c4c61b..3fd4e556d0 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -6,7 +6,7 @@ runs: - name: Setup run: | # install needed tools - sudo apt install git openjdk-8-jdk gitk cmake make g++ texinfo flex bison \ + sudo apt install git openjdk-8-jdk cmake make g++ texinfo flex bison \ subversion libelf-dev graphviz libboost-dev libboost-program-options-dev ruby-full \ liblpsolve55-dev zlib1g-dev gtkwave gtkterm scala autoconf libfl2 expect verilator curl @@ -20,15 +20,14 @@ runs: sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg sudo apt-get update sudo apt-get install sbt - + # Clone the Patmos repository - + mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc - ./misc/build.sh + ./misc/build.sh # Save location in PATH export PATH=$PATH:$HOME/t-crest/misc shell: bash - diff --git a/.github/workflows/c-embedded.yml b/.github/workflows/c-embedded.yml index 20c26019d1..5b49223589 100644 --- a/.github/workflows/c-embedded.yml +++ b/.github/workflows/c-embedded.yml @@ -24,6 +24,6 @@ jobs: flexpret: uses: ./.github/workflows/c-flexpret-tests.yml - # Run the C Patmos integration tests. + # Run the C Patmos integration tests. patmos: uses: ./.github/workflows/c-patmos-tests.yml diff --git a/test/C/src/patmos/HelloPatmos.lf b/test/C/src/patmos/HelloPatmos.lf index 8f289c980a..48c36c139b 100644 --- a/test/C/src/patmos/HelloPatmos.lf +++ b/test/C/src/patmos/HelloPatmos.lf @@ -1,12 +1,11 @@ target C { - platform: "Patmos", - single-threaded: true, - build-type: Debug, - } - - main reactor { - reaction(startup) {= - printf("Hello World!\n"); - =} - } - \ No newline at end of file + platform: "Patmos", + single-threaded: true, + build-type: Debug +} + +main reactor { + reaction(startup) {= + printf("Hello World!\n"); + =} +} From d5d24cb55209d7855e5ed5ca23bb9ea29895b4f8 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Wed, 4 Sep 2024 17:02:42 +0200 Subject: [PATCH 06/22] Spotless --- .../src/main/java/org/lflang/generator/c/CCmakeGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java index c421c3e603..095b18f733 100644 --- a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java +++ b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java @@ -229,7 +229,9 @@ CodeBuilder generateCMakeCode( case PATMOS: cMakeCode.newLine(); cMakeCode.pr("# Include toolchain file and set project"); - cMakeCode.pr("find_program(CLANG_EXECUTABLE NAMES patmos-clang clang DOC \"Path to the clang front-end.\")"); + cMakeCode.pr( + "find_program(CLANG_EXECUTABLE NAMES patmos-clang clang DOC \"Path to the clang" + + " front-end.\")"); cMakeCode.pr("set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})"); cMakeCode.pr("project(" + executableName + " LANGUAGES C)"); cMakeCode.newLine(); From bf4ade96723876c577472ffe1944b264c17fa5a8 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 9 Sep 2024 14:17:22 +0200 Subject: [PATCH 07/22] print added to patmos tests --- .github/actions/setup-patmos/action.yml | 2 ++ .github/workflows/c-patmos-tests.yml | 2 ++ core/src/main/resources/lib/c/reactor-c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 3fd4e556d0..05330be7c5 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -3,6 +3,8 @@ description: Install Patmos and dependencies (Linux only) runs: using: "composite" steps: + - name: Print + run: echo "Starting T_CREST Setup" - name: Setup run: | # install needed tools diff --git a/.github/workflows/c-patmos-tests.yml b/.github/workflows/c-patmos-tests.yml index 5cffb01ce9..3431652ba1 100644 --- a/.github/workflows/c-patmos-tests.yml +++ b/.github/workflows/c-patmos-tests.yml @@ -25,6 +25,8 @@ jobs: Patmos-tests: runs-on: ubuntu-latest steps: + - name: Print + run: echo "Patmos Tests Start" - name: Check out lingua-franca repository uses: actions/checkout@v3 with: diff --git a/core/src/main/resources/lib/c/reactor-c b/core/src/main/resources/lib/c/reactor-c index 26cc23b5ee..8d7cfa7394 160000 --- a/core/src/main/resources/lib/c/reactor-c +++ b/core/src/main/resources/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 26cc23b5eeb0bd6dcb49b00824e5ae5ac28b3b44 +Subproject commit 8d7cfa73949d3e1d1f39a0c10eb3b2d1d866ce94 From b571f4cd237d06bdf1385986a2260cc1c37237ba Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Tue, 10 Sep 2024 11:11:19 +0200 Subject: [PATCH 08/22] Patmos Category added --- .github/actions/setup-patmos/action.yml | 2 - .github/workflows/c-patmos-tests.yml | 5 +- .../org/lflang/tests/runtime/CPatmosTest.java | 80 +++++++++++++++++++ .../java/org/lflang/tests/Configurators.java | 27 +++++++ 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 05330be7c5..3fd4e556d0 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -3,8 +3,6 @@ description: Install Patmos and dependencies (Linux only) runs: using: "composite" steps: - - name: Print - run: echo "Starting T_CREST Setup" - name: Setup run: | # install needed tools diff --git a/.github/workflows/c-patmos-tests.yml b/.github/workflows/c-patmos-tests.yml index 3431652ba1..5dedf58682 100644 --- a/.github/workflows/c-patmos-tests.yml +++ b/.github/workflows/c-patmos-tests.yml @@ -25,8 +25,6 @@ jobs: Patmos-tests: runs-on: ubuntu-latest steps: - - name: Print - run: echo "Patmos Tests Start" - name: Check out lingua-franca repository uses: actions/checkout@v3 with: @@ -47,6 +45,9 @@ jobs: if: ${{ inputs.runtime-ref }} - name: Run Patmos smoke tests run: | + ./gradlew core:integrationTest \ + --tests org.lflang.tests.runtime.CPatmosTest.* \ + core:integrationTestCodeCoverageReport rm -rf test/C/src-gen - name: Report to CodeCov uses: ./.github/actions/report-code-coverage diff --git a/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java new file mode 100644 index 0000000000..3672c15355 --- /dev/null +++ b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java @@ -0,0 +1,80 @@ +/************* + * Copyright (c) 2023, The University of California at Berkeley. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ***************/ +package org.lflang.tests.runtime; + +import java.util.List; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.Test; +import org.lflang.target.Target; +import org.lflang.tests.Configurators; +import org.lflang.tests.TestBase; +import org.lflang.tests.TestRegistry.TestCategory; +import org.lflang.tests.Transformers; + +public class CPatmosTest extends TestBase { + + public CPatmosTest() { + super(Target.C); + } + + @Test + public void buildPatmosConcurrent() { + Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); + super.runTestsFor( + List.of(Target.C), + "Build concurrent tests for Patmos.", + TestCategory.CONCURRENT::equals, + Transformers::noChanges, + Configurators::makePatmosCompatible, + TestLevel.BUILD, + false); + } + + @Test + public void buildPatmosBasicTestsUnthreaded() { + Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); + super.runTestsFor( + List.of(Target.C), + "Build basic tests for Patmos in single threaded mode.", + TestCategory.BASIC::equals, + Transformers::noChanges, + Configurators::makePatmosCompatibleUnthreaded, + TestLevel.BUILD, + false); + } + + @Test + public void buildPatmosBasicTests() { + Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); + super.runTestsFor( + List.of(Target.C), + "Build basic tests for Patmos.", + TestCategory.BASIC::equals, + Transformers::noChanges, + Configurators::makePatmosCompatible, + TestLevel.BUILD, + false); + } +} diff --git a/core/src/testFixtures/java/org/lflang/tests/Configurators.java b/core/src/testFixtures/java/org/lflang/tests/Configurators.java index 91522e57bd..aa85b16a90 100644 --- a/core/src/testFixtures/java/org/lflang/tests/Configurators.java +++ b/core/src/testFixtures/java/org/lflang/tests/Configurators.java @@ -132,6 +132,33 @@ public static boolean makeFlexPRETCompatibleUnthreaded(TargetConfig config) { return makeFlexPRETCompatible(config); } + public static boolean makePatmosCompatible(TargetConfig config) { + /** + * Patmos has a maximum of eight hardware threads; override the chosen number of worker threads + * to be 0 (meaning run-time selects it). + * + *

This is to avoid failing tests that have e.g., `workers: 16`. + */ + WorkersProperty.INSTANCE.override(config, 0); + + var platform = config.get(PlatformProperty.INSTANCE); + PlatformProperty.INSTANCE.override( + config, + new PlatformOptions( + Platform.PATMOS, + new Option(true, "emulator"), + platform.port(), + platform.baudRate(), + new Option(true, false), + platform.userThreads())); + return true; + } + + public static boolean makePatmosCompatibleUnthreaded(TargetConfig config) { + disableThreading(config); + return makePatmosCompatible(config); + } + /** * Make no changes to the configuration. * From 21f7b5b5f3962fae570c6e87da399d3b3dfde74f Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Tue, 10 Sep 2024 13:11:55 +0200 Subject: [PATCH 09/22] t-crest directory added to the PATH --- .github/actions/setup-patmos/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 3fd4e556d0..b99efdb15e 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,12 +22,16 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - + export PATH=\$PATH:\$HOME/t-crest/local/bin mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc ./misc/build.sh + # Make + cd ~/t-crest/llvm/build + make -j + patmos-clang --version # Save location in PATH export PATH=$PATH:$HOME/t-crest/misc shell: bash From 7c3c4f84f968249abe22ba3263eadef8b1eea74b Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Tue, 10 Sep 2024 15:43:29 +0200 Subject: [PATCH 10/22] bug fixed --- .github/actions/setup-patmos/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index b99efdb15e..2ce5a9c48c 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,7 +22,7 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - export PATH=\$PATH:\$HOME/t-crest/local/bin + export PATH=$PATH:$HOME/t-crest/local/bin mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc From 5420d2e91f5a310ffdbbe605cd1416f766365ee2 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 12 Sep 2024 14:07:26 +0200 Subject: [PATCH 11/22] REQUIRED added to patmos-clang --- core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java index 095b18f733..adeb178f75 100644 --- a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java +++ b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java @@ -230,7 +230,7 @@ CodeBuilder generateCMakeCode( cMakeCode.newLine(); cMakeCode.pr("# Include toolchain file and set project"); cMakeCode.pr( - "find_program(CLANG_EXECUTABLE NAMES patmos-clang clang DOC \"Path to the clang" + "find_program(CLANG_EXECUTABLE NAMES patmos-clang REQUIRED DOC \"Path to the clang" + " front-end.\")"); cMakeCode.pr("set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})"); cMakeCode.pr("project(" + executableName + " LANGUAGES C)"); From 3466c44e5366f946e3db4fb4f9af49f76a7a638f Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 12 Sep 2024 15:02:29 +0200 Subject: [PATCH 12/22] echo path added --- .github/actions/setup-patmos/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 2ce5a9c48c..5f75daa234 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -23,6 +23,7 @@ runs: # Clone the Patmos repository export PATH=$PATH:$HOME/t-crest/local/bin + echo $PATH mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc From d06856f92717b9383d8787fd55ec27924ae8b065 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 12 Sep 2024 15:37:18 +0200 Subject: [PATCH 13/22] which patmos-clang added --- .github/actions/setup-patmos/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 5f75daa234..0521a5ea1e 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -33,6 +33,7 @@ runs: cd ~/t-crest/llvm/build make -j patmos-clang --version + which patmos-clang # Save location in PATH export PATH=$PATH:$HOME/t-crest/misc shell: bash From 5092b096881fd4e10990c1eb55c3d29abedb8dac Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Fri, 13 Sep 2024 12:57:01 +0200 Subject: [PATCH 14/22] save PATH into GITHUB_ENV --- .github/actions/setup-patmos/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 0521a5ea1e..903d9f428b 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,7 +22,7 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - export PATH=$PATH:$HOME/t-crest/local/bin + echo "$PATH:$HOME/t-crest/local/bin" >> $GITHUB_ENV echo $PATH mkdir ~/t-crest cd ~/t-crest @@ -35,5 +35,5 @@ runs: patmos-clang --version which patmos-clang # Save location in PATH - export PATH=$PATH:$HOME/t-crest/misc + echo "$PATH:$HOME/t-crest/misc" >> $GITHUB_ENV shell: bash From c1ac7753d386c7e6f2355f7f124827b8394aebdd Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Fri, 13 Sep 2024 14:35:49 +0200 Subject: [PATCH 15/22] is quoted --- .github/actions/setup-patmos/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 903d9f428b..a1bbd0fbbc 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,7 +22,7 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - echo "$PATH:$HOME/t-crest/local/bin" >> $GITHUB_ENV + echo "$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" echo $PATH mkdir ~/t-crest cd ~/t-crest @@ -35,5 +35,5 @@ runs: patmos-clang --version which patmos-clang # Save location in PATH - echo "$PATH:$HOME/t-crest/misc" >> $GITHUB_ENV + echo "$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" shell: bash From ccf962c70f5c212be18f26e912a334be9e4093e5 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 16 Sep 2024 14:25:09 +0200 Subject: [PATCH 16/22] PATH modified and saved in GITHUB_ENV --- .github/actions/setup-patmos/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index a1bbd0fbbc..830a1f849e 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,7 +22,7 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - echo "$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" + echo "PATH=$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" echo $PATH mkdir ~/t-crest cd ~/t-crest @@ -35,5 +35,5 @@ runs: patmos-clang --version which patmos-clang # Save location in PATH - echo "$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" + echo "PATH=$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" shell: bash From 5ffa58c1a44f36731bbe012f1e7ab074d1612405 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 16 Sep 2024 15:12:26 +0200 Subject: [PATCH 17/22] export PATH added along with GITHUB_ENV --- .github/actions/setup-patmos/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 830a1f849e..80719c9964 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -22,7 +22,8 @@ runs: sudo apt-get install sbt # Clone the Patmos repository - echo "PATH=$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" + export PATH=$PATH:$HOME/t-crest/local/bin + echo "PATH=\$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" echo $PATH mkdir ~/t-crest cd ~/t-crest @@ -35,5 +36,6 @@ runs: patmos-clang --version which patmos-clang # Save location in PATH - echo "PATH=$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" + export PATH=$PATH:$HOME/t-crest/misc + echo "PATH=\$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" shell: bash From f330ea3dc980978aa18ef2bf0a5da9197444bf9a Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 16 Sep 2024 16:48:17 +0200 Subject: [PATCH 18/22] setting PATH in GITHUB_ENV removed. Some other optional commands removed. --- .github/actions/setup-patmos/action.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 80719c9964..86080d938d 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -23,19 +23,12 @@ runs: # Clone the Patmos repository export PATH=$PATH:$HOME/t-crest/local/bin - echo "PATH=\$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" + echo "$HOME/t-crest/local/bin" >> "$GITHUB_ENV" echo $PATH mkdir ~/t-crest cd ~/t-crest git clone https://github.com/t-crest/patmos-misc.git misc ./misc/build.sh - - # Make - cd ~/t-crest/llvm/build - make -j patmos-clang --version which patmos-clang - # Save location in PATH - export PATH=$PATH:$HOME/t-crest/misc - echo "PATH=\$PATH:$HOME/t-crest/misc" >> "$GITHUB_ENV" shell: bash From f8d1e8352e0b02a1908e587058370bc9f900d4f9 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Tue, 17 Sep 2024 11:13:04 +0200 Subject: [PATCH 19/22] setting PATH in GITHUB_ENV returned without backslash --- .github/actions/setup-patmos/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-patmos/action.yml b/.github/actions/setup-patmos/action.yml index 86080d938d..7ecc47a67e 100644 --- a/.github/actions/setup-patmos/action.yml +++ b/.github/actions/setup-patmos/action.yml @@ -23,7 +23,7 @@ runs: # Clone the Patmos repository export PATH=$PATH:$HOME/t-crest/local/bin - echo "$HOME/t-crest/local/bin" >> "$GITHUB_ENV" + echo "PATH=$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" echo $PATH mkdir ~/t-crest cd ~/t-crest From f5de81e50116b1bff94ca2416ff14d92796b7853 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 21 Oct 2024 11:45:14 +0200 Subject: [PATCH 20/22] Patmos tests are excluded from cuncurrent and regular-tests --- .../java/org/lflang/tests/RuntimeTest.java | 5 +++-- .../java/org/lflang/tests/runtime/CCppTest.java | 1 + .../java/org/lflang/tests/runtime/CPatmosTest.java | 13 ------------- .../java/org/lflang/tests/TestRegistry.java | 1 + 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/core/src/integrationTest/java/org/lflang/tests/RuntimeTest.java b/core/src/integrationTest/java/org/lflang/tests/RuntimeTest.java index 2f170ec488..e35d45f79f 100644 --- a/core/src/integrationTest/java/org/lflang/tests/RuntimeTest.java +++ b/core/src/integrationTest/java/org/lflang/tests/RuntimeTest.java @@ -232,7 +232,7 @@ public static boolean compatibleWithThreadingOff(TestCategory category) { // CONCURRENT, FEDERATED, DOCKER_FEDERATED, DOCKER // are not compatible with single-threaded execution. - // ARDUINO, ZEPHYR and FLEXPRET have their own test suites, so we don't need to rerun. + // ARDUINO, ZEPHYR, FLEXPRET, and PATMOS have their own test suites, so we don't need to rerun. boolean excluded = category == TestCategory.CONCURRENT || category == TestCategory.SERIALIZATION @@ -245,7 +245,8 @@ public static boolean compatibleWithThreadingOff(TestCategory category) { || category == TestCategory.ZEPHYR_UNTHREADED || category == TestCategory.ZEPHYR_BOARDS || category == TestCategory.ZEPHYR_THREADED - || category == TestCategory.FLEXPRET; + || category == TestCategory.FLEXPRET + || category == TestCategory.PATMOS; // SERIALIZATION and TARGET tests are excluded on Windows. excluded |= isWindows() && category == TestCategory.TARGET; diff --git a/core/src/integrationTest/java/org/lflang/tests/runtime/CCppTest.java b/core/src/integrationTest/java/org/lflang/tests/runtime/CCppTest.java index cd890517f7..687a12011e 100644 --- a/core/src/integrationTest/java/org/lflang/tests/runtime/CCppTest.java +++ b/core/src/integrationTest/java/org/lflang/tests/runtime/CCppTest.java @@ -48,6 +48,7 @@ private static boolean isExcludedFromCCpp(TestCategory category) { excluded |= category == TestCategory.ZEPHYR_THREADED; excluded |= category == TestCategory.ZEPHYR_BOARDS; excluded |= category == TestCategory.ARDUINO; + excluded |= category == TestCategory.PATMOS; excluded |= category == TestCategory.NO_INLINING; excluded |= category == TestCategory.VERIFIER; return !excluded; diff --git a/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java index 3672c15355..293d1fbe5b 100644 --- a/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java +++ b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java @@ -39,19 +39,6 @@ public CPatmosTest() { super(Target.C); } - @Test - public void buildPatmosConcurrent() { - Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); - super.runTestsFor( - List.of(Target.C), - "Build concurrent tests for Patmos.", - TestCategory.CONCURRENT::equals, - Transformers::noChanges, - Configurators::makePatmosCompatible, - TestLevel.BUILD, - false); - } - @Test public void buildPatmosBasicTestsUnthreaded() { Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); diff --git a/core/src/testFixtures/java/org/lflang/tests/TestRegistry.java b/core/src/testFixtures/java/org/lflang/tests/TestRegistry.java index ab20848871..fc74f30d76 100644 --- a/core/src/testFixtures/java/org/lflang/tests/TestRegistry.java +++ b/core/src/testFixtures/java/org/lflang/tests/TestRegistry.java @@ -337,6 +337,7 @@ public enum TestCategory { ZEPHYR_UNTHREADED(false, "zephyr" + File.separator + "unthreaded", TestLevel.BUILD), ZEPHYR_BOARDS(false, "zephyr" + File.separator + "boards", TestLevel.BUILD), FLEXPRET(false, "flexpret", TestLevel.BUILD), + PATMOS(false, "patmos", TestLevel.BUILD), VERIFIER(false, "verifier", TestLevel.EXECUTION), TARGET(false, "", TestLevel.EXECUTION); From 813fb6ac251973d95f2ed521839a3721238a2d79 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Mon, 21 Oct 2024 13:35:52 +0200 Subject: [PATCH 21/22] Patmos threaded basic test is removed --- .../java/org/lflang/tests/runtime/CPatmosTest.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java index 293d1fbe5b..8dd7c67e35 100644 --- a/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java +++ b/core/src/integrationTest/java/org/lflang/tests/runtime/CPatmosTest.java @@ -51,17 +51,4 @@ public void buildPatmosBasicTestsUnthreaded() { TestLevel.BUILD, false); } - - @Test - public void buildPatmosBasicTests() { - Assumptions.assumeTrue(isLinux(), "Patmos tests only supported on Linux"); - super.runTestsFor( - List.of(Target.C), - "Build basic tests for Patmos.", - TestCategory.BASIC::equals, - Transformers::noChanges, - Configurators::makePatmosCompatible, - TestLevel.BUILD, - false); - } } From 46da427b4687d4f485f60de74453300bed617eb7 Mon Sep 17 00:00:00 2001 From: Ehsan Khodadad Date: Thu, 24 Oct 2024 20:40:10 +0200 Subject: [PATCH 22/22] reactor-cpp points to dfdac2c --- core/src/main/resources/lib/cpp/reactor-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/cpp/reactor-cpp b/core/src/main/resources/lib/cpp/reactor-cpp index 65dff1fd22..dfdac2c19e 160000 --- a/core/src/main/resources/lib/cpp/reactor-cpp +++ b/core/src/main/resources/lib/cpp/reactor-cpp @@ -1 +1 @@ -Subproject commit 65dff1fd22d80305473acaf34a7e5209521b5ec0 +Subproject commit dfdac2c19e8d111cf4741c8bf8f304678a59d025