1818
1919set -e
2020
21- CURRENT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
22- source ${CURRENT_DIR} /common.sh
23-
24- # -- validate input ----------------------------------------------------------
25-
26- function help() {
27- echo
28- echo " Build examples from the repository"
29- echo
30- echo " Syntax: $0 fpga_family [examples]..."
31- echo " Arguments:"
32- echo " fpga_family - A supported FPGA family"
33- echo " examples - A name of an available example"
34- echo
35- }
36-
3721if [[ ! $# -ge 1 ]]; then
38- echo " Invalid number of arguments!"
39- help
22+ echo " ERROR: Invalid number of arguments!" >&2
23+ echo " Please, provide: path/to/build-examples.sh <fpga_family> <example>... " >&2
4024 exit 1
4125fi
4226
43- # -- tuttest -----------------------------------------------------------------
44-
4527fpga_family=$1
4628shift
4729
5436fi
5537
5638# activate conda and enter example dir
57- activate_env=" docs/building-examples.rst:export-install-dir,fpga-fam-$fpga_family ,conda-prep-env,f4pga-env-bin,f4pga-env-share- $fpga_family ,conda-act- env"
39+ activate_env=" docs/building-examples.rst:export-install-dir,fpga-fam-$fpga_family ,conda-env"
5840snippets=" ${activate_env} ,enter-dir-$fpga_family "
5941
6042case " $fpga_family " in
6143 xc7) for example in $examples ; do
6244 case $example in
63- " counter" ) tuttest_exec ${snippets} xc7/counter_test/README.rst:example-counter-* -group ;;
64- " picosoc" ) tuttest_exec ${snippets} xc7/picosoc_demo/README.rst:example-picosoc-* -group ;;
65- " litex" ) tuttest_exec ${snippets} xc7/litex_demo/README.rst:example-litex-dir,example-litex-req,example-litex_picorv32-* -group,example-litex_vexriscv-* -group ;;
66- " litex_linux" ) tuttest_exec ${snippets} xc7/linux_litex_demo/README.rst:example-litex-* -group ;;
67- " litex_sata" ) tuttest_exec ${snippets} xc7/litex_sata_demo/README.rst:example-litex-sata-* -group ;;
45+ " counter" ) tuttest ${snippets} xc7/counter_test/README.rst:example-counter-* -group ;;
46+ " picosoc" ) tuttest ${snippets} xc7/picosoc_demo/README.rst:example-picosoc-* -group ;;
47+ " litex" ) tuttest ${snippets} xc7/litex_demo/README.rst:example-litex-dir,example-litex-req,example-litex_picorv32-* -group,example-litex_vexriscv-* -group ;;
48+ " litex_linux" ) tuttest ${snippets} xc7/linux_litex_demo/README.rst:example-litex-* -group ;;
49+ " litex_sata" ) tuttest ${snippets} xc7/litex_sata_demo/README.rst:example-litex-sata-* -group ;;
6850
6951 # Additional examples:
70- " button_controller" ) tuttest_exec ${activate_env} ,enter-dir- $fpga_family xc7/additional_examples/button_controller/README.rst:additional-examples,example-debouncer-basys3 ;;
71- " pulse_width_led" ) tuttest_exec ${snippets} xc7/pulse_width_led/README.rst:example-pulse-arty-35t ;;
72- " timer" ) tuttest_exec ${snippets} xc7/timer/README.rst:example-watch-basys3 ;;
52+ " button_controller" ) tuttest ${snippets} xc7/additional_examples/button_controller/README.rst:additional-examples,example-debouncer-basys3 ;;
53+ " pulse_width_led" ) tuttest ${snippets} xc7/pulse_width_led/README.rst:example-pulse-arty-35t ;;
54+ " timer" ) tuttest ${snippets} xc7/timer/README.rst:example-watch-basys3 ;;
7355
7456 # Project F examples
7557 " hello" ) for helloexample in A B C D E F G H I J; do
76- tuttest_exec ${activate_env} projf-makefiles/hello/hello-arty/${helloexample} /README.rst:hello-arty-${helloexample,,}
58+ tuttest ${activate_env} projf-makefiles/hello/hello-arty/${helloexample} /README.rst:hello-arty-${helloexample,,}
7759 done ;;
7860 " hello-k" ) for helloexample in K L; do
79- tuttest_exec ${activate_env} projf-makefiles/hello/hello-arty/${helloexample} /README.rst:hello-arty-${helloexample,,}
61+ tuttest ${activate_env} projf-makefiles/hello/hello-arty/${helloexample} /README.rst:hello-arty-${helloexample,,}
8062 done ;;
8163 * ) echo " ERROR: Unknown example name: $example " >&2
8264 exit 1 ;;
@@ -85,7 +67,7 @@ case "$fpga_family" in
8567 ;;
8668 eos-s3) for example in $examples ; do
8769 case $example in
88- " counter" ) tuttest_exec ${snippets} eos-s3/btn_counter/README.rst:eos-s3-counter ;;
70+ " counter" ) tuttest ${snippets} eos-s3/btn_counter/README.rst:eos-s3-counter ;;
8971 * ) echo " ERROR: Unknown example name: $example " >&2
9072 exit 1 ;;
9173 esac
0 commit comments