Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI am somewhat leaning towards the belief that this can't be done. The problem is that a function is supposed to return a value which only depends on its inputs. AFAIK, you can only initialize a constant from a function and not from an impure function or procedure. So ... unless there is a builtin function that does this, I think I'm stuck.
In some sense it's a kind of symmetry breaking problem. For my actual use-case I've opted for the somewhat lame approach of just putting a RW "id" register in my devices and then just initializing them from a software counter which iterates all devices inside the SoC. Clearly, a purely VHDL solution would be better. :-/