When multiple Python APIs reference a structure type in their method arguments, the structure typedef is replicated in the generated SV package:
class Point(ct.Structure):
_fields_ = [
("x", ct.c_int32),
("y", ct.c_int32),
]
@hif.api
class FirstAPI(object):
@hif.imp
async def func1(self, pt: Point):
pass
@hif.api
class SecondAPI(object):
@hif.exp
def func2(self, pt: Point):
print(pt)
The above code results in two Point_t structure typedefs in the generated SV package, resulting in the following VCS error:
Error-[IPD] Identifier previously declared
Identifier 'Point_t' previously declared as typedef
A workaround is to split these APIs into separate files and generate them separately, but it would be convenient to add memory when a structure was generated to prevent duplicate definitions.