mirror of https://github.com/VLSIDA/OpenRAM.git
Added the new import method
This commit is contained in:
parent
613146520e
commit
c447ec49eb
19
sram_char.py
19
sram_char.py
|
|
@ -16,20 +16,11 @@ an analytical model or spice simulation is used for characterization.
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
from globals import *
|
from globals import *
|
||||||
try:
|
|
||||||
import openram
|
# You don't need the next two lines if you're sure that openram package is installed
|
||||||
except:
|
from common import *
|
||||||
# If openram library isn't found as a python package,
|
make_openram_package()
|
||||||
# import it from the $OPENRAM_HOME path.
|
import openram
|
||||||
import importlib.util
|
|
||||||
OPENRAM_HOME = os.getenv("OPENRAM_HOME")
|
|
||||||
# Import using spec since the directory can be named something
|
|
||||||
# other than "openram".
|
|
||||||
spec = importlib.util.spec_from_file_location("openram", "{}/../__init__.py".format(OPENRAM_HOME))
|
|
||||||
module = importlib.util.module_from_spec(spec)
|
|
||||||
sys.modules["openram"] = module
|
|
||||||
spec.loader.exec_module(module)
|
|
||||||
import openram
|
|
||||||
|
|
||||||
(OPTS, args) = openram.parse_args()
|
(OPTS, args) = openram.parse_args()
|
||||||
|
|
||||||
|
|
|
||||||
18
sram_func.py
18
sram_func.py
|
|
@ -17,20 +17,10 @@ import sys
|
||||||
import datetime
|
import datetime
|
||||||
from globals import *
|
from globals import *
|
||||||
|
|
||||||
try:
|
# You don't need the next two lines if you're sure that openram package is installed
|
||||||
import openram
|
from common import *
|
||||||
except:
|
make_openram_pacakage()
|
||||||
# If openram library isn't found as a python package,
|
import openram
|
||||||
# import it from the $OPENRAM_HOME path.
|
|
||||||
import importlib.util
|
|
||||||
OPENRAM_HOME = os.getenv("OPENRAM_HOME")
|
|
||||||
# Import using spec since the directory can be named something
|
|
||||||
# other than "openram".
|
|
||||||
spec = importlib.util.spec_from_file_location("openram", "{}/../__init__.py".format(OPENRAM_HOME))
|
|
||||||
module = importlib.util.module_from_spec(spec)
|
|
||||||
sys.modules["openram"] = module
|
|
||||||
spec.loader.exec_module(module)
|
|
||||||
import openram
|
|
||||||
|
|
||||||
(OPTS, args) = openram.parse_args()
|
(OPTS, args) = openram.parse_args()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue