|
3 | 3 | #------------------------------------------------------------- |
4 | 4 | # Install SVUT from https://github.com/dpretet/svut if missing |
5 | 5 | #------------------------------------------------------------- |
| 6 | +install_svut() { |
| 7 | + if [[ ! $(type svutRun) ]]; |
| 8 | + then |
| 9 | + svut_dir="$DIR/.svut" |
| 10 | + if [[ ! -d $svut_dir ]]; then |
| 11 | + echo "INFO: Install SVUT (https://github.com/dpretet/svut)" |
| 12 | + git clone "https://github.com/dpretet/svut.git" "$svut_dir" |
| 13 | + fi |
| 14 | + echo "INFO: Enable SVUT in PATH" |
| 15 | + export PATH=$svut_dir/:$PATH |
| 16 | + fi |
| 17 | +} |
| 18 | + |
| 19 | +#------------------------------------------------------------- |
| 20 | +# Install Verilator with brew |
| 21 | +#------------------------------------------------------------- |
| 22 | +install_verilator() { |
| 23 | + if [[ ! $(type verilator) ]]; |
| 24 | + then |
| 25 | + echo "INFO: Enable Verilator" |
| 26 | + brew install verilator |
| 27 | + verilator -V |
| 28 | + fi |
| 29 | +} |
6 | 30 |
|
7 | | -# Get current script path (applicable even if is a symlink) |
8 | | -SOURCE="${BASH_SOURCE[0]}" |
9 | | -while [ -h "$SOURCE" ]; do |
10 | | - DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" |
11 | | - SOURCE="$(readlink "$SOURCE")" |
12 | | - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" |
13 | | -done |
14 | | -DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" |
| 31 | +#------------------------------------------------------------- |
| 32 | +# Install Icarus-verilog with brew |
| 33 | +#------------------------------------------------------------- |
| 34 | +install_icarus() { |
| 35 | + if [[ ! $(type iverilog) ]]; |
| 36 | + then |
| 37 | + echo "INFO: Enable Icarus-Verilog" |
| 38 | + brew install icarus-verilog |
| 39 | + iverilog -V |
| 40 | + fi |
| 41 | +} |
15 | 42 |
|
16 | | -# Clone SVUT and setup $PATH |
17 | | -if [[ ! $(type svutRun) ]]; |
18 | | -then |
19 | | - svut_dir="$DIR/.svut" |
20 | | - if [[ ! -d $svut_dir ]]; then |
21 | | - echo "INFO: Install SVUT (https://github.com/dpretet/svut)" |
22 | | - git clone "https://github.com/dpretet/svut.git" "$svut_dir" |
| 43 | +#------------------------------------------------------------- |
| 44 | +# Install Icarus-verilog with brew |
| 45 | +#------------------------------------------------------------- |
| 46 | +install_icarus() { |
| 47 | + if [[ ! $(type yosys) ]]; |
| 48 | + then |
| 49 | + echo "INFO: Enable Yosys" |
| 50 | + brew install yosys |
| 51 | + iverilog -V |
23 | 52 | fi |
24 | | - echo "INFO: Enable SVUT in PATH" |
25 | | - export PATH=$svut_dir/:$PATH |
26 | | -fi |
| 53 | +} |
0 commit comments