Altera_Forum
Honored Contributor
13 years agoFIR filter coefficient calulation: $sin usage during synthesis/elaboration
Hi All,
I'm writing some DSP code, where the filter coefficients are parameterized, but fixed at instantiation time. I'm trying to keep the code generic to eliminate the need to import large lookup tables. To do this, I'm using the following constant function: function integer tap_sin; input integer tap; begin tap_sin= (tap == 0 ? 1 : $sin(PI*tap*TSAMP*BW)/(PI*tap*TSAMP*BW)) * $sin(2*PI*tap*TSAMP*FCENT) * (2*TSAMP*BW) * (2 ** 11); end endfunction When I try to compile this, I get: Error (10174): Verilog HDL Unsupported Feature error at ssb_bpf.v(41): system function "$sin" is not supported for synthesis Now, I know that $sin can't be synthesized, but I'm using it in a context where it should be evaluated during elaboration and turned into a constant. There is no need to synthesize the $sin function. Does anyone know of a way to do this cleanly, or is Quartus too rigid for this? thanks, Marcus