-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrapper.sh
executable file
·41 lines (36 loc) · 913 Bytes
/
wrapper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# My hacky script for bypassing the fact that I do not understand
# how to not have a flat project structure when using apio.
# It literary just moves the relevant files up to the root folder when
# needed, moves generated files to its respective folders and cleans
# the root folder when done. It works, I am happy.
# Quality of life aliases:
# alias s="./wrapper.sh sim"
# alias b="./wrapper.sh build"
if [ ! -d "simulation" ]; then
mkdir simulation
fi
if [ ! -d "synthesis" ]; then
mkdir synthesis
fi
if [ "$1" = "sim" ]; then
cp hdl/*.v .
cp hdl/modules/*.v .
if [ -z $2 ]; then
cp test/*.v .
else
cp $2 .
fi
apio sim
rm *.v
mv *.vcd simulation
mv *.out simulation
elif [ "$1" = "build" ]; then
cp hdl/*.v .
cp hdl/modules/*.v .
apio build
mv hardware.* synthesis
rm *.v
else
echo "Unknown argument..."
fi