Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThe Nios II compiler can only handle up to 64-bit data types (double, long long, unsigned long long). The processor is 32-bit so when it accesses 64-bit data in memory it can only do so 32 bits at a time and when it operates on 64-bit data it typically does so 32 bits at a time. In otherwords if you have to access 128-bit data in memory you will need to do so using the smaller C data types that are available to you. For example if I had to write 128 bits of data in the form of four 32-bit words (data0, data1, data2, and data3) to a location 0x1000 in my memory space I would do something like this:
IOWR_32DIRECT(0x1000, 0, data0); // bits 31 to 0 IOWR_32DIRECT(0x1000, 4, data1); // bits 63 to 32 IOWR_32DIRECT(0x1000, 8, data2); // bits 95 to 64 IOWR_32DIRECT(0x1000, 12, data3); // bits 127 to 96 The macros above are defined in io.h so you would have to include that file to use them. Those macros ensure that the Nios II data cache is bypassed, for more information what that's necessary I would google search "cache coherency".