Koheron / koheron-sdk

SDK for FPGA / Linux Instruments
https://www.koheron.com/software-development-kit/
Other
101 stars 41 forks source link

Loading contents of BRAM #560

Open grahamnaylorccfe opened 1 year ago

grahamnaylorccfe commented 1 year ago

Writing to BRAM seems quite slow. I have a 64k BRAM (16k x 4 byte) memory but using driver.set_IQBRAM() takes about 440ms to complete:

For this to send data to the IQBRAM, the 32 bit data needs to be pre-loaded into eg driver.IQdata numpy array

def set_IQBRAM(self):
    @command()
    def set_IQBRAM_data(self, data):
        pass
    set_IQBRAM_data(self, self.IQBRAM)

Any ideas on how to speed this up?

rsarwar87 commented 1 year ago

Hi Graham, the speed is probably slow because of the for loop and the TCP latancy related to each call.

You could write all the data in one go and see if that helps

template<typename T, size_t N, uint32_t offset = 0>
    void write_array(const std::array<T, N>& arr, uint32_t block_idx = 0)