2

I am writing a normal bandwidth kernel in C++ for FPGA, which is reading something from host memory and writing it back to different location in host. I'm using structs, one of whose elements is addresses for input and output buffers. High-level synthesis tool is giving error for the last line in the following code.

    struct addr_struct {
              ap_uint<64> address;
              ap_uint<32> size;
              ap_uint<16> type;
              ap_uint<16> flags;
      };
    struct addr_struct CA_INPUT;
    struct addr_struct CA_OUTPUT;
    din_mem = 0x00;
    dout_mem = 0x00;
    ap_uint<32> i;
    ap_uint<512> temp;
    ap_uint<512> *din_mem;
    ap_uint<512> *dout_mem; 
    for(i=0; i<2048; i++){
    temp= (ap_uint<512> *)(din_mem + CA_INPUT.address + i*64);
    (ap_uint<512> *)(dout_mem + CA_OUTPUT.address + i*64) = temp;}
user3509540
  • 41
  • 1
  • 7

1 Answers1

3

I assume you want to assign to the pointer in dout_mem, therefore there is missing dereference before (ap_uint<512> *) (note the star at the beginning):

*(ap_uint<512> *)(dout_mem + CA_OUTPUT.address + i*64) = temp;
Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43