Skip to content

Commit 861cca8

Browse files
committed
ci/scripts: cleanup
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 524dfb6 commit 861cca8

File tree

4 files changed

+22
-82
lines changed

4 files changed

+22
-82
lines changed

.github/scripts/build-examples.sh

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,12 @@
1818

1919
set -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-
3721
if [[ ! $# -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
4125
fi
4226

43-
# -- tuttest -----------------------------------------------------------------
44-
4527
fpga_family=$1
4628
shift
4729

@@ -54,29 +36,29 @@ esac
5436
fi
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"
5840
snippets="${activate_env},enter-dir-$fpga_family"
5941

6042
case "$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

.github/scripts/common.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/scripts/install-toolchain.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,16 @@
1818

1919
set -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 "Install the F4PGA toolchain as described in the sphinx documentation"
29-
echo
30-
echo "Syntax: $0 fpga_family os"
31-
echo "Arguments:"
32-
echo " fpga_family - A supported FPGA family"
33-
echo " os - A supported operating system"
34-
echo
35-
}
36-
3721
if [[ ! $# -eq 2 ]]; then
38-
echo "ERROR: Invalid number of arguments" >&2
39-
help >&2
22+
echo "ERROR: Two arguments are required!" >&2
23+
echo "Please, provide: path/to/install-toolchain.sh <fpga_family> <os>" >&2
4024
exit 1
4125
fi
4226

43-
# -- tuttest ------------------------------------------------------------------
44-
27+
# A supported FPGA family
4528
fpga_family=$1
29+
30+
# A supported operating system
4631
os=$2
4732

48-
tuttest_exec docs/getting.rst:install-reqs-$os,wget-conda,conda-install-dir,fpga-fam-$fpga_family,env-setup
33+
tuttest "docs/getting.rst:install-reqs-$os,wget-conda,conda-install-dir,fpga-fam-$fpga_family,env-setup"

docs/building-examples.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ Select your FPGA family:
2929
3030
FPGA_FAM="eos-s3"
3131
32-
Next, prepare the environment:
32+
Next, prepare and activate the environment:
3333

3434
.. code-block:: bash
35-
:name: conda-prep-env
35+
:name: conda-env
3636
3737
export PATH="$F4PGA_INSTALL_DIR/$FPGA_FAM/install/bin:$PATH";
3838
source "$F4PGA_INSTALL_DIR/$FPGA_FAM/conda/etc/profile.d/conda.sh"
3939
40-
Finally, enter your working Conda environment:
41-
42-
.. code-block:: bash
43-
:name: conda-act-env
44-
4540
conda activate $FPGA_FAM
4641
4742
.. tip::

0 commit comments

Comments
 (0)