Thread: Error: Expression is not assignable C++ struct

  1. #1
    Registered User
    Join Date
    Oct 2016
    Posts
    1

    Error: Expression is not assignable C++ struct

    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.

    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; 
            temp= (ap_uint<512> *)(din_mem + CA_INPUT.address + i*64);
            (ap_uint<512> *)(dout_mem + CA_OUTPUT.address + i*64) = temp;

  2. #2
    Nasal Demon Xupicor's Avatar
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    179
    It looks like you're missing dereference operator in your two last lines.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error: expected an expression
    By cdmstr in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2011, 02:00 PM
  2. Replies: 2
    Last Post: 11-25-2009, 07:38 AM
  3. Eight by Eight Grid with Assignable Values?
    By Argiem in forum C Programming
    Replies: 5
    Last Post: 12-08-2008, 12:37 PM
  4. Error: expected an expression!
    By bobthebullet990 in forum C Programming
    Replies: 2
    Last Post: 01-05-2007, 09:05 AM
  5. expression error?
    By trekker in forum C++ Programming
    Replies: 3
    Last Post: 11-30-2003, 07:17 PM

Tags for this Thread