Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Why didn't you just try using it and let the compiler decide? You can use a function pretty much anywhere, eg., I use them for setting (calculating) generics like address widths based on the number of registers, etc.,and that code occurs right at the beginning of the architecture. If you're having trouble using functions somewhere in your VHDL, post example code. If you're violating some feature of VHDL, I'll look in the standard and see what it says about your case. Cheers, Dave --- Quote End --- It was only a conceptual doubt. I did read in a book the following concept: "function and procedure (called subprograms) are very similar to process, in the sense that these three are the only sections of vhdl code that are interpreted sequentially (like regular computer programs)". And I understood that it was only allowed to use functions inside sequential code. I already did use functions in concurrent code but I was worried about using a "bad technique". Finite State Machines, for instance, can be written in VHDL, compiled correctly, but they can be developed without a good sequential/combinational segmentation of the code, resulting in a bad technique. Now it is clear. Thank you