[Quartus]

Quartus.II调用ModelSim仿真实例

[复制链接]
12079|23
手机看帖
扫描二维码
随时随地手机跟帖
gaochy1126|  楼主 | 2021-6-25 21:14 | 显示全部楼层 |阅读模式

[color=rgb(51, 51, 51) !important]1、建立工程如下

[color=rgb(51, 51, 51) !important] pIYBAFyAzG6AfRdeAAFvePn8ADg042.jpg

[color=rgb(51, 51, 51) !important]2.如果是第一次使用modelsim,需要建立Quartus ii12.0和modelsim的链接。Quartus II12.0-》Tools-》option-》EDA Tool options再选择自己的软件和对应的安装文件夹,如下

[color=rgb(51, 51, 51) !important] pIYBAFyAzG-AfyvUAAEGJSMCmAg549.jpg

[color=rgb(51, 51, 51) !important]3.建立测试文件(testbench)可以自己写,也可以用quartus II自己生成(生成的只是模版,功能需要自己添加),注:testbench的输出为要测试文件的输入,即测试文件是为要测试文件产生信号用的,因此testbench的input为reg变量,输出为wire变量,具体操纵如下

[color=rgb(51, 51, 51) !important] pIYBAFyAzG-AF29SAALDGSdtUnk653.jpg

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

[color=rgb(51, 51, 51) !important] pIYBAFyAzHCASD7PAAGbT9hC_eA516.jpg

[color=rgb(51, 51, 51) !important]5.添加信号功能如下。

[color=rgb(51, 51, 51) !important] pIYBAFyAzHCAYUjuAAGhVI8i5CA454.jpg

[color=rgb(51, 51, 51) !important]6.复制测试文件模块名(供下步添加testbench name用)添加测试文件。assignment-》setting-》

[color=rgb(51, 51, 51) !important] pIYBAFyAzHCAXRY9AAHw5Fxpa8s852.jpg

[color=rgb(51, 51, 51) !important]7、开始仿真Tools-》run-》simulation tool

[color=rgb(51, 51, 51) !important] pIYBAFyAzHGAMwSXAALaWQK3aP8876.jpg

[color=rgb(51, 51, 51) !important]8.结果(若没有自动运行,需按simulation和add wave)

[color=rgb(51, 51, 51) !important] pIYBAFyAzHKAU0uKAAIiiYKj-as433.jpg




使用特权

评论回复

相关帖子

gaochy1126|  楼主 | 2021-6-25 21:15 | 显示全部楼层
程序
//and3 dataflow

module and3_df(x1,x2,x3,z1);

input x1,x2,x3;

output z1;

wire x1,x2,x3;

wire z1;

assign z1= x1 & x2 & x3;

endmodule

test bench

`timescale 1 ns/ 1 ps

module and3_df_vlg_tst();

// constants

// general purpose registers

//========================

reg x1;//inputs are reg for test bench

reg x2;

reg x3;

// wires

wire z1;//outputs are wire for test bench

//============================

// assign statements (if any)

and3_df i1 (

// port map - connection between master ports and signals/registers

.x1(x1),

.x2(x2),

.x3(x3),

.z1(z1)

);

initial

begin :APPlicable

// code that executes only once

// insert code here --》 begin

//=============================================

reg [3:0] invect; //test invect

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

begin

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

#10 $display (“x1 x2 x3 = %b ,z1 = %b”,

{x1,x2,x3},z1);

end

//==============================================

// --》 end

end

endmodule


使用特权

评论回复
yeates333| | 2021-6-30 21:47 | 显示全部楼层
以后多交流交流                  

使用特权

评论回复
primojones| | 2021-6-30 21:48 | 显示全部楼层
楼主太好了,非常感谢            

使用特权

评论回复
10299823| | 2021-6-30 21:48 | 显示全部楼层
资料的确是很全面                                 

使用特权

评论回复
earlmax| | 2021-6-30 21:48 | 显示全部楼层
楼主太好了,非常感谢            

使用特权

评论回复
mollylawrence| | 2021-6-30 21:48 | 显示全部楼层
以后多交流交流                  

使用特权

评论回复
mituzu| | 2021-6-30 21:48 | 显示全部楼层
非常感谢楼主分享                                 

使用特权

评论回复
modesty3jonah| | 2021-6-30 21:48 | 显示全部楼层
资料的确是很全面                                 

使用特权

评论回复
jimmhu| | 2021-6-30 21:48 | 显示全部楼层
感谢分享,提供的例程很实用                                 

使用特权

评论回复
maudlu| | 2021-6-30 21:48 | 显示全部楼层
资料的确是很全面                                 

使用特权

评论回复
ccook11| | 2021-6-30 21:49 | 显示全部楼层
以后多交流交流                  

使用特权

评论回复
cemaj| | 2021-6-30 21:49 | 显示全部楼层
这些资料太全了!!!                 

使用特权

评论回复
qiufengsd| | 2021-6-30 21:49 | 显示全部楼层
资料的确是很全面                                 

使用特权

评论回复
ghuca| | 2021-6-30 21:49 | 显示全部楼层
内容还是非常丰富的                                 

使用特权

评论回复
hearstnorman323| | 2021-6-30 21:49 | 显示全部楼层
谢谢你共享的资料                                 

使用特权

评论回复
bestwell| | 2021-6-30 21:49 | 显示全部楼层
资料够全的,多谢分享                                 

使用特权

评论回复
sheflynn| | 2021-6-30 21:49 | 显示全部楼层
非常感谢楼主分享                                 

使用特权

评论回复
biechedan| | 2021-6-30 21:49 | 显示全部楼层
资料很实用,谢谢楼主!                                 

使用特权

评论回复
cehuafan| | 2021-6-30 21:49 | 显示全部楼层
资料还是相当全面的                                 

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

1025

主题

11271

帖子

24

粉丝