---
# System prepended metadata

title: chipyard環境下載建置
tags: ['#chipyard', 環境安裝]

---

# chipyard環境下載建置

Ubuntu 20.04.6

## 安裝miniconda
```bash!
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash ~/Miniconda3-latest-Linux-x86_64.sh
source ~/miniconda3/bin/activate
conda init --all
```
## 安裝chipyard 1.8.1
```bash!
conda --version
conda create -n chipyard
conda activate chipyard
conda install --channel=conda-forge --name=chipyard conda-lock
```

```bash!
conda activate chipyard
git clone https://github.com/ucb-bar/chipyard.git
cd chipyard
git checkout 1.8.1
./build-setup.sh riscv-tools
```

## 以下非必要

```bash!
./build-setup.sh esp-tools
source env.sh
cd generators/gemmini
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch && git checkout v0.7.0
git submodule update --init --recursive

SPIKE_HASH=$(cat SPIKE.hash)
cd -
cd toolchains/esp-tools/riscv-isa-sim/build
git fetch && git checkout $SPIKE_HASH
make && make install

cd -
cd ~/chipyard/generators/gemmini
./scripts/build-spike.sh
cd -/generators/gemmini/software/gemmini-rocc-tests
./build.sh
```

## 安裝chipyard 1.13.0

```bash!
sudo apt update
sudo apt upgrade
sudo apt install build-essential
sudo apt-get install ninja-build

sudo apt install git 
git clone https://github.com/ucb-bar/chipyard.git

cd chipyard
git checkout 1.13.0

conda --version
conda create -n chipyard_1.13.0

conda install -n chipyard_1.13.0 conda-libmamba-solver
conda config --set solver libmamba

conda activate chipyard_1.13.0
pip install cmake
./build-setup.sh
```
```bash!
./scripts/build-circt-from-source.sh --prefix $CONDA_PREFIX/riscv-tools
```

### firtool not found
https://groups.google.com/g/chipyard/c/nOAAdWkfZ4w/m/XFoN4wvqAAAJ
`It's likely that the command ./build-setup.sh riscv-tools did not successfully download or set up CIRCT, which is required for firtool.`

```bash!
./scripts/build-circt-from-source.sh --prefix $CONDA_PREFIX/riscv-tools
```

### test
```bash!
cd ~/chipyard/sims/verilator
make CONFIG=RocketConfig -j16
ls

```