-
Notifications
You must be signed in to change notification settings - Fork 530
Description
Hi,
I have created a 2 MB BRAM memory using Block Memory Generator. But in my test case, I want to store the data which is more than 2 MB (I may transfer up to 100 MB). So there is module which takes care of this transaction, which will feed the data from the BRAM to the receiver which I want to validate at 40 MHz speed. When half of the memory is feed to the receiver it will update the half count . When the half count is updated immediately half of the memory will be written with next 1 MB of new data.
There is an AGC RAM in the receiver. When I configure the AGC RAM. This Half count reading is taking more time. Even filling up the memory is taking more time. So the receiver is not able to receive the actual data. When the AGC is not configured, there is no issue. Half count read is fast and filling up memory is also fast. What will be the cause of this issue?
The c code logic I am using is
`int` target_half = 0;
while (1) {
rc = fpga_dma_burst_read(read_fd, (uint8_t*)(&half_count),4, (BASE_ADDR_IPC + 0x1c));
// Check if half_count has changed
if (half_count != target_half) {
// Update the target_half variable
target_half = half_count;
printf("Half_count: %d\n",half_count);
// Determine which half to fill based on the parity of half_count
if (half_count % 2 == 1)
{
rc = fpga_dma_burst_write(write_fd, &((uint8_t *)ptr_to_adc_buffer)[BUFFER_ADDR], half_size, BASE_ADDR_ADC);
BUFFER_ADDR = BUFFER_ADDR + 1048576;
} else {
rc = fpga_dma_burst_write(write_fd, &((uint8_t *)ptr_to_adc_buffer)[BUFFER_ADDR], half_size, BASE_ADDR_ADC + 0x100000);
BUFFER_ADDR = BUFFER_ADDR + 1048576;
}
}
if (exp_half_count == half_count) {
break;
}`
Note: clock_main_a0 is 125 MHz and the receiver receiving the data at 40 MHz. When I go with pci it is taking 1.3 ms to write the 40000 data into BRAM( I don't want this since read is happening at 1 ms inside the FPGA). So, I am going with DMA where it takes only 0.19 ms to write the data into BRAM.
Kindly help me solving this issue. Thanks.