by Guest »
Sorry about the messy phrasing.
Well, I found that for some reason the string is sent (or received?) in reverse order. So using allwrite(fd, &data, 4) when data is initialized with ABCD is being stored as DCBA on the FPGA. Perhaps it's related to the fact I've "broken" the user_w_mem_data signal to 4 chunks of 8 bits, so I can store the chars individually for convenience. At any rate, this wasn't an issue when I was using strtoul or atoi. Furthermore, when reading from FPGA and using %s in printf, it does show up correctly as ABCD.
I'd like to understand why and how this is happening, but I understand this is probably not the right place to ask. So sorry if this question was misplaced, but thanks for the help, because I now know the issue and can work around it (I'll just reverse the order of Bytes on the FPGA side).
Thank you.
Sorry about the messy phrasing.
Well, I found that for some reason the string is sent (or received?) in reverse order. So using allwrite(fd, &data, 4) when data is initialized with ABCD is being stored as DCBA on the FPGA. Perhaps it's related to the fact I've "broken" the user_w_mem_data signal to 4 chunks of 8 bits, so I can store the chars individually for convenience. At any rate, this wasn't an issue when I was using strtoul or atoi. Furthermore, when reading from FPGA and using %s in printf, it does show up correctly as ABCD.
I'd like to understand why and how this is happening, but I understand this is probably not the right place to ask. So sorry if this question was misplaced, but thanks for the help, because I now know the issue and can work around it (I'll just reverse the order of Bytes on the FPGA side).
Thank you.