add solutions
This commit is contained in:
		
							
								
								
									
										53
									
								
								zz-solutions/01-WaveformGenerator/Scripts/.gitlab-ci.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								zz-solutions/01-WaveformGenerator/Scripts/.gitlab-ci.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | ||||
| stages: | ||||
|   - deploy | ||||
|  | ||||
| image: alpine:latest | ||||
|  | ||||
| scripts: | ||||
|   stage: deploy | ||||
|   rules: | ||||
|     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' | ||||
|       changes: | ||||
|       - deployScriptsAll.bash | ||||
|       - deployScripts.bash | ||||
|       - /*.{pl} | ||||
|     - when: manual | ||||
|  | ||||
|   before_script: | ||||
|     - echo "install additional packages" | ||||
|     - apk update | ||||
|     - apk upgrade | ||||
|     - echo "Install Bash" | ||||
|     - apk add bash | ||||
|     - echo "Install Core Utils" | ||||
|     - apk add coreutils | ||||
|     - echo "Install Git" | ||||
|     - apk add git | ||||
|     - echo "Set Git credentials" | ||||
|     - git config --global user.email "silvan.zahno@hevs.ch" | ||||
|     - git config --global user.name "Silvan Zahno" | ||||
|     - echo "Setting up deploy-eda_scripts environment" | ||||
|  | ||||
|   script: | ||||
|     - bash ./deployScriptsAll.bash | ||||
|  | ||||
| libs_trigger: | ||||
|   stage: deploy | ||||
|   rules: | ||||
|     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' | ||||
|       changes: | ||||
|       - deployLibsAll.bash | ||||
|       - deployLibs.bash | ||||
|     - when: manual | ||||
|   variables: | ||||
|     GIT_CHECKOUT: "false" | ||||
|    | ||||
|   before_script: | ||||
|     - echo "install additional packages" | ||||
|     - apk update | ||||
|     - apk upgrade | ||||
|     - echo "Install Curl" | ||||
|     - apk add curl | ||||
|  | ||||
|   script: | ||||
|     - 'curl -X POST --fail -F token=glptt-0235c37f03e3060733df7d1151555fd0c63d0adb -F ref=master "https://gitlab.hevs.ch/api/v4/projects/762/trigger/pipeline"' | ||||
							
								
								
									
										11
									
								
								zz-solutions/01-WaveformGenerator/Scripts/LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								zz-solutions/01-WaveformGenerator/Scripts/LICENSE
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| All Rights Reserved | ||||
|  | ||||
| Copyright (c) 2019 - HES-SO Valais Wallis | ||||
|  | ||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
| THE SOFTWARE. | ||||
							
								
								
									
										238
									
								
								zz-solutions/01-WaveformGenerator/Scripts/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										238
									
								
								zz-solutions/01-WaveformGenerator/Scripts/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,238 @@ | ||||
| <h1 align="center"> | ||||
|   <br> | ||||
|   <img src="./img/EDA_scripts.gif" alt="EDA scripts Logo" width="200" height="200"> | ||||
|   <br> | ||||
|   Hevs EDA Scripts | ||||
|   <br> | ||||
| </h1> | ||||
|  | ||||
| <h4 align="center">Common Files and Scripts for ELN Laboratories practical sessions.</h4> | ||||
|  | ||||
| [](https://gitlab.hevs.ch/course/ElN/eda_scripts/commits/master) | ||||
| [](https://gitlab.hevs.ch/course/ElN/eda_scripts/commits/master) | ||||
|  | ||||
| # Table of contents | ||||
| <p align="center"> | ||||
|   <a href="#description">Description</a> • | ||||
|   <a href="#how-to-use">How To Use</a> • | ||||
|   <a href="#download">Download</a> • | ||||
|   <a href="#credits">Credits</a> • | ||||
|   <a href="#license">License</a> | ||||
|   <a href="#find-us-on">Find us on</a> | ||||
| </p> | ||||
|  | ||||
| ## Description | ||||
| [(Back to top)](#table-of-contents) | ||||
|  | ||||
| These scripts can be used as for: | ||||
| **Git Repos** | ||||
| * [EDA_libs](https://gitlab.hevs.ch/course/ElN/eda_libs.git) | ||||
| * [ELN_labs](https://gitlab.hevs.ch/course/ElN/eln_labs.git) | ||||
| * [SEm_exams](https://gitlab.hevs.ch/course/SEm/exams.git) | ||||
| * [ELN_chrono](https://gitlab.hevs.ch/course/ElN/eln_chrono.git) | ||||
| * [ELN_cursor](https://gitlab.hevs.ch/course/ElN/eln_cursor.git) | ||||
| * [ELN_kart](https://gitlab.hevs.ch/course/ElN/eln_kart.git) | ||||
| * [ELN_inverter](https://gitlab.hevs.ch/course/ElN/eln_inverter.git) | ||||
| * [ELN_synchro](https://gitlab.hevs.ch/course/ElN/eln_synchro.git) | ||||
| * [SEm_labs](https://gitlab.hevs.ch/course/SEm/sem_labs.git) | ||||
| * [ELN-kart](https://gitlab.hevs.ch/course/ElN/eln_kart_sodimm200.git) | ||||
| * [ELN-display](https://gitlab.hevs.ch/course/ElN/eln_display.git) | ||||
|  | ||||
| **SVN Repos** | ||||
| * [CanSat](https://repos.hevs.ch/svn/eda/VHDL/labs/CanSat) (TODO) :rotating_light: | ||||
| * [ELN_support](https://repos.hevs.ch/svn/eda/VHDL/labs/ELN_support) (TODO) :rotating_light: | ||||
| * [EPTM_AudioAmp](https://repos.hevs.ch/svn/eda/VHDL/labs/AudioAmp) (TODO) :rotating_light: | ||||
| * [EPTM_Radio](https://repos.hevs.ch/svn/eda/VHDL/labs/EPTM_radio) (TODO) :rotating_light: | ||||
| * ... | ||||
|  | ||||
| ### Files | ||||
| **Linux** | ||||
| * ``changeDefaultViews.bash`` - Changes RTL <=> studentVersion | ||||
|   * Usage master => student: ``changeDefaultViews.bash -v -a masterVersion -n studentVersion`` | ||||
|   * Usage master => student: ``changeDefaultViews.bash -v -a master@version -n student@version`` | ||||
|   * Usage student => master: ``changeDefaultViews.bash -v -a studentVersion -n masterVersion`` | ||||
|   * Usage student => master: ``changeDefaultViews.bash -v -a student@version -n master@version`` | ||||
|   * Note: use the ``-r`` otion to also delete the specified actual_view | ||||
| * ``cleanGenerated.bash`` - Deletes all intermediate files | ||||
|   * Usage: ``./cleanGenerated.bash`` | ||||
| * ``hdlDesigner.bash`` - Main script for starting HDL-Designer | ||||
| * ``deployLibs.bash`` - Execution from eln_libs repo, copy required libraries to student repo and commit/push it. | ||||
|   * Usage: ``./Scripts/deployLibs.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git`` | ||||
| * ``deployLibsAll.bash`` - Execution from eln_libs repo, copy required libraries to all student repo's and commit/push it. | ||||
|   * Usage: ``./Scripts/deployLibsAll.bash`` | ||||
| * ``deployLab.bash`` - Execution from Laborepo, copy required laboratory files to student repo and commits/push it. | ||||
|   * Usage: ``./Scripts/deployLab.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git`` | ||||
| * ``deployScripts.bash`` - Copy required scripts to student repo and commits/push it. | ||||
|   * Usage: ``./deployScripts.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git`` | ||||
| * ``deployScriptsAll.bash`` - Execution from eln_scripts repo, copy required scripts to all student repo's and commit/push it. | ||||
|   * Usage: ``./deployScriptsAll.bash`` | ||||
|  | ||||
| **Windows** | ||||
| * ``cleanGenerated.bat`` - Deletes all intermediate files | ||||
|   * Usage: ``./cleanGenerated.bat`` | ||||
| * ``cleanScratch.bat`` - Delete scratch directory | ||||
|   * Usage: | ||||
| ``` bash | ||||
| set SCRATCH_DIR=C:\temp\eda\%username% | ||||
| ./cleanScratch.bat | ||||
| ``` | ||||
|  | ||||
| * ``hdlDesigner.bat`` - Main script for starting HDL-Designer | ||||
| * ``searchPaths.bat`` - Search for required Libraries and tools | ||||
|   * Usage: | ||||
| ``` bash | ||||
| :: Define required Tools to be present | ||||
| set REQUIRE_LIBS=1 | ||||
| set REQUIRE_HDS=1 | ||||
| set REQUIRE_MODELSIM=1 | ||||
| set REQUIRE_ISE=1 | ||||
| set REQUIRE_LIBERO=0 | ||||
| set HEI_LIBS_DIR=R:\SYND\Ele_2131\ELN\Labs\Libraries | ||||
| set HDS_HOME=C:\eda\MentorGraphics\HDS | ||||
| set MODELSIM_HOME=C:\eda\MentorGraphics\Modelsim\win64 | ||||
| set ISE_VERSION=14.7 | ||||
| set ISE_HOME=C:\eda\Xilinx\%ISE_VERSION%\ISE_DS\ISE | ||||
| set LIBERO_HOME=C:\eda\Microsemi\Libero | ||||
| set design_name=eln_labs | ||||
| ./searchPaths.bat | ||||
| ``` | ||||
|  | ||||
| **Perl Scripts** | ||||
| Perl scripts are used to launch different tasks from HDL-Designer | ||||
| * ``trimLibs.pl`` - Comment regular libraries in an concatenated file | ||||
|   * Parameter : ``trimlibs.pl <Input File Name> <Output File Name>`` | ||||
| * ``update_ise.pl`` - | ||||
|   * Parameter : ``update_ise.pl <ISE File Spec> <VHDL File Spec> <UCF File Spec>`` | ||||
| * ``update_libero.pl`` - | ||||
|   * Parameter : ``update_libero.pl <Libero File Spec> <VHDL File Spec> <PDC File Spec>`` | ||||
| * ``start_libero.pl`` - | ||||
|   * Parameter : ``start_libero.pl <Libero File Spec>`` | ||||
|  | ||||
| ## How To Use | ||||
| [(Back to top)](#table-of-contents) | ||||
|  | ||||
| To clone and run this application, you'll need [Git](https://git-scm.com) installed on your computer. | ||||
| This repo is normally used as submodule to the laboratories and projects. | ||||
|  | ||||
| To deploy the studentVersion to github cd to root of Labor master repo: | ||||
| ```bash | ||||
| cd eln_labs | ||||
| ./Scripts/deployLab.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git | ||||
| ./Scripts/deployLab.bash -v -p ete_eln_labs -r https://github.com/hei-ete-8132-eln/eln_labs.git | ||||
| ./Scripts/deployLab.bash -v -p isc-eln-labs -r https://github.com/hei-isc-eln/eln-labs.git | ||||
|  | ||||
| cd sem_labs | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 01-WaveformGenerator | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 02-SplineInterpolator | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 03-DigitalToAnalogConverter | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 04-Lissajous | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 05-Morse | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 06-07-08-09-SystemOnChip | ||||
| ./Scripts/deployLab.bash -v -p sem_labs -r sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git -d 10-PipelinedOperators | ||||
|  | ||||
| cd eln_chrono | ||||
| ./Scripts/deployLab.bash -v -p eln_chrono -r https://github.com/hei-synd-2131-eln/eln_chrono.git | ||||
|  | ||||
| cd eln_cursor | ||||
| ./Scripts/deployLab.bash -v -p eln_cursor -r https://github.com/hei-synd-2131-eln/eln_cursor.git | ||||
|  | ||||
| cd eln-display | ||||
| ./Scripts/deployLab.bash -v -p eln-display -r https://github.com/hei-isc-eln/eln-display.git | ||||
|  | ||||
| cd eln-kart | ||||
| ./Scripts/deployLab.bash -v -p eln-kart -r https://github.com/hei-synd-2131-eln/eln-kart.git | ||||
| ``` | ||||
|  | ||||
| To deploy the Libraries to github cd to root of Libs master repo: | ||||
| ```bash | ||||
| ./Scripts/deployLibs.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git | ||||
| ./Scripts/deployLibs.bash -v -p ete_eln_labs -r https://github.com/hei-ete-8132-eln/eln_labs.git | ||||
| ./Scripts/deployLibs.bash -v -p isc_eln_labs -r https://github.com/hei-isc-eln/eln-labs.git | ||||
| ./Scripts/deployLibs.bash -v -p sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git | ||||
| ./Scripts/deployLibs.bash -v -p eln_chrono -r https://github.com/hei-synd-2131-eln/eln_chrono.git | ||||
| ./Scripts/deployLibs.bash -v -p eln_cursor -r https://github.com/hei-synd-2131-eln/eln_cursor.git | ||||
| ./Scripts/deployLibs.bash -v -p eln_kart -r https://github.com/hei-synd-2131-eln/eln_kart.git | ||||
| ./Scripts/deployLibs.bash -v -p eln_inverter -r https://github.com/hei-synd-2131-eln/eln_inverter.git | ||||
| ./Scripts/deployLibs.bash -v -p eln_synchro -r https://github.com/hei-synd-2131-eln/eln_synchro.git | ||||
| ./Scripts/deployLibs.bash -v -p eln-kart -r https://github.com/hei-synd-2131-eln/eln-kart.git | ||||
| ./Scripts/deployLibs.bash -v -p eln-display -r https://github.com/hei-isc-eln/eln-display.git | ||||
| # or | ||||
| ./Scripts/deployLibsAll.bash | ||||
| ``` | ||||
|  | ||||
| To deploy the Scripts to github cd root of Scripts master Repo | ||||
| ```bash | ||||
| ./deployScripts.bash -v -p synd_eln_labs -r https://github.com/hei-synd-2131-eln/eln_labs.git | ||||
| ./deployScripts.bash -v -p ete_eln_labs -r https://github.com/hei-ete-8132-eln/eln_labs.git | ||||
| ./deployScripts.bash -v -p isc_eln_labs -r https://github.com/hei-isc-eln/eln-labs.git | ||||
| ./deployScripts.bash -v -p sem_labs -r https://github.com/hei-synd-225-sem/sem_labs.git | ||||
| ./deployScripts.bash -v -p eln_chrono -r https://github.com/hei-synd-2131-eln/eln_chrono.git | ||||
| ./deployScripts.bash -v -p eln_cursor -r https://github.com/hei-synd-2131-eln/eln_cursor.git | ||||
| ./deployScripts.bash -v -p eln_kart -r https://github.com/hei-synd-2131-eln/eln_kart.git | ||||
| ./deployScripts.bash -v -p eln_inverter -r https://github.com/hei-synd-2131-eln/eln_inverter.git | ||||
| ./deployScripts.bash -v -p eln_synchro -r https://github.com/hei-synd-2131-eln/eln_synchro.git | ||||
| ./deployScripts.bash -v -p eln-kart -r https://github.com/hei-synd-2131-eln/eln-display.git | ||||
| ./deployScripts.bash -v -p eln-display -r https://github.com/hei-isc-eln/eln-display.git | ||||
| # or | ||||
| ./deployScriptsAll.bash | ||||
| ``` | ||||
|  | ||||
| <div align="center"> | ||||
|  | ||||
| </div> | ||||
|  | ||||
| ### Download | ||||
| ```bash | ||||
| # Clone repo including submodules | ||||
| git clone --recursive <repo_url> | ||||
| ``` | ||||
|  | ||||
| ### Pull changes repo and submodules | ||||
| ```bash | ||||
| # Pull all changes in the repo including changes in the submodules (of given commit) | ||||
| git pull --recurse-submodules | ||||
| ``` | ||||
|  | ||||
| #### Update to latest commit | ||||
| Update submodule to latest commit and update parentrepo | ||||
| ```bash | ||||
| # Update submodule to latest commit | ||||
| git submodule update --remote --merge | ||||
|  | ||||
| # Afterwared you need to commit in the parentrepo the new pointer to the new commit in the submodule | ||||
| git commit -am "Update submodule to latest commit" | ||||
| ``` | ||||
|  | ||||
| ### Add submodule | ||||
| If the folder ``Scripts`` already exists, delete it and commit these changes.  | ||||
| Add submodule and define the master branch as the one you want to track | ||||
| ```bash | ||||
| git submodule add -b master <repo_url> <relative/path/to/folder> | ||||
| git submodule add -b master https://gitlab.hevs.ch/course/ElN/eda_scripts.git Scripts | ||||
| git submodule add -b master https://gitlab.hevs.ch/course/ElN/eda_libs.git Libs | ||||
|  | ||||
| git submodule init | ||||
|  | ||||
| git submodule update | ||||
| ``` | ||||
|  | ||||
| ## Credits | ||||
| [(Back to top)](#table-of-contents) | ||||
| * COF | ||||
| * PRC | ||||
| * ZAS | ||||
| * AMA | ||||
|  | ||||
| ## License | ||||
| [(Back to top)](#table-of-contents) | ||||
|  | ||||
| :copyright: [All rights reserved](LICENSE) | ||||
|  | ||||
| --- | ||||
|  | ||||
| ## Find us on | ||||
| > Website [hevs.ch](https://www.hevs.ch)  ·  | ||||
| > LinkedIn [HES-SO Valais-Wallis](https://www.linkedin.com/groups/104343/)  ·  | ||||
| > Youtube [HES-SO Valais-Wallis](https://www.youtube.com/user/HESSOVS) | ||||
| > Twitter [@hessovalais](https://twitter.com/hessovalais)  ·  | ||||
| > Facebook [@hessovalais](https://www.facebook.com/hessovalais)  ·  | ||||
| @@ -0,0 +1,94 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # changeDefaultViews.bash - change HDL Project views | ||||
| # * Usage master => student: ``changeDefaultViews.bash -v -a masterVersion -n studentVersion`` | ||||
| # * Usage student => master: ``changeDefaultViews.bash -v -a studentVersion -n masterVersion`` | ||||
| # * Usage: add ``-r`` for deleting the specified actual view **dangerous** | ||||
| # | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
| base_directory="$base_directory/.." | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #-------------------------------------------------------------------------------- | ||||
| # Parse command line options | ||||
| # | ||||
| project_directory='' | ||||
| actual_view='masterVersion' | ||||
| new_view='studentVersion' | ||||
|  | ||||
| usage='Usage: changeDefaultViews.bash [-p projectDir] [-r] [-v] [-h]' | ||||
| while getopts 'p:a:n:rvh' options; do | ||||
|   case $options in | ||||
|     p ) project_directory=$OPTARG;; | ||||
|     a ) actual_view=$OPTARG;; | ||||
|     n ) new_view=$OPTARG;; | ||||
|     r ) delete_actual_view=1;; | ||||
|     v ) verbose=1;; | ||||
|     h ) echo -e $usage | ||||
|           exit 1;; | ||||
|     * ) echo -e $usage | ||||
|           exit 1;; | ||||
|   esac | ||||
| done | ||||
| if [ -z "$project_directory" ]; then | ||||
|   project_directory="$base_directory" | ||||
| else | ||||
|   project_directory="$base_directory/$project_directory" | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Display info | ||||
| # | ||||
| if [ -n "$verbose" ] ; then | ||||
|   echo "$SEPARATOR" | ||||
|   echo "Changing default views for HDL Designer" | ||||
|   echo "${INDENT}in $project_directory" | ||||
|   echo "${INDENT}from $actual_view to $new_view" | ||||
|   if [ -n "$delete_actual_view" ] ; then | ||||
|     echo "Delete all $actual_view in $project_directory" | ||||
|   fi | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Remove generated and cache files | ||||
| # | ||||
| ./cleanGenerated.bash | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Change views in configuration files | ||||
| # | ||||
| find $project_directory -type f -name '*._epf' \ | ||||
|   | xargs sed -i "s/$actual_view/$new_view/g" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Remove all acutal views File | ||||
| # | ||||
| if [ -n "$delete_actual_view" ] ; then | ||||
|   project_directory=`realpath $project_directory` | ||||
|   echo $project_directory | ||||
|   echo "Delete $actual_view" | ||||
|   find $project_directory/ -type f -iname "*$actual_view*" -exec echo "rm {}" \; | ||||
|   find $project_directory/ -type f -iname "*$actual_view*" -exec rm {} \; | ||||
|   # For HDL Designer file naming convention | ||||
|   # making uppercase letters to @lowercase masterVersion = master@version | ||||
|   actual_view="$(sed -E s/\([A-Z]\)/@\\L\\1/g <<< $actual_view)" | ||||
|   find $project_directory/ -type f -name "*$actual_view*" -exec echo "rm {}" \; | ||||
|   find $project_directory/ -type f -name "*$actual_view*" -exec rm {} \; | ||||
|  | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- ${0##*/} Finished!" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
| @@ -0,0 +1,38 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # cleanGenerated.bash - Clean intermediate files form folder | ||||
| # | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
| base_directory="$base_directory/.." | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Remove generated and cache files | ||||
| # | ||||
| find $base_directory -type f -name '.cache.dat' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*.bak' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*.lck' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*.vhd.info' | xargs -r rm -v | ||||
| find $base_directory -type f -name 'default_view' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*_entity.vhd' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*_struct.vhd' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*_fsm.vhd' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*.vhg' | xargs -r rm -v | ||||
| find $base_directory -type f -name '*.DS_Store' | xargs -r rm -v | ||||
| find $base_directory -type d -name '.xrf' | xargs -r rm -Rv | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- ${0##*/} Finished!" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										42
									
								
								zz-solutions/01-WaveformGenerator/Scripts/cleanGenerated.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								zz-solutions/01-WaveformGenerator/Scripts/cleanGenerated.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| ::============================================================================== | ||||
| :: cleanGenerated.bat | ||||
| :: Clean intermediate files from folder | ||||
| :: | ||||
| :start | ||||
|   @echo off | ||||
|   setlocal | ||||
|   set cmd_location="%~dp0" | ||||
|   pushd %cmd_location% | ||||
|   set SEPARATOR="--------------------------------------------------------------------------------" | ||||
|   set INDENT="  " | ||||
|  | ||||
|   echo %SEPARATOR% | ||||
|   echo "-- %~nx0 Started!" | ||||
|   echo. | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Delete intermediate files | ||||
| :: | ||||
| set base_directory="%cmd_location:"=%.." | ||||
|  | ||||
| echo "Delete intermediate files in: %base_directory%" | ||||
| del /f /s /a %base_directory%\*cache.dat | ||||
| del /f /s /a %base_directory%\*.bak | ||||
| del /f /s /a %base_directory%\*.lck | ||||
| del /f /s /a %base_directory%\*.vhd.info | ||||
| del /f /s /a %base_directory%\default_view | ||||
| del /f /s /a %base_directory%\*_entity.vhd | ||||
| del /f /s /a %base_directory%\*_struct.vhd | ||||
| del /f /s /a %base_directory%\*_fsm.vhd | ||||
| del /f /s /a %base_directory%\*.vhg | ||||
| del /f /s /a %base_directory%\*.DS_Store | ||||
|  | ||||
| echo "Delete intermediate directories in: %base_directory%" | ||||
| for /d /r "%base_directory:"=%\" %%a in (.xrf\) do if exist "%%a" rmdir /s /q "%%a" | ||||
|  | ||||
| :end | ||||
|   echo. | ||||
|   echo "-- %~nx0 Finished!" | ||||
|   echo %SEPARATOR% | ||||
|   popd | ||||
|   endlocal | ||||
|   goto:eof | ||||
							
								
								
									
										39
									
								
								zz-solutions/01-WaveformGenerator/Scripts/cleanScratch.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								zz-solutions/01-WaveformGenerator/Scripts/cleanScratch.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| ::============================================================================== | ||||
| :: cleanScratch.bat | ||||
| :: Clean scratch directory | ||||
| :: | ||||
| :start | ||||
|   @echo off | ||||
|   setlocal | ||||
|   set cmd_location="%~dp0" | ||||
|   pushd %cmd_location% | ||||
|   set SEPARATOR=-------------------------------------------------------------------------------- | ||||
|   set INDENT="  " | ||||
|  | ||||
|   echo %SEPARATOR% | ||||
|   echo -- %~nx0 Started! | ||||
|   echo. | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Delete scratch directory | ||||
| :: | ||||
| if "%SCRATCH_DIR%" == "" ( | ||||
|   set SCRATCH_DIR=C:\temp\eda\ | ||||
| ) | ||||
|  | ||||
| echo Delete scratch directory %SCRATCH_DIR% | ||||
| if exist %SCRATCH_DIR% ( | ||||
|   echo    Scratch directory found, deleting! | ||||
|   rmdir /S /Q "%SCRATCH_DIR%" | ||||
| ) else ( | ||||
|   echo    Scratch directory not found! | ||||
| ) | ||||
|  | ||||
| :end | ||||
|   echo. | ||||
|   echo -- %~nx0 Finished! | ||||
|   echo %SEPARATOR% | ||||
|   echo. && echo. | ||||
|   popd | ||||
|   endlocal | ||||
|   goto:eof | ||||
							
								
								
									
										559
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLab.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										559
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLab.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,559 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployLab.bash - updates github repos for individual labos | ||||
| # Example usage 01: ./Scripts/deployLab.bash -v -p synd-did-labs -r https://github.com/hei-synd-did/did-labs.git | ||||
| # Example usage 02: ./Scripts/deployLab.bash -v -p ete-did-labs -r https://github.com/hei-ete-did/did-labs.git | ||||
| # Example usage 03: ./Scripts/deployLab.bash -v -p isc-did-labs -r https://github.com/hei-isc-eln/did-labs.git | ||||
| # Example usage 04: ./Scripts/deployLab.bash -v -p did-chrono -r https://github.com/hei-synd-did/did-chrono.git | ||||
| # Example usage 05: ./Scripts/deployLab.bash -v -p did-cursor -r https://github.com/hei-synd-did/did-cursor.git | ||||
| # Example usage 06: ./Scripts/deployLab.bash -v -p did-inverter -r https://github.com/hei-ete-did/did-inverter.git | ||||
| # Example usage 07: ./Scripts/deployLab.bash -v -p did-synchro -r https://github.com/hei-ete-did/did-synchro.git | ||||
| # Example usage 08: ./Scripts/deployLab.bash -v -p did-kart-ebs3 -r https://github.com/hei-synd-did/did-kart-ebs3.git | ||||
| # Example usage 09: ./Scripts/deployLab.bash -v -p did-display -r https://github.com/hei-isc-did/did-display.git | ||||
|  | ||||
| # Example usage 10: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 01-WaveformGenerator | ||||
| # Example usage 11: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 01-WaveformGenerator | ||||
| # Example usage 12: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 02-SplineInterpolator | ||||
| # Example usage 13: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 03-DigitalToAnalogConverter | ||||
| # Example usage 14: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 04-Lissajous | ||||
| # Example usage 15: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 05-Morse | ||||
| # Example usage 16: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 06-07-08-09-SystemOnChip | ||||
| # Example usage 17: ./Scripts/deployLab.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 10-PipelinedOperators | ||||
|  | ||||
| # Example usage 18: ./Scripts/deployLab.bash -v -p car-labs -r https://github.com/hei-isc-car/car-labs.git -s 1 | ||||
| # Example usage 19: ./Scripts/deployLab.bash -v -p car-heirv -r https://github.com/hei-isc-car/car-heirv.git | ||||
|  | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
| base_directory="$base_directory/.." | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Parse command line options | ||||
| # | ||||
| project='synd-did-labs' | ||||
| repo='https://github.com/hei-synd-did/did-labs.git' | ||||
| dir='01-StepperMotor' | ||||
| sourceDirUp=0 | ||||
|  | ||||
| usage='Usage: deployLab.bash [-p projectName] [-r repourl] [-d directory] [-s sourceDirUp] [-v] [-h]' | ||||
| while getopts 'p:r:d:s:vh' options; do | ||||
|   case $options in | ||||
|     p ) project=$OPTARG;; | ||||
|     r ) repo=$OPTARG;; | ||||
|     d ) dir=$OPTARG;; | ||||
|     s ) sourceDirUp=$OPTARG;; | ||||
|     v ) verbose=1;; | ||||
|     h ) echo -e $usage | ||||
|           exit 1;; | ||||
|     * ) echo -e $usage | ||||
|           exit 1;; | ||||
|   esac | ||||
| done | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Display info | ||||
| # | ||||
| if [ -n "$verbose" ] ; then | ||||
|   echo "$SEPARATOR" | ||||
|   echo "-- $DATE: Deploy Laboratory for Students" | ||||
|   echo "${INDENT}for $project" | ||||
|   echo "${INDENT}to $repo" | ||||
|   echo "${INDENT}in $dir" | ||||
|   echo "" | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Clean current repo | ||||
| # | ||||
| echo "Clean parent repo from intermediate files" | ||||
| ./cleanGenerated.bash | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Clone student repo | ||||
| # | ||||
| # Create a tmp subdirectory if it doesn't exist | ||||
| echo "Create tmp folder" | ||||
| mkdir -p tmp | ||||
| cd tmp | ||||
|  | ||||
| # Get repo | ||||
| echo "Clone student repo $project" | ||||
| # Add login and access token to url | ||||
| repo_access=$(echo $repo | sed 's/https\?:\/\///') | ||||
| github_username=tschinz | ||||
| github_accesstoken=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 | ||||
| repo_access="https://$github_username:$github_accesstoken@${repo_access}" | ||||
| git clone $repo_access | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|   cd did-labs | ||||
| else | ||||
|   cd $project | ||||
| fi | ||||
|  | ||||
| repo_dest=`realpath "./"` | ||||
| repo_source="./" | ||||
| # If Scripts folder is at root of project, needs to get up 3 times (scripts, project name, tmp) | ||||
| # If more is needed (i.e. see car-labs structure), can be added with -s switch | ||||
| for ((i=0;i<$sourceDirUp+3;i++)); do | ||||
|   repo_source="$repo_source/.." | ||||
| done | ||||
| repo_source=`realpath "$repo_source"` | ||||
|  | ||||
| echo "Update files in student repo $project" | ||||
| # Copy needed files per project | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   rm -v -f ./Num/hdl/sinewaveGenerator_comb.vhd | ||||
|  | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   rm -v -f ./Num/hdl/sinewaveGenerator_comb.vhd | ||||
|  | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|     # copy root files except some specific ones | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|     # iterate over folders to choose what to copy | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   rm -v -f ./Num/hdl/sinewaveGenerator_comb.vhd | ||||
|  | ||||
| elif  [ "$project" == "car-labs" ]; then | ||||
|   # bem | ||||
|   echo "copy $repo_source/bem" | ||||
|   cp -ar "$repo_source/bem" ./ | ||||
|   # isa | ||||
|   echo "copy $repo_source/isa" | ||||
|   cp -ar "$repo_source/isa" ./ | ||||
|   # heirv32_sc | ||||
|   mkdir -p heirv32_sc | ||||
|     # copy root files except some specific ones | ||||
|   find $repo_source/hdl -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest/heirv32_sc \; | ||||
|     # iterate over folders to choose what to copy | ||||
|   for folder in $(find $repo_source/hdl -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source/hdl" != "$folder" && "$repo_source/hdl/.git" != "$folder" && "$repo_source/hdl/Libs" != "$folder" && "$repo_source/hdl/Scripts" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder heirv32_sc/ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|  | ||||
|   rm -v -f heirv32_sc/Board/concat/concatenated.vhd | ||||
|   rm -v -f heirv32_sc/Board/concat/car-labs.vhd | ||||
|  | ||||
|   rm -v -f heirv32_sc/HEIRV32/hdl/ALU_rtl.vhd | ||||
|   rm -v -f heirv32_sc/HEIRV32/hdl/extend_rtl.vhd | ||||
|   rm -v -f heirv32_sc/HEIRV32/hdl/aludecoder_entity.vhg | ||||
|   rm -v -f heirv32_sc/HEIRV32/hdl/aluDecoder_rtl.vhd | ||||
|   rm -v -f -r heirv32_sc/HEIRV32/hds/alu@decoder | ||||
|   rm -v -f heirv32_sc/HEIRV32/hds/_aludecoder._epf | ||||
|  | ||||
|   rm -v -f heirv32_sc/HEIRV32/SingleCycle/hdl/mainDecoder_entity.vhg | ||||
|   rm -v -f heirv32_sc/HEIRV32/SingleCycle/hdl/mainDecoder_rtl.vhd | ||||
|   rm -v -f -r heirv32_sc/HEIRV32/SingleCycle/hds/main@decoder | ||||
|   rm -v -f heirv32_sc/HEIRV32/SingleCycle/hds/_maindecoder._epf | ||||
|  | ||||
|   rm -v -f heirv32_sc/Simulation/empty_ram.txt | ||||
|  | ||||
| elif [ "$project" == "car-heirv" ]; then | ||||
|   # heirv32_mc | ||||
|     # copy root files except some specific ones | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|     # iterate over folders to choose what to copy | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source/" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|  | ||||
|   rm -v -f ./Board/concat/concatenated.vhd | ||||
|   rm -v -f ./Board/concat/car-labs.vhd | ||||
|  | ||||
|   rm -v -f ./HEIRV32/hdl/ALU_rtl.vhd | ||||
|   rm -v -f ./HEIRV32/hdl/extend_rtl.vhd | ||||
|   rm -v -f ./HEIRV32/hdl/aludecoder_entity.vhg | ||||
|   rm -v -f ./HEIRV32/hdl/aluDecoder_rtl.vhd | ||||
|   rm -v -f -r ./HEIRV32/hds/alu@decoder | ||||
|   rm -v -f ./HEIRV32/hds/_aludecoder._epf | ||||
|  | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hdl/instrdecoder_entity.vhg | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hdl/instrDecoder_rtl.vhd | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hdl/mainfsm_entity.vhg | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hdl/mainfsm_fsm.vhg | ||||
|   rm -v -f -r ./HEIRV32/MultiCycle/hds/instr@decoder | ||||
|   rm -v -f -r ./HEIRV32/MultiCycle/hds/main@f@s@m | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hds/_instrdecoder._epf | ||||
|   rm -v -f ./HEIRV32/MultiCycle/hds/_mainfsm._epf | ||||
|  | ||||
|   rm -v -f ./HEIRV32_test/hdl/universalTester_test.vhd | ||||
|   rm -v -f -r ./HEIRV32_test/hds/universal@tester | ||||
|   rm -v -f ./HEIRV32_test/hds/_universaltester._epf | ||||
|  | ||||
|   rm -v -f ./Simulation/code_mc_disassembled.svg | ||||
|   rm -v -f ./Simulation/code_mc_disassembled_labels.svg | ||||
|   rm -v -f ./Simulation/code_mc_ghidra_labels.png | ||||
|   rm -v -f ./Simulation/empty_ram.txt | ||||
|  | ||||
|   #search='design_root = Board.ebs2_sc(struct)ebs2_sc/struct.bd' | ||||
|   #replace='design_root = Board.ebs2_mc(struct)ebs2_mc/struct.bd' | ||||
|   #sed -i "s/$search/$replace" Prefs/hds.hdp | ||||
|  | ||||
| elif [ "$project" == "ele_labs" ]; then | ||||
|   echo "Error: Not implemented yet" | ||||
|  | ||||
| elif [ "$project" == "sem-labs" ]; then | ||||
|   mkdir -p $dir | ||||
|   repo_dest=`realpath "./$dir/"` | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/01-WaveformGenerator/Scripts" != "$folder" && "$repo_source/02-SplineInterpolator/Scripts" != "$folder" && "$repo_source/03-DigitalToAnalogConverter/Scripts" != "$folder" && "$repo_source/04-Lissajous/Scripts" != "$folder" && "$repo_source/05-Morse/Scripts" != "$folder" && "$repo_source/06-07-08-09-SystemOnChip/Scripts" != "$folder" && "$repo_source/10-PipelinedOperators/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder $repo_dest | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for sem-labs $dir" | ||||
|  | ||||
|   if [ "$dir" == "01-WaveformGenerator" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "02-SplineInterpolator" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "03-DigitalToAnalogConverter" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "04-Lissajous" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "05-Morse" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "06-07-08-09-SystemOnChip" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   elif [ "$dir" == "10-PipelinedOperators" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   fi | ||||
|  | ||||
| elif [ "$project" == "did-cursor" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-cursor" | ||||
|   rm -v -f ./Cursor/hdl/amplitudeControl_RTL.vhd | ||||
|   rm -v -f ./Cursor/hdl/bridgeControl_RTL.vhd | ||||
|   rm -v -f ./Cursor/hdl/decelerationPositions_RTL.vhd | ||||
|   rm -v -f ./Cursor/hdl/divider_RTL.vhd | ||||
|   rm -v -f ./Cursor/hdl/findDistance_RTL1.vhd | ||||
|   rm -v -f ./Cursor/hdl/positionCounter_RTL.vhd | ||||
|   rm -v -f ./Cursor/hdl/pulseWidthModulator_RTL.vhd | ||||
|   rm -v -f ./Cursor/hds/_amplitudecontrol._epf | ||||
|   rm -v -f ./Cursor/hds/_bridgecontrol._epf | ||||
|   rm -v -f ./Cursor/hds/_control._epf | ||||
|   rm -v -f ./Cursor/hds/_decelerationpositions._epf | ||||
|   rm -v -f ./Cursor/hds/_divider._epf | ||||
|   rm -v -f ./Cursor/hds/_positioncounter._epf | ||||
|   rm -v -f ./Cursor/hds/_pulsewidthmodulator._epf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_amplitudecontrol_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_amplitudeControl_RTL.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_bridgecontrol_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_bridgeControl_RTL.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_control_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_control_fsm.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_decelerationpositions_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_decelerationPositions_RTL.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_divider_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_divider_RTL.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_findDistance_RTL1.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_positioncounter_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_positionCounter_RTL.vhd._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_pulsewidthmodulator_entity.vhg._fpf | ||||
|   rm -v -f ./Cursor/hds/.hdlsidedata/_pulseWidthModulator_RTL.vhd._fpf | ||||
|   rm -v -f -r ./Cursor/hds/amplitude@control | ||||
|   rm -v -f -r ./Cursor/hds/bridge@control | ||||
|   rm -v -f -r ./Cursor/hds/control | ||||
|   rm -v -f -r ./Cursor/hds/deceleration@positions | ||||
|   rm -v -f -r ./Cursor/hds/divider | ||||
|   rm -v -f -r ./Cursor/hds/position@counter | ||||
|   rm -v -f -r ./Cursor/hds/pulse@width@modulator | ||||
|   rm -v -f -r ./Cursor/hds/rising@detector | ||||
|   rm -v -f -r ./Board/concat/concatenated.vhd | ||||
|   rm -v -f -r ./Board/concat/did-cursor.vhd | ||||
|  | ||||
| elif [ "$project" == "did-chrono" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-chrono" | ||||
|   rm -v -f ./Chronometer/hdl/coilControl_RTL.vhd | ||||
|   rm -v -f ./Chronometer/hdl/divider1Hz_RTL.vhd | ||||
|   rm -v -f ./Chronometer/hdl/tickLengthCounter_RTL.vhd | ||||
|   rm -v -f ./Chronometer/hdl/lcdDisplay_masterVersion.vhd | ||||
|   rm -v -f ./Chronometer/hds/_coilcontrol._epf | ||||
|   rm -v -f ./Chronometer/hds/_control._epf | ||||
|   rm -v -f ./Chronometer/hds/_divider1hz._epf | ||||
|   rm -v -f ./Chronometer/hds/_ticklengthcounter._epf | ||||
|   rm -v -f ./Chronometer/hds/_coilcontrol._epf | ||||
|   rm -v -f ./Chronometer/hds/_coilcontrol._epf | ||||
|   rm -v -f ./Chronometer/hds/_coilcontrol._epf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_coilcontrol_entity.vhg._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_coilControl_RTL.vhd._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_control_entity.vhg._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_control_fsm.vhg._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_divider1hz_entity.vhg._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_divider1Hz_RTL.vhd._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_ticklengthcounter_entity.vhg._fpf | ||||
|   rm -v -f ./Chronometer/hds/.hdlsidedata/_tickLengthCounter_RTL.vhd._fpf | ||||
|   rm -v -f -r ./Chronometer/hds/coil@control/ | ||||
|   rm -v -f -r ./Chronometer/hds/control/ | ||||
|   rm -v -f -r ./Chronometer/hds/divider1@hz/ | ||||
|   rm -v -f -r ./Chronometer/hds/rising@detector/ | ||||
|   rm -v -f -r ./Chronometer/hds/tick@length@counter/ | ||||
|   rm -v -f -r ./Board/concat/concatenated.vhd | ||||
|   rm -v -f -r ./Board/concat/did-chrono.vhd | ||||
|  | ||||
| elif [ "$project" == "did-kart-ebs2" ]; then | ||||
|   mkdir -p $dir | ||||
|   repo_dest=`realpath "./$dir/"` | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder $repo_dest | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-kart-ebs2 $dir" | ||||
|  | ||||
|   if [ "$dir" == "01-StepperMotor" ]; then | ||||
|     rm -v -f ./01-StepperMotor/StepperMotor/hdl/angleDifference_RTL.vhd | ||||
| 	rm -v -f ./01-StepperMotor/StepperMotor/hdl/coilControl_RTL.vhd | ||||
| 	rm -v -f ./01-StepperMotor/StepperMotor/hdl/stepperCounter_RTL.vhd | ||||
| 	rm -v -f ./01-StepperMotor/StepperMotor/hds/angle@control/master@version.bd | ||||
| 	rm -v -f ./01-StepperMotor/StepperMotor/hds/coil@control/master@version_counter@demux.bd | ||||
| 	rm -v -f ./01-StepperMotor/StepperMotor/hds/coil@control/master@version_shift@reg.bd | ||||
|   elif [ "$dir" == "02-DcMotor" ]; then | ||||
|     rm -v -f ./02-DcMotor/DcMotor/hdl/dcMotorPwm_RTL.vhd | ||||
|   elif [ "$dir" == "03-Sensors" ]; then | ||||
|     rm -v -f ./03-Sensors/Sensors/hdl/hallCounters_RTL.vhd | ||||
| 	rm -v -f ./03-Sensors/Sensors/hdl/ultrasoundRanger_RTL.vhd | ||||
|   elif [ "$dir" == "04-Controller" ]; then | ||||
|     echo "Info: Nothing to be deleted" | ||||
|   fi | ||||
|  | ||||
| elif [ "$project" == "did-kart-ebs3" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-kart-ebs3" | ||||
|   rm -v -f ./DcMotor/hdl/dcMotorPwm_RTL.vhd | ||||
|   rm -v -f ./Kart_test/hdl/txFIFO_tester_test.vhd | ||||
|   rm -v -f -r ./Kart_test/hds/tx@f@i@f@o_tb/ | ||||
|   rm -v -f -r ./Kart_test/hds/tx@f@i@f@o_tester/ | ||||
|   rm -v -f ./Kart_test/hds/_txfifo_tb._epf | ||||
|   rm -v -f ./Kart_test/hds/_txfifo_tester._epf | ||||
|   rm -v -f -r ./Kart_test/hds/kart@controller_full_tb/ | ||||
|   rm -v -f ./Kart_test/hds/_kartcontroller_full_tb._epf | ||||
|   rm -v -f ./Sensors/hdl/hallCounters_RTL.vhd | ||||
|   rm -v -f ./Sensors/hdl/ultrasoundRanger_RTL.vhd | ||||
|   rm -v -f ./Stepper/hdl/angleDifference_RTL.vhd | ||||
|   rm -v -f ./Stepper/hdl/coilControl_RTL.vhd | ||||
|   rm -v -f ./Stepper/hdl/stepperCounter_RTL.vhd | ||||
|   rm -v -f ./Stepper/hds/angle@control/master@version.bd | ||||
|   rm -v -f ./Stepper/hds/coil@control/master@version_counter@demux.bd | ||||
|   rm -v -f ./Stepper/hds/coil@control/master@version_shift@reg.bd | ||||
|   rm -v -f ./Stepper_test/hdl/stepperMotorRegisters_tester_test.vhd | ||||
|   rm -v -f -r ./Stepper_test/hds/stepper@motor@registers_tb/ | ||||
|   rm -v -f -r ./Stepper_test/hds/stepper@motor@registers_tester/ | ||||
|   rm -v -f ./Stepper_test/hds/_steppermotorregisters_tb._epf | ||||
|   rm -v -f ./Simulation/Kart/UVM/uvmCommands.txt | ||||
|   rm -v -f ./Simulation/Kart/kartUVM.do | ||||
|   rm -v -f ./Simulation/Kart/txFIFO.do | ||||
|   rm -v -f ./Simulation/Stepper/stepperMotorRegisters.do | ||||
|   rm -v -f -r ./Simulation/UART/ | ||||
|   rm -v -f -r ./UART_test/ | ||||
|  | ||||
|   rm -v -f ./Board/concat/*.vhd | ||||
|   find ./Board/libero/designer/ ! \( -name "*.prjx" -o -name "*.adb" -o -name "*.ide_des" -o -name "*.pdb" -o -name "*_syn.prj" \) -type f -exec rm -v -f -r {} + | ||||
|   rm -v -f -r ./Documentation/ | ||||
|   rm -v -f -r ./CommandInterpreter/src/ | ||||
|  | ||||
| elif [ "$project" == "did-synchro" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-synchro" | ||||
|   rm -v -f -r ./Board/concat/concatenated.vhd | ||||
|   rm -v -f -r ./Board/concat/did-synchro.vhd | ||||
|  | ||||
| elif [ "$project" == "did-inverter" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-inverter" | ||||
|   rm -v -f -r ./Board/concat/concatenated.vhd | ||||
|   rm -v -f -r ./Board/concat/did-inverter.vhd | ||||
|  | ||||
| elif [ "$project" == "did-display" ]; then | ||||
|   find $repo_source -maxdepth 1 -type f \! \( -name .gitmodules -o -name .gitlab-ci.yml -o -name README.md -o -name LICENSE \) -exec cp -ar '{}' $repo_dest \; | ||||
|   for folder in $(find $repo_source -maxdepth 1 -type d ) | ||||
|   do | ||||
|     if [[ "$repo_source" != "$folder" && "$repo_source/.git" != "$folder" && "$repo_source/Libs" != "$folder" && "$repo_source/Scripts" != "$folder" && "$repo_source/img" != "$folder" ]] ; then | ||||
|       echo "copy $folder" | ||||
|       cp -ar $folder ./ | ||||
|     else | ||||
|       echo "skip $folder" | ||||
|     fi | ||||
|   done | ||||
|   echo "" | ||||
|   echo "Delete solutions blocs for did-display" | ||||
|   find ./Board/ise/ -name "*.mcs" -type f -exec rm -v -f {} + | ||||
|   rm -v -f -r ./Display/concat/ | ||||
|   find ./Display/hdl/ -name "*.vhg" -type f -exec rm -v -f {} + | ||||
|   rm -v -f ./Display/hdl/test_pattern_calculated_rtl.vhd | ||||
|   rm -v -f ./Display/hdl/vgaDataCreator_rgb.vhd | ||||
|   rm -v -f ./Display/hdl/vgaDataSelector_rtl.vhd | ||||
|   rm -v -f ./Display/hds/display@circuit/master@version.bd | ||||
|   rm -v -f -r ./Display/hds/vga@data@calculated/ | ||||
|   rm -v -f -r ./Display/hds/vga@data@selector/ | ||||
|  | ||||
|   rm -v -f -r ./Display_test/concat/ | ||||
|  | ||||
|   rm -v -f -r ./Board/concat/concatenated.vhd | ||||
|   rm -v -f -r ./Board/concat/did-display.vhd | ||||
|  | ||||
| elif [ "$project" == "eln_support" ]; then | ||||
|   echo "Error: Not implemented yet" | ||||
|  | ||||
| elif [ "$project" == "eptm_radio" ]; then | ||||
|   echo "Error: Not implemented yet" | ||||
|  | ||||
| elif [ "$project" == "eptm_audioamp" ]; then | ||||
|   echo "Error: Not implemented yet" | ||||
|  | ||||
| elif [ "$project" == "cansat" ]; then | ||||
|   echo "Error: Not implemented yet" | ||||
| fi | ||||
|  | ||||
| echo "Source taken from $repo_source to $repo_dest" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # change from masterVersion to studentVersion and delete all masterVersion | ||||
| # | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a masterVersion -n studentVersion -r | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a master@version -n student@version -r | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a masterVersion -n studentVersion -r | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a master@version -n student@version -r | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a masterVersion -n studentVersion -r | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/did-labs" -a master@version -n student@version -r | ||||
| else | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/$project" -a masterVersion -n studentVersion -r | ||||
|   ./../../changeDefaultViews.bash -p "Scripts/tmp/$project" -a master@version -n student@version -r | ||||
| fi | ||||
|  | ||||
| # add/commit/push changes to student repo | ||||
| git add -A | ||||
| git commit -a -m "$DATE: Automatic Laboratory Update with ``deployLab.bash`` :shipit:" | ||||
| git push origin main | ||||
| cd .. | ||||
|  | ||||
| # Delete tmp directory | ||||
| echo "Delete tmp directory" | ||||
| cd .. | ||||
| pwd | ||||
| rm -rf "./tmp" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- $DATE: $project updated at $repo" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										320
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLibs.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										320
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLibs.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,320 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployLibs.bash - updates github repos for individual labos | ||||
| # indend to push libs from [DiD-libs](https://gitlab.hevs.ch/course/did/did-libs.git) | ||||
| # Example usage 1:  ./Scripts/deployLibs.bash -v -p synd-did-labs -r https://github.com/hei-synd-did/did-labs.git | ||||
| # Example usage 2:  ./Scripts/deployLibs.bash -v -p ete-did-labs -r https://github.com/hei-ete-did/did-labs.git | ||||
| # Example usage 3:  ./Scripts/deployLibs.bash -v -p isc-did-labs -r https://github.com/hei-isc-did/did-labs.git | ||||
| # Example usage 4:  ./Scripts/deployLibs.bash -v -p did-chrono -r https://github.com/hei-synd-did/did-chrono.git | ||||
| # Example usage 5:  ./Scripts/deployLibs.bash -v -p did-cursor -r https://github.com/hei-synd-did/did-cursor.git | ||||
| # Example usage 6:  ./Scripts/deployLibs.bash -v -p did-inverter -r https://github.com/hei-ete-did/did-inverter.git | ||||
| # Example usage 7:  ./Scripts/deployLibs.bash -v -p did-synchro -r https://github.com/hei-ete-did/did-synchro.git | ||||
| # Example usage 8:  ./Scripts/deployLibs.bash -v -p did-kart-ebs3 -r https://github.com/hei-synd-did/did-kart-ebs3.git | ||||
| # Example usage 9:  ./Scripts/deployLibs.bash -v -p did-display -r https://github.com/hei-isc-did/did-display.git | ||||
| # Example usage 10: ./Scripts/deployLibs.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git | ||||
| # Example usage 11: ./Scripts/deployLibs.bash -v -p car-labs -r https://github.com/hei-isc-car/car-labs.git | ||||
| # Example usage 12: ./Scripts/deployLibs.bash -v -p car-heirv -r https://github.com/hei-isc-car/car-heirv.git | ||||
|  | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
| base_directory="$base_directory/.." | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Parse command line options | ||||
| # | ||||
| project='did-labs' | ||||
| repo='https://github.com/hei-synd-did/did-labs.git' | ||||
|  | ||||
| usage='Usage: deployLibs.bash [-p projectName] [-r repourl] [-v] [-h]' | ||||
| while getopts 'p:r:vh' options; do | ||||
|   case $options in | ||||
|     p ) project=$OPTARG;; | ||||
|     r ) repo=$OPTARG;; | ||||
|     v ) verbose=1;; | ||||
|     h ) echo -e $usage | ||||
|           exit 1;; | ||||
|     * ) echo -e $usage | ||||
|           exit 1;; | ||||
|   esac | ||||
| done | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Display info | ||||
| # | ||||
| if [ -n "$verbose" ] ; then | ||||
|   echo "$SEPARATOR" | ||||
|   echo "-- $DATE: Deploy Libraries for Students" | ||||
|   echo "${INDENT}for $project" | ||||
|   echo "${INDENT}to $repo" | ||||
|   echo "" | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Clean current repo | ||||
| # | ||||
| echo "Clean parent repo from intermediate files" | ||||
| ./cleanGenerated.bash | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Clone student repo | ||||
| # | ||||
| # Create a tmp subdirectory if it doesn't exist | ||||
| echo "Create tmp folder" | ||||
| mkdir -p tmp | ||||
| cd tmp | ||||
|  | ||||
| # Get repo | ||||
| echo "Clone student repo $project" | ||||
| # Add login and access token to url | ||||
| repo_access=$(echo $repo | sed 's/https\?:\/\///') | ||||
| github_username=tschinz | ||||
| github_accesstoken=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 | ||||
| repo_access="https://$github_username:$github_accesstoken@${repo_access}" | ||||
| git clone $repo_access | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|   cd did-labs | ||||
| else | ||||
|   cd $project | ||||
| fi | ||||
|  | ||||
| library_dest=`realpath "./Libs"` | ||||
| library_source=`realpath "./../../.."` | ||||
| mkdir -p $library_dest | ||||
|  | ||||
| # Copy needed libraries per project | ||||
| echo "Update files in student repo $project" | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, NanoBlaze" | ||||
|   cp -arf "$library_source/Gates/"          "$library_dest/" | ||||
|   cp -arf "$library_source/IO/"             "$library_dest/" | ||||
|   cp -arf "$library_source/Sequential/"     "$library_dest/" | ||||
|   cp -arf "$library_source/Common/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Common_test/"    "$library_dest/" | ||||
|   cp -arf "$library_source/NanoBlaze/"      "$library_dest/" | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Operators, Common, NanoBlaze" | ||||
|   cp -arf "$library_source/Gates/"          "$library_dest/" | ||||
|   cp -arf "$library_source/IO/"             "$library_dest/" | ||||
|   cp -arf "$library_source/Sequential/"     "$library_dest/" | ||||
|   cp -arf "$library_source/Operators/"      "$library_dest/" | ||||
|   cp -arf "$library_source/Common/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Common_test/"    "$library_dest/" | ||||
|   cp -arf "$library_source/NanoBlaze/"      "$library_dest/" | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, NanoBlaze" | ||||
|   cp -arf "$library_source/Gates/"          "$library_dest/" | ||||
|   cp -arf "$library_source/IO/"             "$library_dest/" | ||||
|   cp -arf "$library_source/Sequential/"     "$library_dest/" | ||||
|   cp -arf "$library_source/Common/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Common_test/"    "$library_dest/" | ||||
|   cp -arf "$library_source/NanoBlaze/"      "$library_dest/" | ||||
| elif [ "$project" == "car-labs" ]; then | ||||
|   echo "    Copy libraries: Common, Gates, Memory, Operators, Sequential" | ||||
|   library_dest=`realpath "./heirv32_sc/Libs"` | ||||
|   cp -arf "$library_source/Common/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Common_test/"    "$library_dest/" | ||||
|   cp -arf "$library_source/Gates/"          "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"        "$library_dest/" | ||||
|   cp -arf "$library_source/Memory/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Operators/"      "$library_dest/" | ||||
|   cp -arf "$library_source/Sequential/"     "$library_dest/" | ||||
| elif [ "$project" == "car-heirv" ]; then | ||||
|   echo "    Copy libraries: Common, Gates, Memory, Operators, Sequential" | ||||
|   cp -arf "$library_source/Common/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Common_test/"    "$library_dest/" | ||||
|   cp -arf "$library_source/Gates/"          "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"        "$library_dest/" | ||||
|   cp -arf "$library_source/Memory/"         "$library_dest/" | ||||
|   cp -arf "$library_source/Operators/"      "$library_dest/" | ||||
|   cp -arf "$library_source/Sequential/"     "$library_dest/" | ||||
| elif [ "$project" == "ele_labs" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Operators, Common, Memory, Modulation, NanoBlaze" | ||||
|   cp -ar "$library_source/Gates"           "$library_dest/" | ||||
|   cp -ar "$library_source/IO"              "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"      "$library_dest/" | ||||
|   cp -ar "$library_source/Operators"       "$library_dest/" | ||||
|   cp -ar "$library_source/Common"          "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test"     "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"       "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"          "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test"     "$library_dest/" | ||||
|   cp -ar "$library_source/Modulation"      "$library_dest/" | ||||
|   cp -ar "$library_source/Modulation_test" "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze"       "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze_test"  "$library_dest/" | ||||
| elif [ "$project" == "sem-labs" ]; then | ||||
|   echo "    Copy libraries: Common, RS232, AhbLite, Memory, RiscV, NanoBlaze" | ||||
|   cp -ar "$library_source/Common"         "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test"    "$library_dest/" | ||||
|   cp -ar "$library_source/RS232"          "$library_dest/" | ||||
|   cp -ar "$library_source/RS232_test"     "$library_dest/" | ||||
|   cp -ar "$library_source/AhbLite"        "$library_dest/" | ||||
|   cp -ar "$library_source/AhbLite_test"   "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"       "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"         "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test"    "$library_dest/" | ||||
|   cp -ar "$library_source/RiscV"          "$library_dest/" | ||||
|   cp -ar "$library_source/RiscV_test"     "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze"      "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze_test" "$library_dest/" | ||||
| elif [ "$project" == "did-cursor" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Lcd, Memory" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd"         "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd_test"    "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
| elif [ "$project" == "did-chrono" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Lcd, Memory, RS232" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd"         "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd_test"    "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
|   #cp -ar "$library_source/RS232"       "$library_dest/" | ||||
|   #cp -ar "$library_source/RS232_test"  "$library_dest/" | ||||
| elif [ "$project" == "did-kart-ebs2" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Lcd, Memory, RS232" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -ar "$library_source/I2C"         "$library_dest/" | ||||
|   cp -ar "$library_source/I2C_test"    "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
|   cp -ar "$library_source/RS232"       "$library_dest/" | ||||
|   cp -ar "$library_source/RS232_test"  "$library_dest/" | ||||
| elif [ "$project" == "did-kart-ebs3" ]; then | ||||
|   echo "    Copy libraries: Common, Gates, I2C, Memory, RS232, IO, Sequential, UVM" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/I2C"         "$library_dest/" | ||||
|   cp -ar "$library_source/I2C_test"    "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
|   cp -ar "$library_source/RS232"       "$library_dest/" | ||||
|   cp -ar "$library_source/RS232_test"  "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/UVM"         "$library_dest/" | ||||
|   cp -ar "$library_source/UVM_test"    "$library_dest/" | ||||
| elif [ "$project" == "did-synchro" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Cordic" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Operators"   "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
|   cp -ar "$library_source/RS232"       "$library_dest/" | ||||
|   cp -ar "$library_source/RS232_test"  "$library_dest/" | ||||
| elif [ "$project" == "did-inverter" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Cordic" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Operators"   "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -ar "$library_source/Cordic"      "$library_dest/" | ||||
|   cp -ar "$library_source/Cordic_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
| elif [ "$project" == "eln_support" ]; then | ||||
|   echo "Nothing todo, no Libararies needed" | ||||
| elif [ "$project" == "did-display" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common, Lcd, Memory, RS232" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd"         "$library_dest/" | ||||
|   cp -ar "$library_source/Lcd_test"    "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"      "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test" "$library_dest/" | ||||
| elif [ "$project" == "eptm_radio" ]; then | ||||
|   echo "    Copy libraries: Gates, IO, Sequential, Common" | ||||
|   cp -ar "$library_source/Gates"       "$library_dest/" | ||||
|   cp -ar "$library_source/IO"          "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
|   cp -ar "$library_source/Sequential"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
| elif [ "$project" == "eptm_audioamp" ]; then | ||||
|   echo "    Copy libraries: AD_DA, Common, Filter" | ||||
|   cp -ar "$library_source/AD_DA"       "$library_dest/" | ||||
|   cp -ar "$library_source/AD_DA_test"  "$library_dest/" | ||||
|   cp -ar "$library_source/Common"      "$library_dest/" | ||||
|   cp -ar "$library_source/Common_test" "$library_dest/" | ||||
|   cp -ar "$library_source/Filter"      "$library_dest/" | ||||
|   cp -ar "$library_source/Filter_test" "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"   "$library_dest/" | ||||
| elif [ "$project" == "cansat" ]; then | ||||
|   echo "    Copy libraries: AhbLite, AhbLiteComponents, Common, Commandline, Memory, NanoBlaze, RS232" | ||||
|   cp -ar "$library_source/AhbLite"                "$library_dest/" | ||||
|   cp -ar "$library_source/AhbLite_test"           "$library_dest/" | ||||
|   cp -ar "$library_source/AhbLiteComponents"      "$library_dest/" | ||||
|   cp -ar "$library_source/AhbLiteComponents_test" "$library_dest/" | ||||
|   cp -ar "$library_source/Common"                 "$library_dest/" | ||||
|   cp -ar "$library_source/Commandline"            "$library_dest/" | ||||
|   cp -ar "$library_source/Commandline_test"       "$library_dest/" | ||||
|   cp -arf "$library_source/Lattice/"              "$library_dest/" | ||||
|   cp -ar "$library_source/Memory"                 "$library_dest/" | ||||
|   cp -ar "$library_source/Memory_test"            "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze"              "$library_dest/" | ||||
|   cp -ar "$library_source/NanoBlaze_test"         "$library_dest/" | ||||
|   cp -ar "$library_source/RS232"                  "$library_dest/" | ||||
|   cp -ar "$library_source/RS232_test"             "$library_dest/" | ||||
| fi | ||||
|  | ||||
| # add/commit/push changes to student repo | ||||
| echo "    Git: Add => Commit => Push" | ||||
| git add -A | ||||
| git commit -a -m "$DATE: Automatic Library Update with ``deployLibs.bash`` :shipit:" | ||||
| git push origin main | ||||
| cd .. | ||||
|  | ||||
| # Delete tmp directory | ||||
| cd .. | ||||
| echo "    Delete tmp directory" | ||||
| rm -rf "./tmp" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- $DATE: $project updated at $repo" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										37
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLibsAll.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployLibsAll.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployLibsAll.bash - updates github repos for all labo's at once | ||||
| # indend to push libs from [eda_libs](https://gitlab.hevs.ch/course/ElN/eda_libs.git) | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| ./deployLibs.bash -v -p synd-did-labs -r https://github.com/hei-synd-did/did-labs.git | ||||
| ./deployLibs.bash -v -p ete-did-labs -r https://github.com/hei-ete-did/did-labs.git | ||||
| ./deployLibs.bash -v -p isc-did-labs -r https://github.com/hei-isc-did/did-labs.git | ||||
| ./deployLibs.bash -v -p did-chrono -r https://github.com/hei-synd-did/did-chrono.git | ||||
| ./deployLibs.bash -v -p did-cursor -r https://github.com/hei-synd-did/did-cursor.git | ||||
| #./deployLibs.bash -v -p did-kart-ebs2 -r https://github.com/hei-synd-did/did-ket-ebs2.git # repo does not exist !!! | ||||
| ./deployLibs.bash -v -p did-inverter -r https://github.com/hei-ete-did/did-inverter.git | ||||
| ./deployLibs.bash -v -p did-synchro -r https://github.com/hei-ete-did/did-synchro.git | ||||
| ./deployLibs.bash -v -p did-kart-ebs3 -r https://github.com/hei-synd-did/did-kart-ebs3.git | ||||
| ./deployLibs.bash -v -p did-display -r https://github.com/hei-isc-did/did-display.git | ||||
| ./deployLibs.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git | ||||
| ./deployLibs.bash -v -p car-labs -r https://github.com/hei-isc-car/car-labs.git | ||||
| ./deployLibs.bash -v -p car-heirv -r https://github.com/hei-isc-car/car-heirv.git | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- $DATE: ${0##*/} finished" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										32
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deploySEmLabs.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deploySEmLabs.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployLabsAll.bash - updates github repos for all labo's at once | ||||
| # indend to push labs from [sem-labs](https://gitlab.hevs.ch/course/SEm/hd-labs.git) | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
|  | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 01-WaveformGenerator | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 02-SplineInterpolator | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 03-DigitalToAnalogConverter | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 04-Lissajous | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 05-Morse | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 06-07-08-09-SystemOnChip | ||||
| ./deployLab.bash -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git -d 10-PipelinedOperators | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- $DATE: ${0##*/} finished" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										331
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployScripts.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										331
									
								
								zz-solutions/01-WaveformGenerator/Scripts/deployScripts.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,331 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployScripts.bash - updates github repos for individual labos | ||||
| # indend to push scripts from [DiD-scripts](https://gitlab.hevs.ch/course/did/did-scripts.git) | ||||
| # Example usage 1:  ./Scripts/deployScripts.bash -v -p synd-did-labs -r https://github.com/hei-synd-did/did-labs.git | ||||
| # Example usage 2:  ./Scripts/deployScripts.bash -v -p ete-did-labs -r https://github.com/hei-ete-did/did-labs.git | ||||
| # Example usage 3:  ./Scripts/deployScripts.bash -v -p isc-did-labs -r https://github.com/hei-isc-did/did-labs.git | ||||
| # Example usage 4:  ./Scripts/deployScripts.bash -v -p did-chrono -r https://github.com/hei-synd-did/did-chrono.git | ||||
| # Example usage 5:  ./Scripts/deployScripts.bash -v -p did-cursor -r https://github.com/hei-synd-did/did-cursor.git | ||||
| # Example usage 6:  ./Scripts/deployScripts.bash -v -p did-inverter -r https://github.com/hei-ete-did/did-inverter.git | ||||
| # Example usage 7:  ./Scripts/deployScripts.bash -v -p did-synchro -r https://github.com/hei-ete-did/did-synchro.git | ||||
| # Example usage 8:  ./Scripts/deployScripts.bash -v -p did-kart-ebs3 -r https://github.com/hei-synd-did/did-kart-ebs3.git | ||||
| # Example usage 9:  ./Scripts/deployScripts.bash -v -p did-display -r https://github.com/hei-isc-did/did-display.git | ||||
| # Example usage 10: ./Scripts/deployScripts.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git | ||||
| # Example usage 11: ./Scripts/deployScripts.bash -v -p car-labs -r https://github.com/hei-isc-car/car-labs.git -d heirv32_sc | ||||
| # Example usage 12: ./Scripts/deployScripts.bash -v -p car-heirv -r https://github.com/hei-isc-car/car-heirv.git | ||||
|  | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
| base_directory="$base_directory" | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Parse command line options | ||||
| # | ||||
| project='did-labs' | ||||
| repo='https://github.com/hei-synd-did/did-labs.git' | ||||
| destdir='' | ||||
|  | ||||
| usage='Usage: deployScripts.bash [-p projectName] [-r repourl] [-d destdir] [-v] [-h]' | ||||
| while getopts 'p:r:d:vh' options; do | ||||
|   case $options in | ||||
|     p ) project=$OPTARG;; | ||||
|     r ) repo=$OPTARG;; | ||||
|     d ) destdir=$OPTARG;; | ||||
|     v ) verbose=1;; | ||||
|     h ) echo -e $usage | ||||
|           exit 1;; | ||||
|     * ) echo -e $usage | ||||
|           exit 1;; | ||||
|   esac | ||||
| done | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Display info | ||||
| # | ||||
| if [ -n "$verbose" ] ; then | ||||
|   echo "$SEPARATOR" | ||||
|   echo "-- $DATE: Deploy Scripts for Students" | ||||
|   echo "${INDENT}for $project" | ||||
|   echo "${INDENT}to $repo" | ||||
|   echo "" | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Clone student repo | ||||
| # | ||||
| # Create a tmp subdirectory if it doesn't exist | ||||
| echo "Create tmp folder" | ||||
| mkdir -p tmp | ||||
| cd tmp | ||||
|  | ||||
| # Get repo | ||||
| echo "Clone student repo $project" | ||||
| # Add login and access token to url | ||||
| repo_access=$(echo $repo | sed 's/https\?:\/\///') | ||||
| github_username=tschinz | ||||
| github_accesstoken=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 | ||||
| repo_access="https://$github_username:$github_accesstoken@${repo_access}" | ||||
| git clone $repo_access | ||||
| if [ "$project" == "synd-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "ete-did-labs" ]; then | ||||
|   cd did-labs | ||||
| elif [ "$project" == "isc-did-labs" ]; then | ||||
|   cd did-labs | ||||
| else | ||||
|   cd $project | ||||
| fi | ||||
|  | ||||
| library_source=`realpath "./../.."` | ||||
|  | ||||
| # DiD Kart (EBS2 version) has a different project structure | ||||
| if [ "$project" == "did-kart-ebs2" ]; then | ||||
|   # Copy needed libraries per project | ||||
|   mkdir -p "01-StepperMotor/Scripts" | ||||
|   library_dest=`realpath "./01-StepperMotor/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_libero.pl"    "$library_dest/" | ||||
|   cp -arf "$library_source/start_libero.pl"     "$library_dest/" | ||||
|  | ||||
|  | ||||
|   # Copy needed libraries per project | ||||
|   mkdir -p "02-DcMotor/Scripts" | ||||
|   library_dest=`realpath "./02-DcMotor/Scripts"` | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_libero.pl"    "$library_dest/" | ||||
|   cp -arf "$library_source/start_libero.pl"     "$library_dest/" | ||||
|  | ||||
|   # Copy needed libraries per project | ||||
|   mkdir -p "03-Sensors/Scripts" | ||||
|   library_dest=`realpath "./03-Sensors/Scripts"` | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_libero.pl"    "$library_dest/" | ||||
|   cp -arf "$library_source/start_libero.pl"     "$library_dest/" | ||||
|  | ||||
|   # Copy needed libraries per project | ||||
|   mkdir -p "04-Controller/Scripts" | ||||
|   library_dest=`realpath "./04-Controller/Scripts"` | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_libero.pl"    "$library_dest/" | ||||
|   cp -arf "$library_source/start_libero.pl"     "$library_dest/" | ||||
|  | ||||
|  | ||||
| # SEm Labs has also a different project structure | ||||
| elif [ "$project" == "sem-labs" ]; then | ||||
|   # Copy needed libraries per project | ||||
|   mkdir -p "01-WaveformGenerator/Scripts" | ||||
|   library_dest=`realpath "./01-WaveformGenerator/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|   mkdir -p "02-SplineInterpolator/Scripts" | ||||
|   library_dest=`realpath "./02-SplineInterpolator/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|   mkdir -p "03-DigitalToAnalogConverter/Scripts" | ||||
|   library_dest=`realpath "./03-DigitalToAnalogConverter/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|     mkdir -p "04-Lissajous/Scripts" | ||||
|   library_dest=`realpath "./04-Lissajous/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|     mkdir -p "05-Morse/Scripts" | ||||
|   library_dest=`realpath "./05-Morse/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|     mkdir -p "06-07-08-09-SystemOnChip/Scripts" | ||||
|   library_dest=`realpath "./06-07-08-09-SystemOnChip/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
|     mkdir -p "10-PipelinedOperators/Scripts" | ||||
|   library_dest=`realpath "./10-PipelinedOperators/Scripts"` | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|  | ||||
| else | ||||
|  | ||||
|   if [ -n "$destdir" ]; then | ||||
|     mkdir -p "$destdir/Scripts" | ||||
|     library_dest=`realpath "$destdir/Scripts"` | ||||
|   else | ||||
|     mkdir -p "Scripts" | ||||
|     library_dest=`realpath "./Scripts"` | ||||
|   fi | ||||
|  | ||||
|   # Copy needed libraries per project | ||||
|   echo "Update files in student repo $project" | ||||
|   echo "    Copy scripts for Windows" | ||||
|   cp -arf "$library_source/hdlDesigner.bat"     "$library_dest/" | ||||
|   cp -arf "$library_source/cleanScratch.bat"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bat"  "$library_dest/" | ||||
|   cp -arf "$library_source/searchPaths.bat"     "$library_dest/" | ||||
|   echo "    Copy scripts for Linux" | ||||
|   cp -arf "$library_source/hdlDesigner.bash"    "$library_dest/" | ||||
|   cp -arf "$library_source/cleanGenerated.bash" "$library_dest/" | ||||
|   cp -arf "$library_source/generateSSHKey.bash" "$library_dest/" | ||||
|   echo "    Copy perl scripts for HDL Designer" | ||||
|   cp -arf "$library_source/trimLibs.pl"         "$library_dest/" | ||||
|   cp -arf "$library_source/update_ise.pl"       "$library_dest/" | ||||
|   cp -arf "$library_source/update_libero.pl"    "$library_dest/" | ||||
|   cp -arf "$library_source/update_diamond.pl"   "$library_dest/" | ||||
|   cp -arf "$library_source/start_libero.pl"     "$library_dest/" | ||||
|   cp -arf "$library_source/start_diamond.pl"     "$library_dest/" | ||||
| fi | ||||
|  | ||||
| # add/commit/push changes to student repo | ||||
| echo "    Git: Add => Commit => Push" | ||||
| git add -A | ||||
| git commit -a -m "$DATE: Automatic Scripts Update with ``deployScripts.bash`` :shipit:" | ||||
| git push origin main | ||||
| cd .. | ||||
|  | ||||
| # Delete tmp directory | ||||
| cd .. | ||||
| echo "    Delete tmp directory" | ||||
| rm -rf "./tmp" | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| #s | ||||
| echo "" | ||||
| echo "-- $DATE: $project updated at $repo" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
| @@ -0,0 +1,37 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # deployScriptsAll.bash - updates github Scripts folder for all labo's at once | ||||
| # indend to push scripts from [eda_scripts](https://gitlab.hevs.ch/course/ElN/eda_scripts.git) | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| pushd $base_directory | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
| DATE=`date '+%Y-%m-%d %H:%M:%S'` | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| ./deployScripts.bash -v -p synd-did-labs -r https://github.com/hei-synd-did/did-labs.git | ||||
| ./deployScripts.bash -v -p ete-did-labs -r https://github.com/hei-ete-did/did-labs.git | ||||
| ./deployScripts.bash -v -p isc-did-labs -r https://github.com/hei-isc-did/did-labs.git | ||||
| ./deployScripts.bash -v -p did-chrono -r https://github.com/hei-synd-did/did-chrono.git | ||||
| ./deployScripts.bash -v -p did-cursor -r https://github.com/hei-synd-did/did-cursor.git | ||||
| #./deployScripts.bash -v -p did-kart-ebs2 -r https://github.com/hei-synd-did/did-ket-ebs2.git # repo does not exist !!! | ||||
| ./deployScripts.bash -v -p did-inverter -r https://github.com/hei-ete-did/did-inverter.git | ||||
| ./deployScripts.bash -v -p did-synchro -r https://github.com/hei-ete-did/did-synchro.git | ||||
| ./deployScripts.bash -v -p did-kart-ebs3 -r https://github.com/hei-synd-did/did-kart-ebs3.git | ||||
| ./deployScripts.bash -v -p did-display -r https://github.com/hei-isc-did/did-display.git | ||||
| ./deployScripts.bash -v -p sem-labs -r https://github.com/hei-synd-sem/sem-labs.git | ||||
| ./deployScripts.bash -v -p car-labs -r https://github.com/hei-isc-car/car-labs.git -d heirv32_sc | ||||
| ./deployScripts.bash -v -p car-heirv -r https://github.com/hei-isc-car/car-heirv.git | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- $DATE: ${0##*/} finished" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
| @@ -0,0 +1,42 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #============================================================================== | ||||
| # generates an SSH key under default user location ~/.ssh/ | ||||
| # and add the public key to the clipboard | ||||
| # | ||||
| # the email could be given when calling the script or be prompted later | ||||
|  | ||||
| email='' | ||||
| filename=$(hostname) | ||||
| user=$(whoami) | ||||
|  | ||||
| usage='Usage: generateSSH.bash [-e email]' | ||||
|  | ||||
| # handle options | ||||
| while getopts 'e:v' flag; do | ||||
|   case "${flag}" in | ||||
|     e) email=${OPTARG};; | ||||
|   esac | ||||
| done | ||||
|  | ||||
| # if the mail is not given, prompt it | ||||
| if [ -z "$email" ] | ||||
| then | ||||
|       echo -n "Please enter your mail: " | ||||
|       read email | ||||
| fi | ||||
| # generates the key-couple | ||||
| # cat /dev/zero create an empty file to be filled by the key | ||||
| # then ssh-keygen is called with: | ||||
| # -q to call it silently (no verbose) | ||||
| # -N with empty string to set no-password | ||||
| # -t to specify the type of key | ||||
| # -C to set the user mail | ||||
| cat /dev/zero | ssh-keygen -q -N "" -t ed25519 -C "${user}@${filename}" -f ~/.ssh/$filename | ||||
|  | ||||
| # then copy the public key into the clipboard | ||||
| clip < ~/.ssh/${filename}.pub | ||||
|  | ||||
| # print output for user | ||||
| echo -e "\nThe keyfiles are generated under ~/.ssh/" | ||||
| echo -e "\nThe public key is in your clipboard, ready to be added to your Github account." | ||||
							
								
								
									
										154
									
								
								zz-solutions/01-WaveformGenerator/Scripts/hdlDesigner.bash
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								zz-solutions/01-WaveformGenerator/Scripts/hdlDesigner.bash
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,154 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| #================================================================================ | ||||
| # hdl_designer.bash - Starts HDL designer | ||||
| # | ||||
| base_directory="$(dirname "$(readlink -f "$0")")" | ||||
| base_directory="$base_directory/.." | ||||
| pushd $base_directory | ||||
|  | ||||
| SEPARATOR='--------------------------------------------------------------------------------' | ||||
| INDENT='  ' | ||||
|  | ||||
| echo "$SEPARATOR" | ||||
| echo "-- ${0##*/} Started!" | ||||
| echo "" | ||||
|  | ||||
| #-------------------------------------------------------------------------------- | ||||
| # Parse command line options | ||||
| # | ||||
| command_switches='n:d:p:m:i:u:t:s:c:y:vh' | ||||
| usage='Usage: hdl_designer.bash [-v] [-h]' | ||||
| usage="$usage\n\t[-d designDirectory] [-u userPrefsDirectory]" | ||||
|                                                     # set name and base directory | ||||
| design_name=`basename $0 .bash` | ||||
| design_directory=`dirname ${BASH_SOURCE[0]}` | ||||
|  | ||||
| while getopts $command_switches options; do | ||||
|   case $options in | ||||
|     n ) design_name=$OPTARG;; | ||||
|     d ) design_directory=$OPTARG;; | ||||
|   esac | ||||
| done | ||||
|                                             # continue with preferences directory | ||||
| prefs_directory="$design_directory/Prefs" | ||||
|  | ||||
| OPTIND=1 | ||||
| while getopts $command_switches options; do | ||||
|   case $options in | ||||
|     n ) design_name=$OPTARG;; | ||||
|     d ) design_directory=$OPTARG;; | ||||
|     p ) prefs_directory=$OPTARG;; | ||||
|   esac | ||||
| done | ||||
|                                                    # finish with other parameters | ||||
| library_matchings="$design_name.hdp" | ||||
| library_matchings='hds.hdp' | ||||
| simulation_directory="$design_directory/Simulation" | ||||
| user_prefs_directory="$prefs_directory/hds_user-linux" | ||||
| team_prefs_directory="$prefs_directory/hds_team" | ||||
| scratch_directory='/tmp/eda/' | ||||
| synthesis_subdirectory="Board/ise" | ||||
| concat_directory="$design_directory/Board/concat" | ||||
|  | ||||
| OPTIND=1 | ||||
| while getopts $command_switches options; do | ||||
|   case $options in | ||||
|     n ) ;; | ||||
|     d ) ;; | ||||
|     m ) library_matchings=$OPTARG;; | ||||
|     i ) simulation_directory=$OPTARG;; | ||||
|     u ) user_prefs_directory=$OPTARG;; | ||||
|     t ) team_prefs_directory=$OPTARG;; | ||||
|     s ) scratch_directory=$OPTARG;; | ||||
|     c ) concat_directory=$OPTARG;; | ||||
|     y ) synthesis_subdirectory=$OPTARG;; | ||||
|     v ) verbose=1;; | ||||
|     h ) echo -e $usage | ||||
|           exit 1;; | ||||
|     * ) echo -e $usage | ||||
|           exit 1;; | ||||
|   esac | ||||
| done | ||||
|  | ||||
| design_directory=`realpath $design_directory` | ||||
| library_matchings=`realpath $prefs_directory/$library_matchings` | ||||
| simulation_directory=`realpath $simulation_directory` | ||||
| user_prefs_directory=`realpath $user_prefs_directory` | ||||
| team_prefs_directory=`realpath $team_prefs_directory` | ||||
| concat_directory=`realpath $concat_directory` | ||||
| mkdir -p $scratch_directory | ||||
| scratch_directory=`realpath $scratch_directory` | ||||
|  | ||||
| #================================================================================ | ||||
| # Main script | ||||
| # | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # System environment variables | ||||
| # | ||||
| export HDS_HOME=/usr/opt/HDS | ||||
| export MODELSIM_HOME=/usr/opt/Modelsim/modeltech/bin/ | ||||
| export SYNTHESIS_HOME=/usr/opt/Xilinx/ISE_DS/ISE | ||||
| export LC_ALL=C | ||||
| export LD_LIBRARY_PATH=/usr/openwin/lib:/usr/lib:/usr/dt/lib:/usr/opt/HDS/ezwave/lib:/usr/opt/HDS/bin | ||||
| export MGLS_HOME=/usr/opt/HDS/license/mgls | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Project environment variables | ||||
| # | ||||
| export DESIGN_NAME=$design_name | ||||
| export HDS_LIBS=$library_matchings | ||||
| export HDS_USER_HOME="$user_prefs_directory" | ||||
| export HDS_TEAM_HOME=$team_prefs_directory | ||||
| export SIMULATION_DIR=$simulation_directory | ||||
| export SCRATCH_DIR=$scratch_directory | ||||
| export CONCAT_DIR=$concat_directory | ||||
| export SYNTHESIS_BASE_DIR=`realpath $design_directory/$synthesis_subdirectory` | ||||
| export SYNTHESIS_WORK_DIR=$scratch_directory/$synthesis_subdirectory | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Display info | ||||
| # | ||||
| if [ -n "$verbose" ] ; then | ||||
|   echo "Environment variables:" | ||||
|   echo "${INDENT}Design name              is $DESIGN_NAME" | ||||
|   echo "${INDENT}Lib matchings file       is $HDS_LIBS" | ||||
|   echo "${INDENT}Simulation directory     is $SIMULATION_DIR" | ||||
|   echo "${INDENT}User prefs directory     is $HDS_USER_HOME" | ||||
|   echo "${INDENT}Team prefs directory     is $HDS_TEAM_HOME" | ||||
|   echo "${INDENT}Scratch directory        is $SCRATCH_DIR" | ||||
|   echo "${INDENT}Concat directory         is $CONCAT_DIR" | ||||
|   echo "${INDENT}HDS location             is $HDS_HOME" | ||||
|   echo "${INDENT}Modelsim location        is $MODELSIM_HOME" | ||||
|   echo "${INDENT}Synthesis app location   is $SYNTHESIS_HOME" | ||||
|   echo "${INDENT}Synthesis base directory is $SYNTHESIS_BASE_DIR" | ||||
|   echo "${INDENT}Synthesis work directory is $SYNTHESIS_WORK_DIR" | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Copy synthesis data to scratch | ||||
| # | ||||
| if true; then | ||||
|   echo "Copying" | ||||
|   echo "${INDENT}$SYNTHESIS_BASE_DIR" | ||||
|   echo "${INDENT}-> $SYNTHESIS_WORK_DIR" | ||||
| fi | ||||
| if [ -e "$SYNTHESIS_BASE_DIR" ]; then | ||||
|   rm -Rf $SYNTHESIS_WORK_DIR | ||||
|   mkdir -p $SYNTHESIS_WORK_DIR | ||||
|   cp -pr $SYNTHESIS_BASE_DIR/* $SYNTHESIS_WORK_DIR/ | ||||
| fi | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Launch application | ||||
| # | ||||
| hdl_designer & | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Exit | ||||
| # | ||||
| echo "" | ||||
| echo "-- ${0##*/} Finished!" | ||||
| echo "$SEPARATOR" | ||||
| popd | ||||
							
								
								
									
										278
									
								
								zz-solutions/01-WaveformGenerator/Scripts/hdlDesigner.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										278
									
								
								zz-solutions/01-WaveformGenerator/Scripts/hdlDesigner.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,278 @@ | ||||
| ::============================================================================== | ||||
| :: hdl_designer.bash - Starts HDL designer | ||||
| :: | ||||
| :start | ||||
|   setlocal EnableExtensions EnableDelayedExpansion | ||||
|   set cmd_location=%~dp0 | ||||
|   pushd %cmd_location% | ||||
|   set SEPARATOR=-------------------------------------------------------------------------------- | ||||
|   set INDENT="  " | ||||
|  | ||||
|   echo %SEPARATOR% | ||||
|   echo -- %~nx0 Started! | ||||
|   echo. | ||||
|  | ||||
| :: ----------------------------------------------------------------------------- | ||||
| :: Define default environment variables | ||||
| IF NOT DEFINED REQUIRE_LIBS SET "REQUIRE_LIBS=0" | ||||
| IF NOT DEFINED REQUIRE_HDS SET "REQUIRE_HDS=0" | ||||
| IF NOT DEFINED REQUIRE_MODELSIM SET "REQUIRE_MODELSIM=0" | ||||
| IF NOT DEFINED REQUIRE_ISE SET "REQUIRE_ISE=0" | ||||
| IF NOT DEFINED REQUIRE_LIBERO SET "REQUIRE_LIBERO=0" | ||||
| IF NOT DEFINED REQUIRE_DIAMOND SET "REQUIRE_DIAMOND=0" | ||||
| :: | ||||
| ::remove trailing backslash | ||||
| if %cmd_location:~-1%==\ set design_directory=%design_directory:~0,-1% | ||||
|  | ||||
| set design_name=%~n0 | ||||
| set hpd_name=hds | ||||
|  | ||||
| if "%ISE_VERSION%"== "" ( | ||||
|   set ISE_VERSION=14.7 | ||||
| ) | ||||
| set prefs_directory="%design_directory:"=%\Prefs" | ||||
| set library_matchings="%hpd_name%.hdp" | ||||
| set simulation_directory="%design_directory:"=%\Simulation" | ||||
| set user_prefs_directory="%prefs_directory:"=%\hds_user" | ||||
| set team_prefs_directory="%prefs_directory:"=%\hds_team" | ||||
| if "%SCRATCH_DIR%" == "" ( | ||||
|   set scratch_directory=C:\temp\eda\%username% | ||||
| ) else ( | ||||
|   set scratch_directory=%SCRATCH_DIR% | ||||
| ) | ||||
|  | ||||
| set synthesis_subdirectory="" | ||||
| if %REQUIRE_ISE% == 1 ( | ||||
|   set synthesis_subdirectory="Board\ise" | ||||
| ) | ||||
| if %REQUIRE_LIBERO% == 1 ( | ||||
|   set synthesis_subdirectory="Board\libero" | ||||
| ) | ||||
| if %REQUIRE_DIAMOND% == 1 ( | ||||
|   set synthesis_subdirectory="Board\diamond" | ||||
| ) | ||||
| set concat_directory="%design_directory:"=%\Board\concat" | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Parse command line options | ||||
| :: | ||||
| :parse | ||||
| set usage1="Usage: hdl_designer.bat [-v] [-h]" | ||||
| set usage2="                        [-n designName] [-d designDirectory]" | ||||
| set usage3="                        [-p prefsDirectory] [-u userPrefsDirectory] [-t teamPrefsDirectory]" | ||||
| set usage4="                        [-s scratchDirectory] [-c concatDirectory]" | ||||
| set usage5="                        [-y synthesisDirectory] [-m library_matchings]" | ||||
|  | ||||
| echo Search Commandline Parameters | ||||
| :parseloop | ||||
| if not "%1"=="" ( | ||||
|     if "%1"=="-v" ( | ||||
|         set VERBOSE=1 | ||||
|         echo %INDENT:"=%verbose enabled | ||||
|         shift | ||||
|     ) | ||||
|     if "%1"=="-h" ( | ||||
|         goto :HELP | ||||
|         shift | ||||
|     ) | ||||
|     if "%1"=="-n" ( | ||||
|         set design_name=%2 | ||||
|         echo %INDENT:"=%design_name=!design_name:"=! | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-d" ( | ||||
|         set design_directory=%2 | ||||
|         echo %INDENT:"=%design_directory=!design_directory:"=! | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-p" ( | ||||
|         set prefs_directory=%2 | ||||
|         echo %INDENT:"=%prefs_directory=!prefs_directory:"=! | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-u" ( | ||||
|         set user_prefs_directory=%2 | ||||
|         echo %INDENT:"=%user_prefs_directory=%user_prefs_directory:"=% | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-t" ( | ||||
|         set team_prefs_directory=%2 | ||||
|         echo %INDENT:"=%team_prefs_directory=%team_prefs_directory:"=% | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-s" ( | ||||
|         set scratch_directory=%2 | ||||
|         echo %INDENT:"=%scratch_directory=%scratch_directory:"=% | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-c" ( | ||||
|         set concat_directory=%2 | ||||
|         echo "%INDENT:"=%concat_directory=%concat_directory:"=% " | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-y" ( | ||||
|         set synthesis_subdirectory=%2 | ||||
|         echo %INDENT:"=%synthesis_subdirectory=%synthesis_subdirectory:"=% | ||||
|         shift & shift | ||||
|     ) | ||||
|     if "%1"=="-m" ( | ||||
|         set set library_matchings="%2.hdp" | ||||
|         echo %INDENT:"=%library_matchings=%library_matchings:"=% | ||||
|         shift & shift | ||||
|     ) | ||||
|     goto :parseloop | ||||
| ) | ||||
| echo. | ||||
|  | ||||
| :: Setting all concurrent variables | ||||
| set prefs_directory="!design_directory:"=!\Prefs" | ||||
| set user_prefs_directory="!prefs_directory:"=!\hds_user" | ||||
| set team_prefs_directory="!prefs_directory:"=!\hds_team" | ||||
| set library_matchings=!prefs_directory:"=!\!library_matchings:"=! | ||||
| set simulation_directory="!design_directory:"=!\Simulation" | ||||
| set concat_directory="!design_directory:"=!\Board\concat" | ||||
|  | ||||
| :: Getting realpath | ||||
| :: TODO | ||||
|  | ||||
| :: create scratch dir | ||||
| if not exist "%scratch_directory%" ( | ||||
|   mkdir "%scratch_directory:"=%" | ||||
| ) | ||||
|  | ||||
| ::================================================================================ | ||||
| :: Main script | ||||
| :: | ||||
| echo. | ||||
| call "./searchPaths.bat" | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Project environment variables | ||||
| :: | ||||
| set DESIGN_NAME=%design_name:"=% | ||||
| set HDS_LIBS=%library_matchings:"=% | ||||
| set HDS_USER_HOME=%user_prefs_directory:"=% | ||||
| set HDS_TEAM_HOME=%team_prefs_directory:"=% | ||||
| set SIMULATION_DIR=%simulation_directory:"=% | ||||
| :: Changing Slashed (Needed for Modelsim) | ||||
| set SIMULATION_DIR=%SIMULATION_DIR:\=/% | ||||
| set SCRATCH_DIR=%scratch_directory:"=% | ||||
| set CONCAT_DIR=%concat_directory:"=% | ||||
| set ISE_BASE_DIR=%design_directory:"=%\%synthesis_subdirectory:"=% | ||||
| set ISE_WORK_DIR=%scratch_directory:"=%\%DESIGN_NAME:"=%\%synthesis_subdirectory:"=% | ||||
| set LIBERO_BASE_DIR=%design_directory:"=%\%synthesis_subdirectory:"=% | ||||
| set LIBERO_WORK_DIR=%scratch_directory:"=%\%DESIGN_NAME:"=%\%synthesis_subdirectory:"=% | ||||
| set DIAMOND_BASE_DIR=%design_directory:"=%\%synthesis_subdirectory:"=% | ||||
| set DIAMOND_WORK_DIR=%scratch_directory:"=%\%DESIGN_NAME:"=%\%synthesis_subdirectory:"=% | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Display info | ||||
| :: | ||||
| if !VERBOSE! == 1 ( | ||||
|   echo Program Parameters | ||||
|   echo %INDENT:"=%DESIGN_NAME     is %DESIGN_NAME:"=% | ||||
|   echo %INDENT:"=%HEI_LIBS_DIR    is %HEI_LIBS_DIR:"=% | ||||
|   echo %INDENT:"=%HDS_LIBS        is %HDS_LIBS:"=% | ||||
|   echo %INDENT:"=%SIMULATION_DIR  is %SIMULATION_DIR:"=% | ||||
|   echo %INDENT:"=%HDS_USER_HOME   is %HDS_USER_HOME:"=% | ||||
|   echo %INDENT:"=%HDS_TEAM_HOME   is %HDS_TEAM_HOME:"=% | ||||
|   echo %INDENT:"=%SCRATCH_DIR     is %SCRATCH_DIR:"=% | ||||
|   echo %INDENT:"=%CONCAT_DIR      is %CONCAT_DIR:"=% | ||||
|   if %REQUIRE_HDS% == 1 ( | ||||
|     echo %INDENT:"=%HDS_HOME        is %HDS_HOME:"=% | ||||
|   ) | ||||
|   if %REQUIRE_MODELSIM% == 1 ( | ||||
|     echo %INDENT:"=%MODELSIM_HOME   is %MODELSIM_HOME:"=% | ||||
|   ) | ||||
|   if %REQUIRE_ISE% == 1 ( | ||||
|     echo %INDENT:"=%ISE_HOME        is %ISE_HOME:"=% | ||||
|     echo %INDENT:"=%ISE_BASE_DIR    is %ISE_BASE_DIR:"=% | ||||
|     echo %INDENT:"=%ISE_WORK_DIR    is %ISE_WORK_DIR:"=% | ||||
|   ) | ||||
|   if %REQUIRE_LIBERO% == 1 ( | ||||
|     echo %INDENT:"=%LIBERO_HOME     is %LIBERO_HOME:"=% | ||||
|     echo %INDENT:"=%LIBERO_BASE_DIR is %LIBERO_BASE_DIR:"=% | ||||
|     echo %INDENT:"=%LIBERO_WORK_DIR is %LIBERO_WORK_DIR:"=% | ||||
|   ) | ||||
|   if %REQUIRE_DIAMOND% == 1 ( | ||||
|     echo %INDENT:"=%DIAMOND_HOME     is %DIAMOND_HOME:"=% | ||||
|     echo %INDENT:"=%DIAMOND_BASE_DIR is %DIAMOND_BASE_DIR:"=% | ||||
|     echo %INDENT:"=%DIAMOND_WORK_DIR is %DIAMOND_WORK_DIR:"=% | ||||
|   ) | ||||
|   echo. | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Delete scratch directory | ||||
| :: | ||||
| echo. | ||||
| call "./cleanScratch.bat" | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Copy synthesis data to scratch directory | ||||
| :: | ||||
| if %REQUIRE_ISE% == 1 ( | ||||
|   if exist %ISE_BASE_DIR% ( | ||||
|     echo %ISE_BASE_DIR:"=% | ||||
|     echo   -> %ISE_WORK_DIR:"=% | ||||
|     if exist %ISE_WORK_DIR% ( | ||||
|       rmdir /S /Q "%ISE_WORK_DIR%" | ||||
|     ) | ||||
|     mkdir "%ISE_WORK_DIR%" | ||||
|     xcopy /Y "%ISE_BASE_DIR%" "%ISE_WORK_DIR%\" | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| if %REQUIRE_LIBERO% == 1 ( | ||||
|   if exist %LIBERO_BASE_DIR% ( | ||||
|     echo %LIBERO_BASE_DIR:"=% | ||||
|     echo   -> %LIBERO_BASE_DIR:"=% | ||||
|     if exist %LIBERO_WORK_DIR% ( | ||||
|       rmdir /S /Q "%LIBERO_WORK_DIR%" | ||||
|     ) | ||||
|     mkdir "%LIBERO_WORK_DIR%" | ||||
|     xcopy /S /Y "%LIBERO_BASE_DIR%" "%LIBERO_WORK_DIR%\" | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| if %REQUIRE_DIAMOND% == 1 ( | ||||
|   if exist %DIAMOND_BASE_DIR% ( | ||||
|     echo %DIAMOND_BASE_DIR:"=% | ||||
|     echo   -> %DIAMOND_BASE_DIR:"=% | ||||
|     if exist %DIAMOND_WORK_DIR% ( | ||||
|       rmdir /S /Q "%DIAMOND_WORK_DIR%" | ||||
|     ) | ||||
|     mkdir "%DIAMOND_WORK_DIR%" | ||||
|     xcopy /S /Y "%DIAMOND_BASE_DIR%" "%DIAMOND_WORK_DIR%\" | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Launch application | ||||
| :: | ||||
| echo -- Launching program | ||||
| ::echo %INDENT:"=%Waiting until programs finished... | ||||
| ::start /wait !HDS_HOME:"=!\bin\hdldesigner.exe | ||||
| %windir%\system32\cmd.exe /c start !HDS_HOME!\bin\hdldesigner.exe | ||||
| ::echo -- Finished... YOU CAN CLOSE THIS WINDOW NOW! | ||||
|  | ||||
| :end | ||||
|   echo. | ||||
|   echo -- %~nx0 Finished! | ||||
|   echo %SEPARATOR% | ||||
|   echo. && echo. | ||||
|   popd | ||||
|   endlocal | ||||
|   goto:eof | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Helper Functions | ||||
| :: | ||||
| :HELP | ||||
|   echo. | ||||
|   echo %usage1:"=% | ||||
|   echo %usage2:"=% | ||||
|   echo %usage3:"=% | ||||
|   echo %usage4:"=% | ||||
|   echo %usage5:"=% | ||||
|   echo.&pause&goto:eof | ||||
							
								
								
									
										
											BIN
										
									
								
								zz-solutions/01-WaveformGenerator/Scripts/img/EDA_scripts.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								zz-solutions/01-WaveformGenerator/Scripts/img/EDA_scripts.gif
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 12 KiB | 
							
								
								
									
										
											BIN
										
									
								
								zz-solutions/01-WaveformGenerator/Scripts/img/EDA_scripts.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								zz-solutions/01-WaveformGenerator/Scripts/img/EDA_scripts.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 20 KiB | 
| @@ -0,0 +1,98 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||||
|  | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    width="23.118999mm" | ||||
|    height="23.118999mm" | ||||
|    viewBox="0 0 23.118999 23.119" | ||||
|    version="1.1" | ||||
|    id="svg8" | ||||
|    inkscape:version="0.92.4 (5da689c313, 2019-01-14)" | ||||
|    sodipodi:docname="ELN_scripts.svg" | ||||
|    inkscape:export-filename="C:\Users\silvan.zahno\Workspace\HESSO\10_Course\01_Admin\logo\ELN_scripts.png" | ||||
|    inkscape:export-xdpi="549.33002" | ||||
|    inkscape:export-ydpi="549.33002"> | ||||
|   <defs | ||||
|      id="defs2" /> | ||||
|   <sodipodi:namedview | ||||
|      id="base" | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1.0" | ||||
|      inkscape:pageopacity="0.0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:zoom="4" | ||||
|      inkscape:cx="137.00591" | ||||
|      inkscape:cy="88.132636" | ||||
|      inkscape:document-units="mm" | ||||
|      inkscape:current-layer="g66" | ||||
|      showgrid="false" | ||||
|      inkscape:window-width="1920" | ||||
|      inkscape:window-height="1017" | ||||
|      inkscape:window-x="-8" | ||||
|      inkscape:window-y="32" | ||||
|      inkscape:window-maximized="1" | ||||
|      fit-margin-top="0" | ||||
|      fit-margin-left="0" | ||||
|      fit-margin-right="0" | ||||
|      fit-margin-bottom="0" /> | ||||
|   <metadata | ||||
|      id="metadata5"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title /> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <g | ||||
|      inkscape:label="Layer 1" | ||||
|      inkscape:groupmode="layer" | ||||
|      id="layer1" | ||||
|      style="opacity:1" | ||||
|      transform="translate(-59.839396,-122.06852)"> | ||||
|     <circle | ||||
|        id="path59" | ||||
|        cx="71.398895" | ||||
|        cy="133.62802" | ||||
|        style="fill:#c8306f;fill-opacity:1;stroke-width:0.19988333" | ||||
|        r="11.5595" | ||||
|        inkscape:export-xdpi="549.33002" | ||||
|        inkscape:export-ydpi="549.33002" /> | ||||
|     <path | ||||
|        style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:0.34806632;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" | ||||
|        d="m 291.35352,485.29688 -7.53907,7.44726 -0.77148,25.07813 -24.72656,0.0644 -10.04883,6.79492 28.36133,23.49609 c 18.90124,-3.02484 33.65671,-18.14046 36.4082,-37.29687 z" | ||||
|        id="rect4880" | ||||
|        inkscape:connector-curvature="0" | ||||
|        transform="scale(0.26458333)" | ||||
|        inkscape:export-xdpi="549.33002" | ||||
|        inkscape:export-ydpi="549.33002" | ||||
|        sodipodi:nodetypes="cccccccc" /> | ||||
|     <g | ||||
|        id="g66" | ||||
|        transform="matrix(0.55021306,0,0,0.55021306,64.796338,-438.81366)" | ||||
|        inkscape:export-xdpi="549.33002" | ||||
|        inkscape:export-ydpi="549.33002"> | ||||
|       <path | ||||
|          style="fill:#cccccc;stroke-width:2.0795455" | ||||
|          d="M 24.972656 22.894531 C 22.67559 22.894531 20.814453 24.765234 20.814453 27.052734 L 20.814453 41.609375 L 20.814453 45.769531 L 20.814453 60.326172 C 20.814453 62.613672 22.67559 64.484375 24.972656 64.484375 L 43.689453 64.484375 L 62.40625 64.484375 C 64.704148 64.484375 66.564453 62.613672 66.564453 60.326172 L 66.564453 45.769531 L 66.564453 41.609375 L 66.564453 27.052734 C 66.564453 24.765234 64.704148 22.894531 62.40625 22.894531 L 43.689453 22.894531 L 24.972656 22.894531 z M 27.052734 29.392578 L 37.451172 35.371094 L 27.052734 41.349609 L 27.052734 39.009766 L 33.291016 35.371094 L 27.052734 31.732422 L 27.052734 29.392578 z M 37.451172 39.53125 L 47.847656 39.53125 L 47.847656 41.609375 L 37.451172 41.609375 L 37.451172 39.53125 z " | ||||
|          transform="matrix(0.48087432,0,0,0.48087432,-9.0091318,1019.3909)" | ||||
|          id="path60" /> | ||||
|       <path | ||||
|          style="fill:#ffffff;stroke-width:2.0795455" | ||||
|          d="M 24.972656 22.894531 C 22.67559 22.894531 20.814453 24.755669 20.814453 27.052734 L 20.814453 33.291016 L 20.814453 39.53125 L 20.814453 41.609375 L 20.814453 43.689453 L 20.814453 45.769531 L 20.814453 52.007812 L 20.814453 58.246094 C 20.814453 60.543991 22.67559 62.40625 24.972656 62.40625 L 43.689453 62.40625 L 62.40625 62.40625 C 64.704148 62.40625 66.564453 60.543991 66.564453 58.246094 L 66.564453 52.007812 L 66.564453 43.689453 L 66.564453 39.53125 L 66.564453 33.291016 L 66.564453 27.052734 C 66.564453 24.755669 64.704148 22.894531 62.40625 22.894531 L 43.689453 22.894531 L 24.972656 22.894531 z M 27.052734 29.392578 L 37.451172 35.371094 L 27.052734 41.349609 L 27.052734 39.009766 L 33.291016 35.371094 L 27.052734 31.732422 L 27.052734 29.392578 z M 37.451172 39.53125 L 47.847656 39.53125 L 47.847656 41.609375 L 37.451172 41.609375 L 37.451172 39.53125 z " | ||||
|          transform="matrix(0.48087432,0,0,0.48087432,-9.0091318,1019.3909)" | ||||
|          id="path62" /> | ||||
|     </g> | ||||
|   </g> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 5.9 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.7 MiB | 
							
								
								
									
										183
									
								
								zz-solutions/01-WaveformGenerator/Scripts/searchPaths.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								zz-solutions/01-WaveformGenerator/Scripts/searchPaths.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,183 @@ | ||||
| ::============================================================================== | ||||
| :: search_paths.bat - Search for Libraries and HDL Tools | ||||
| :: | ||||
|  | ||||
| :start | ||||
|   @echo off | ||||
|   set cmd_location="%~dp0" | ||||
|   pushd %cmd_location% | ||||
|   set SEPARATOR=-------------------------------------------------------------------------------- | ||||
|   set INDENT="  " | ||||
|  | ||||
|   echo %SEPARATOR% | ||||
|   echo -- %~nx0 Started! | ||||
|   echo. | ||||
|  | ||||
| echo Search HEI Library | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search HEI library directory | ||||
| :: | ||||
| if !REQUIRE_LIBS! == 1 ( | ||||
|   if "%HEI_LIBS_DIR%" == "" ( | ||||
|     set HEI_LIBS_DIR=%design_directory:"=!%\Libs | ||||
|     if not exist !HEI_LIBS_DIR!\ ( | ||||
|       :: check at folder one level above project folder, as used on svn for boards libraries | ||||
|       set HEI_LIBS_DIR=%design_directory:"=!%\..\Libs | ||||
|       if not exist !HEI_LIBS_DIR!\ ( | ||||
|         :: check at folder one level above project folder, as used on svn for boards libraries | ||||
|         set HEI_LIBS_DIR=%design_directory:"=!%\..\..\Libs | ||||
|         if not exist !HEI_LIBS_DIR!\ ( | ||||
|           :: check on server, as used for ET labs | ||||
|           set HEI_LIBS_DIR=R:\ETE\Ele1_8132\ELN\Labs\Libraries | ||||
|           if not exist !HEI_LIBS_DIR!\ ( | ||||
|             :: check on server, as used for SI labs | ||||
|             set HEI_LIBS_DIR=R:\SYND\Ele_2131\ELN\Labs\Libraries | ||||
|             if not exist !HEI_LIBS_DIR!\ ( | ||||
|               echo "ERROR: No valid libraries found: please verify your project setup." | ||||
|               pause&goto:end | ||||
|             ) | ||||
|           ) | ||||
|         ) | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !HEI_LIBS_DIR!\ ( | ||||
|     echo %INDENT:"=%Found HEI_LIBS_DIR   at !HEI_LIBS_DIR:"=! | ||||
|   ) else ( | ||||
|     echo %INDENT:"=%ERROR: No valid HEI_LIBS_DIR found: please verify your HEI_LIBS_DIR settings. | ||||
|     pause&goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
|  | ||||
| echo Search Design Tools: HDL Designer, Modelsim, Xilinx ISE, Microsemi Libero, Lattice Diamond | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search HDL Designer directory | ||||
| :: | ||||
| if !REQUIRE_HDS! == 1 ( | ||||
|   if "%HDS_HOME%" == "" ( | ||||
|     set HDS_HOME=C:\eda\MentorGraphics\HDS | ||||
|     if not exist !HDS_HOME!\ ( | ||||
|       set HDS_HOME=C:\tools\eda\HDS | ||||
|       if not exist !HDS_HOME!\ ( | ||||
|         echo %INDENT:"=%ERROR: No valid installation of HDL-Designer found: please verify your HDS_HOME settings. | ||||
|         pause&goto:eof | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !HDS_HOME! ( | ||||
|       echo %INDENT:"=%Found HDL-Designer   at !HDS_HOME! | ||||
|   ) else ( | ||||
|       echo %INDENT:"=%ERROR: No valid installation of HDL-Designer found: please verify your HDS_HOME settings. | ||||
|       pause&goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search Modelsim directory | ||||
| :: | ||||
| if !REQUIRE_MODELSIM! == 1 ( | ||||
|   if "%MODELSIM_HOME%" == "" ( | ||||
|     set MODELSIM_HOME=C:\eda\MentorGraphics\modelsim\win64 | ||||
|     if not exist !MODELSIM_HOME!\ ( | ||||
|       set MODELSIM_HOME=C:\eda\MentorGraphics\modelsim\win32 | ||||
|       if not exist !MODELSIM_HOME!\ ( | ||||
|         set MODELSIM_HOME=C:\tools\eda\Modelsim\win64 | ||||
|         if not exist !MODELSIM_HOME!\ ( | ||||
|           set MODELSIM_HOME=C:\tools\eda\Modelsim\win32 | ||||
|           if not exist !MODELSIM_HOME!\ ( | ||||
|             echo %INDENT:"=%ERROR: No valid installation of ModelSim found please verify your MODELSIM_HOME settings. | ||||
|             pause&goto:eof | ||||
|           ) | ||||
|         ) | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !MODELSIM_HOME! ( | ||||
|     echo %INDENT:"=%Found ModelSim       at !MODELSIM_HOME:"=! | ||||
|   ) else ( | ||||
|     echo %INDENT:"=%ERROR: No valid installation of ModelSim found please verify your MODELSIM_HOME settings. | ||||
|     pause | ||||
|     goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search Xilinx ISE directory | ||||
| :: | ||||
|  | ||||
| if !REQUIRE_ISE! == 1 ( | ||||
|   if "%ISE_HOME%" == "" ( | ||||
|     set ISE_HOME=C:\eda\Xilinx\!ISE_VERSION:"=!\ISE_DS\ISE | ||||
|     if not exist !ISE_HOME!\ ( | ||||
|       set ISE_HOME=C:\tools\eda\Xilinx\!ISE_VERSION:"=!\ISE_DS\ISE | ||||
|       if not exist !ISE_HOME!\ ( | ||||
|         echo %INDENT:"=%ERROR: No valid installation of ISE found please verify your ISE_HOME settings. | ||||
|         pause&goto:eof | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !ISE_HOME! ( | ||||
|     echo %INDENT:"=%Found ISE            at !ISE_HOME:"=! | ||||
|   ) else ( | ||||
|     echo %INDENT:"=%ERROR: No valid installation of ISE found please verify your ISE_HOME settings. | ||||
|     pause&goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search Microsemi Libero directory | ||||
| :: | ||||
| if %REQUIRE_LIBERO% == 1 ( | ||||
|   if "%LIBERO_HOME%" == "" ( | ||||
|     set LIBERO_HOME=C:\eda\Microsemi\Libero | ||||
|     if not exist !LIBERO_HOME!\ ( | ||||
|       set LIBERO_HOME=C:\tools\eda\Microsemi\Libero | ||||
|       if not exist !LIBERO_HOME!\ ( | ||||
|         echo %INDENT:"=%ERROR: No valid installation of Libero found please verify your LIBERO_HOME settings. | ||||
|         pause&goto:eof | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !LIBERO_HOME! ( | ||||
|     echo %INDENT:"=%Found Libero         at !LIBERO_HOME:"=! | ||||
|   ) else ( | ||||
|     echo %INDENT:"=%ERROR: No valid installation of Libero found please verify your LIBERO_HOME settings. | ||||
|     pause | ||||
|     goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| ::------------------------------------------------------------------------------ | ||||
| :: Search Lattice Diamond directory | ||||
| :: | ||||
| if %REQUIRE_DIAMOND% == 1 ( | ||||
|   if "%DIAMOND_HOME%" == "" ( | ||||
|     set DIAMOND_HOME=C:\eda\lscc\diamond\3.12 | ||||
|     if not exist !DIAMOND_HOME!\ ( | ||||
|       set DIAMOND_HOME=C:\tools\lscc\diamond\3.12 | ||||
|       if not exist !DIAMOND_HOME!\ ( | ||||
|         set DIAMOND_HOME=C:\lscc\diamond\3.12 | ||||
|         if not exist !DIAMOND_HOME!\ ( | ||||
|           echo %INDENT:"=%ERROR: No valid installation of Lattice Diamond found - please verify your DIAMOND_HOME settings. | ||||
|           pause&goto:eof | ||||
|         ) | ||||
|       ) | ||||
|     ) | ||||
|   ) | ||||
|   if exist !DIAMOND_HOME! ( | ||||
|     echo %INDENT:"=%Found Diamond        at !DIAMOND_HOME:"=! | ||||
|   ) else ( | ||||
|     echo %INDENT:"=%ERROR: No valid installation of Diamond found - please verify your DIAMOND_HOME settings. | ||||
|     pause | ||||
|     goto:eof | ||||
|   ) | ||||
| ) | ||||
|  | ||||
| :end | ||||
|   echo. | ||||
|   echo -- %~nx0 Finished! | ||||
|   echo %SEPARATOR% | ||||
|   echo. && echo. | ||||
|   popd | ||||
|   goto:eof | ||||
							
								
								
									
										39
									
								
								zz-solutions/01-WaveformGenerator/Scripts/start_diamond.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								zz-solutions/01-WaveformGenerator/Scripts/start_diamond.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| #!/usr/bin/perl | ||||
| # filename:          start_diamond.pl | ||||
| # created by:        Corthay Francois & Zahno Silvan & Amand Axel | ||||
| # | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # Description: | ||||
| #   Starts Diamond in the correct timezone for the Synplify License | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : start_diamond.pl <Diamond File Spec> | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # History: | ||||
| #   V0.1 : zas 08.2019 -- Initial release | ||||
| #   V0.2 : ama 02.2023 -- Adapted for Diamond | ||||
| # | ||||
| ################################################################################ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
| $verbose = 1; | ||||
| $| = 1; # forces flush on prints | ||||
|  | ||||
| $ENV{TZ} = ''; # needed to be able to run Synplify avoinding license error | ||||
| my $designerExe = "$ENV{DIAMOND_HOME}\\bin\\nt64\\pnmain.exe"; | ||||
| $diamondFileSpec = $ARGV[0]; | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Launch Diamond | ||||
| # | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "$separator\n\n"; | ||||
|   print "Launching Diamond from $designerExe\n"; | ||||
|   print $indent, "* Project file spec: $diamondFileSpec\n\n"; | ||||
|   print "$separator\n\n"; | ||||
| } | ||||
|  | ||||
| system("$designerExe $diamondFileSpec"); | ||||
							
								
								
									
										37
									
								
								zz-solutions/01-WaveformGenerator/Scripts/start_libero.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								zz-solutions/01-WaveformGenerator/Scripts/start_libero.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| #!/usr/bin/perl | ||||
| # filename:          start_libero.pl | ||||
| # created by:        Corthay Francois & Zahno Silvan | ||||
| # | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # Description: | ||||
| #   Starts Libero in the correct timezone for the Synplify License | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : start_libero.pl <Libero File Spec> | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # History: | ||||
| #   V0.1 : zas 08.2019 -- Initial release | ||||
| # | ||||
| ################################################################################ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
| $verbose = 1; | ||||
|  | ||||
| $ENV{TZ} = ''; # needed to be able to run Synplify avoinding license error | ||||
| my $designerExe = "$ENV{LIBERO_HOME}\\Designer\\bin\\libero.exe"; | ||||
| $liberoFileSpec = $ARGV[0]; | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Launch Libero | ||||
| # | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\n"; | ||||
|   print "launching $designerExe\n"; | ||||
|   print $indent, "project file spec: $liberoFileSpec\n"; | ||||
|   print "$separator\n"; | ||||
| } | ||||
|  | ||||
| system("$designerExe $liberoFileSpec"); | ||||
							
								
								
									
										163
									
								
								zz-solutions/01-WaveformGenerator/Scripts/trimLibs.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										163
									
								
								zz-solutions/01-WaveformGenerator/Scripts/trimLibs.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,163 @@ | ||||
| #!/usr/bin/perl | ||||
| # ------------------------------------------------------------------------------ | ||||
| # trimLibs | ||||
| #   Comment regular libraries in an concatenated file | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : trimlibs.pl <Input File Name> <Output File Name> | ||||
| # ------------------------------------------------------------------------------ | ||||
| #  Authors: | ||||
| #    cof: [Fran<61>ois Corthay](francois.corthay@hevs.ch) | ||||
| #    guo: [Oliver A. Gubler](oliver.gubler@hevs.ch) | ||||
| #    zas: [Silvan Zahno](silvan.zahno@hevs.ch) | ||||
| #    gal: [Laurent Gauch] | ||||
| # ------------------------------------------------------------------------------ | ||||
| # Changelog: | ||||
| #   2019.08.23 : cof | ||||
| #     * Comment "omment "FOR xxxx : yyy USE ENTITY zzz;"" instead all "For All ... work" lines | ||||
| #     * Seen problems in ELN_Kart | ||||
| #   2019.06.11 : zas | ||||
| #     * Comment "For All .... work."" instead all "For All" lines | ||||
| #     * Allow Outputfilename as Env var or as Script parameter | ||||
| #	  2015-08-25 : guo | ||||
| #	    * added unisim to the list of excluded libraries | ||||
| #   2015-05-08 : guo | ||||
| #     * added verbosity debug | ||||
| #     * changed this header | ||||
| #     * minor comment modifications | ||||
| #  2013-08-13 : zas guo | ||||
| #     Handle error if environment variable not found, character'pos('$') -> ') | ||||
| #     was found as env var, added exception | ||||
| #   2013-06-13 : cof zas guo | ||||
| #     Remove comments from testline | ||||
| #   2013-01-09 : cof  -- | ||||
| #     * Bugfix: no carriage return on commented "use" statements | ||||
| #     * Bugfix: more precise targeting of "library" statement | ||||
| #     * Bugfix: "Library" test after "use" test | ||||
| #   2012-04-27 : zas | ||||
| #     * Bugfix: on feature added in version 2011-06-10 | ||||
| #   2012-02-02 : zas | ||||
| #     * Write the output into a new file with the name defined in the | ||||
| #     * $DESIGN_NAME variable | ||||
| #   2012-01-23 : zas | ||||
| #     * Replaces $env_var_name by the value of the found environmemnt variable. | ||||
| #     * Mostly used to replace $SIMULATION_DIR for initialise bram's from a file | ||||
| #     * placed in the Simulation Directory | ||||
| #   2011-06-10 : zas | ||||
| #     Replaces | ||||
| #       library xxx;use xxx.yyy.all; | ||||
| #     with | ||||
| #       --library xxx; | ||||
| #       use work.yyy.all; | ||||
| #   2005...2011 : cof | ||||
| #     Improvements | ||||
| #   2005-01-29 : gal | ||||
| #	    initlial release | ||||
| # ------------------------------------------------------------------------------ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
| $hdlInFileSpec = $ARGV[0]; | ||||
| if (defined $ARGV[1]) { | ||||
|   $hdlOutFileSpec = $ARGV[1]; | ||||
| } | ||||
| else { | ||||
|   $hdlOutFileSpec = 'trimmed.vhd'; | ||||
| } | ||||
|  | ||||
| $verbose = 1; | ||||
| $debug = 0; | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # program I/O files | ||||
| # | ||||
| $tempFileSpec = $hdlOutFileSpec . '.tmp'; | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\n$separator\n"; | ||||
|   print "Trimming library declarations from $hdlInFileSpec to $hdlOutFileSpec\n"; | ||||
|   print $indent, "temporary file spec: $tempFileSpec\n"; | ||||
| } | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # read original file, edit and save to temporary file | ||||
| # | ||||
| my $line; | ||||
|  | ||||
| open(HDLFile, $hdlInFileSpec) || die "couldn't open $HDLFileSpec!"; | ||||
| open(tempFile, ">$tempFileSpec"); | ||||
| while (chop($line = <HDLFile>)) { | ||||
|  | ||||
|   # remove all comment for the test | ||||
|   my $testline = $line; | ||||
|   $testline =~ s/--.*//; | ||||
|  | ||||
|   # Replace 'use xxx.yyy' with 'use work.yyy', except if xxx is ieee or std or unisim or ecp5u | ||||
|   if ($testline =~ m/use\s.*\.all\s*;/i) { | ||||
|     if ( not($testline =~ m/\bieee\./i) and | ||||
| 		 not($testline =~ m/\bstd\./i)  and | ||||
| 		 not($testline =~ m/\bunisim\./i) and | ||||
|      not($testline =~ m/\becp5u\./i)) { | ||||
|       # if there is any char before "use" except \s, insert new line \n | ||||
|       if ( ($testline =~ m/[^\s]\s*use/i) ) { | ||||
|         $line =~ s/use\s+.*?\./\nuse work./i; | ||||
|         if ($debug == 1) { | ||||
|           print "TEST0099: ", $testline, "\n" | ||||
|         } | ||||
|       } | ||||
|       else { | ||||
|         $line =~ s/use\s+.*?\./use work./i; | ||||
|         if ($debug == 1) { | ||||
|           print "TEST0105: ", $testline, "\n" | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   # Comment libraries which aren't ieee or std or unisim or ecp5u | ||||
|   if (($testline =~ m/\slibrary\s+/i) or ($testline =~ m/\Alibrary\s+/i)) { | ||||
|     if ( not($testline =~ m/ieee/i) and | ||||
| 		 not($testline =~ m/std/i) and | ||||
| 		 not($testline =~ m/unisim/i) and | ||||
|      not($testline =~ m/ecp5u/i)) { | ||||
|       $line = '-- ' . $line; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   # Comment "FOR xxxx : yyy USE ENTITY zzz; | ||||
|   if ($line =~ m/for\s+.+:.+\s+use\s+entity/i) { | ||||
|     $line = '-- ' . $line; | ||||
|   } | ||||
|  | ||||
|   # Search for $Env_Var_Names and replace them by the value of the env_var | ||||
|   if ($testline =~ m/(\$[^\s\/.'"\\]+)/i) { | ||||
|     $envvar = $1; | ||||
|     $envvar =~ s/^.//; | ||||
|     eval { | ||||
|       $line =~ s/\$$envvar/$ENV{$envvar}/; | ||||
|     }; | ||||
|     if ($@) { | ||||
|       print ("WARNING: Environment Variable not found: $envvar \n") | ||||
|     } | ||||
|  | ||||
|   } | ||||
|  | ||||
|   print tempFile ("$line\n"); | ||||
| } | ||||
|  | ||||
| close(tempFile); | ||||
| close(HDLFile); | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # delete original file and rename temporary file | ||||
| # | ||||
| unlink($hdlOutFileSpec); | ||||
| rename($tempFileSpec, $hdlOutFileSpec); | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "$separator\n"; | ||||
| } | ||||
|  | ||||
| #if ($verbose == 1) { | ||||
| #  print $indent, "Hit any <CR> to continue"; | ||||
| #  $dummy = <STDIN>; | ||||
| #} | ||||
							
								
								
									
										129
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_diamond.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										129
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_diamond.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,129 @@ | ||||
| #!/usr/bin/perl | ||||
| # filename:          update_diamond.pl | ||||
| # created by:        Corthay Francois & Zahno Silvan & Amand Axel | ||||
| # | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # Description: | ||||
| #   Updates the file references in the .ldf Lattice project file | ||||
| #   and launches the Diamond project manager | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : update_diamond.pl <Diamond File Spec> <VHDL File Spec> <LPF File Spec> | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # History: | ||||
| #   V0.1 : cof 12.2013 -- Initial release | ||||
| #   V0.2 : zas 08.2019 -- Changed actel to libero | ||||
| #   V0.3 : ama 02.2023 -- Adapted for diamond | ||||
| # | ||||
| ################################################################################ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
| $verbose = 1; | ||||
| $| = 1; # forces flush on prints | ||||
|  | ||||
| $ENV{TZ} = ''; # needed to be able to run Synplify avoinding license error | ||||
| my $designerExe = "$ENV{DIAMOND_HOME}\\bin\\nt64\\pnmain.exe"; | ||||
| $diamondFileSpec = $ARGV[0]; | ||||
| $vhdlFileSpec = $ARGV[1]; | ||||
| $lpfFileSpec = $ARGV[2]; | ||||
|  | ||||
| use File::Basename; | ||||
| $diamond_dir  = dirname(dirname($vhdlFileSpec)) . '/diamond/'; # get up concat and into diamond | ||||
| $projectTitle = basename($diamondFileSpec, ".ldf"); | ||||
|  | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "Script Parameters:\n"; | ||||
|   print "  * diamondFileSpec: $diamondFileSpec\n"; | ||||
|   print "  * vhdlFileSpec: $vhdlFileSpec\n"; | ||||
|   print "  * lpfFileSpec: $lpfFileSpec\n"; | ||||
|   print "  * Project title: $projectTitle\n" | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Project variables | ||||
| # | ||||
|  | ||||
| $diamondWorkFileSpec = $diamondFileSpec . '.tmp'; | ||||
| 															  # source directory | ||||
| my $sourceDir = "$ENV{CONCAT_DIR}"; | ||||
| my $projectDir = "$ENV{DIAMOND_WORK_DIR}"; | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Update paths in the project file | ||||
| # | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\n$separator\n\n"; | ||||
|   print "Updating file specifications in $diamondFileSpec\n"; | ||||
|   print $indent, "temporary file spec: $diamondWorkFileSpec\n"; | ||||
| } | ||||
| my $line; | ||||
| if ( !open(DiamondFile, $diamondFileSpec) ){ | ||||
|   print("\nCould not open $diamondFileSpec !\nExiting (failure)\n\n"); | ||||
|   die "\nCould not open $diamondFileSpec !\nExiting (failure)\n\n"; | ||||
| } | ||||
|  | ||||
| open(workFile, ">$diamondWorkFileSpec"); | ||||
| while (chop($line = <DiamondFile>)) { | ||||
|  | ||||
|                                                         # replace title | ||||
|   if ($line =~ m/<BaliProject.*title=".*"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing title line\n";} | ||||
|     $line =~ s/title=".*?"/title="$projectTitle"/; | ||||
|   } | ||||
|                                                         # replace VHDL file spec | ||||
|   if ($line =~ m/<Source\sname=".*\.vhd"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing VHDL line\n";} | ||||
|     $line =~ s/".*\.vhd"/"$vhdlFileSpec"/; | ||||
|   } | ||||
|                                                          # replace LPF file spec | ||||
|   if ($line =~ m/<Source\sname=".*\.lpf"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing LPF line\n";} | ||||
|     $line =~ s/".*\.lpf"/"$lpfFileSpec"/; | ||||
|   } | ||||
|                                                          # replace RVA file spec | ||||
|   if ($line =~ m/<Source\sname="(.*\.rva)"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing RVA line\n";} | ||||
|     $tpath = $diamond_dir . basename($1); | ||||
|     $line =~ s/".*\.rva"/"$tpath"/; | ||||
|   } | ||||
|                                                          # replace RVL file spec | ||||
|   if ($line =~ m/<Source\sname="(.*\.rvl)"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing RVL line\n";} | ||||
|     $tpath = $diamond_dir . basename($1); | ||||
|     $line =~ s/".*\.rvl"/"$tpath"/; | ||||
|   } | ||||
|                                                          # replace XCF file spec | ||||
|   if ($line =~ m/<Source\sname="(.*\.xcf)"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing XCF line\n";} | ||||
|     $tpath = $diamond_dir . basename($1); | ||||
|     $line =~ s/".*\.xcf"/"$tpath"/; | ||||
|   } | ||||
|                                                          # replace strategy | ||||
|   if ($line =~ m/<Strategy\sfile="(.*\.sty)"/i) { | ||||
|     if ($verbose == 1) {print " * Replacing Strategy line\n";} | ||||
|     $tpath = $diamond_dir . basename($1); | ||||
|     $line =~ s/".*\.sty"/"$tpath"/; | ||||
|   } | ||||
|  | ||||
|   print workFile ("$line\n"); | ||||
| } | ||||
|  | ||||
| close(workFile); | ||||
| close(DiamondFile); | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # delete original file and rename temporary file | ||||
| # | ||||
| unlink($diamondFileSpec); | ||||
| rename($diamondWorkFileSpec, $diamondFileSpec); | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\nDone\n\n"; | ||||
|   print "$separator\n\n"; | ||||
| } | ||||
							
								
								
									
										91
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_ise.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_ise.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,91 @@ | ||||
| #!/usr/bin/perl | ||||
| # ------------------------------------------------------------------------------ | ||||
| # update_ise | ||||
| #   replace ucf and vhd filelocation and name in the Xilinx xise project file | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : update_ise.pl <ISE File Spec> <VHDL File Spec> <UCF File Spec> | ||||
| # ------------------------------------------------------------------------------ | ||||
| # Changelog: | ||||
| #   2019-06-12 : zas | ||||
| #     * All parameters given with agruments instead of env variables | ||||
| #   2015-05-26 : guo | ||||
| #     * update to environment from HELS v.15.0526 | ||||
| #   2012-05-27 : cof | ||||
| #     * Initial release | ||||
| # ------------------------------------------------------------------------------ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
|  | ||||
| $iseFileSpec = $ARGV[0]; | ||||
| $vhdlFileSpec = $ARGV[1]; | ||||
| $ucfFileSpec = $ARGV[2]; | ||||
|  | ||||
| $verbose = 1; | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "Script Parameters:\n"; | ||||
|   print "  * iseFileSpec: $iseFileSpec\n"; | ||||
|   print "  * vhdlFileSpec: $vhdlFileSpec\n"; | ||||
|   print "  * ucfFileSpec: $ucfFileSpec\n"; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # program I/O files | ||||
| # | ||||
| $tempFileSpec = $iseFileSpec . '.tmp'; | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\n$separator\n"; | ||||
|   print "Updating file specifications in $iseFileSpec\n"; | ||||
|   print $indent, "temporary file spec: $tempFileSpec\n"; | ||||
| } | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # read original file, edit and save to temporary file | ||||
| # | ||||
| my $line; | ||||
|  | ||||
| open(ISEFile, $iseFileSpec) || die "couldn't open $iseFileSpec!"; | ||||
| open(tempFile, ">$tempFileSpec"); | ||||
| while (chop($line = <ISEFile>)) { | ||||
|                                                             # replace VHDL files | ||||
|   if ($line =~ m/FILE_VHDL/i) { | ||||
|     $line =~ s/<file\s+xil_pn\:name=.*?".+?"/<file xil_pn:name="$vhdlFileSpec"/ig; | ||||
|   } | ||||
|                                                             # replace EDIF files | ||||
|   if ($line =~ m/FILE_EDIF/i) { | ||||
|     $line =~ s/<file\s+xil_pn\:name=.*?".+?"/<file xil_pn:name="$edifFileSpec"/ig; | ||||
|   } | ||||
|                                                              # replace UCF files | ||||
|   if ($line =~ m/FILE_UCF/i) { | ||||
|     $line =~ s/<file\s+xil_pn\:name=.*?".+?"/<file xil_pn:name="$ucfFileSpec"/ig; | ||||
|   } | ||||
|                                                       # Implementation Top files | ||||
|   if ($line =~ m/\.vhd"/i) { | ||||
|     $line =~ s/<property\s+xil_pn:name="Implementation\s+Top\s+File"\s+xil_pn\:value=".+?"/<property xil_pn:name="Implementation Top File" xil_pn:value="$vhdlFileSpec"/ig; | ||||
|   } | ||||
|   if ($line =~ m/\.edf"/i) { | ||||
|     $line =~ s/<property\s+xil_pn:name="Implementation\s+Top\s+File"\s+xil_pn\:value=".+?"/<property xil_pn:name="Implementation Top File" xil_pn:value="$edifFileSpec"/ig; | ||||
|   } | ||||
|                                                            # replace UCF binding | ||||
|   if ($line =~ m/\.ucf"/i) { | ||||
|     $line =~ s/<binding\s+(.+)\s+xil_pn\:name=.*?".+?"/<binding $1 xil_pn:name="$ucfFileSpec"/ig; | ||||
|   } | ||||
|  | ||||
|   print tempFile ("$line\n"); | ||||
| } | ||||
|  | ||||
| close(tempFile); | ||||
| close(ISEFile); | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # delete original file and rename temporary file | ||||
| # | ||||
| unlink($iseFileSpec); | ||||
| rename($tempFileSpec, $iseFileSpec); | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "$separator\n"; | ||||
| } | ||||
							
								
								
									
										107
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_libero.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								zz-solutions/01-WaveformGenerator/Scripts/update_libero.pl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,107 @@ | ||||
| #!/usr/bin/perl | ||||
| # filename:          update_libero.pl | ||||
| # created by:        Corthay Francois & Zahno Silvan | ||||
| # | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # Description: | ||||
| #   Updates the file references in the .prjx Actel project file | ||||
| #   and launches the Libero project manager | ||||
| #   Help Parameter : <?> | ||||
| #   Parameter : update_libero.pl <Libero File Spec> <VHDL File Spec> <^PDC File Spec> | ||||
| #------------------------------------------------------------------------------- | ||||
| # | ||||
| # History: | ||||
| #   V0.1 : cof 12.2013 -- Initial release | ||||
| #   V0.2 : zas 08.2019 -- Changed actel to libero | ||||
| # | ||||
| ################################################################################ | ||||
|  | ||||
| $separator = '-' x 79; | ||||
| $indent = ' ' x 2; | ||||
| $verbose = 1; | ||||
|  | ||||
| $ENV{TZ} = ''; # needed to be able to run Synplify avoinding license error | ||||
| my $designerExe = "$ENV{LIBERO_HOME}\\Designer\\bin\\libero.exe"; | ||||
| $liberoFileSpec = $ARGV[0]; | ||||
| $vhdlFileSpec = $ARGV[1]; | ||||
| $pdcFileSpec = $ARGV[2]; | ||||
|  | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "Script Parameters:\n"; | ||||
|   print "  * liberoFileSpec: $liberoFileSpec\n"; | ||||
|   print "  * vhdlFileSpec: $vhdlFileSpec\n"; | ||||
|   print "  * pdcFileSpec: $pdcFileSpec\n"; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Project variables | ||||
| # | ||||
| $liberoWorkFileSpec = $liberoFileSpec . '.tmp'; | ||||
| 															  # source directory | ||||
| my $sourceDir = "$ENV{CONCAT_DIR}"; | ||||
| my $projectDir = "$ENV{LIBERO_WORK_DIR}"; | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Update paths in the project file | ||||
| # | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "\n$separator\n"; | ||||
|   print "Updating file specifications in $liberoFileSpec\n"; | ||||
|   print $indent, "temporary file spec: $liberoWorkFileSpec\n"; | ||||
| } | ||||
| my $line; | ||||
|  | ||||
| open(LiberoFile, $liberoFileSpec) || die "couldn't open $HDLFileSpec!"; | ||||
| open(workFile, ">$liberoWorkFileSpec"); | ||||
| while (chop($line = <LiberoFile>)) { | ||||
|                                                            # replace source path | ||||
|   if ($line =~ m/DEFAULT_IMPORT_LOC/i) { | ||||
|     $line =~ s/".*"/"$sourceDir"/; | ||||
|   } | ||||
|                                                           # replace project path | ||||
|   if ($line =~ m/ProjectLocation/i) { | ||||
|     $line =~ s/".*"/"$projectDir"/; | ||||
|   } | ||||
|                                                         # replace VHDL file spec | ||||
|   if ($line =~ m/VALUE\s".*,hdl"/i) { | ||||
|     $line =~ s/".*"/"$vhdlFileSpec,hdl"/; | ||||
|   } | ||||
|                                                          # replace PDC file spec | ||||
|   if ($line =~ m/VALUE\s".*\.pdc,pdc"/i) { | ||||
|     $line =~ s/".*"/"$pdcFileSpec,pdc"/; | ||||
|   } | ||||
|  | ||||
|   print workFile ("$line\n"); | ||||
| } | ||||
|  | ||||
| close(workFile); | ||||
| close(LiberoFile); | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # delete original file and rename temporary file | ||||
| # | ||||
| unlink($liberoFileSpec); | ||||
| rename($liberoWorkFileSpec, $liberoFileSpec); | ||||
|  | ||||
| if ($verbose == 1) { | ||||
|   print "$separator\n"; | ||||
| } | ||||
|  | ||||
| #------------------------------------------------------------------------------- | ||||
| # Launch Libero | ||||
| # | ||||
|  | ||||
| #if ($verbose == 1) { | ||||
| #  print "\n"; | ||||
| #  print "launching $designerExe\n"; | ||||
| #  print $indent, "project file spec: $liberoFileSpec\n"; | ||||
| #  print "$separator\n"; | ||||
| #} | ||||
|  | ||||
| #system("$designerExe $liberoFileSpec"); | ||||
		Reference in New Issue
	
	Block a user