Quartus II 仅在仿真中使用文件 [英] Quartus II use file only in simulation
问题描述
我想在 Quartus 中运行模拟.所以我在分配"菜单中分配了一个测试平台.我的测试平台包括我的 DUT(D) 和一个额外的组件 (E),它仅用于仿真(因此该组件包含不可合成的语句).如果我从 Testbench 中删除 E,我的模拟就会运行,但是当我想在我的 Testbench 中包含 E 时,我从 modelsim 中得到错误:
I want to run a simulation in Quartus. So I assign a Testbench in the Assignment menu. My testbench includes my DUT(D) and a extra component(E), which is only for simulation (so this component includes statements which are not syntesizeable). My simulation runs if I remove E from my Testbench, but when I want to include E in my Testbench, I get the error from modelsim:
my_testbench.vhd(197): (vcom-1195) cannot find expanded name "mylib.only_for_simulation".
如何让 Quartus/Modelsim 编译 E 文件?
How could I make Quartus/Modelsim to compile the E file?
推荐答案
当您开始仿真时,Quartus 分析项目设置中指定的所有文件(可通过菜单 Assignment -> Settings -> Files 访问)).但是,它仅详细说明了从顶级实体开始的 DUT 所需的实体(请参阅菜单分配"->设置"->常规").例如,在我的测试项目中,top
指定了 DUT 的实体,而 my_testbench
和 only_for_simulation
仅用于仿真.这是启动仿真后消息窗口中 Quartus 的输出:
When you start a simulation, Quartus analyzes all files specified in the project settings (accessible via menu Assignment -> Settings -> Files). But, it elaborates only the entities which are required for the DUT starting from the top-level entity (see menu Assignment -> Settings -> General).
For example, in my test project top
specifies the entity of the DUT, and my_testbench
and only_for_simulation
are required for simulation only. This is the output from Quartus in the messages window after starting the simulation:
信息(12021):在源码中找到2个设计单元,包括1个实体文件 my_testbench.vhdl
Info (12021): Found 2 design units, including 1 entities, in source file my_testbench.vhdl
信息(12021):在源码中找到2个设计单元,包括1个实体文件 top.vhdl
Info (12021): Found 2 design units, including 1 entities, in source file top.vhdl
信息(12021):在源码中找到2个设计单元,包括1个实体文件 only_for_simulation.vhdl
Info (12021): Found 2 design units, including 1 entities, in source file only_for_simulation.vhdl
信息 (12127):详细说明顶级层次结构的实体top"
Info (12127): Elaborating entity "top" for the top level hierarchy
只有存储在细化期间找到的实体的文件会自动添加到脚本中以启动 ModelSim 模拟器.因此,将 my_testbench
和 only_for_simulation
列为项目文件并不重要.更多的模拟文件必须总是在测试台设置中指定,可通过菜单分配 -> 设置 -> 模拟 -> 编译测试台 -> 测试台 -> 新建/编辑.在那里,您必须列出存储 my_testbench
和 only_for_simulation
的文件.并且你必须按照正确的编译顺序列出它们,即only_for_simulation
在my_testbench
之前.在此对话框中,您还可以通过属性将only_for_simulation
的库设置为mylib
.这是我的测试台设置的屏幕截图.
Only the files which store the entities found during elaboration are added automatically to the script to start the ModelSim simulator. Thus, it doesn't matter if my_testbench
and only_for_simulation
are listed as project files. Further simulation files must be always specified in the test-bench setup accessible via menu Assignment -> Settings -> Simulation -> Compile test bench -> Test Benches -> New/Edit. There, you have to list the files storing my_testbench
and only_for_simulation
. And you have to list them in the right compilation order, that is, only_for_simulation
before my_testbench
. Within this dialog, you can also set the library of only_for_simulation
to mylib
via Properties. Here, is a screenshot of the my test-bench setup.
生成的ModelSim 脚本存储在子目录simulation/modelsim 的扩展名为.do
的文件中.它列出了 ModelSim 要编译的所有文件.ModelSim 只按照给定的顺序编译它们.
The generated ModelSim script is stored in the sub-directory simulation/modelsim in file with extension .do
. It lists all files to be compiled by ModelSim. And ModelSim compiles them in the given order only.
这篇关于Quartus II 仅在仿真中使用文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!