Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass tutorial with sky130 + openroad #809

Merged
merged 12 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/Examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ The following are prebuilt example designs, toolchain and/or flows you can use
:maxdepth: 2
:caption: Examples:

e2e
openroad-sky130
e2e
94 changes: 94 additions & 0 deletions doc/Examples/openroad-sky130.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Introduction with Sky130 and OpenROAD

The following directions will get a simple ``pass`` design from RTL to GDS using the [OpenROAD tools](https://theopenroadproject.org) and the [Skywater 130nm PDK](https://github.com/google/skywater-pdk). These directions are meant to provide the minimal set of steps to do so, please reference the next section, [Hammer End-to-End Integration Tests](https://hammer-vlsi.readthedocs.io/en/stable/Examples/e2e.html), for more detailed descriptions of all files and commands.
harrisonliew marked this conversation as resolved.
Show resolved Hide resolved

## Instructions

First, follow the [Hammer Developer Setup](https://hammer-vlsi.readthedocs.io/en/stable/Hammer-Basics/Hammer-Setup.html#developer-setup) to clone Hammer and install/activate the poetry virtual environment.

Next, run the setup script to install the OpenROAD tools using Conda, and Skywater 130 nm PDK using the [Open-PDKs tool](https://github.com/RTimothyEdwards/open_pdks).
This step will take a long time due to the amount and size of the required installs.

```shell
cd hammer/e2e
./scripts/setup-sky130-openroad.sh [INSTALL_PREFIX] # default = ~/
harrisonliew marked this conversation as resolved.
Show resolved Hide resolved
```

You should now have a file ``configs-env/my-env.yml`` containing all required tool and technology paths for this tutorial.
To point to your custom environment setup, set the Make variable ``env=my``.
Additionally, we set the ``design``, ``pdk``, and ``tools`` Make variables to the appropriate RTL design, PDK, and tools flow, respecively.
Now simply run the VLSI flow:

```shell
make design=pass pdk=sky130 tools=or env=my build
make design=pass pdk=sky130 tools=or env=my syn
make design=pass pdk=sky130 tools=or env=my par
make design=pass pdk=sky130 tools=or env=my drc
make design=pass pdk=sky130 tools=or env=my lvs
```

After Place-and-Route completes, the final database can be opened in an interactive OpenROAD session. Hammer generates a convenient script to launch these sessions:
```shell
cd ./build-sky130-or/pass/par-rundir
./generated-scripts/open_chip
```

After DRC and LVS complete, the final results may be viewed with the following scripts:

```shell
# View DRC results:
cd ./build-sky130-or/pass/drc-rundir
./generated-scripts/view_drc

# View LVS results:
cd ./build-sky130-or/pass/lvs-rundir
./generated-scripts/open_chip
```

Congrats, you've just run your ``pass`` design from RTL to GDS with Hammer!

## Next Steps

At this point, you should go through the [Hammer End-to-End Integration Tests](https://hammer-vlsi.readthedocs.io/en/stable/Examples/e2e.html) documentation to learn how to configure Hammer further. We've also outlined some common next steps below.


### Commercial flow

This flow may be run with commercial tools by setting the Make variable ``tools=cm``, which selects the tool plugins via ``configs-tools/cm.yml``.
You will need to create a custom environment YAML file with your environment configuration, in ``configs-env/<my_custom>-env.yml``.
As a minimum, you must specify YAML keys below for the CAD tool licenses and versions/paths of the tools you are using,
see examples in ``configs-env/``.

```yaml
# Commercial tool licenses/paths
mentor.mentor_home: "" # Base path to where Mentor tools are installed
mentor.MGLS_LICENSE_FILE: "" # Mentor license server/file

cadence.cadence_home: "" # Base path to where Cadence tools are installed
cadence.CDS_LIC_FILE: "" # Cadence license server/file

synopsys.synopsys_home: "" # Base path to where Synopsys tools are installed
synopsys.SNPSLMD_LICENSE_FILE: "" # Synopsys license server/files
synopsys.MGLS_LICENSE_FILE: ""

# Commercial tool versions/paths
sim.vcs.version: ""
synthesis.genus.version: "" # NOTE: for genus/innovus/joules, must specify binary path if version < 221
par.innovus.version: ""
power.joules.joules_bin: ""
```

Now re-run a similar flow as before, but pointing to your environment and the commercial tool plugins:

```shell
make design=pass pdk=sky130 tools=cm env=<my_custom> build
```


Running DRC/LVS with commercial tools requires access to an NDA-version of the Skywater PDK.
We support running DRC/LVS with either Cadence Pegasus or Siemens Calibre.
See the [Sky130 documentation](https://hammer-vlsi.readthedocs.io/en/stable/Technology/Sky130.html) for how to point to the NDA PDKs and run DRC/LVS with their respective tools.

### Chipyard flow

Follow [these directions in the Chipyard docs](https://chipyard.readthedocs.io/en/latest/VLSI/Sky130-OpenROAD-Tutorial.html) to build your own Chisel SoC design with OpenROAD and Sky130.
13 changes: 0 additions & 13 deletions doc/Examples/openroad-sky130.rst

This file was deleted.

49 changes: 49 additions & 0 deletions e2e/scripts/setup-sky130-openroad.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

export e2e_dir=${PWD}

if [ ! -z $1 ]
then
export INSTALL_PREFIX=$1
else
export INSTALL_PREFIX=~/
fi

# install open-source tools
conda create -y -c litex-hub --prefix ${INSTALL_PREFIX}/.conda-yosys yosys=0.27_4_gb58664d44
conda create -y -c litex-hub --prefix ${INSTALL_PREFIX}/.conda-openroad openroad=2.0_7070_g0264023b6
conda create -y -c litex-hub --prefix ${INSTALL_PREFIX}/.conda-klayout klayout=0.28.5_98_g87e2def28
conda create -y -c litex-hub --prefix ${INSTALL_PREFIX}/.conda-signoff magic=8.3.427_0_gd624b76 netgen=1.5.250_0_g178b172

git clone https://github.com/google/skywater-pdk.git ${INSTALL_PREFIX}/skywater-pdk
git clone https://github.com/RTimothyEdwards/open_pdks.git ${INSTALL_PREFIX}/open_pdks
git clone https://github.com/rahulk29/sram22_sky130_macros ${INSTALL_PREFIX}/sram22_sky130_macros

# add magic to PATH for open_pdks
export PATH=${INSTALL_PREFIX}/.conda-signoff/bin:$PATH

# install sky130A with open_pdks
cd ${INSTALL_PREFIX}/open_pdks
./configure \
--enable-sky130-pdk=${INSTALL_PREFIX}/skywater-pdk/libraries --prefix=$INSTALL_PREFIX \
--disable-gf180mcu-pdk --disable-alpha-sky130 --disable-xschem-sky130 --disable-primitive-gf180mcu \
--disable-verification-gf180mcu --disable-io-gf180mcu --disable-sc-7t5v0-gf180mcu \
--disable-sc-9t5v0-gf180mcu --disable-sram-gf180mcu --disable-osu-sc-gf180mcu
make
make install

cd ${e2e_dir}

export ENV_YML=${e2e_dir}/configs-env/my-env.yml
echo "# My environment configs" > $ENV_YML
echo "# pdk" > $ENV_YML
echo "technology.sky130.sky130A: ${INSTALL_PREFIX}/share/pdk/sky130A" >> $ENV_YML
echo "technology.sky130.sram22_sky130_macros: ${INSTALL_PREFIX}/sram22_sky130_macros" >> $ENV_YML
echo "" >> $ENV_YML
echo "# tools" >> $ENV_YML
echo "synthesis.yosys.yosys_bin: ${INSTALL_PREFIX}/.conda-yosys/bin/yosys" >> $ENV_YML
echo "par.openroad.openroad_bin: ${INSTALL_PREFIX}/.conda-openroad/bin/openroad" >> $ENV_YML
echo "par.openroad.klayout_bin: ${INSTALL_PREFIX}/.conda-klayout/bin/klayout" >> $ENV_YML
echo "drc.klayout.klayout_bin: ${INSTALL_PREFIX}/.conda-klayout/bin/klayout" >> $ENV_YML
echo "drc.magic.magic_bin: ${INSTALL_PREFIX}/.conda-signoff/bin/magic" >> $ENV_YML
echo "lvs.netgen.netgen_bin: ${INSTALL_PREFIX}/.conda-signoff/bin/netgen" >> $ENV_YML