OpenRAM/__init__.py

25 lines
748 B
Python
Raw Normal View History

2022-10-25 21:22:18 +02:00
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import os
import sys
# Attempt to add the source code to the PYTHONPATH here before running globals.init_openram().
try:
OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME"))
except:
2022-11-22 00:38:49 +01:00
OPENRAM_HOME = os.path.dirname(os.path.abspath(__file__)) + "/compiler"
2022-10-25 21:22:18 +02:00
if not os.path.isdir(OPENRAM_HOME):
assert False
if OPENRAM_HOME not in sys.path:
sys.path.insert(0, OPENRAM_HOME)
# Export everything in globals.py as part of "openram"
from globals import *