Forum Discussion

James_B's avatar
James_B
Icon for Contributor rankContributor
4 years ago
Solved

VHDL Function Overloading not working

I have a VHDL function that is overloaded and works "inconsistently" meaning that sometimes is works and sometimes is just does not. The general signature of this function is (with return types as ...
  • James_B's avatar
    4 years ago

    Nurina,

    Thank you for the feedback, this is very helpful.

    Basically, if I can summarize your answer, the overloading functions need to have distinct Types for the arguments. From a function signature point of view:

    my_function(arg1 : type1) return result type 1

    should have an overloaded function type of :

    my_function(arge1 : type2) return result type 2

    Correct ?

    On a background note:

    I am updating a code base that someone else developed; I typically would not use overloaded functions. The design intent was to make the VHDL more readable; however I think the basic issue is that the same argument type is present in all three overloaded versions of the function, as you have illustrated. The design is large and there are many functions in packages meant to make the design more readable, however, there are always issues with VHDL conversions if one does not handle them carefully as appears to be the case here.

    Thank you and Regards,

    James