在windows下的quartus 18.1 hls+vs2010

在windows下的quartus 18.1 hls+vs2010

1.工具选择

1.quartus 18.1(破解工具以及下载软件见如下链接链接:https://pan.baidu.com/s/1rqrPR2dHl-1W8S36YxjTkw 提取码:askg,亲测可以使用)
2.vs2010版本,vs2010可在微信公众号软件管家进行下载

在这里插入图片描述

2.环境搭建

2.1初始化

1.打开系统命令管理器cmd,定位到init_hls.bat的路径,并运行

d:
cd D:\intelFPGA\18.1\hls
init_hls.bat

此时会提示vs的路径问题,不用担心,系统会自动添加所需要的路径

在这里插入图片描述

2.2编写测试文件

在桌面新建文件夹prj,创建text.cpp,编写如下乘法器代码:

#include “HLS/hls.h”
#include “stdio.h”

component int mul(int a,int b)
{
    int c =0;
    c = a*b;
    return c;
}
int main()
{
    int a=0,b=0,c=0,i=0;
    for(i=0;i<5;i++)
    {
        a= i+1;
        b= i+2;
        c = mul(a,b);
        printf("%d * %d = %d\n",a,b,c);
    }
    return 0;
}

2.3编辑测试文件

1.切换到刚刚新建的工程目录

c:
cd C:\Users\han\Desktop\prj
i++ -march=x86-64 -o mul.exe test.cpp 用于生成mul.exe文件

2.运行mul.exe文件

mul.exe

在这里插入图片描述

3.生成镜像文件

i++ -march=CycloneV -o mul test.cpp -ghdl

在这里插入图片描述

4.继续运行mul.exe文件,产生波形文件vsim.wlf

mul.exe

在这里插入图片描述

5.查看报告

在这里插入图片描述

报告内容如下

在这里插入图片描述

6、查看生成的波形文件

vsim vsim.wlf

在这里插入图片描述

在这里插入图片描述

3.导入自编辑IP核

将生成的 components 文件夹的路径导入到quartus中

Tools–>Options–>IP Setting–>IP Catalog Search Locations

在这里插入图片描述

4.HLS-IP核的添加

4.1添加生成的qsy文件

在这里插入图片描述

4.2HLS-IP核的添加

首先,找到已经添加的IP核

在这里插入图片描述

双击mul IP核

在弹出的框中,点击generate HDL

在这里插入图片描述

在弹出新的对话框,点击generate

在这里插入图片描述

一直点击退出,直到最后一层,点击finish。

5、模块例化

在之前创建的工程中,新建Verilog文件,命名为hls
双击之前打开的qsy文件

在这里插入图片描述

点击generate->Show instantination Template

在这里插入图片描述

copy其中的内容加入到编写的hls.v文件中,并进行实例化

在这里插入图片描述

编译测试代码:双击Analysis & Synthesis

在这里插入图片描述

编译成功后,生成测试文件。

在这里插入图片描述

在这里插入图片描述

此时HLS工程创建完毕

5、实验总结

这次作业是hls相关的简单实验,通过这次实验的练习我收获了很多。

6、参考链接

https://blog.youkuaiyun.com/qq_52548731/article/details/130795962

Microsoft Windows [版本 10.0.26100.3476] (c) Microsoft Corporation。保留所有权利。 C:\Windows\System32>d: D:\>cd D:\intelFPGA_lite\18.1\hls D:\intelFPGA_lite\18.1\hls>init_hls Assuming current directory (D:\intelFPGA_lite\18.1\hls\) is root of i++ Will use D:\intelFPGA_lite\18.1\hls\..\quartus to find Quartus for internal i++ use 信息: 用提供的模式无法找到文件。 Will be using Modelsim at D:\intelFPGA_lite\18.1\modelsim_ase\win32aloem\ Will be using Modelsim at D:\intelFPGA\18.1\modelsim_ase\win32aloem\ VisualStudio's link.exe is not on the path. Guessing its location. VS100COMNTOOLS environment variable is set to d:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\. Looks like you have VisualStudio2010 installed. Using it. Setting environment for using Microsoft Visual Studio 2010 x64 tools. Adding D:\intelFPGA_lite\18.1\hls\bin to PATH Adding D:\intelFPGA_lite\18.1\hls\host\windows64\bin to PATH D:\intelFPGA_lite\18.1\hls>cd examples\counter D:\intelFPGA_lite\18.1\hls\examples\counter>build No target specified, defaulting to Available targets: test-x86-64, test-fpga, test-msvc, clean i++ -march=x86-64 counter.cpp -o test-x86-64.exe i++: Unable to determine the execution environment of the Intel(R) HLS Compiler. i++: Detailed error: Could not find root directory for the SDK: could not find the 'share' directory Run test-x86-64.exe to execute the test. D:\intelFPGA_lite\18.1\hls\examples\counter>test-x86-64.exe PASSED D:\intelFPGA_lite\18.1\hls\examples\counter>cd D:\intelFPGA_lite\18.1\hls\examples\counter\1_4 D:\intelFPGA_lite\18.1\hls\examples\counter\1_4>i++ -march=cyclonev --component mycomp -o interface interface.cpp i++: Unable to determine the execution environment of the Intel(R) HLS Compiler. i++: Detailed error: Could not find root directory for the SDK: could not find the 'share' directory
最新发布
03-27
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值