mirror of https://github.com/VLSIDA/OpenRAM.git
Fix KeyError for bitell types.
This commit is contained in:
parent
5176a70f84
commit
f30d0b9197
|
|
@ -67,4 +67,8 @@ class ModuleType():
|
||||||
self.names[b] = c
|
self.names[b] = c
|
||||||
|
|
||||||
def __getitem__(self, b):
|
def __getitem__(self, b):
|
||||||
|
if b not in self.names.keys():
|
||||||
|
raise KeyError
|
||||||
|
|
||||||
return self.names[b]
|
return self.names[b]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ class sram_factory:
|
||||||
A generic function to create a module with a given module_type.
|
A generic function to create a module with a given module_type.
|
||||||
The args are passed directly to the module constructor.
|
The args are passed directly to the module constructor.
|
||||||
"""
|
"""
|
||||||
|
real_module_type = module_type
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tech import tech_modules
|
from tech import tech_modules
|
||||||
real_module_type = tech_modules[module_type]
|
real_module_type = tech_modules[module_type]
|
||||||
|
|
@ -43,6 +45,9 @@ class sram_factory:
|
||||||
# If they didn't define these, then don't use the option types.
|
# If they didn't define these, then don't use the option types.
|
||||||
# Primarily for backward compatibility and simplicity of tech files.
|
# Primarily for backward compatibility and simplicity of tech files.
|
||||||
pass
|
pass
|
||||||
|
except KeyError:
|
||||||
|
# If it wasn't a tech module type, we can ignore that too.
|
||||||
|
pass
|
||||||
|
|
||||||
if hasattr(OPTS, module_type):
|
if hasattr(OPTS, module_type):
|
||||||
# Retrieve the name from OPTS if it exists,
|
# Retrieve the name from OPTS if it exists,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue