help needed
help needed
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Hello,
the analyzer couldn't find the start mark.
Did you palce the marks (IACA_START and IACA_END) from iacaMArks.h around the code you want to anazye?
Thanks,
Tal
Tal, thank you very much for your quick reply. This is my codes. In the main.c : sync_catch(signal_rx,CHUNK_LEN/3*2.1, paras,&g_fo,&g_timing_pos,&g_cell_id,debug_enable) In the sync_catch.c: decimate_sync(signal_rx_d, signal_rx, sigal_len, decimate_rate); In the dsp_sync.c: void decimate_sync(complex_i *y, complex_i *x, size_t xlen, int r) the decimate sync part is the code I want to analyze.And I place the marks in it. Is it available?
Did you implement decimate_sync? make sure to put the marks
in the function and not around a call
This is a static analyzer, if this code is implemented in a shred object file
than the analyzer will not be able find the marks.
Thanks,
Tal
#include
#include
#include
#include "iacaMarks.h"
typedef float complex_f[2];
typedef short complex_i[2];
typedef int complex_i32[2];
void decimate_sync(complex_i *y, complex_i *x, size_t xlen, int r)
{
static short b[9]={16384,32767,16384,16384,32767,16384,16384,32767,16384};
static short a[9]={16384,-27217,13310,16384,-23414,9160,16384,-21666,7253};
static short g[3]={1238,1065,986};
complex_i32 px[9],py[9];
complex_i32 iir_out[xlen];
memset(px, 0, sizeof(complex_i32) *9);
memset(py, 0, sizeof(complex_i32) *9);
int di=10,iy=0;
for(int k=0;k
{
IACA_START
px[0][0]=x[k][0];
px[0][1]=x[k][1];
iir_out[k][0]=((px[0][0])*(b[0])>>14);
iir_out[k][1]=((px[0][1])*(b[0])>>14);
for(int i=1;i<=2;i++)
{
iir_out[k][0]+=((px[i][0]*b[i])>>14)-(a[i]*py[i][0]>>14);
iir_out[k][1]+=((px[i][1]*b[i])>>14)-(a[i]*py[i][1]>>14);
}
for(int i=2;i>0;i--)
{
px[i][0]=px[i-1][0];
px[i][1]=px[i-1][1];
}
py[2][0]=py[1][0];
py[2][1]=py[1][1];
py[1][0]=iir_out[k][0];
py[1][1]=iir_out[k][1];
px[3][0]=py[1][0]*g[0]>>15;
px[3][1]=py[1][1]*g[0]>>15;
iir_out[k][0]=((px[3][0])*(b[3])>>14);
iir_out[k][1]=((px[3][1])*(b[3])>>14);
for(int i=1;i<=2;i++)
{
iir_out[k][0]+=((px[3+i][0]*b[3+i])>>14)-(a[3+i]*py[3+i][0]>>14);
iir_out[k][1]+=((px[3+i][1]*b[3+i])>>14)-(a[3+i]*py[3+i][1]>>14);
}
for(int i=5;i>=4;i--)
{
px[i][0]=px[i-1][0];
px[i][1]=px[i-1][1];
}
py[5][0]=py[4][0];
py[5][1]=py[4][1];
py[4][0]=iir_out[k][0];
py[4][1]=iir_out[k][1];
px[6][0]=py[4][0]*g[1]>>15;
px[6][1]=py[4][1]*g[1]>>15;
iir_out[k][0]=((px[6][0])*(b[6])>>14);
iir_out[k][1]=((px[6][1])*(b[6])>>14);
for(int i=1;i<=2;i++)
{
iir_out[k][0]+=((px[6+i][0]*b[6+i])>>14)-(a[6+i]*py[6+i][0]>>14);
iir_out[k][1]+=((px[6+i][1]*b[6+i])>>14)-(a[6+i]*py[6+i][1]>>14);
}
for(int i=8;i>=7;i--)
{
px[i][0]=px[i-1][0];
px[i][1]=px[i-1][1];
}
py[8][0]=py[7][0];
py[8][1]=py[7][1];
py[7][0]=iir_out[k][0];
py[7][1]=iir_out[k][1];
if ( (k-di)>=0 && (k-di)%r==0)
{
y[iy][0] = iir_out[k][0]*(0.030094146728515625)+0.5;
y[iy][1] = iir_out[k][1]*(0.030094146728515625)+0.5;
iy++;
}
}//the end of loop
IACA_END
}
void main()
{
complex_i x[10]={{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,1}};
int xlen=10;
int r=4;
complex_i y[10];
decimate_sync(y,x,xlen,r);
printf("%d,%d",y[1][0],y[1][1]);
}
I want to analyze the code in the loop.Where is the right place?
What's more,when I add the marks,the gdb says:"Program received signal SIGILL, Illegal instruction."
Thanks!
Best Reply
The marks contain UD bytes, this is the reason the program
is failing with the marks. you shouldn't run the binary that contain the marks,
only use it for analysis.
The fact that you are seeing the UD when you run the application suggest that
it does contain the marks.
I copied your code snippet to my local dir and compiled as so:
gcc example.c -o example -I iaca-lin32/include -std=c99
running the analyzer,
iaca-lin32/bin/iaca.sh -64 example
I was able to get analysis from the analyzer
how do you compile/run your code?
Thanks,
Tal
Tal:
Thank you very much . I do as what you do and I get the analysis now. I found the way I compile is wrong. And now I can continue my job. Thank you for your help again.


