Bug report:
Quartus Pro Edition version 20.3 and 20.4 crashes during synthesis ("Fatal Error: Segment Violation") on VHDL recursive function calls with a intermediate values set to a constant or to the initial value of a variable delared in the function.
This bug was first introduced with Quartus Pro version 20.3 and persists in 20.4. Versions 20.2 and earlier handle these code constructs correctly and without complaint.
To reproduce the bug, a minimal working example is provided.
Place the files example.vhd and example.tcl in a directory. In that directory, execute:
quartus -t example.tcl
I'm also attaching a resulting error log. See file log.txt.
I'm running Quartus on CentOS 8.
Link Copied
i manage to duplicate the crashes, will get back to you if we have a workaround on this.
Thanks, @KennyT_Intel. I'm already able to work around it with a minor code change in my design. I brought this problem to your attention so that it will be fixed in Quartus. Can you confirm that this will be fixed in the next release?
Our developer will need sometimes to work on this.
Do you mind to share with us your workaround?
Gladly.
For the workaround, instead of assigning the value to a constant, assign it to a variable, with the assignment done in the body of the function. See attached.
Note that the assignment of the value to the variable must be done in the body of the function, must not be done as an initial value assignment in the declarative part of the function, as the latter results in the same crash as setting a constant.
Also, oops, just noticed an error in my original post.
quartus -t example.tcl
Should have been:
quartus_sh -t example.tcl
to run Quartus in shell mode for the example provided. No need to bring up the GUI.
For more complete information about compiler optimizations, see our Optimization Notice.