From ad7e787157db51b8e7752c2e5bdb74b0c4868601 Mon Sep 17 00:00:00 2001 From: Samuel Pelegrinello Caipers Date: Fri, 8 Oct 2021 16:45:45 +0200 Subject: [PATCH] Adding s3 bucket --- .github/workflows/main.yml | 100 ++++++++++++------ .../RTE/Device/SSE-300-MPS3/region_limits.h | 8 +- .../microspeech.Audio_Provider_Mock.cprj | 6 +- ...microspeech.Audio_Provider_Mock_Test.cprj} | 29 +++-- .../microspeech.Example_Test.cprj | 6 +- .../microspeech.uvoptx | 18 ++-- .../microspeech.uvprojx | 20 ++-- .../microspeech.IMXRT1050-EVKB.cprj | 12 +-- Platform_IMXRT1050-EVKB/microspeech.uvoptx | 26 ++--- Platform_IMXRT1050-EVKB/microspeech.uvprojx | 14 +-- .../microspeech.MIMXRT1064-EVK.cprj | 12 +-- Platform_MIMXRT1064-EVK/microspeech.uvoptx | 6 +- Platform_MIMXRT1064-EVK/microspeech.uvprojx | 42 ++++---- README.md | 3 +- vht/vht.yml | 17 ++- 15 files changed, 170 insertions(+), 149 deletions(-) rename Platform_FVP_Corstone_SSE-300_Ethos-U55/{microspeech.Example.Helium.cprj => microspeech.Audio_Provider_Mock_Test.cprj} (82%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c017f09..4725a09 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,64 +1,94 @@ -# This is a basic workflow to help you get started with Actions - name: CI - -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the main branch - #push: - # branches: [ main ] pull_request: branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on + env: + CREATE_EC2_INSTANCE: true + EC2_INSTANCE_ID: '' + TERMINATE_EC2_INSTANCE: false + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + AWS_DEFAULT_REGION: eu-west-1 + AWS_S3_BUCKET: gh-orta-vht runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - #- name: Create Container runtime from DockerHub - # run : | - # docker run -i -v ${{ github.workspace }}:/workspace/host --mac-address="00:02:F7:FF:55:55" --name build_runtime -d armswdev/cmsis_tools_m55:latest - # docker exec build_runtime pip3 install six requests pyyaml junit_xml pillow + - name: Create new EC2 instance + timeout-minutes: 2 + if: ${{ env.CREATE_EC2_INSTANCE }} + run: | + instance_id=$(aws ec2 run-instances \ + --image-id ami-060c9b43ee8c7905a \ + --count 1 \ + --instance-type t2.micro \ + --key-name common \ + --security-group-ids sg-0b5fb9062b40be14f \ + --iam-instance-profile Name=Proj-s3-orta-vht-role \ + --subnet-id subnet-00455495b268076f0 \ + --output text \ + | awk '/INSTANCE/{print $9}') + echo "instance_id = $instance_id" + echo "EC2_INSTANCE_ID=$instance_id" >> $GITHUB_ENV - # Runs a set of commands using the runners shell - #- name: Build on Docker - # run: | - # docker exec build_runtime wget -N https://www.keil.com/pack/index.pidx -P /armtools/packs/.Web/ - # docker exec -w /workspace/host/Platform_FVP_Corstone_SSE-300_Ethos-U55 build_runtime cbuild.sh /workspace/host/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example.cprj + - name: Wait for instance-status-ok + timeout-minutes: 10 + if: ${{ env.CREATE_EC2_INSTANCE }} + run: | + aws ec2 wait instance-status-ok \ + --instance-ids ${{ env.EC2_INSTANCE_ID }} + + - name: Set EC2_INSTANCE_ID if not created and assigned + if: ${{ !env.CREATE_EC2_INSTANCE && env.EC2_INSTANCE_ID == '' }} + run: | + echo "EC2_INSTANCE_ID=${{ secrets.AWS_INSTANCE_ID }}" >> $GITHUB_ENV - name: Prepare Build on EC2 instance run: | cp -r ${{ github.workspace }}/Platform_FVP_Corstone_SSE-300_Ethos-U55/ ${{ github.workspace }}/vht/ + cp -r ${{ github.workspace }}/micro_speech/ ${{ github.workspace }}/vht/ - name: Prepare VHT Testsuite run: | - #cp ${{ github.workspace }}/Platform_FVP_Corstone_SSE-300_Ethos-U55/Objects/microspeech.axf ${{ github.workspace }}/vht/elf/ cp -r ${{ github.workspace }}/VSI ${{ github.workspace }}/vht/VSI cp -r ${{ github.workspace }}/Platform_FVP_Corstone_SSE-300_Ethos-U55/fvp_config.txt ${{ github.workspace }}/vht/ - # Run test suite in Arm VHT + # Run test suite in Arm VHT + # The EC2 instance needs a IAM Role allowing it to read/write S3 buckets. + # TODO: I need to give the policy for it - uses: spcaipers-arm/VHT-AMI@use_s3_bucket with: vht_in: ./vht/ - instance_id: ${{ secrets.AWS_INSTANCE_ID }} + instance_id: ${{ env.EC2_INSTANCE_ID }} + aws_region: ${{ env. AWS_DEFAULT_REGION }} + s3_bucket_name: ${{ env.AWS_S3_BUCKET }} access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_key_id: ${{ secrets.AWS_SECRET_KEY }} - - #- name: Setup tmate session - # uses: mxschmitt/action-tmate@v3 + secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + session_token: ${{ secrets.AWS_SESSION_TOKEN }} + - name: Archive out.tar + uses: actions/upload-artifact@v2 + with: + name: out.tar + path: out.tar - - name: Fetch results from VHT Testsuite + - name: Untar results from VHT Testsuite run: | - tar tvf ${{ github.workspace }}/vht/out.tar - tar xvzf ${{ github.workspace }}/vht/out.tar - cat ./home/ubuntu/vhtwork/out/microspeech.axf.stdio + tar xvzf out.tar + cat home/ubuntu/vhtwork/out/microspeech.axf.stdio + + - name: Archive microspeech.axf.stdio + uses: actions/upload-artifact@v2 + with: + name: microspeech.axf.stdio + path: home/ubuntu/vhtwork/out/microspeech.axf.stdio + + # - name: Terminate EC2 Instance + # if: ${{ env.TERMINATE_EC2_INSTANCE }} + # run: | + # aws ec2 terminate-instances \ + # --instance-ids ${{ env.EC2_INSTANCE_ID }} diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/RTE/Device/SSE-300-MPS3/region_limits.h b/Platform_FVP_Corstone_SSE-300_Ethos-U55/RTE/Device/SSE-300-MPS3/region_limits.h index 74ad482..9c0ae1d 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/RTE/Device/SSE-300-MPS3/region_limits.h +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/RTE/Device/SSE-300-MPS3/region_limits.h @@ -28,20 +28,20 @@ /* Secure Code */ #define S_ROM_ALIAS (0x10000000) /* ITCM_BASE_S */ -#define TOTAL_S_ROM_SIZE (0x00040000) /* 256 kB */ +#define TOTAL_S_ROM_SIZE (0x00100000) /* 1 MB */ /* Secure Data */ #define S_RAM_ALIAS (0x30000000) /* DTCM_BASE_S */ -#define TOTAL_S_RAM_SIZE (0x00040000) /* 256 kB */ +#define TOTAL_S_RAM_SIZE (0x00400000) /* 4 MB */ /* Non-Secure Code */ #define NS_ROM_ALIAS (0x01000000) /* SRAM_BASE_NS */ -#define TOTAL_NS_ROM_SIZE (0x00040000) /* 256 kB */ +#define TOTAL_NS_ROM_SIZE (0x00200000) /* 2 MB */ /* Non-Secure Data */ #define NS_RAM_ALIAS (0x21000000) /* ISRAM0_BASE_NS */ -#define TOTAL_NS_RAM_SIZE (0x00040000) /* 256 kB */ +#define TOTAL_NS_RAM_SIZE (0x00080000) /* 512 kB */ /* Heap and Stack sizes for secure and nonsecure applications */ diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock.cprj b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock.cprj index f123ad3..0eb457b 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock.cprj +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock.cprj @@ -1,7 +1,7 @@ - + Blinky @@ -26,8 +26,8 @@ - - + + ../micro_speech/src diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example.Helium.cprj b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock_Test.cprj similarity index 82% rename from Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example.Helium.cprj rename to Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock_Test.cprj index 1b68214..4fa6285 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example.Helium.cprj +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Audio_Provider_Mock_Test.cprj @@ -1,7 +1,7 @@ - + Blinky @@ -23,14 +23,14 @@ - + - - - + + + - ../VSI/audio/include;../VSI/include;../micro_speech/src - __FVP_PY + ../micro_speech/src + __TEST @@ -84,19 +84,12 @@ - - - - - - - @@ -122,12 +115,16 @@ - - + + + + + + diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example_Test.cprj b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example_Test.cprj index e807a4b..34eaf6f 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example_Test.cprj +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example_Test.cprj @@ -1,7 +1,7 @@ - + Blinky @@ -26,8 +26,8 @@ - - + + ../VSI/audio/include;../VSI/include;../micro_speech/src __FVP_PY;__TEST diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvoptx b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvoptx index 069fec4..a3d4b45 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvoptx +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvoptx @@ -75,7 +75,7 @@ 1 0 - 0 + 1 7 @@ -145,7 +145,7 @@ 0 DbgFMv8M - -I -S"System Generator:cpu_core" -L"cpu_core.cpu0" -O4102 -C0 -MC"..\..\Program Files\ARM\arm_vsi\Build_Corstone_SSE-300_Ethos-U55\system\systemc-peripheral-example.exe" -MF"fvp_config.txt" -PF -MA"-V "..\VSI\audio\python" -C cpu_core.mps3_board.telnetterminal0.start_telnet=1" + -I -S"System Generator:cpu_core" -L"cpu_core.cpu0" -O4102 -C0 -MC"..\..\Program Files\Arm\VHT\models\Win64_VC2017\VHT-Corstone-300.exe" -MF"fvp_config.txt" -PF -MA"-V "..\VSI\audio\python" -C cpu_core.mps3_board.telnetterminal0.start_telnet=1" 0 @@ -155,12 +155,12 @@ - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd ARM.CMSIS.5.8.0 1 - C:\Packs\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd + C:\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd Keil.ARM_Compiler.1.6.3 1 @@ -270,7 +270,7 @@ 1 0 - 1 + 0 7 @@ -350,12 +350,12 @@ - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd ARM.CMSIS.5.8.0 1 - C:\Packs\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd + C:\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd Keil.ARM_Compiler.1.6.3 1 @@ -870,7 +870,7 @@ Driver - 1 + 0 0 0 0 @@ -890,7 +890,7 @@ TF_micro_frontend - 1 + 0 0 0 0 diff --git a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvprojx b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvprojx index 601acac..546f906 100644 --- a/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvprojx +++ b/Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.uvprojx @@ -1239,7 +1239,7 @@ 1 - 6 + 7 0 0 1 @@ -2267,7 +2267,7 @@ 1 - 6 + 7 0 0 1 @@ -4035,7 +4035,7 @@ - + @@ -4044,7 +4044,7 @@ - + @@ -4053,7 +4053,7 @@ - + @@ -4062,7 +4062,7 @@ - + @@ -4070,8 +4070,8 @@ - - + + @@ -4079,8 +4079,8 @@ - - + + diff --git a/Platform_IMXRT1050-EVKB/microspeech.IMXRT1050-EVKB.cprj b/Platform_IMXRT1050-EVKB/microspeech.IMXRT1050-EVKB.cprj index f3fc7b1..ffa381d 100644 --- a/Platform_IMXRT1050-EVKB/microspeech.IMXRT1050-EVKB.cprj +++ b/Platform_IMXRT1050-EVKB/microspeech.IMXRT1050-EVKB.cprj @@ -52,11 +52,11 @@ - - - - - + + + + + @@ -67,7 +67,7 @@ - + .;../VSI/audio/include;../micro_speech/src CODEC_WM8960_ENABLE;SKIP_SYSCLK_INIT;XIP_BOOT_HEADER_DCD_ENABLE=1;XIP_BOOT_HEADER_ENABLE=1;XIP_EXTERNAL_FLASH=1 diff --git a/Platform_IMXRT1050-EVKB/microspeech.uvoptx b/Platform_IMXRT1050-EVKB/microspeech.uvoptx index 7893a52..cdddbf8 100644 --- a/Platform_IMXRT1050-EVKB/microspeech.uvoptx +++ b/Platform_IMXRT1050-EVKB/microspeech.uvoptx @@ -160,18 +160,18 @@ - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\Driver\VIO\cmsis_vio.scvd ARM.CMSIS.5.8.0 1 - C:\Packs\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd - Keil.ARM_Compiler.1.6.3 + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd + ARM.CMSIS.5.8.0 1 - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\Driver\VIO\cmsis_vio.scvd - ARM.CMSIS.5.8.0 + C:\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd + Keil.ARM_Compiler.1.6.3 1 @@ -228,7 +228,7 @@ App - 1 + 0 0 0 0 @@ -248,7 +248,7 @@ Board - 1 + 0 0 0 0 @@ -280,7 +280,7 @@ Board IO - 1 + 0 0 0 0 @@ -300,7 +300,7 @@ Driver - 1 + 0 0 0 0 @@ -320,7 +320,7 @@ MCUXpresso - 1 + 0 0 0 0 @@ -340,7 +340,7 @@ Documentation - 1 + 0 0 0 0 @@ -360,7 +360,7 @@ TF_micro_frontend - 1 + 0 0 0 0 @@ -736,7 +736,7 @@ ::Data Processing - 1 + 0 0 0 1 diff --git a/Platform_IMXRT1050-EVKB/microspeech.uvprojx b/Platform_IMXRT1050-EVKB/microspeech.uvprojx index a2b313c..2e1d6ea 100644 --- a/Platform_IMXRT1050-EVKB/microspeech.uvprojx +++ b/Platform_IMXRT1050-EVKB/microspeech.uvprojx @@ -1083,13 +1083,9 @@ - + - - - 1 - - + @@ -1275,7 +1271,7 @@ RTE\Machine_Learning\debug_log.cc - + @@ -1283,7 +1279,7 @@ RTE\Machine_Learning\micro_time.cc - + @@ -1291,7 +1287,7 @@ RTE\Machine_Learning\system_setup.cc - + diff --git a/Platform_MIMXRT1064-EVK/microspeech.MIMXRT1064-EVK.cprj b/Platform_MIMXRT1064-EVK/microspeech.MIMXRT1064-EVK.cprj index 10fe3d0..ccf8630 100644 --- a/Platform_MIMXRT1064-EVK/microspeech.MIMXRT1064-EVK.cprj +++ b/Platform_MIMXRT1064-EVK/microspeech.MIMXRT1064-EVK.cprj @@ -1,7 +1,7 @@ - + Platform @@ -52,11 +52,11 @@ - - - - - + + + + + diff --git a/Platform_MIMXRT1064-EVK/microspeech.uvoptx b/Platform_MIMXRT1064-EVK/microspeech.uvoptx index 9aa21ca..e94fdef 100644 --- a/Platform_MIMXRT1064-EVK/microspeech.uvoptx +++ b/Platform_MIMXRT1064-EVK/microspeech.uvoptx @@ -155,17 +155,17 @@ - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\Driver\VIO\cmsis_vio.scvd + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\Driver\VIO\cmsis_vio.scvd ARM.CMSIS.5.8.0 1 - C:\Packs\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd + C:\ARM\PACK\ARM\CMSIS\5.8.0\CMSIS\RTOS2\RTX\RTX5.scvd ARM.CMSIS.5.8.0 1 - C:\Packs\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd + C:\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd Keil.ARM_Compiler.1.6.3 1 diff --git a/Platform_MIMXRT1064-EVK/microspeech.uvprojx b/Platform_MIMXRT1064-EVK/microspeech.uvprojx index b3a75cc..5df756f 100644 --- a/Platform_MIMXRT1064-EVK/microspeech.uvprojx +++ b/Platform_MIMXRT1064-EVK/microspeech.uvprojx @@ -985,29 +985,29 @@ - + - + - + - + - + - + - + - + - + - + @@ -1329,37 +1329,37 @@ - + - + - + - + - - + + - - + + @@ -1521,7 +1521,7 @@ RTE\Machine_Learning\debug_log.cc - + @@ -1529,7 +1529,7 @@ RTE\Machine_Learning\micro_time.cc - + @@ -1537,7 +1537,7 @@ RTE\Machine_Learning\system_setup.cc - + diff --git a/README.md b/README.md index 29ab604..826390a 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ ## Micro speech for TensorFlow Lite -Derived from [Micro speech example](https://github.com/MDK-Packs/tensorflow-pack/tree/main/examples/micro_speech) -for [TensorFlow Lite for Microcontrollers](https://www.tensorflow.org/lite/microcontrollers). +Micro speech example for [TensorFlow Lite for Microcontrollers](https://www.tensorflow.org/lite/microcontrollers). ### Prerequisites - toolchain (IDE): diff --git a/vht/vht.yml b/vht/vht.yml index c68f8c5..d27952d 100644 --- a/vht/vht.yml +++ b/vht/vht.yml @@ -2,20 +2,19 @@ suite: name: "Tensorflow lite micro examples" model: "VHT-Corstone-300" configuration: "" - pre: "" + working_dir: "/home/ubuntu/vhtwork/Platform_FVP_Corstone_SSE-300_Ethos-U55" + pre: "cp_install.sh packlist" post: "" - + builds: - "microspeech example": - shell: "cbuild.sh ./Platform_FVP_Corstone_SSE-300_Ethos-U55/microspeech.Example.cprj" - post: "cp ./Platform_FVP_Corstone_SSE-300_Ethos-U55/Objects/microspeech.axf ./elf/" - + shell: "cbuild.sh microspeech.Example.cprj" + post: "" tests: - "microspeech example": - executable: "./elf/microspeech.axf" - arguments: "-V ./VSI/audio/python -f ./fvp_config.txt --stat --cyclelimit 768000000" + executable: "./Objects/microspeech.axf" + arguments: "-V ../VSI/audio/python -f fvp_config.txt --stat --cyclelimit 768000000" pre: "" post: "" - timeout: 20 - + timeout: 20 \ No newline at end of file