Forum Discussion
Altera_Forum
Honored Contributor
11 years agosystem verilog system functions in quartus integrated Synthesis
Is there ability to use sv system function such as $ceil, $pow etc to caluculate module parameters (localparmeters)?
For example something like thatparameter integer N_COEFF_ACCUM =($ceil(( SUMM1 + SUMM2 - SUMM3) * CLK_FREQUENCY)); SUMM1, SUMM2, SUMM3 are real parameter2 Replies
- Altera_Forum
Honored Contributor
hey Radamaher,
Doesn't look like it's gonna work. http://quartushelp.altera.com/14.0/mergedprojects/hdl/vlog/vlog_list_support.htm http://quartushelp.altera.com/current/master.htm#mergedprojects/hdl/vlog/vlog_support_2001.htm http://quartushelp.altera.com/15.0/mergedprojects/hdl/vlog/vlog_list_sys_vlog.htm doesn't show that those maths functions / conversion functions are supported in Quartus. sad but true... but just my opinion based on what the docs say... - Altera_Forum
Honored Contributor
Quartus really does not support the system function based on my previous experience. I did few simple mathematic tricks in my coding to get the ceil function but not applicable to your case. So, you can try and verify the suggestion below as workaround.
1) Put result ( SUMM1 + SUMM2 - SUMM3) * CLK_FREQUENCY) into real parameter => parameter real real_result = (( SUMM1 + SUMM2 - SUMM3) * CLK_FREQUENCY)); 2) Put result ( SUMM1 + SUMM2 - SUMM3) * CLK_FREQUENCY) into integer parameter => parameter integer int_result = (( SUMM1 + SUMM2 - SUMM3) * CLK_FREQUENCY)); 3) Check whether "real_result" variable larger than "int_result" variable 4) If steps is true , then add 1 value into the "int_result" variable