2022-09-24 18:35:22 -04:00
# Broccoli Development Environment
2023-06-05 12:35:33 -04:00
The following tools are available:< br >
go - architectural and behavioral simulation< br >
haystack - formal synthesis of self-timed circuits< br >
act - circuit design and digital simulation< br >
prspice - configure digital/analog circuit co-simulation< br >
Xyce - analog circuit simulation< br >
gaw - analog waveform viewer< br >
2024-06-05 16:50:55 -04:00
klayout - circuit layout< br >
2023-06-05 12:35:33 -04:00
magic - circuit layout< br >
2024-06-05 16:50:55 -04:00
OpenROAD - physical design< br >
2023-05-17 13:14:27 -04:00
2023-06-05 12:35:33 -04:00
Semiconductor PDKs are in /opt/cad/conf< br >
Packages may be installed with 'sudo apt install < package > '< br >
Other usages of sudo are disabled< br >
2023-05-17 13:14:27 -04:00
2023-06-05 12:31:46 -04:00
## Setup
2023-05-17 13:14:27 -04:00
2023-06-05 12:31:46 -04:00
Download the Skywater 130nm PDK and configuration files, and extract them to your home directory:
2023-04-24 15:06:00 -04:00
```
2023-06-05 12:31:46 -04:00
wget https://broccoli-hosting.s3.us-east-2.amazonaws.com/sky130.tar.gz
2023-05-17 13:14:27 -04:00
mkdir ~/tech; tar -xzvf sky130.tar.gz -C ~/tech
2023-04-24 15:06:00 -04:00
```
2023-06-05 12:31:46 -04:00
Pull the docker image for the broccoli command line interface, and configure it.
2022-09-24 18:35:22 -04:00
```
2024-06-05 16:50:55 -04:00
docker pull broccolimicro/broccoli-cli:latest
2023-06-05 12:31:46 -04:00
git clone https://git.broccolimicro.io/Broccoli/broccoli-cli.git
source broccoli-cli/bcli-develop.sh
export BCLI_TECH="$HOME/tech"
2022-09-24 18:35:22 -04:00
```
2023-06-05 12:31:46 -04:00
## Runtime
2022-09-26 10:33:59 -04:00
2023-06-05 12:31:46 -04:00
Boot up the development environment in docker
2022-09-24 18:35:22 -04:00
```
bcli up
```
Open up a shell inside the development environment. Here you will have access to all of the necessary tools.
```
bcli
```
Your home directory will be mounted at
```
/host
```
Many of the installed tools may be found at
```
/opt
```
2023-05-17 13:14:27 -04:00
Finally, vim is fully set up for both golang and act.
2022-09-24 18:35:22 -04:00
```
vim file.act
```
2023-05-17 13:14:27 -04:00
When you are done, you can shut down the development environment.
2022-09-24 18:35:22 -04:00
```
bcli down
```
2023-05-17 13:14:27 -04:00
2023-06-05 12:31:46 -04:00
## Troubleshooting
2024-06-05 16:50:55 -04:00
This script runs the docker container with the following commands:
```
# This produces a list of groups and their gids like so:
# 1000 nbingham
# 138 docker
# ...
MEMBERS="$(groups | sed 's/ /\n/g' | xargs -I{} getent group {} | sed 's/\([^:]*\):[^:]*:\([^:]*\):.*/\2 \1/g')"
docker run --rm -d --net=host \
-v $HOME:/host \
-v "${BCLI_TECH:-/opt/tech}:/opt/cad/conf" \
--name "bcli-$USER" \
-h "bcli-$USER" \
-e USER=$USER \
-e USER_ID=$(id -u) \
-e GROUP_ID=$(id -g) \
-e DISPLAY=$DISPLAY \
-e MEMBERS="$MEMBERS" \
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
broccolimicro/broccoli-cli:latest > /dev/null
```
2023-06-05 12:33:49 -04:00
There are multiple versions of docker, the one that seems to work best for this is `docker.io` . `docker-ce` seems to have trouble writing files in the container.
```
sudo apt install docker.io
```
2023-06-05 12:31:46 -04:00
If graphical tools (such as magic and gaw) fail to launch, you may need to install ```xhost``` on your local machine, and grant docker permission to access your X server.
```
xhost +local:docker
```