mirror of https://github.com/VLSIDA/OpenRAM.git
Merge branch 'dev' into sky130_custom_modules
This commit is contained in:
commit
5e31b624b5
20
Makefile
20
Makefile
|
|
@ -49,8 +49,8 @@ INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib klayout_lvs_
|
|||
INSTALL_BASE := $(OPENRAM_HOME)/../technology/sky130
|
||||
INSTALL_DIRS := $(addprefix $(INSTALL_BASE)/,$(INSTALL_BASE_DIRS))
|
||||
|
||||
# Remove this if you don't want to use conda
|
||||
USE_CONDA ?= 1
|
||||
# If conda is installed, we will use Magic from there
|
||||
CONDA_DIR := $(wildcard $(TOP_DIR)/miniconda)
|
||||
|
||||
check-pdk-root:
|
||||
ifndef PDK_ROOT
|
||||
|
|
@ -72,7 +72,14 @@ $(OPEN_PDKS_DIR): $(SKY130_PDKS_DIR)
|
|||
|
||||
$(SKY130_PDK): $(OPEN_PDKS_DIR) $(SKY130_PDKS_DIR)
|
||||
@echo "Installing open_pdks..."
|
||||
ifdef USE_CONDA
|
||||
ifeq ($(CONDA_DIR),"")
|
||||
@cd $(PDK_ROOT)/open_pdks && \
|
||||
./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \
|
||||
cd sky130 && \
|
||||
make veryclean && \
|
||||
make && \
|
||||
make SHARED_PDKS_PATH=$(PDK_ROOT) install
|
||||
else
|
||||
@source $(TOP_DIR)/miniconda/bin/activate && \
|
||||
cd $(PDK_ROOT)/open_pdks && \
|
||||
./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \
|
||||
|
|
@ -81,13 +88,6 @@ ifdef USE_CONDA
|
|||
make && \
|
||||
make SHARED_PDKS_PATH=$(PDK_ROOT) install && \
|
||||
conda deactivate
|
||||
else
|
||||
@cd $(PDK_ROOT)/open_pdks && \
|
||||
./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \
|
||||
cd sky130 && \
|
||||
make veryclean && \
|
||||
make && \
|
||||
make SHARED_PDKS_PATH=$(PDK_ROOT) install
|
||||
endif
|
||||
|
||||
$(SRAM_LIB_DIR): check-pdk-root
|
||||
|
|
|
|||
27
PORTING.md
27
PORTING.md
|
|
@ -6,19 +6,24 @@ If you want to support a new technology, you will need to create:
|
|||
|
||||
We provide two technology examples for [SCMOS] and [FreePDK45]. Each
|
||||
specific technology (e.g., [FreePDK45]) should be a subdirectory
|
||||
(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files:
|
||||
* gds_lib folder with all the .gds (premade) library cells:
|
||||
* dff.gds
|
||||
* sense_amp.gds
|
||||
* write_driver.gds
|
||||
* cell_1rw.gds
|
||||
* replica\_cell\_1rw.gds
|
||||
* dummy\_cell\_1rw.gds
|
||||
* sp_lib folder with all the .sp (premade) library netlists for the above cells.
|
||||
* layers.map
|
||||
* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with:
|
||||
(e.g., `$OPENRAM_TECH/freepdk45`) and include certain folders and files:
|
||||
* `gds_lib` folder with all the `.gds` (premade) library cells:
|
||||
* `dff.gds`
|
||||
* `sense_amp.gds`
|
||||
* `write_driver.gds`
|
||||
* `cell_1rw.gds`
|
||||
* `replica\_cell\_1rw.gds`
|
||||
* `dummy\_cell\_1rw.gds`
|
||||
* `sp_lib` folder with all the `.sp` (premade) library netlists for the above cells.
|
||||
* `layers.map`
|
||||
* A valid tech Python module (tech directory with `__init__.py` and `tech.py`) with:
|
||||
* References in tech.py to spice models
|
||||
* DRC/LVS rules needed for dynamic cells and routing
|
||||
* Layer information
|
||||
* Spice and supply information
|
||||
* etc.
|
||||
|
||||
|
||||
|
||||
[FreePDK45]: https://www.eda.ncsu.edu/wiki/FreePDK45:Contents
|
||||
[SCMOS]: https://www.mosis.com/files/scmos/scmos.pdf
|
||||
|
|
|
|||
30
__init__.py
30
__init__.py
|
|
@ -60,26 +60,26 @@ class custom_module_finder(MetaPathFinder):
|
|||
# Skip if the package is not openram
|
||||
if package_name != "openram":
|
||||
return None
|
||||
customizable = False
|
||||
# Search for the module name in customizable modules
|
||||
from openram import OPTS
|
||||
for k, v in OPTS.__dict__.items():
|
||||
if module_name == v:
|
||||
customizable = True
|
||||
break
|
||||
else:
|
||||
return None
|
||||
# Search for the custom module
|
||||
if customizable:
|
||||
import sys
|
||||
# Try to find the module in sys.path
|
||||
for path in sys.path:
|
||||
# Skip this path if not directory
|
||||
if not os.path.isdir(path):
|
||||
continue
|
||||
for file in os.listdir(path):
|
||||
# If there is a script matching the custom module name,
|
||||
# import it with the default module name
|
||||
if file == (module_name + ".py"):
|
||||
from importlib.util import spec_from_file_location
|
||||
return spec_from_file_location(module_name, "{0}/{1}.py".format(path, module_name))
|
||||
import sys
|
||||
# Try to find the module in sys.path
|
||||
for path in sys.path:
|
||||
# Skip this path if not directory
|
||||
if not os.path.isdir(path):
|
||||
continue
|
||||
for file in os.listdir(path):
|
||||
# If there is a script matching the custom module name,
|
||||
# import it with the default module name
|
||||
if file == (module_name + ".py"):
|
||||
from importlib.util import spec_from_file_location
|
||||
return spec_from_file_location(module_name, "{0}/{1}.py".format(path, module_name))
|
||||
return None
|
||||
# Python calls meta path finders and asks them to handle the module import if
|
||||
# they can
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ then
|
|||
conda install -q -y -c vlsida-eda ${tool}
|
||||
done
|
||||
|
||||
# Install required Python packages
|
||||
# (This step isn't required but used to prevent possible issues)
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
conda deactivate
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue