首先
![](https://i-blog.csdnimg.cn/blog_migrate/30219c91449ea60a80ed1e811df8b164.webp?x-image-process=image/format,png)
然后填充好自己写的代码
之后save as 存到自己的文件夹
会自动弹出
![](https://i-blog.csdnimg.cn/blog_migrate/296b07e33542869766e643ebe588e835.webp?x-image-process=image/format,png)
配置
![](https://i-blog.csdnimg.cn/blog_migrate/e115aa103b6be5cb67c3ff23273b9ec1.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/09c7ef60c10d82aada47bdf87e8ec971.webp?x-image-process=image/format,png)
Assignments settings
![](https://i-blog.csdnimg.cn/blog_migrate/d89476b2066e56d5c58b2055dfc06424.webp?x-image-process=image/format,png)
之后第一次编译
成功后processing start start testbench template writer
之后去保存的文件下,下面有一个simulation文件夹,找到XXX.vt文件,打开,save as XX_test_tb.v 。(注意saveas到顶层文件夹下) 修改其中内容为自己设计好的test文件
之后再次到qutartus 编译
成功后tools netlist viewer rtlviewer 可以看到rtl网表图。
![](https://i-blog.csdnimg.cn/blog_migrate/78d561db87f14ae3ac0b6a4aea076499.webp?x-image-process=image/format,png)
之后tools runsimulationtools rtl级模拟
弹出
![](https://i-blog.csdnimg.cn/blog_migrate/0658dbe111a580bd3dcb595b76295b7b.webp?x-image-process=image/format,png)
Tools options general edatooloptions
添加modelsim altera的路径
这里一般是和quartus绑定在一起,自己找一下,比较好找。
![](https://i-blog.csdnimg.cn/blog_migrate/c4aa8819a58c602544d9e593d512e422.webp?x-image-process=image/format,png)
之后tools runsimulationtools rtl级模拟
然后又出现问题,找不到test_tb
再回到qutartus。
Assignments settings
![](https://i-blog.csdnimg.cn/blog_migrate/0036ec7d7ced23d369292652168f3b9b.webp?x-image-process=image/format,png)
Test benches new
File name 添加刚刚的顶层test_tb文件
注意别忘了填写testbenchname
![](https://i-blog.csdnimg.cn/blog_migrate/442d68b1472cce54c5beb13f7dc1639a.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/d3fb34c67f6556709466f559a5083792.webp?x-image-process=image/format,png)
之后重新编译
之后tools runsimulationtools rtl级模拟
Simulate start simulation work选择test_tb
添加wave,查看(注意这里单位是ps,所以可能要run很长时间才能有变化,要灵活运用那个缩小镜)
![](https://i-blog.csdnimg.cn/blog_migrate/77e98ba57238fce1aa416fea7ff7d045.webp?x-image-process=image/format,png)