cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
230 Views
Registered: ‎03-17-2020

Axi-stream data dsp with HLS (Normalize)

Jump to solution

Hi. I'm a FPGA newbie.

Currently, I want to implement the functions I want on the FPGA using the HLS tool.


The block that I want to implement is as follows.

After receiving the axi-stream data(16 bits) coming from multiple channels, finding the largest value, I want to create an IP that normalizes each stream data to the corresponding value and outputs it.

 

20200427_213241.png

In the normalization process, division operation is required, and the result value of the normalized data is to be output in the form of a fixed point.

(ap_fixed<16,1>)

We didn't use floating-point arithmetic because we don't need precise division.

 

 

To obtain the digital bit corresponding to the fixed-point division result, the following operation was performed.

short  Output1 = (x1 << 15) / (largest value)

 

 

Even though I confirmed that there was no problem with the code on the test bench, when I check the data using the Vivado ILA, I get 0000.

(I have already tried floating type and double type, but the result was the same.)

Previously, I had experience implementing division blocks with denominator set to a constant value, and this time it was well implemented.

I would like to know if the process of receiving and processing denominator terms as stream data during division is not possible in HLS.


If so, I am wondering if there is a good idea to normalize based on the maximum value of the received data.

 

 


Thank you in advance and I will wait for your reply.

Regards.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
210 Views
Registered: ‎03-28-2016

Re: Axi-stream data dsp with HLS (Normalize)

Jump to solution

@twyu0211 ,

What you are describing should be doable in HLS.  The biggest issue is the "largest value" that is used to scale the rest of the data.  This will require two passes of the data.  One pass to find the "largest value" and then a second pass to scale all of the data by the "largest value" that was found during the first pass.

If the scale of the data doesn't change too much from one run to the next, you could do a single pass  implementation that scales the data by the "largest value" from the previous batch of the data and looks for the largest value in the current batch of data so that it can be used to scale the next batch of data.  There will always be a one "batch" delay between the data and the "largest value" that is used to scale the data.

If the amount of data being processed in each "batch" isn't too large, you could implement the 2 pass version by storing the data in an internal buffer between the two passes.  That way you wouldn't have to input the data twice.

Ted Booth | Tech. Lead FPGA Design Engineer | DesignLinx Solutions
https://www.designlinxhs.com

View solution in original post

0 Kudos
3 Replies
Highlighted
Scholar
Scholar
211 Views
Registered: ‎03-28-2016

Re: Axi-stream data dsp with HLS (Normalize)

Jump to solution

@twyu0211 ,

What you are describing should be doable in HLS.  The biggest issue is the "largest value" that is used to scale the rest of the data.  This will require two passes of the data.  One pass to find the "largest value" and then a second pass to scale all of the data by the "largest value" that was found during the first pass.

If the scale of the data doesn't change too much from one run to the next, you could do a single pass  implementation that scales the data by the "largest value" from the previous batch of the data and looks for the largest value in the current batch of data so that it can be used to scale the next batch of data.  There will always be a one "batch" delay between the data and the "largest value" that is used to scale the data.

If the amount of data being processed in each "batch" isn't too large, you could implement the 2 pass version by storing the data in an internal buffer between the two passes.  That way you wouldn't have to input the data twice.

Ted Booth | Tech. Lead FPGA Design Engineer | DesignLinx Solutions
https://www.designlinxhs.com

View solution in original post

0 Kudos
Highlighted
Visitor
Visitor
152 Views
Registered: ‎03-17-2020

Re: Axi-stream data dsp with HLS (Normalize)

Jump to solution

Thank you for your kind answer. In the end, you need a buffer that stores data between the two stages of the process.

As you have advised, I will try to modify the code once and proceed with the design.

Regards.

0 Kudos
Highlighted
Visitor
Visitor
138 Views
Registered: ‎03-17-2020

Re: Axi-stream data dsp with HLS (Normalize)

Jump to solution

The data value is observed to be equal to 0000 even though the division operation was performed by placing another buffer according to your comment.


It proceeded by dividing the block that finds the largest value and divides the block that divides into two.


There is no problem in the c ++ testbench, but the problem with creating blocks seems to be a problem with the division operator itself.


I think I need to implement division operations in a different way, but any ideas?

0 Kudos