shashi Posted April 5, 2017 Share Posted April 5, 2017 Hello there, I have developed a fixed point design, then an IP core for matrix multiplication using vivado HLS.I need to deal with fixed point data types in Vivado SDK to send data to a fixed point IP core.Does anyone has any idea of how can i go about.?Thank you Link to comment Share on other sites More sharing options...
artvvb Posted April 5, 2017 Share Posted April 5, 2017 @shashi Have you found a library to handle fixed point data in C? Otherwise you will need to write your own functions to do that, addition and subtraction should work identically to normal integers, while multiplication and division require some bit shifting or multiplication/division to maintain the correct scaling factor. As far as the processor will be aware, fixed point numbers are just integers, so to pass data, you will need to make sure that you have an AXI interface set up to connect to your core. Once you have that, you might review step eight of this tutorial to understand how to pass u32 formatted data over AXI in SDK. Vivado does not care if the u32 data is actually an unsigned integer or if the data is formatted in some other way, it just needs to be 32 bits of raw data. Thanks, Arthur Link to comment Share on other sites More sharing options...
shashi Posted April 8, 2017 Author Share Posted April 8, 2017 HI artvvb, Thank you for the reply. The problem still remains unsolved. I have added Fixed point library from Vivado HLS but not seems to be working yet. It compiles and gives result but the values are random. I have attached my code here. Can you please help me in resolving this bug.? main.cc Link to comment Share on other sites More sharing options...
jpeyron Posted April 10, 2017 Share Posted April 10, 2017 Hi @shashi, I found a thread with a potential fix when getting wrong data when using atan2 with fixed point precision using ap_fixed.h here. It talks about normalizing the data before using the function. cheers, Jon Link to comment Share on other sites More sharing options...
artvvb Posted April 10, 2017 Share Posted April 10, 2017 @shashi My suspicion is that there is an issue in your code when you are constructing the matrices A and B to be sent. I'm not really familiar with HLS, but it looks like XAxiDma_SimpleTransfer needs the buffer parameter to be a single dimensional array? You may be able to see the function prototype and source for that by control-clicking on it's name in SDK. If the second parameter is a u32*, then what you are passing is a list of addresses to your data rather than your actual data. You may need to make your matrix A a nine long buffer, I'm not really sure. As for how to interpret that from the IP core side, I really don't know. Hope this helps, Arthur Link to comment Share on other sites More sharing options...
Question
shashi
Hello there,
I have developed a fixed point design, then an IP core for matrix multiplication using vivado HLS.
I need to deal with fixed point data types in Vivado SDK to send data to a fixed point IP core.
Does anyone has any idea of how can i go about.?
Thank you
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.