diff options
author | rahulp13 | 2022-02-21 17:17:35 +0530 |
---|---|---|
committer | rahulp13 | 2022-02-21 17:17:35 +0530 |
commit | 83585b6d5273ca70a31f919118e50e03e68507df (patch) | |
tree | 2a239c923c0c1a5c2fa5c5228e85ff1ec83cf211 | |
parent | f1f088321f2c39d1fcf223f7ebe38d86d1d7dc4d (diff) | |
download | nghdl-83585b6d5273ca70a31f919118e50e03e68507df.tar.gz nghdl-83585b6d5273ca70a31f919118e50e03e68507df.tar.bz2 nghdl-83585b6d5273ca70a31f919118e50e03e68507df.zip |
Shifted Verilator install commands on Ubuntu from eSim repo
-rwxr-xr-x | Ubuntu/install-nghdl.sh | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/Ubuntu/install-nghdl.sh b/Ubuntu/install-nghdl.sh index 2dbb4e3..3e28bcc 100755 --- a/Ubuntu/install-nghdl.sh +++ b/Ubuntu/install-nghdl.sh @@ -1,13 +1,13 @@ #!/bin/bash -#=============================================================================== +#========================================================== # FILE: install-nghdl.sh # # USAGE: ./install-nghdl.sh --install # OR # ./install-nghdl.sh --uninstall # -# DESCRIPTION: Installation script for Ngspice and GHDL simulators (NGHDL) -# +# DESCRIPTION: Installation script for Ngspice, GHDL +# and Verilator simulators (NGHDL) # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- @@ -15,11 +15,12 @@ # AUTHOR: Fahim Khan, Rahul Paknikar, Sumanto Kar # ORGANIZATION: eSim, FOSSEE group at IIT Bombay # CREATED: Tuesday 02 December 2014 17:01 -# REVISION: Tuesday 11 November 2021 15:56 -#=============================================================================== +# REVISION: Tuesday 02 February 2022 01:35 +#========================================================== ngspice="ngspice-nghdl" ghdl="ghdl-0.37" +verilator="verilator-4.210" config_dir="$HOME/.nghdl" config_file="config.ini" src_dir=`pwd` @@ -70,6 +71,23 @@ function installDependency sudo apt install -y libxaw7-dev + echo "Installing $verilator dependencies........................" + if [[ -n "$(which apt-get 2> /dev/null)" ]] + then + # Ubuntu + sudo apt-get install make autoconf g++ flex bison + else [[ -n "$(which yum 2> /dev/null)" ]] + # Ubuntu + sudo yum install make autoconf flex bison which -y + sudo yum groupinstall 'Development Tools' -y + fi + +} + + +function installGHDL +{ + echo "Installing $ghdl LLVM................................." tar -xJf $ghdl.tar.xz echo "$ghdl successfully extracted" @@ -97,6 +115,34 @@ function installDependency } +function installVerilator +{ + + echo "Installing $verilator......................." + tar -xJf $verilator.tar.xz + echo "$verilator successfully extracted" + echo "Changing directory to $verilator installation" + cd $verilator + echo "Configuring $verilator build as per requirements" + chmod +x configure + ./configure + make -j$(nproc) + sudo make install + echo "Removing the unessential verilator files........" + rm -r docs + rm -r examples + rm -r include + rm -r test_regress + rm -r bin + ls -1 | grep -E -v 'config.status|configure.ac|Makefile.in|verilator.1|configure|Makefile|src|verilator.pc' | xargs rm -f + #sudo rm -v -r'!("config.status"|"configure.ac"|"Makefile.in"|"verilator.1"|"configure"|"Makefile"|"src"|"verilator.pc")' + + echo "Verilator installed successfully" + cd ../ + +} + + function installNgspice { @@ -224,6 +270,8 @@ if [ $option == "--install" ];then echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" exit 0 fi + installGHDL + installVerilator installNgspice createConfigFile createSoftLink |