Skip to content
Snippets Groups Projects
Commit 560103d1 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Removed use of unclear and unnecessary try-except construction.

parent 7fa48d41
Branches
No related tags found
No related merge requests found
......@@ -122,6 +122,7 @@ class HdlConfig:
- 'hdl_lib_excludes' defines the libraries that must be excluded for synthesis
"""
# Get use_libs
use_libs = []
if 'hdl_lib_uses_synth' in lib_dict:
use_libs = lib_dict['hdl_lib_uses_synth'].split()
if build_type=='sim':
......@@ -160,13 +161,10 @@ class HdlConfig:
lib_dict = self.libs.dicts[self.lib_names.index(lib_name)]
# use recursion to include all used libs
use_libs, exclude_libs = self.get_used_libs(build_type, lib_dict, exclude_libs)
try:
for use_lib in use_libs:
if use_lib in self.lib_names:
all_use_libs.append(use_lib)
all_use_libs += self.derive_all_use_libs(build_type, use_lib, exclude_libs)
except NameError:
pass
# remove all duplicates from the list
return cm.unique(all_use_libs)
else:
......@@ -186,14 +184,11 @@ class HdlConfig:
for lib_dict in cm.listify(lib_dicts):
lib_name = lib_dict['hdl_lib_name']
use_libs, exclude_libs = self.get_used_libs(build_type, lib_dict, [])
try:
for use_lib in use_libs:
if use_lib in lib_names:
if lib_order.index(use_lib) > lib_order.index(lib_name):
lib_order.remove(use_lib)
lib_order.insert(lib_order.index(lib_name), use_lib) # move used lib to just before this lib
except NameError:
pass
# use recursion to keep on reordering the lib_order until it is stable
if lib_names != lib_order:
lib_order = self.derive_lib_order(build_type, lib_order)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment