From b6c44a88705c534975db04143041ffa56eef4c45 Mon Sep 17 00:00:00 2001 From: Hannu Vuolasaho Date: Fri, 29 Jun 2018 21:26:46 +0300 Subject: Cyclone 1,2,3 support for compile-altera.sh Quartus 13 is last version which supported older devices. Also first supported version of script. TODO: Port support to Windows, maybe add more file existence testing. --- libraries/vendors/compile-altera.sh | 60 ++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh index 46cccfde1..c075244e5 100755 --- a/libraries/vendors/compile-altera.sh +++ b/libraries/vendors/compile-altera.sh @@ -513,7 +513,63 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_ARRIA" == "TRUE" ] && [ $SKIP_LARGE_F GHDLCompilePackages fi +# compile Cyclone library +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then + Library="cyclone" + Files=( + cyclone_atoms.vhd + cyclone_components.vhd + ) + # append absolute source path + SourceFiles=() + for File in ${Files[@]}; do + #Don't put nonexisting files. + if [ -f "$SourceDirectory/$File" ]; then + SourceFiles+=("$SourceDirectory/$File") + fi + done + + GHDLCompilePackages +fi +# compile CycloneII library +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then + Library="cycloneii" + Files=( + cycloneii_atoms.vhd + cycloneii_components.vhd + ) + + # append absolute source path + SourceFiles=() + for File in ${Files[@]}; do + #Don't put nonexisting files. + if [ -f "$SourceDirectory/$File" ]; then + SourceFiles+=("$SourceDirectory/$File") + fi + done + + GHDLCompilePackages +fi +# compile Cyclone IIIlibrary +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then + Library="cycloneiii" + Files=( + cycloneiii_atoms.vhd + cycloneiii_components.vhd + ) + + # append absolute source path + SourceFiles=() + for File in ${Files[@]}; do + #Don't put nonexisting files. + if [ -f "$SourceDirectory/$File" ]; then + SourceFiles+=("$SourceDirectory/$File") + fi + done + + GHDLCompilePackages +fi # compile CycloneIV library if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then Library="cycloneiv" @@ -583,7 +639,9 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then # append absolute source path SourceFiles=() for File in ${Files[@]}; do - SourceFiles+=("$SourceDirectory/$File") + if [ -f "$SourceDirectory/$File" ]; then + SourceFiles+=("$SourceDirectory/$File") + fi done GHDLCompilePackages -- cgit v1.2.3 From f1bbe1639383cbb750667c1a3c542b176cf0ae46 Mon Sep 17 00:00:00 2001 From: Hannu Vuolasaho Date: Sat, 30 Jun 2018 00:34:00 +0300 Subject: Fixes for compile-altera.sh based on feedback --- libraries/vendors/compile-altera.sh | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh index c075244e5..3de2789b3 100755 --- a/libraries/vendors/compile-altera.sh +++ b/libraries/vendors/compile-altera.sh @@ -524,9 +524,12 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then # append absolute source path SourceFiles=() for File in ${Files[@]}; do + FullPath="$SourceDirectory/$File" #Don't put nonexisting files. - if [ -f "$SourceDirectory/$File" ]; then - SourceFiles+=("$SourceDirectory/$File") + if [ -f $FullPath ]; then + SourceFiles+=($FullPath) + elif [ $SUPPRESS_WARNINGS -eq 0 ] ; then + echo -e "${ANSI_YELLOW}File ${FullPath} not found.${ANSI_NOCOLOR}" fi done @@ -543,15 +546,18 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then # append absolute source path SourceFiles=() for File in ${Files[@]}; do + FullPath="$SourceDirectory/$File" #Don't put nonexisting files. - if [ -f "$SourceDirectory/$File" ]; then - SourceFiles+=("$SourceDirectory/$File") + if [ -f $FullPath ]; then + SourceFiles+=($FullPath) + elif [ $SUPPRESS_WARNINGS -eq 0 ] ; then + echo -e "${ANSI_YELLOW}File ${FullPath} not found.${ANSI_NOCOLOR}" fi done GHDLCompilePackages fi -# compile Cyclone IIIlibrary +# compile Cyclone III library if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then Library="cycloneiii" Files=( @@ -562,9 +568,12 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then # append absolute source path SourceFiles=() for File in ${Files[@]}; do + FullPath="$SourceDirectory/$File" #Don't put nonexisting files. - if [ -f "$SourceDirectory/$File" ]; then - SourceFiles+=("$SourceDirectory/$File") + if [ -f $FullPath ]; then + SourceFiles+=($FullPath) + elif [ $SUPPRESS_WARNINGS -eq 0 ] ; then + echo -e "${ANSI_YELLOW}File ${FullPath} not found.${ANSI_NOCOLOR}" fi done @@ -639,8 +648,12 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CYCLONE" == "TRUE" ]; then # append absolute source path SourceFiles=() for File in ${Files[@]}; do - if [ -f "$SourceDirectory/$File" ]; then - SourceFiles+=("$SourceDirectory/$File") + FullPath="$SourceDirectory/$File" + #Don't put nonexisting files. + if [ -f $FullPath ]; then + SourceFiles+=($FullPath) + elif [ $SUPPRESS_WARNINGS -eq 0 ] ; then + echo -e "${ANSI_YELLOW}File ${FullPath} not found.${ANSI_NOCOLOR}" fi done -- cgit v1.2.3