Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Question about good design: overriding functions, function parameters or similar

Hi,

Is in VHDL something similar to overriding a function or giving function as parameter to an entity (similar to c++ or javascript).

I'm implementing some image processing components which are similar to each other up to one or two functions which I use to calculate pixel values. I want to create one entitiy and provide different functions as parameters to this entity. I can't export signals and compute values outside of entity because function is used inside in several places, in for loops etc.

What is the best way to implement this?

My current idea is to create a large main function which calls other small functions according to parameter given to entity. The entity always calls the main function and gives a selection parameter.

11 Replies