======== setup basic environment =========
ubuntu20.04-LTS
sudo apt install jq device-tree-compiler ninja-build
===== install cmake version above 3.20 =====
download cmake-3.20.0-linux-x86_64.tar.gz from http://cmake.org/download
cd /opt & sudo -i
tar zxvf cmake-3.20.0-linux-x86_64.tar.gz to /opt/cmake-3.20
export PATH=/opt/cmake-3.20/bin:$PATH
========== install circt firtool ============
git clone https://github.com/llvm/circt
cd circt
git submodule init
git submodule update
git checkout -b firtool-1.50.0
cd circt/llvm/build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="mlir" \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ninja
ninja check-mlir
cd circt
mkdir build
cd build
cmake -G Ninja .. \
-DMLIR_DIR=$PWD/../llvm/build/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../llvm/build/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ninja
ninja check-circt
ninja check-circt-integration
export PATH=/home/hemin/cad/circt/build/bin:$PATH
========= install scala-sbt ==============
refer to http://www.scala-sbt.org/download.html
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update
sudo apt-get install sbt
sbt --version
sbt version in this project: 1.9.3
sbt script version: 1.9.3
========= install verilator v4.218 ==========
git clone https://gitee.com/weihemin/verilator
git checkout -b v4.218
git branch
autoconf
./configure
make
sudo make install
======== compile and run chipyard ========
git clone https://github.com/ucb-bar/chipyard
cd chipyard
git submodule update --init
cd chipyard/generator/rocket-chip
git submodule update --init
cd chipyard/sims/vcs
make CONFIG=TinyRocketConfig