[FPGA] Quartus.II调用ModelSim仿真实例

[复制链接]
 楼主| gaochy1126 发表于 2021-3-25 21:25 | 显示全部楼层 |阅读模式

1、建立工程如下

[color=rgb(51, 51, 51) !important][color=rgb(66, 152, 186)">[/url]

2.如果是第一次使用modelsim,需要建立Quartusii12.0和modelsim的链接。QuartusII12.0-》Tools-》op[color=rgb(66, 152, 186)">[url=http://www.**/tags/ti/]tion-》EDATooloptions再选择自己的软件和对应的安装文件夹,如下

[color=rgb(66, 152, 186)">[/url]

3.建立[color=rgb(66, 152, 186)">[url=http://www.hqpcb.com/zhuoluye11/?tid=26&plan=fashaoyou]测试文件(testbench)可以自己写,也可以用quartusII自己生成(生成的只是模版,功能需要自己添加),注:testbench的输出为要测试文件的输入,即测试文件是为要测试文件产生信号用的,因此testbench的input为reg变量,输出为wire变量,具体操纵如下

[color=rgb(66, 152, 186)">[/url]

4.打开测试文本,添加测试的信号功能(注:上步生成的文件后缀为.vt,在所建工程下的simulation\modelsim\下面)。

[color=rgb(51, 51, 51) !important][color=rgb(66, 152, 186)">[url=http://file.**/web1/M00/86/CF/pIYBAFyAzHCASD7PAAGbT9hC_eA516.jpg]

5.添加信号功能如下。

[color=rgb(51, 51, 51) !important][color=rgb(66, 152, 186)">[/url]

6.复制测试文件模块名(供下步添加testbenchname用)添加测试文件。assignment-》setting-》

[color=rgb(51, 51, 51) !important][color=rgb(66, 152, 186)">[url=http://file.**/web1/M00/86/CF/pIYBAFyAzHCAXRY9AAHw5Fxpa8s852.jpg]

7、开始仿真Tools-》run-》simulationtool

[color=rgb(51, 51, 51) !important][color=rgb(66, 152, 186)">[/url]

8.结果(若没有自动运行,需按simulation和addwave)

[color=rgb(51, 51, 51) !important][color=rgb(15, 118, 159)">[url=http://file.**/web1/M00/86/CF/pIYBAFyAzHKAU0uKAAIiiYKj-as433.jpg]


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| gaochy1126 发表于 2021-3-25 21:26 | 显示全部楼层
  1. 程序

  2. //and3dataflow

  3. moduleand3_df(x1,x2,x3,z1);

  4. inputx1,x2,x3;

  5. outputz1;

  6. wirex1,x2,x3;

  7. wirez1;

  8. assignz1=x1&x2&x3;

  9. endmodule

  10. testbench

  11. `timescale1ns/1ps

  12. moduleand3_df_vlg_tst();

  13. //constants

  14. //generalpurposeregisters

  15. //========================

  16. regx1;//inputsareregfortestbench

  17. regx2;

  18. regx3;

  19. //wires

  20. wirez1;//outputsarewirefortestbench

  21. //============================

  22. //assignstatements(ifany)

  23. and3_dfi1(

  24. //portmap-connectionbetweenmasterportsandsignals/registers

  25. .x1(x1),

  26. .x2(x2),

  27. .x3(x3),

  28. .z1(z1)

  29. );

  30. initial

  31. begin:APPlicable

  32. //codethatexecutesonlyonce

  33. //insertcodehere--》begin

  34. //=============================================

  35. reg[3:0]invect;//testinvect

  36. for(invect=0;invect《8;invect=invect+1)

  37. begin

  38. {x1,x2,x3}=invect[3:0];

  39. #10$display(“x1x2x3=%b,z1=%b”,

  40. {x1,x2,x3},z1);

  41. end

  42. //==============================================

  43. //--》end

  44. end

  45. endmodule


评论

赞一个  发表于 2021-3-31 22:25
mituzu 发表于 2021-3-31 22:04 来自手机 | 显示全部楼层
资料很实用,谢谢楼主!                                 

评论

赞一个  发表于 2021-3-31 22:25
ulystronglll 发表于 2021-3-31 22:04 来自手机 | 显示全部楼层
谢谢你共享的资料                                 

评论

赞一个  发表于 2021-3-31 22:25
kkzz 发表于 2021-3-31 22:04 来自手机 | 显示全部楼层
资料的确是很全面                                 

评论

赞一个  发表于 2021-3-31 22:25
abotomson 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
以后多交流交流                  

评论

赞一个  发表于 2021-3-31 22:26
deliahouse887 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
感谢分享,提供的例程很实用                                 

评论

赞一个  发表于 2021-3-31 22:26
yujielun 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
谢谢lz分享,很有用                                 

评论

赞一个  发表于 2021-3-31 22:26
macpherson 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
谢谢你共享的资料                                 

评论

赞一个  发表于 2021-3-31 22:26
232321122 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
有时间需要好好看看   不错                                 

评论

赞一个  发表于 2021-3-31 22:26
myiclife 发表于 2021-3-31 22:07 来自手机 | 显示全部楼层
很详细的资料                                 

评论

赞一个  发表于 2021-3-31 22:26
dzfansman 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
感谢分享,提供的例程很实用                                 

评论

赞一个  发表于 2021-3-31 22:26
linfelix 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
非常感谢楼主分享                                 

评论

赞一个  发表于 2021-3-31 22:26
hudi008 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
楼主好人,资料很好。谢谢楼主!                                 

评论

赞一个  发表于 2021-3-31 22:26
cemaj 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
  应用还是很广泛的                                 

评论

赞一个  发表于 2021-3-31 22:27
usysm 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
资料够全的,多谢分享                                 

评论

赞一个  发表于 2021-3-31 22:27
quickman 发表于 2021-3-31 22:08 来自手机 | 显示全部楼层
  应用还是很广泛的                                 

评论

赞一个  发表于 2021-3-31 22:27
dspmana 发表于 2021-3-31 22:09 来自手机 | 显示全部楼层
谢谢lz分享,很有用                                 

评论

赞一个  发表于 2021-3-31 22:27
plsbackup 发表于 2021-3-31 22:09 来自手机 | 显示全部楼层
资料很实用,谢谢楼主!                                 

评论

赞一个  发表于 2021-3-31 22:27
uytyu 发表于 2021-3-31 22:09 来自手机 | 显示全部楼层
共享的资料比较详细  谢谢                                 

评论

赞一个  发表于 2021-3-31 22:27
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:这个社会混好的两种人:一是有权有势,二是没脸没皮的。

1148

主题

11651

帖子

26

粉丝
快速回复 在线客服 返回列表 返回顶部
个人签名:这个社会混好的两种人:一是有权有势,二是没脸没皮的。

1148

主题

11651

帖子

26

粉丝
快速回复 在线客服 返回列表 返回顶部