OpenRAM/README.md

250 lines
8.9 KiB
Markdown
Raw Normal View History

# OpenRAM
2018-11-21 00:12:14 +01:00
2018-11-21 00:52:46 +01:00
[![Python 3.5](https://img.shields.io/badge/Python-3.5-green.svg)](https://www.python.org/)
2018-11-21 00:12:14 +01:00
[![License: BSD 3-clause](./images/license_badge.svg)](./LICENSE)
2018-11-21 04:48:33 +01:00
Master:
[![Pipeline Status](https://scone.soe.ucsc.edu:8888/mrg/PrivateRAM/badges/master/pipeline.svg?private_token=ynB6rSFLzvKUseoBPcwV)](https://github.com/VLSIDA/PrivateRAM/commits/master)
2018-11-21 15:38:39 +01:00
![Coverage](https://scone.soe.ucsc.edu:8888/mrg/PrivateRAM/badges/master/coverage.svg?private_token=ynB6rSFLzvKUseoBPcwV)
2018-11-21 01:02:11 +01:00
[![Download](./images/download-stable-blue.svg)](https://github.com/VLSIDA/PrivateRAM/archive/master.zip)
2018-11-21 00:12:14 +01:00
2018-11-21 04:48:33 +01:00
Dev:
[![Pipeline Status](https://scone.soe.ucsc.edu:8888/mrg/PrivateRAM/badges/dev/pipeline.svg?private_token=ynB6rSFLzvKUseoBPcwV)](https://github.com/VLSIDA/PrivateRAM/commits/dev)
2018-11-21 15:38:39 +01:00
![Coverage](https://scone.soe.ucsc.edu:8888/mrg/PrivateRAM/badges/dev/coverage.svg?private_token=ynB6rSFLzvKUseoBPcwV)
2018-11-21 01:02:11 +01:00
[![Download](./images/download-unstable-blue.svg)](https://github.com/VLSIDA/PrivateRAM/archive/dev.zip)
An open-source static random access memory (SRAM) compiler.
2018-11-15 23:26:59 +01:00
# What is OpenRAM?
2018-11-15 23:54:56 +01:00
<img align="right" width="25%" src="images/SCMOS_16kb_sram.jpg">
2018-11-15 23:26:59 +01:00
OpenRAM is an open-source Python framework to create the layout,
netlists, timing and power models, placement and routing models, and
other views necessary to use SRAMs in ASIC design. OpenRAM supports
integration in both commercial and open-source flows with both
predictive and fabricable technologies.
# Basic Setup
## Docker Image
We have a pre-configured Ubuntu [Docker](https://www.docker.com/) image
available that has all tools installed for the [SCMOS] process. It is
available at [docker hub](https://hub.docker.com/r/vlsida/openram-ubuntu).
Please see
[our README.md](https://github.com/VLSIDA/openram-docker-images/blob/master/README.md)
for information on how to use this docker image.
## Dependencies
2017-11-09 20:24:42 +01:00
The OpenRAM compiler has very few dependencies:
+ [Ngspice] 26 (or later) or HSpice I-2013.12-1 (or later) or CustomSim 2017 (or later)
2018-11-15 23:38:28 +01:00
+ Python 3.5 or higher
+ Python numpy (pip3 install numpy to install)
If you want to perform DRC and LVS, you will need either:
2018-11-15 23:38:28 +01:00
+ Calibre (for [FreePDK45])
+ [Magic] + [Netgen] (for [SCMOS])
2018-11-15 23:38:28 +01:00
You must set two environment variables:
+ OPENRAM\_HOME should point to the compiler source directory.
+ OPENERAM\_TECH should point to a root technology directory.
2018-11-15 23:54:56 +01:00
## Environment
2018-11-15 23:54:56 +01:00
For example add this to your .bashrc:
2018-11-15 23:38:28 +01:00
```
2018-10-22 17:37:22 +02:00
export OPENRAM_HOME="$HOME/openram/compiler"
export OPENRAM_TECH="$HOME/openram/technology"
```
2018-11-16 17:25:04 +01:00
You may also wish to add OPENRAM\_HOME to your PYTHONPATH:
```
export PYTHONPATH="$PYTHONPATH:$OPENRAM_HOME"
```
2018-11-15 23:38:28 +01:00
We include the tech files necessary for [FreePDK45] and [SCMOS]
SCN4M_SUBM. The [SCMOS] spice models, however, are generic and should
be replaced with foundry models. If you are using [FreePDK45], you
should also have that set up and have the environment variable point
2018-11-15 23:54:56 +01:00
to the PDK. For example add this to your .bashrc:
2018-11-15 23:38:28 +01:00
```
export FREEPDK45="/bsoe/software/design-kits/FreePDK45"
```
2018-11-15 23:38:28 +01:00
You may get the entire [FreePDK45 PDK here][FreePDK45].
If you are using [SCMOS], you should install [Magic] and [Netgen].
2018-11-15 23:38:28 +01:00
We have included the most recent SCN4M_SUBM design rules from [Qflow].
2018-11-15 23:26:59 +01:00
# Basic Usage
Once you have defined the environment, you can run OpenRAM from the command line
2018-11-16 17:25:04 +01:00
using a single configuration file written in Python.
2018-11-15 23:38:28 +01:00
2018-11-15 23:54:56 +01:00
For example, create a file called *myconfig.py* specifying the following
parameters for your memory:
2018-11-15 23:38:28 +01:00
2018-11-15 23:26:59 +01:00
```
2018-11-15 23:38:28 +01:00
# Data word size
2018-11-15 23:26:59 +01:00
word_size = 2
2018-11-15 23:38:28 +01:00
# Number of words in the memory
2018-11-15 23:26:59 +01:00
num_words = 16
2018-11-16 02:28:06 +01:00
# Technology to use in $OPENRAM_TECH
2018-11-15 23:26:59 +01:00
tech_name = "scn4m_subm"
2018-11-15 23:38:28 +01:00
# Process corners to characterize
2018-11-15 23:26:59 +01:00
process_corners = ["TT"]
2018-11-15 23:38:28 +01:00
# Voltage corners to characterize
2018-11-15 23:26:59 +01:00
supply_voltages = [ 3.3 ]
2018-11-15 23:38:28 +01:00
# Temperature corners to characterize
2018-11-15 23:26:59 +01:00
temperatures = [ 25 ]
2018-11-15 23:38:28 +01:00
# Output directory for the results
2018-11-15 23:26:59 +01:00
output_path = "temp"
2018-11-15 23:38:28 +01:00
# Output file base name
2018-11-15 23:26:59 +01:00
output_name = "sram_{0}_{1}_{2}".format(word_size,num_words,tech_name)
2018-11-15 23:54:56 +01:00
# Disable analytical models for full characterization (WARNING: slow!)
# analytical_delay = False
# To force this to use magic and netgen for DRC/LVS/PEX
# Could be calibre for FreePDK45
drc_name = "magic"
lvs_name = "netgen"
pex_name = "magic"
2018-11-15 23:26:59 +01:00
```
2018-11-15 23:38:28 +01:00
You can then run OpenRAM by executing:
2018-11-15 23:26:59 +01:00
```
2018-11-16 00:48:15 +01:00
python3 $OPENRAM_HOME/openram.py myconfig
2018-11-15 23:26:59 +01:00
```
You can see all of the options for the configuration file in
$OPENRAM\_HOME/options.py
2018-11-15 23:54:56 +01:00
# Unit Tests
Regression testing performs a number of tests for all modules in OpenRAM.
2018-11-15 23:26:59 +01:00
From the unit test directory ($OPENRAM\_HOME/tests),
use the following command to run all regression tests:
2018-11-15 23:38:28 +01:00
```
python3 regress.py
```
To run a specific test:
```
python3 {unit test}.py
```
The unit tests take the same arguments as openram.py itself.
To increase the verbosity of the test, add one (or more) -v options:
```
python3 tests/00_code_format_check_test.py -v -t freepdk45
```
To specify a particular technology use "-t <techname>" such as
2019-01-26 00:47:09 +01:00
"-t freepdk45". The default for a unit test is scn4m_subm.
2018-10-19 18:16:54 +02:00
The default for openram.py is specified in the configuration file.
2018-11-15 23:38:28 +01:00
# Porting to a New Technology
If you want to support a enw technology, you will need to create:
+ a setup script for each technology you want to use
+ a technology directory for each technology with the base cells
All setup scripts should be in the setup\_scripts directory under the
2018-11-15 23:38:28 +01:00
$OPENRAM\_TECH directory. We provide two technology examples for
[SCMOS] and [FreePDK45]. Please look at the following file for an
example of what is needed for OpenRAM:
```
$OPENRAM_TECH/setup_scripts/setup_openram_freepdk45.py
```
2018-11-15 23:38:28 +01:00
Each setup script should be named as: setup\_openram\_{tech name}.py.
Each specific technology (e.g., [FreePDK45]) should be a subdirectory
2017-11-09 20:22:14 +01:00
(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files:
2018-11-15 23:26:59 +01:00
* gds_lib folder with all the .gds (premade) library cells:
* dff.gds
* sense_amp.gds
* write_driver.gds
* cell_6t.gds
* replica\_cell\_6t.gds
* sp_lib folder with all the .sp (premade) library netlists for the above cells.
* layers.map
2019-01-26 00:47:09 +01:00
* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with:
2018-11-15 23:26:59 +01:00
* References in tech.py to spice models
* DRC/LVS rules needed for dynamic cells and routing
* Layer information
* Spice and supply information
* etc.
2018-11-15 20:33:15 +01:00
# Get Involved
2018-11-15 23:29:32 +01:00
+ Report bugs by submitting [Github issues].
2018-11-15 20:33:15 +01:00
+ Develop new features (see [how to contribute](./CONTRIBUTING.md))
+ Submit code/fixes using a [Github pull request]
+ Follow our [project][Github projects].
+ Read and cite our [ICCAD paper][OpenRAMpaper]
2018-11-15 23:54:56 +01:00
# Further Help
+ [Additional hints](./HINTS.md)
+ [OpenRAM Slack Workspace][Slack]
+ [OpenRAM Users Group][user-group] ([subscribe here][user-group-subscribe])
+ [OpenRAM Developers Group][dev-group] ([subscribe here][dev-group-subscribe])
# License
OpenRAM is licensed under the [BSD 3-clause License](./LICENSE).
2018-02-06 20:22:22 +01:00
# Contributors & Acknowledgment
2018-11-15 23:26:59 +01:00
- [Matthew Guthaus] from [VLSIDA] created the OpenRAM project and is the lead architect.
- [James Stine] from [VLSIARCH] co-founded the project.
- Hunter Nichols maintains and updates the timing characterization.
2018-11-16 17:26:09 +01:00
- Michael Grimes created and maintains the multiport netlist code.
2018-11-15 23:26:59 +01:00
- Jennifer Sowash is creating the OpenRAM IP library.
- Jesse Cirimelli-Low created the datasheet generation.
2018-11-15 23:38:28 +01:00
- Samira Ataei created early multi-bank layouts and control logic.
2018-11-15 23:26:59 +01:00
- Bin Wu created early parameterized cells.
- Yusu Wang is porting parameterized cells to new technologies.
- Brian Chen created early prototypes of the timing characterizer.
- Jeff Butera created early prototypes of the bank layout.
2018-11-16 17:26:09 +01:00
If I forgot to add you, please let me know!
* * *
[Matthew Guthaus]: https://users.soe.ucsc.edu/~mrg
2018-11-15 23:26:59 +01:00
[James Stine]: https://ece.okstate.edu/content/stine-james-e-jr-phd
[VLSIDA]: https://vlsida.soe.ucsc.edu
[VLSIARCH]: https://vlsiarch.ecen.okstate.edu/
[OpenRAMpaper]: https://ieeexplore.ieee.org/document/7827670/
2018-11-16 00:48:15 +01:00
[Github issues]: https://github.com/VLSIDA/PrivateRAM/issues
[Github pull request]: https://github.com/VLSIDA/PrivateRAM/pulls
[Github projects]: https://github.com/VLSIDA/PrivateRAM
2018-11-15 23:54:56 +01:00
[email me]: mailto:mrg+openram@ucsc.edu
2018-11-15 23:54:56 +01:00
[dev-group]: mailto:openram-dev-group@ucsc.edu
[user-group]: mailto:openram-user-group@ucsc.edu
[dev-group-subscribe]: mailto:openram-dev-group+subscribe@ucsc.edu
[user-group-subscribe]: mailto:openram-user-group+subscribe@ucsc.edu
2018-11-15 23:26:59 +01:00
[Magic]: http://opencircuitdesign.com/magic/
[Netgen]: http://opencircuitdesign.com/netgen/
[Qflow]: http://opencircuitdesign.com/qflow/history.html
2018-11-15 23:26:59 +01:00
[Ngspice]: http://ngspice.sourceforge.net/
[OSUPDK]: https://vlsiarch.ecen.okstate.edu/flow/
[FreePDK45]: https://www.eda.ncsu.edu/wiki/FreePDK45:Contents
[SCMOS]: https://www.mosis.com/files/scmos/scmos.pdf
2018-11-15 23:54:56 +01:00
[Slack]: https://join.slack.com/t/openram/shared_invite/enQtNDgxMjc3NzU5NTI1LTE4ODMyM2I0Mzk2ZmFiMjgwYTYyMTQ4NTgwMmUwMDhiM2E1MDViNDRjYzU1NjJhZTQxNWZjMzE3M2FlODBmZjA