OpenRAM/docs/source/basic_setup.md

150 lines
4.7 KiB
Markdown
Raw Normal View History

2022-10-15 03:27:39 +02:00
### [Go Back](./index.md#table-of-contents)
2022-10-15 01:51:54 +02:00
2022-11-28 03:24:01 +01:00
# Basic Setup
2023-04-20 08:32:06 +02:00
This page shows the basic setup for using OpenRAM to generate an SRAM.
2022-10-15 01:51:54 +02:00
2022-11-28 03:24:01 +01:00
## Table of Contents
1. [Dependencies](#dependencies)
2023-01-29 07:33:47 +01:00
1. [Anaconda](#anaconda)
1. [Docker](#docker-deprecated-use-anaconda-instead)
2022-11-28 03:24:01 +01:00
1. [Environment](#environment)
1. [Sky130 Setup](#sky130-setup)
## Dependencies
2022-10-15 01:51:54 +02:00
In general, the OpenRAM compiler has very few dependencies:
2023-01-29 07:33:47 +01:00
+ Git
2022-10-15 01:51:54 +02:00
+ Make
2023-03-15 20:41:50 +01:00
+ Python 3.5 or higher
2022-10-15 01:51:54 +02:00
+ Various Python packages (pip install -r requirements.txt)
2023-01-29 07:33:47 +01:00
+ Anaconda
2022-11-12 01:16:38 +01:00
2023-01-29 07:33:47 +01:00
## Anaconda
2023-03-16 22:10:22 +01:00
We use Anaconda package manager to install the tools used by OpenRAM. This way,
you don't have to worry about updating/installing these tools. OpenRAM installs
Anaconda silently in the background (without affecting any existing Anaconda
setup you have).
2023-01-29 07:33:47 +01:00
2023-04-11 20:13:38 +02:00
You don't have to manually activate/deactivate the Anaconda environment. OpenRAM
automatically manages this before and after running the tools.
2023-03-16 22:10:22 +01:00
OpenRAM uses Anaconda by default, but you can turn this feature off by setting
`use_conda = False` in your config file. Then, OpenRAM will use the tools you
have installed on your system.
2023-01-29 07:33:47 +01:00
2023-05-12 01:47:42 +02:00
You can also tell OpenRAM where Anaconda should be installed or which Anaconda
setup it should use. You can set the `$CONDA_HOME` variable like this:
```
export CONDA_HOME="/path/to/conda/setup"
```
2023-03-16 22:10:22 +01:00
> **Note**: If you want to install Anaconda without running OpenRAM (for example
> to run unit tests, which do not install Anaconda), you can run:
> ```
> ./install_conda.sh
> ```
2023-04-11 20:13:38 +02:00
> **Note**: You can uninstall OpenRAM's Anaconda installation by simply deleting
> the folder Anaconda is installed to. You can run:
2023-04-10 23:30:30 +02:00
> ```
> rm -rf miniconda
> ```
> **Note**: You can change a tool's version with the following commands:
> ```
> source ./miniconda/bin/activate
> conda uninstall <tool>
> conda install -y -c vlsida-eda <tool>=<version>
> ```
2023-01-29 07:33:47 +01:00
## Docker (deprecated, use Anaconda instead)
2023-03-16 22:10:22 +01:00
We have a [docker setup](../../docker) to run OpenRAM. To use this, you should
run:
2022-10-15 01:51:54 +02:00
```
cd OpenRAM/docker
make build
```
2023-03-16 22:10:22 +01:00
This must be run once and will take a while to build all the tools. If you have
the OpenRAM library installed, you can also run the docker setup from the
package installation directory.
2022-11-12 01:16:38 +01:00
2022-10-15 01:51:54 +02:00
## Environment
2023-03-16 22:10:22 +01:00
If you haven't installed the OpenRAM library or you want to use a different
OpenRAM installation, you can set two environment variables:
+ `OPENRAM_HOME` should point to the compiler source directory.
+ `OPENRAM_TECH` should point to one or more root technology directories (colon
separated).
2022-10-15 01:51:54 +02:00
2023-03-16 22:10:22 +01:00
If you have the library installed and `OPENRAM_HOME` set, the library will use
the installation on the `OPENRAM_HOME` path.
2022-10-15 01:51:54 +02:00
2023-03-16 22:10:22 +01:00
If you don't have the library, you should also add `OPENRAM_HOME` to your
`PYTHONPATH`. This is not needed if you have the library.
2022-10-15 01:51:54 +02:00
2022-11-12 01:16:38 +01:00
You can add these environment variables to your `.bashrc`:
2022-10-15 01:51:54 +02:00
```
2023-03-06 06:22:03 +01:00
export OPENRAM_HOME="$HOME/OpenRAM/compiler"
export OPENRAM_TECH="$HOME/OpenRAM/technology"
export PYTHONPATH=$OPENRAM_HOME
2022-10-15 01:51:54 +02:00
```
2023-03-16 22:10:22 +01:00
Note that if you want symbols to resolve in your editor, you may also want to
add the specific technology directory that you use and any custom technology
modules as well. For example:
2022-10-15 01:51:54 +02:00
```
2023-03-06 06:22:03 +01:00
export PYTHONPATH="$OPENRAM_HOME:$OPENRAM_TECH/sky130:$OPENRAM_TECH/sky130/custom"
2022-10-15 01:51:54 +02:00
```
2023-03-16 22:10:22 +01:00
We include the tech files necessary for [SCMOS] SCN4M\_SUBM, [FreePDK45]. The
[SCMOS] spice models, however, are generic and should be replaced with foundry
models. You may get the entire [FreePDK45 PDK here][FreePDK45].
2022-10-15 01:51:54 +02:00
2022-11-12 01:16:38 +01:00
2023-02-12 20:00:22 +01:00
## Sky130 Setup
2022-10-15 01:51:54 +02:00
2023-03-16 22:10:22 +01:00
To install [Sky130], you must have open\_pdks installed in $PDK\_ROOT. We highly
recommend that you use the version tagged in the Makefile as others have not
been verified. To install this automatically, you can run:
2022-10-15 01:51:54 +02:00
```
cd $HOME/OpenRAM
make pdk
```
2023-03-16 22:10:22 +01:00
> **Note**: If you don't have Magic installed, you need to install and activate
> the conda environment before running this command. You can run:
>
> ```
2023-03-16 22:10:22 +01:00
> ./install_conda.sh
> source miniconda/bin/activate
> ```
2022-10-15 01:51:54 +02:00
2023-03-16 22:10:22 +01:00
Then you must also install the [Sky130] SRAM build space with the appropriate
cell views into the OpenRAM technology directory by running:
2022-10-15 01:51:54 +02:00
```
cd $HOME/OpenRAM
make install
```
2022-11-12 01:16:38 +01:00
2023-03-16 22:10:22 +01:00
You can also run these from the package installation directory if you have the
OpenRAM library.
2022-11-12 01:16:38 +01:00
## GF180 Setup
2022-11-12 01:16:38 +01:00
OpenRAM currently **does not** support gf180mcu for SRAM generation. However ROM generation for gf180mcu is supported as an experimental feature. To set up gf180mcu, first change ```OPEN_PDKS_GIT_COMMIT``` in ```OpenRAM/Makefile``` to version 1.0.395. Then follow the setup instructions for Sky130 but run ```make gf180-pdk``` instead of ```make pdk```.
2022-11-12 01:16:38 +01:00
[SCMOS]: https://www.mosis.com/files/scmos/scmos.pdf
[FreePDK45]: https://www.eda.ncsu.edu/wiki/FreePDK45:Contents
[Sky130]: https://github.com/google/skywater-pdk-libs-sky130_fd_bd_sram.git