当前位置:网站首页>[HLS] Call of queuing function in pipeline simulation
[HLS] Call of queuing function in pipeline simulation
2022-07-23 09:26:00 【WW, 121】
Catalog
I. function introduction
①
ihc_hls_enqueue(void *retptr, void *funcptr,/*function arguments*/)
Parameters retptr: Return value funcptr: To be called HLS component
This function is right for HLS A call of the component is queued . The return value is stored in the first argument , The argument should be a pointer to the return type . Calling ihc_hls_component_run_all() Before , The component will not run .
②
ihc_hls_enqueue_noret(void* funcptr,/*function arguments*/)
Parameters funcptr: To be called HLS component
This function is right for HLS A call of the component is queued . When HLS The return type of the component is void when , This function should be used . Calling ihc_hls_component_run_all() Before , The component will not run .
③
ihc_hls_component_run_all(void* funcptr)
Parameters funcptr: To be called HLS component
This function accepts a point HLS Pointer to component function . All queued calls of the component will be pushed at run time , When the component can accept new calls ,HDL The simulator can run at the fastest speed .
2. Compilation instructions
①
i++ -march=x86-64 <.c perhaps .cpp file > -v
This step is just to use g++ or i++ The compiler performs function verification
②
i++ -march=CycloneV <.c perhaps .cpp file > -v -ghdl
compile HLS, Generate IP, Check the reports generated by the compiler , Verify the design in simulation
③
Run the generated under the directory exe Executable file , If not running , There will be no waveform in the next simulation
④
vsim a.prj/verification/vsim.wlf
3. Adder
Code design :
#include "HLS/stdio.h"
#include "HLS/hls.h"
#include "assert.h"
#include "stdlib.h"
component int add(int a,int b)
{
return a+b;
}
int main()
{
srand(0);
int i,x,y,z;
#if 0
for ( i = 0; i < 10; i++)
{
x = rand() % 10;
y = rand() % 10;
ihc_hls_enqueue(&z,&add,x,y);
}
ihc_hls_component_run_all(add);
return 0;
#else
for ( i = 0; i < 10; i++)
{
x = rand() % 10;
y = rand() % 10;
z = add(x,y);
printf("%d = %d + %d\n",z,x,y);
assert(z == x+y);
}
return 0;
#endif
}
1. No assembly line

It can be seen from the waveform that Is a function call , Wait for the result to be output once , Then you can call the function again
2. Assembly line

Call functions accumulatively first acc, Waiting ihc_hls_component_run_all Function call play , Queue function before one run .
4. Multiplier
Code design :
#include "HLS/stdio.h"
#include "HLS/hls.h"
#include "assert.h"
#include "stdlib.h"
component int multiply(int a,int b)
{
return a*b;
}
int main()
{
srand(0);
int i,x[10]={
0},y[10]={
0},z[10]={
0};
#if 0
for ( i = 0; i < 10; i++)
{
x[i] = rand() % 10;
y[i] = rand() % 10;
z[i] = multiply(x[i],y[i]);
printf("%d = %d * %d\n",z[i],x[i],y[i]);
}
return 0;
#else
for ( i = 0; i < 10; i++)
{
x[i] = rand() % 10;
y[i] = rand() % 10;
ihc_hls_enqueue(&z[i],&multiply,x[i],y[i]);
}
ihc_hls_component_run_all(multiply);
return 0;
#endif
}
1. No assembly line

2. Assembly line

3. Report analysis
Follow the path to find the report analysis 
Open it to see the resource usage 

Finally, comparing the reports of the two methods, it is found that the resources consumed are the same , Only here is the difference

Reference article :https://blog.csdn.net/qq_42585108/article/details/120614492
边栏推荐
- C#之winform窗体的最大化、最小化、还原、关闭以及窗体的移动
- 【FPGA教程案例36】通信案例6——基于vivado核的FFT傅里叶变换开发以及verilog输入时序配置详解,通过matlab进行辅助验证
- 认识盒子模型,盒子模型的边框、内外边距、水平布局、垂直布局、设置浮动、处理高度塌陷的基本方法
- 开发者必看 | DevWeekly 第1期:什么是时间复杂度?
- setup中的props和context
- 银联最新测试工程师笔试题目,你能得多少分?
- 程序环境和预处理
- [FPGA tutorial case 36] communication case 6 - development of FFT Fourier transform based on vivado core and detailed explanation of Verilog input timing configuration, which is verified by MATLAB
- 727. Minimum window subsequence sliding window
- BGP機房的優點
猜你喜欢

网站建设开始前要考虑的7个问题

RNA 25. SCI文章中只有生信没有实验该怎么办?

一文了解微服务低代码实现方式

Solve the greatest common divisor and the least common multiple

Salary increase artifact

真人踩过的坑,告诉你避免自动化测试常犯的10个错误

AIRIOT答疑第5期|如何使用低代码业务流引擎?

wallys/WiFi6 MiniPCIe Module 2T2R2×2.4GHz 2x5GHz MT7915 MT7975

What is the combined effect of compose and recyclerview?

读书笔记:程序员的自我修养---第三章
随机推荐
Advantages of server hosting, server leasing and virtual machine
购买股票开户安全吗,会亏钱吗?
How to learn MySQL efficiently and systematically?
FPGA出错的积累
正则表达式
600 English words that programmers must master
【管理篇 / 升级】* 02. 查看升级路径 * FortiGate 防火墙
服务器内存性能调优
程序环境和预处理
Pytorch simple sample summary
1058 A+B in Hogwarts
PyG利用MessagePassing搭建GCN实现节点分类
【Jailhouse 文章】Virtualization over Multiprocessor System-on-Chip an Enabling Paradigm for...
涅槃重生!字节大牛力荐大型分布式手册,凤凰架构让你浴火成神
SPSS Chi-Square
实行自动化网络性能监控的优势
解析创客教育活动所需的空间实践场
万物互联时代,看IoT测试如何应对“芯”挑战
SPSS Chi-Square
wallys/WiFi6 MiniPCIe Module 2T2R2×2.4GHz 2x5GHz MT7915 MT7975