pyVHDLModel
pyVHDLModel copied to clipboard
Constant in pkg files cause issues in AnalyzeObjects due to _identifiers vs _identifier
I assume this may also cause issues with other elements which use _identifiers. I am not sure how to solve this correctly. I have a local workaround to access the zeroth element of _identifiers for now (when declaredItem has the attr _identifiers).
There was once a change in the model, because a constant declaration can have multiple identifiers.
constant a, b : integer := 5;
I thought I found all places referring to _identifier when it was changed to _identifiers. A quick workaround would be defaulting to the first identifier as in many VHDL sources that will be the case.
But at the end the problem needs a solution.
See PR for potential solution. I think it may be the correct route, since it would desirable for a and b to point to the constant type. I used the following as the as the basis for the solution, but generalized it by looking for an attr of the object instead of specific object types. https://github.com/VHDL/pyVHDLModel/blob/8086c3789e069c1d55560094b93c64638633af15/pyVHDLModel/Regions.py#L141-L144
Do you think this is a good solution?
#82 looks good. I proposed a minor change to it.