|
|
@@ -0,0 +1,13 @@ |
|
|
|
function write_polyfir_coeffs(file, coeffs)
|
|
|
|
|
|
|
|
|
|
|
|
coeff_format = 'library ieee;\nUSE ieee.std_logic_1164.all;\nUSE work.POLY_FIR_PKG.all;\npackage coeff_fir is\n CONSTANT fir_coeffs_generated : vect_polyfir_coeffs_in := (';
|
|
|
|
for i=1:(length(coeffs)-1)
|
|
|
|
coeff_format = strcat(coeff_format,'X"%02x", ');
|
|
|
|
end
|
|
|
|
coeff_format = strcat(coeff_format,'X"%02x");\nend package coeff_fir;');
|
|
|
|
fcoeff = fopen(file,'w');
|
|
|
|
fprintf(fcoeff,coeff_format,typecast(int8(coeffs),'uint8'));
|
|
|
|
fclose(fcoeff);
|
|
|
|
|
|
|
|
end |