Error passing type access to function in VHDL

我怕爱的太早我们不能终老 提交于 2019-12-12 01:23:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!