- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 parameter
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page