Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- At first sight, the code can't synthesize due to various errors related to the incorrect handling of numeric types. Next problem is, that integer or natural are restricted to 32 bits in most VHDL implementations, e.g. Quartus or ModelSim, So you won't never get a correct result of 41 bit length. But the serious problem is, that recursion depth isn't restricted in a way, that could be recognized by the design compiler. If you let Quartus try to compile the code (after editing the syntax errors and ignoring the result length issue), you get this: Error (10493): VHDL Function Call or Procedure Call Statement error at hermitePolynomial_2.vhd(20): calls to function or procedure "Her" caused stack overflow That's pretty reasonable when trying to synthesize an effictively infinite number of subprogram instances! I see, that you have restricted d to 15 in the input. But because you change it to natural, the compiler can't "see" this restriction. Furthermore even d=15 would be too much for synthesis considering the quadratic growth of recursion, but it's somewhat more finite. The basic point is, that recursion in HDL means generating parallel logic instances. So although it's generally allowed for subprograms, it's only meaningful for special cases. --- Quote End --- @FvM: Thank you very much. Now, I realize I got to go for a long way to reach real VHDL programming. Could you please give me the edited code? so that I can refer it.