Package with enums shall not be dumped if no enums are present

This commit is contained in:
Dennis Potter 2021-10-14 23:22:01 -07:00
parent 6e355c62af
commit b23ddded74
Signed by: Dennis
GPG Key ID: 186A8AD440942BAF

View File

@ -371,10 +371,14 @@ class AddrMap(Component):
# Create RTL to return # Create RTL to return
for key, value in enum_rtl.items(): for key, value in enum_rtl.items():
if not value:
# Skip if package wouldn't contain any enums
continue
package_rtl =\ package_rtl =\
AddrMap.templ_dict['package_declaration']['rtl'].format( AddrMap.templ_dict['package_declaration']['rtl'].format(
name = key, name = key,
pkg_content = '\n\n'.join(enum_rtl[key])) pkg_content = '\n\n'.join(value))
rtl_return[key] = AddrMap.add_tabs( rtl_return[key] = AddrMap.add_tabs(