Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Problem with Alignment

Altera_Forum
Honored Contributor II
975 Views

Hey ,  

 

I got the warning message about "Non Using DMA for transfer ... lack of alignment". 

The data structure I used looks like as follows : 

""""" 

typedef struct{ 

double test1 , test2;  

int test3; 

}Test; 

typedef struct{ 

double temp1;  

double temp2;  

double temp3;  

double temp4;  

Test temp5[256]; 

Test temp6; 

}temp; 

""""" 

And I add the " __attribute__((aligned(64))) " in host and kernel like as shown : 

""""" 

typedef struct{ 

double test1 , test2;  

int test3; 

}Test; 

__attribute__((aligned(64))) 

typedef struct{ 

double temp1;  

double temp2;  

double temp3;  

double temp4;  

Test temp5[256]; 

Test temp6; 

}temp; 

""""" 

Then I executed the program and the warning message still happened and segmentation fault. 

It seems that the data can't not transfer between host and FPGA , and the program will be stopped. 

Could anyone help me , please : ((( 

 

Thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
242 Views

You probably need to manually align the data structure on the host side for example, using posix_memalign. 

 

... 

temp tmp_struct;  

posix_memalign((void**)&tmp_struct, 64, sizeof(temp)); 

...
0 Kudos
Reply