mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-12-22 15:08:39 +00:00
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:
parent
17f1877390
commit
240fba8e12
@ -264,13 +264,16 @@ class AddrMap(Component):
|
|||||||
|
|
||||||
|
|
||||||
def __append_genvars(self):
|
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 ',
|
'\ngenvar ',
|
||||||
', '.join([chr(97+i) for i in range(self.get_max_dim_depth())]),
|
genvars,
|
||||||
';\n'
|
';\n'
|
||||||
])
|
])
|
||||||
|
|
||||||
self.rtl_header.append(genvars)
|
self.rtl_header.append(genvars_instantiation)
|
||||||
|
|
||||||
def get_package_names(self) -> set():
|
def get_package_names(self) -> set():
|
||||||
names = set()
|
names = set()
|
||||||
|
Loading…
Reference in New Issue
Block a user