Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Example Analysis of HLS Lesson20

Shulou Source: shulou.com Published: 2022-06-01 23:24:03 10月02日 Update

Today, I will talk to you about the example analysis of HLS Lesson20. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

1. Improved throughput: essentially achieved by improving parallelism

When pipeline acts on a function, there is no gap in the data from the IO point of view, while when acting on a loop, there will be a gap between the two adjacent loops.

two。 Improve latency

3. Improve area

Example: cordic

Here, the value range of z0 is required to be [- π / 2, π / 2]. For the number of [- π, π], it is necessary to pre-process and map to [- π / 2, π / 2], and then calculate it, and finally carry out post-processing.

# include "cordic.h"

Void pre_cir_cordic (di_t full_alpha,di_t & alpha,flag_t & flag)

{

If (full_alpha > PI/2)

{

Alpha=PI-full_alpha

Flag=2

}

Else if (full_alpha > m)

Yi [massi1] = Yi [m] + (xi [m] > > m)

Zi [massi1] = Zii [m]-myarctan [m]

}

Else

{

Xi [massi1] = Xi [m] + (yi [m] > > m)

Yi [massi1] = Yi [m]-(Xi [m] > > m)

Zi [massi1] = Zii [m] + myarctan [m]

}

Flag_delay_ a [m + 1] = flag_delay_ a [m]

}

Mysin= Yi [N-1]

Mycos= Xi [N-1]

Flag_delay=flag_delay_ a [N-1]

}

Void post_cir_cordic (do_t mysin,do_t mycos,flag_t flag_delay,do_t & sin_out,do_t & cos_out)

{

Switch (int (flag_delay))

{

Case 2 rig sinuous outflow mystical cosmetic outflow color mycosmic break

Case 3bloc sinuous outflow mystical cosmetic outflow color mycosmic break

Default:sin_out=mysin;cos_out=mycos;break

}

}

Void cir_cordic (di_t full_alpha,do_t & sin_out,do_t & cos_out)

{

Di_t alpha

Flag_t flag

Do_t mysin

Do_t mycos

Flag_t flag_delay

Pre_cir_cordic (full_alpha,alpha,flag)

Cir_cordic_calc (alpha,flag,mysin,mycos,flag_delay)

Post_cir_cordic (mysin,mycos,flag_delay,sin_out,cos_out)

}

After reading the above, do you have any further understanding of the example analysis of HLS Lesson20? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Content example analysis function time gap loop two between function instance data more essence knowledge article scope industry perspective information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi NVidia Apple Linux