本文内容来自对Xilinx入门lab的学习:https://github.com/xupgit/High-Level-Synthesis-Flow-on-Zynq-using-Vivado-HLS/
Lab1:HLS tool flow
创建project : 添加source文件 → 设置top Function → 添加tb文件 → 选择板卡
本实验的矩阵乘法例子:
void matrixmul(
mat_a_t a[MAT_A_ROWS][MAT_A_COLS],
mat_b_t b[MAT_B_ROWS][MAT_B_COLS],
result_t res[MAT_A_ROWS][MAT_B_COLS])
{
// Iterate over the rows of the A matrix
Row: for(int i = 0; i < MAT_A_ROWS; i++) {
// Iterate over the columns of the B matrix
Col: for(int j = 0; j < MAT_B_COLS; j++) {
// Do the inner product of a row of A and col of B
res[i][j] = 0;
Product: for(int k = 0; k < MAT_B_ROWS; k++) {
res[i][j] += a[i][k] * b[k][j];
}
}
}
}
2、C Simulation:可以选择lunch debugger进行debug,除了设置断点后运行外,其他运行方式有:
step into:单步执行,遇到子函数就进入并且继续单步执行(简而言之,进入子函数);
step over:在单步执行时,在函数内遇到子函数时不会进入子函数内单步执行,而是将子函数整个执行完再停止,也就是把子函数整个作为一步。有一点,经过我们简单的调试,在不存在子函数的情况下是和step into效果一样的(简而言之,越过子函数,但子函数会执行)。
ste