Resolve bug for addrmaps without any genvars

In this case, there would be a line with `genvars ;`. This is not
compilable by SystemVerilog compilers.
This commit is contained in:
Dennis Potter 2021-09-12 19:37:30 -07:00
parent 17f1877390
commit 240fba8e12
Signed by: Dennis
GPG Key ID: 186A8AD440942BAF

View File

@ -264,13 +264,16 @@ class AddrMap(Component):
def __append_genvars(self):
genvars = ''.join([
genvars = ', '.join([chr(97+i) for i in range(self.get_max_dim_depth())])
if genvars:
genvars_instantiation = ''.join([
'\ngenvar ',
', '.join([chr(97+i) for i in range(self.get_max_dim_depth())]),
genvars,
';\n'
])
self.rtl_header.append(genvars)
self.rtl_header.append(genvars_instantiation)
def get_package_names(self) -> set():
names = set()