mirror of https://github.com/VLSIDA/OpenRAM.git
Move library documentation to its own page
This commit is contained in:
parent
c0d9941985
commit
4994e3ddde
|
|
@ -7,7 +7,6 @@ This page shows the basic setup for using OpenRAM.
|
|||
|
||||
## Table of Contents
|
||||
1. [Dependencies](#dependencies)
|
||||
1. [OpenRAM Library](#openram-library)
|
||||
1. [Anaconda](#anaconda)
|
||||
1. [Docker](#docker-deprecated-use-anaconda-instead)
|
||||
1. [Environment](#environment)
|
||||
|
|
@ -16,8 +15,6 @@ This page shows the basic setup for using OpenRAM.
|
|||
|
||||
|
||||
## Dependencies
|
||||
Please see the Dockerfile for the required versions of tools.
|
||||
|
||||
In general, the OpenRAM compiler has very few dependencies:
|
||||
+ Git
|
||||
+ Make
|
||||
|
|
@ -27,28 +24,6 @@ In general, the OpenRAM compiler has very few dependencies:
|
|||
|
||||
|
||||
|
||||
## OpenRAM Library
|
||||
OpenRAM is available as a Python library. There are a few ways to install it:
|
||||
|
||||
+ Install the latest _stable_ version with pip:
|
||||
```
|
||||
pip3 install openram
|
||||
```
|
||||
|
||||
+ Install the latest _dev_ version:
|
||||
```
|
||||
pip3 install git+https://git@github.com/VLSIDA/OpenRAM.git@dev
|
||||
```
|
||||
|
||||
+ Install using Makefile (you need to clone the repo):
|
||||
```
|
||||
git clone git@github.com:VLSIDA/OpenRAM.git
|
||||
cd OpenRAM
|
||||
make library
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Anaconda
|
||||
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
|
||||
|
|
@ -142,3 +117,4 @@ You can also run these from the package installation directory if you have the O
|
|||
[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
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ This page of the documentation explains the basic usage of OpenRAM.
|
|||
|
||||
## Table of Contents
|
||||
1. [Environment Variable Setup](#environment-variable-setup-assuming-bash)
|
||||
1. [Script Usage (with library)](#script-usage-with-library)
|
||||
1. [Command Line Usage (with library)](#command-line-usage-with-library)
|
||||
1. [Command Line Usage (without library)](#command-line-usage-without-library)
|
||||
1. [Command Line Usage](#command-line-usage)
|
||||
1. [Script Usage](#script-usage)
|
||||
1. [Configuration Files](#configuration-files)
|
||||
1. [Common Configuration File Options](#common-configuration-file-options)
|
||||
1. [Output Files](#output-files)
|
||||
|
|
@ -18,10 +17,11 @@ This page of the documentation explains the basic usage of OpenRAM.
|
|||
|
||||
|
||||
## Environment Variable Setup (assuming bash)
|
||||
> **Note**: This is optional if you have the OpenRAM library. See [basic setup](./basic_setup.md#go-back) for details.
|
||||
> **Note**: This is optional if you have the OpenRAM library.
|
||||
> See [Python library](./python_library.md#go-back) for details.
|
||||
* OPENRAM\_HOME defines where the compiler directory is
|
||||
* ```export OPENRAM_HOME="$HOME/openram/compiler"```
|
||||
* OPENRAM_TECH defines list of paths where the technologies exist
|
||||
* `export OPENRAM_HOME="$HOME/openram/compiler"`
|
||||
* OPENRAM\_TECH defines list of paths where the technologies exist
|
||||
* `export OPENRAM_TECH="$HOME/openram/technology"`
|
||||
* Colon separated list so you can have private technology directories
|
||||
* Must also have any PDK related variables set up
|
||||
|
|
@ -30,102 +30,25 @@ This page of the documentation explains the basic usage of OpenRAM.
|
|||
|
||||
|
||||
|
||||
## Script Usage (with library)
|
||||
If you have the library installed, you can use OpenRAM in any Python script. You can import "openram" as follows:
|
||||
```python
|
||||
import openram
|
||||
openram.init_openram("myconfig.py") # Config files are explained on this page
|
||||
# Now you can use modules from openram
|
||||
from openram import tech
|
||||
...
|
||||
```
|
||||
|
||||
Note that you need to initialize OpenRAM so that the modules are imported properly. You can also look
|
||||
at [sram_compiler.py](../../sram_compiler.py) as an example on how to use "openram."
|
||||
|
||||
If you want to pass custom configuration when generating an SRAM, you can use the `sram_config` class.
|
||||
```python
|
||||
import openram
|
||||
openram.init_openram("myconfig.py")
|
||||
|
||||
from openram import sram_config
|
||||
c = sram_config(...)
|
||||
|
||||
from openram import sram
|
||||
s = sram(sram_config=c,
|
||||
name="custom_name")
|
||||
|
||||
s.save()
|
||||
|
||||
openram.end_openram()
|
||||
```
|
||||
|
||||
|
||||
## Command Line Usage (with library)
|
||||
You can run OpenRAM from the command line using the [sram_compiler.py](../../sram_compiler.py) script that is
|
||||
included in the library's installation. You can find the package directory on a path like:
|
||||
```
|
||||
/home/mrg/.local/lib/python3.8/site-packages/openram
|
||||
```
|
||||
|
||||
Alternatively, you can run the following command to find that path:
|
||||
```
|
||||
echo -e "import os\nimport openram\nprint(os.path.dirname(openram.__file__))" | python3 -
|
||||
```
|
||||
|
||||
You can continue with following section for more details.
|
||||
|
||||
|
||||
## Command Line Usage (without library)
|
||||
## Command Line Usage
|
||||
Once you have defined the environment, you can run OpenRAM from the command line
|
||||
using a single configuration file written in Python.
|
||||
|
||||
For example, create a file called *myconfig.py* specifying the following
|
||||
parameters for your memory:
|
||||
```python
|
||||
# Data word size
|
||||
word_size = 2
|
||||
# Number of words in the memory
|
||||
num_words = 16
|
||||
|
||||
# Technology to use in $OPENRAM_TECH
|
||||
tech_name = "scn4m_subm"
|
||||
|
||||
# You can use the technology nominal corner only
|
||||
nominal_corner_only = True
|
||||
# Or you can specify particular corners
|
||||
# Process corners to characterize
|
||||
# process_corners = ["SS", "TT", "FF"]
|
||||
# Voltage corners to characterize
|
||||
# supply_voltages = [ 3.0, 3.3, 3.5 ]
|
||||
# Temperature corners to characterize
|
||||
# temperatures = [ 0, 25 100]
|
||||
|
||||
# Output directory for the results
|
||||
output_path = "temp"
|
||||
# Output file base name
|
||||
output_name = "sram_{0}_{1}_{2}".format(word_size,num_words,tech_name)
|
||||
|
||||
# Disable analytical models for full characterization (WARNING: slow!)
|
||||
# analytical_delay = False
|
||||
|
||||
```
|
||||
|
||||
You can then run OpenRAM by executing:
|
||||
using a single configuration file written in Python. You can then run OpenRAM by
|
||||
executing:
|
||||
```
|
||||
python3 $OPENRAM_HOME/../sram_compiler.py myconfig
|
||||
```
|
||||
You can see all of the options for the configuration file in
|
||||
$OPENRAM\_HOME/options.py
|
||||
|
||||
To run designs in Docker, it is suggested to use, for example:
|
||||
To run macros, it is suggested to use, for example:
|
||||
```
|
||||
cd OpenRAM/macros
|
||||
make example_config_scn4m_subm
|
||||
```
|
||||
|
||||
* Common arguments:
|
||||
* `-t` specify technology (scn4m_subm or scmos or freepdk45)
|
||||
* `-h` print all arguments
|
||||
* `-t` specify technology (scn4m\_subm or scmos or freepdk45)
|
||||
* `-v` increase verbosity of output
|
||||
* `-n` don't run DRC/LVS
|
||||
* `-c` perform simulation-based characterization
|
||||
|
|
@ -133,6 +56,12 @@ make example_config_scn4m_subm
|
|||
|
||||
|
||||
|
||||
## Script Usage
|
||||
OpenRAM is also available as a Python library. See
|
||||
[Python library](./python_library.md#go-back) for details.
|
||||
|
||||
|
||||
|
||||
## Configuration Files
|
||||
* Memories are created using a Python configuration file to replicate results
|
||||
* No YAML, JSON, etc.
|
||||
|
|
@ -167,7 +96,7 @@ make example_config_scn4m_subm
|
|||
# Could be calibre for FreePDK45
|
||||
drc_name = "magic"
|
||||
lvs_name = "netgen"
|
||||
pex_name = "magic"
|
||||
pex_name = "magic"
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# OpenRAM Documentation
|
||||

|
||||
|
||||
These pages provide the documentation of OpenRAM. You can use the links below to navigate through the documentation.
|
||||
These pages provide the documentation of OpenRAM. You can use the links below to
|
||||
navigate through the documentation.
|
||||
|
||||
|
||||
|
||||
|
|
@ -10,6 +11,7 @@ These pages provide the documentation of OpenRAM. You can use the links below to
|
|||
1. [Supported Technologies](#supported-technologies)
|
||||
1. [Basic Setup](./basic_setup.md#go-back)
|
||||
1. [Basic Usage](./basic_usage.md#go-back)
|
||||
1. [Python Library](./python_library.md#go-back)
|
||||
1. [Bitcells](./bitcells.md#go-back)
|
||||
1. [Architecture](./architecture.md#go-back)
|
||||
1. [Implementation](#implementation)
|
||||
|
|
@ -29,10 +31,7 @@ These pages provide the documentation of OpenRAM. You can use the links below to
|
|||
|
||||
|
||||
|
||||
|
||||
## OpenRAM Dependencies
|
||||
Please see the Dockerfile for the required versions of tools.
|
||||
|
||||
In general, the OpenRAM compiler has very few dependencies:
|
||||
+ Git
|
||||
+ Make
|
||||
|
|
@ -90,6 +89,8 @@ Commercial tools (optional):
|
|||
* DRC and LVS can be performed at all levels of the design hierarchy to enhance bug tracking.
|
||||
* DRC and LVS can be disabled completely for improved run-time or if licenses are not available.
|
||||
|
||||
|
||||
|
||||
## Contributors/Collaborators
|
||||
<img align="right" height="120" src="../assets/images/logos/okstate.png">
|
||||
|
||||
|
|
@ -108,4 +109,3 @@ Commercial tools (optional):
|
|||
* Marcelo Sero
|
||||
* Seokjoong Kim
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
### [Go Back](./index.md#table-of-contents)
|
||||
|
||||
# Python Library
|
||||
This page explains the Python library of OpenRAM.
|
||||
|
||||
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
1. [Environment Variables](#environment-variables)
|
||||
1. [Usage](#usage)
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
OpenRAM is available as a Python library. There are a few ways to install it:
|
||||
|
||||
+ Install the latest _stable_ version with pip:
|
||||
```
|
||||
pip3 install openram
|
||||
```
|
||||
|
||||
+ Install the latest _dev_ version:
|
||||
```
|
||||
pip3 install git+https://git@github.com/VLSIDA/OpenRAM.git@dev
|
||||
```
|
||||
|
||||
+ Install using Makefile (you need to clone the repo):
|
||||
```
|
||||
git clone git@github.com:VLSIDA/OpenRAM.git
|
||||
cd OpenRAM
|
||||
make library
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Environment Variables
|
||||
OpenRAM library doesn't need any envinronment variable by default. However, if
|
||||
you have set the environment variables explained on
|
||||
[basic usage](.basic_usage.md#go-back), the library will use the OpenRAM source
|
||||
code located at `OPENRAM_HOME`.
|
||||
|
||||
If you want the convenience of being able to call OpenRAM from any Python script
|
||||
and have a custom OpenRAM setup, you can set these environment variables to
|
||||
point to that OpenRAM installation.
|
||||
|
||||
If you don't want to use this feature, you can simply unset these environment
|
||||
variables.
|
||||
|
||||
|
||||
|
||||
## Usage
|
||||
With the OpenRAM library, you can use OpenRAM in any Python script. You can
|
||||
import "openram" as follows:
|
||||
```python
|
||||
import openram
|
||||
openram.init_openram("myconfig.py") # Config files are explained on "Basic Usage" page
|
||||
# Now you can use modules from openram
|
||||
from openram import tech
|
||||
...
|
||||
```
|
||||
|
||||
Note that you need to initialize OpenRAM so that the modules are imported
|
||||
properly. You can also look at [sram\_compiler.py](../../sram_compiler.py) as an
|
||||
example on how to use "openram."
|
||||
|
||||
If you want to pass custom configuration when generating an SRAM, you can use
|
||||
the `sram_config` class.
|
||||
```python
|
||||
import openram
|
||||
openram.init_openram("myconfig.py")
|
||||
|
||||
from openram import sram_config
|
||||
c = sram_config(...)
|
||||
|
||||
from openram import sram
|
||||
s = sram(sram_config=c,
|
||||
name="custom_name")
|
||||
|
||||
s.save()
|
||||
|
||||
openram.end_openram()
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue