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