问题
I have a record in VHDL that contains a pointer (access
).
I need to create a function that receives this record as parameter and from its data write in a file.
But simulating with MODELSIM I get the following error:
**Error: (vcom-1462) Illegal declaration of constant "xxx" of type x_file_format (type is or contains access type).
How can I pass a pointer as parameter to a function?
回答1:
Function parameters can only be constant (or signal or file) inputs. Access types must be variables. Therefore you must write a procedure to do it, with the access type passed in as a variable.
Procedure proc ( variable ptr : someAccessType ) is
来源:https://stackoverflow.com/questions/53694255/error-passing-type-access-to-function-in-vhdl