Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

How to make faster Linux to FPGA's On-Chip RAM access

I've connect FPGA's On-Chip RAM's Avalon Slave to h2f_axi_master and Clock to h2f_user0_clock, 100 MHz.

In Linux I've mmap On-Chip RAM

fd_IQ_RAM = open("/dev/mem", O_RDWR|O_SYNC);
mem_IQ_RAM = (unsigned int *)mmap(NULL, MAP_IQ_RAM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd_IQ_RAM, MAP_IQ_RAM_BASE);

RAM is filled in FPGA and in Linux I send data from RAM to Ethernet:

while (...) {
  ret_val = sendto(sock, (void * )(mem_IQ_RAM), sizeof(data_in_RAM), 0, (struct sockaddr *) &echoclient, sizeof(echoclient));
}

Transfer speed is 12...19 MB/s or less, if I send data from SDRAM
unsigned int mem_IQ_RAM;
then speed is more than 40 MB/s.

What is wrong? How can I make it faster?
No RepliesBe the first to reply