Reorganize library files to include everything

This commit is contained in:
Eren Dogan 2022-11-04 15:10:44 -07:00
parent 3ed1a92ce2
commit 557b2e7459
5 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,6 @@
include Makefile
include openram.mk
include setpaths.sh
include requirements.txt
include docker/*
recursive-include compiler *

View File

@ -218,6 +218,8 @@ wipe: uninstall
# Build the openram library
build-library:
@rm -rf dist
@rm -rf openram.egg-info
@python3 -m build
.PHONY: build-library

View File

@ -13,7 +13,7 @@ try:
OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME"))
except:
import openram
OPENRAM_HOME = os.path.dirname(openram.__file__)
OPENRAM_HOME = os.path.dirname(openram.__file__) + "/compiler"
if not os.path.isdir(OPENRAM_HOME):
assert False

View File

@ -1,6 +1,6 @@
OPENRAM_HOME := $(abspath $(TOP_DIR)/compiler)
OPENRAM_TECH := $(abspath $(TOP_DIR)/technology)
OPENRAM_COMPILER := $(abspath $(TOP_DIR)/openram.py)
OPENRAM_COMPILER := $(abspath $(TOP_DIR)/sram_compiler.py)
PDK_ROOT ?= $(TOP_DIR)

View File

@ -9,9 +9,9 @@ from setuptools import setup, find_namespace_packages
# Include these folder from the root of repo as submodules
include = ["docker", "technology"]
include = ["compiler", "docker", "technology", "macros"]
# Exclude files/folders with these words
exclude = ["docs", "images", "macros"]
exclude = ["docs", "images"]
# Find all modules inside the 'compiler' folder
@ -24,7 +24,7 @@ for dir in find_namespace_packages():
# Replace 'compiler' with 'openram' for package names
packages = []
for dir in dirs:
packages += [dir.replace("compiler", "openram")]
packages.append(dir)
# Make the included folders submodules of openram package
for i in range(len(packages)):
@ -35,6 +35,10 @@ for i in range(len(packages)):
for i in range(len(dirs)):
dirs[i] = dirs[i].replace(".", "/")
# Insert the root as the openram module
packages.insert(0, "openram")
dirs.insert(0, "")
# Zip package names and their paths
package_dir = {k: v for k, v in zip(packages, dirs)}