vivado2016.2下系统自带DDR3 ip例程仿真运行

背景:从ISE14.7迁移到vivado2016.2. xilinx的软件改的真是不一般的大。两个软件操作差距真是让人想骂人。由于项目需要,准备调试DDR3。对于新手来说,例化一个DDR3 ip.如果有个例程,可以参考。那就非常好了。xilinx贴心的给我们准备了这个例程。那如何去运行这个例程,给我们作为参考用呢。本文档就简单介绍一下具体方法。本方法纯属个人方法。如有问题,自行解决!!! 
开始正题:

第一步,在你自己的project下例化一个DDR3的ip。例化完成之后,如下图:

DDR3例化核

第二步,右击这个核,显示open ip example 
open_ip_example_design

第三步,就是点击这个open_ip_example_design .vivado会开始新建一个project .过程不表~。结果如图 
example
第四步,简单的操作是,运行tb仿真就行了 
tb
run
运行结果:就是漫长的等待!!!!!!!!!系统自带的vivado simulate 
run1
实际项目,仿真测试,还是用利器modelsim吧!速度甩了vivado自带的好几条街~ 
运行结果: 
这里写图片描述

到此,整个流程都结束了。 
BUT,总感觉怪怪的是不是,系统自带的仿真时如何操作的呢!!! 
其实vivado对应的project里有相关的文档解释的很清楚了。 
关于modelsim的操作如下: 
1. How to run simulations in Modelsim/QuestaSim simulator

A) sim.do File :

  a) The 'sim.do' file has commands to compile and simulate memory
     interface design and run the simulation for specified period of time.

  b) It has the syntax to Map the required libraries (unisims_ver,
     unisim and secureip). The libraries should be mapped using
     the following command
     vmap unisims_ver <unisims_ver lib path>
     vmap unisim <unisim lib path>
     vmap secureip  <secureip lib path>

     Also, $XILINX_VIVADO environment variable must be set in order to compile glbl.v file

  c) Displays the waveforms that are listed with "add wave" command.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

B) Steps to run the Modelsim/QuestaSim simulation:

  a) The user should invoke the Modelsim/QuestaSim simulator GUI.

  b) Change the present working directory path to the sim folder.
     In Transcript window, at Modelsim/QuestaSim prompt, type the following
     command to change directory path.
        cd <sim directory path>

  c) Run the simulation using sim.do file.
     At Modelsim/QuestaSim prompt, type the following command:
        do sim.do

  d) To exit simulation, type the following command at Modelsim/QuestaSim
     prompt:
        quit -f

  e) Verify the transcript file for the memory transactions.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

大家看懂了有没有?看起了很简单。是不是!!!!BUT,你自己操作一遍,发现不知道怎么弄!!!

此处分割线———————————————————————- 
为了找到流程,第一步在project里面找到sim.do文件。 
sim.do
第二步,打开文件,查看相关内容 
这里写图片描述

vlib work

Map the required libraries here

vmap unisims_ver

vmap unisim

vmap secureip

Compile all modules

vlog ../../../sources_1/imports/rtl/*.v 
vlog -incr ../../../sources_1/imports/rtl/traffic_gen/*.v 
vlog ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/mig_7series_0.v 
vlog ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/mig_7series_0_mig_sim.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/clocking/*.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/controller/*.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/ecc/*.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/ip_top/*.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/phy/*.v 
vlog -incr ../../../sources_1/ip/mig_7series_0/mig_7series_0/user_design/rtl/ui/*.v 
这段代码干什么用的呢?

vlib work ,刚才截图里说了,是用来在当前目录下建一个work文件夹 
至于为毛能建立?大伙百度一下。

vlog …. 
vlog…. 
vlog…. 
这几行的是编译对应目录下的.v文件 
剩下的基本上就是一样的。编译

Compile files in sim folder (excluding model parameter file)

$XILINX variable must be set

vlog -incr $env(XILINX_VIVADO)/data/verilog/src/glbl.v 
vlog wiredly.v 
vlog sim_tb_top.v

这里的glbl.v文件是哪里的呢?这个文件是在vivado安装路径里面。我们需要copy过来。然后把语句改一下。不然你就要去设置XILINX_VIVADO 的环境变量。我一开始是报错了。所以还是改了吧 
改成如下的 
vlog ./glbl.v

do 文件需要修改的就这么多。没什么修改的。

是不是到此就可以了呢!too native too simple 
这里我们需要一个modelsim.ini文件。这个文件是干啥的呢?

是vivado仿真库里的环境变量!!! 
这个文件必须要,不然找不到相应的编译库。根本就无法编译。 
我们把这个文件copy过来。基本上就可以了。

这次就直接在modelsim里面,change directory到当前目录。然后直接输入do sim.do。就等着运行结束,出结果吧。

第一篇认真写的博客。谢绝无引用转载。写的有点粗略。后期再慢慢修改吧!

 
 
 
yanhe156
  • yanhe156

    4天前 20:233楼
  • vivado自带的example design的路径在哪? 找不到啊
  • 回复 
qq_32164245
  • qq_32164245

    前天 11:06
  • 回复yanhe156:D:FPGADDR3k7_ddr3ddr3_sim1mig_7series_0_exmig_7series_0_ex.srcssources_1ipmig_7series_0mig_7series_0example_design按这样的路径找 这只是我的路径 但是后面的都一样
 
u011164476
  • u011164476

    2017-07-06 19:202楼
  • 你好,我问一下如果我加上fifo,自己写一个与ddr3的控制接口, sim_tb_top.v需要修改吗?其他的还要修改吗?我自己写了一个用户接口控制一直不知道testvbench怎么写,希望你能回复一下,谢谢。可加qq870650456
 
qq_36255949
  • qq_36255949

    2017-04-30 21:391楼
  • 你好,如果加上fifo的话怎么仿真呢?sim.do文件改怎样修改呢?

转载:http://blog.csdn.net/zxbdlv/article/details/61195224

原文地址:https://www.cnblogs.com/chengqi521/p/7878904.html