I'm trying to port a baremetal design, in which I have a simple HLS IP that performs vector additions, that triggers an interrupt when it finishes its computation. After the bitstream generation I exported the hdf and I generated the Petalinux project based on it, in which I specified "generic-uio" in the compatible field as follows:
CONFIG_UIO=y
CONFIG_UIO_PDRV_GENIRQ=M
CONFIG_UIO_DMEM_GENIRQ=M
then I create a simple application that runs the initialization drivers of the IP and wait for interrupts:int main(){int a ;int b ;for(int i =0; i < N; i){
a = i;
b = i;}XIrq_genHLSdevice;XIrq_gen_Initialize(&HLSdevice,"irq_gen");XIrq_gen_Write_a_Words(&HLSdevice,0, a, N);XIrq_gen_Write_b_Words(&HLSdevice,0, b, N);int uioFd = open(UIO_DEVICE, O_RDWR);if( uioFd <0){
fprintf(stderr,"Cannot open %s:%s
", UIO_DEVICE, strerror(errno));return-1;}volatileuint32_t* counters = mmap(NULL, MMAP_SIZE, PROT_READ, MAP_SHARED, uioFd,0);if(counters == MAP_FAILED){
fprintf(stderr,"Cannot mmap:%s
", strerror(errno));
close(uioFd);return-1;}uint32_t intInfo;ssize_t readSize;for(int i =0; i <10; i){XIrq_gen_Start(&HLSdevice);
printf("XIrq_gen_Start()");
intInfo =1;if(write(uioFd,&intInfo,sizeof(intInfo))<0){
fprintf(stderr,"Cannot acknowledge uio device interrupt:%s
", strerror(errno));break;}
printf("write()");// Wait for interrupt
readSize = read(uioFd,&intInfo,sizeof(intInfo));if(readSize <0){
fprintf(stderr,"Cannot wait for uio device interrupt:%s
", strerror(errno));break;}// Display counter value
printf("We got %lu interrupts, counter value:0xx", intInfo, counters );}XIrq_gen_Release(&HLSdevice);return0;}
The program blocks on the read call and does not receive any interrupts. Under /proc/interrupts I can see my HLS IP, but the interrupt counter is still zero:
Question
HeroGian
hello,
I'm trying to port a baremetal design, in which I have a simple HLS IP that performs vector additions, that triggers an interrupt when it finishes its computation. After the bitstream generation I exported the hdf and I generated the Petalinux project based on it, in which I specified "generic-uio" in the compatible field as follows:
Then I created an appropriate bootargs configuration and placed inside the uEnv.txt file:
and I enabled the following modules:
The program blocks on the read call and does not receive any interrupts. Under /proc/interrupts I can see my HLS IP, but the interrupt counter is still zero:
could you please give me some hints? thanks
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.