Simulation, UniSim, SimPrim - How do I use the "glbl.v" module in a Verilog simulation?

Description

How do I use the "glbl.v" module in a Verilog simulation?

Solution

The "glbl.v" module connects the Global Set/Reset and Global Tristate signals to the design. In order to properly reset the design in a Verilog simulation, the "glbl.v" module must be compiled and loaded along with the design. The "glbl.v" module is located at "$XILINX/verilog/src/glbl.v".

Using 6.1i design tools and later

In the 6.1i design tools, the "glbl.v" module was modified to automatically pulse GSR (FPGA Global Set/Reset) and PRLD (CPLD Global Set/Reset) for the first 100 ns of simulation. Code was also added to automatically pulse Global Tristate (GTS), but the default pulse is 0 ns.

For exact commands on how to compile and load the "glbl.v" in ModelSim, see the following solutions:

(Xilinx Answer 1078) - Behavioral Simulation

(Xilinx Answer 10177) - Post-PAR Timing Simulation

For additional information, reference the Synthesis and Simulation Design Guide:

http://toolbox.xilinx.com/docsan/xilinx6/books/docs/sim/sim.pdf
In Chapter 6, Verifying Your Design, there is a section on "Understanding the Global Reset and Tristate for Simulation."

Using 5.1i/5.2i design tools and earlier versions

Prior to the 6.1i release, the "glbl.v" module did not automatically pulse the GSR or PRLD signal. It is therefore necessary to drive GSR or PRLD and/or GTS from the testbench. This is the code that needs to be added to the testbench:

reg GSR;

assign glbl.GSR = GSR;

reg GTS;

assign glbl.GTS = GTS;

initial begin

GSR = 1;

#100 GSR = 0;

end

NOTE 1: For CPLD designs, replace GSR with PRLD in above the code.

NOTE 2: GTS can also be driven, but it is generally not necessary unless you are doing a board-level simulation.

For exact commands on how to compile and load the "glbl.v" in ModelSim, see the following solutions:

(Xilinx Answer 1078) - Behavioral Simulation

(Xilinx Answer 10177) - Post-PAR Timing Simulation

For additional information, reference the Synthesis and Simulation Design Guide:

http://toolbox.xilinx.com/docsan/xilinx6/books/docs/sim/sim.pdf
In Chapter 6, Verifying Your Design, there is a section on "Understanding the Global Reset and Tristate for Simulation."


Xilinx FPGAs have register (flip-flops and latches) set/reset circuitry that pulses at the end of the configuration mode. This pulse is automatic and does not need to be programmed. All the flip-flops and latches receive this pulse through a dedicated global GSR (Global Set-Reset) net. The registers either set or reset, depending on how the registers are defined.

For some device families, it is important to address the built-in reset circuitry behavior in your designs starting with the first simulation to ensure that the simulations agree at the three primary points.

For the Virtex and Spartan-II device families, Xilinx recommends using the manual reset instead of the dedicated GSR circuitry. This is because the implementation tools use the high-speed backbone routing for Reset signals, thus making them faster than the dedicated global routing which transports the GSR signal. However, for the XC4000 and Spartan device families, GSR is the better method of propagating the global reset signal.

For the XC4000 and Spartan device families, if you do not simulate GSR behavior prior to synthesis and place and route, your RTL and possibly post-synthesis simulations might not initialize to the same state as your post-route timing simulation. As a result, the various design descriptions will not be functionally equivalent and your simulation results will not match. Some synthesis tools can identify, from the behavioral description, the GSR net, and will place the STARTUP module on the net to direct the implementation tools to use the global network. However, other synthesis tools interpret behavioral descriptions literally, and will introduce additional logic into your design to implement a function. Without specific instructions to use device global networks, the Xilinx implementation tools will use general purpose logic and interconnect resources to redundantly build functions already provided by the silicon.

If GSR behavior is not described, the chip will initialize during configuration, and the post-route netlist will include this net that must be driven during simulation. This section includes the methodology to describe this behavior, as well as the GTS behavior for output buffers.

In addition to the set/reset pulse, all output buffers are set to a high impedance state during configuration mode with the dedicated global output tristate enable (GTS) net.

The GSR net requires special handling during synthesis, simulation, and implementation to prevent them from being assigned to normally routed nets, which uses valuable routing resources and degrades design performance. The GSR net receives a reset-on-configuration pulse from the initialization controller, as shown in the following figure.

Figure 6-2 Built-in FPGA Initialization Circuitry

This pulse occurs during the configuration mode of the FPGA. However, for ease of simulation, it is usually inserted at time zero of the test bench, before logical simulation is initiated. The pulse width is device-dependent and can vary widely, depending on process voltage and temperature changes. The pulse is guaranteed to be long enough to overcome all net delays on the reset special-purpose net. The parameter for the pulse width is TPOR, as described in The Programmable Logic Data Book.

The tristate-on-configuration circuit shown in the "Built-in FPGA Initialization Circuitry" also occurs during the configuration mode of the FPGA. Just as for the reset-on-configuration simulation, it is usually inserted at time zero of the test bench before logical simulation is initiated. The pulse drives all outputs to the tristate condition they are in during the configuration of the FPGA. All general-purpose outputs are affected whether they are regular, tristate, or bi-directional outputs during normal operation. This ensures that the outputs do not erroneously drive other devices as the FPGA is being configured. The pulse width is device-dependent and can vary widely with process and temperature changes. The pulse is guaranteed to be long enough to overcome all net delays on the GTS net. The generating circuitry is separate from the reset-on-configuration circuit. The pulse width parameter is TPOR, as described in The Programmable Logic Data Book. Simulation models use this pulse width parameter for determining HDL simulation for global reset and tristate circuitry.

If a global set/reset is desired for behavioral simulation, it must be included in the behavioral code. Any described register in the code must have a common signal that will asynchronously set or reset the register depending on the desired result. Similarly, if a global tristate-state is desired for simulation, it should be described in the code as well.

参考

https://wenku.baidu.com/view/fb602c53ad02de80d4d8402b.html

转载于:https://www.cnblogs.com/limanjihe/p/9822996.html

对仿真glbl.v文件的理解相关推荐

  1. Modelsim自动化仿真及do文件编写

    基于脚本的modelsim自动化仿真是提高工作效率的大杀器,此文基于此做了些记录汇总,基于脚本的modelsim自动化仿真的一些知识和模板,同时可以参照给的例程进行练习学习下载双击 .bat 文件就会 ...

  2. modelsim仿真中 do文件的写法技巧

    Modelsim之 DO文件简介 网上的关于DO文件的编写好像资料不多,比较杂,所以本人总结一下常用的简单语法,方便大家查看.其实本人也刚接触DO文件没多久,有纰漏很正常,欢迎指正批评,互相学习.PS ...

  3. 二相混合式步进电机开环细分控制simulink建模仿真含模型文件

    目录 细分原理 二相混合式步进电机电磁转矩方程 对Te方程简单的理解 细分控制的推导 细分系统总体图 正弦电流的仿真simulink实现 关于PWM电流控制(或SVPWM控制) 关于模型中如何控制细分 ...

  4. XLINX FPGA调用子模块(.V文件)实例(基于ISE 13.4)

    通过顶层模块调用子模块(.v文件)来实现模块的复用,这里通过对led_controller模块的计数参数赋不同的值来控制LED的不同闪烁时间. 注意:led_controller.v要放在顶层模块的工 ...

  5. Vivado生成及仿真网表文件

    Vivado生成及仿真网表文件 1- 将子模块设置为顶层模块 - 右键Set as top 2-将该顶层模块设置综合属性 Options中将-faltten_hierarchy设置为full属性(意思 ...

  6. modelsim打开.v文件,modelsim无法打开.v文件

    modelsim打开.v文件 Mentor公司的ModelSim是业界最优秀的HDL语言仿真软件,它能提供友好的仿真环境,是业界唯一的单内核支持VHDL和Verilog混合仿真的仿真器. 我们在编写m ...

  7. ISE如何封装与使用IP —— 使用ngc文件与仅包含端口的v文件

    一. 为什么要封装IP IP封装后只能用不能改,也看不到源码,便于保护知识产权 封装之后不会再花时间综合源文件,节省了综合时间 二. ISE如何封装IP 步骤如下: 1)打开ISE,新建工程,添加源文 ...

  8. 对数学规划软件 CPLEX 等读取 MPS 文件的理解

    不少数学规划软件都支持对 MPS 文件的读取,例如 CPLEX,GAMES,GRUOBI 等,因此了解这个文件怎么用是非常有必要的.根据 CPLEX 的帮助文档,我将自己对 MPS 文件的理解总结如下 ...

  9. utils.py 文件的理解:一些小脚本文件

    文章目录 utils.py 文件的理解:一些小脚本文件 1. 包含的函数 1.1. def to_cpu(tensor): 1.2. def load_classes(path): 加载数据集的类别 ...

最新文章

  1. 干掉了竞争对手的餐饮夫妻店,在等待自己的死亡
  2. 计组-总线操作和定时
  3. Your PC needs to be repaired
  4. ^_^家园游记^_^
  5. rest_framework09:自动生成接口文档(简略)
  6. 7-10 逆波兰表达式求值 (20 分)(c语言)(数据结构)
  7. apache ignite_从In Memory Data Grid,Apache Ignite快速入门
  8. python学习—python中的引用本质
  9. java web怎么快速设计网页_Javaweb毕业设计快速开发指南(一)
  10. shell grep cut 【整理】
  11. pytorch nn.MSELoss
  12. DlgProc对话框回调
  13. hibernate id生成策略 mysql_Hibernate中ID生成策略
  14. MSRCRGIMP(基于GIMP版本的多尺度Retinex)
  15. android view state,Android状态系统(二)——View状态组合
  16. 四招搞定托业(TOEIC)英语阅读
  17. 大数据分析与应用技术创新平台
  18. Firewalld防火墙IP伪装与端口转发
  19. 程序员的自我修养_之三_曾国藩与左宗棠
  20. 英国易捷航空遭黑客入侵 约900万客户数据被窃取

热门文章

  1. Windows ink工作区屏幕草图直尺旋转可用鼠标滚轮。
  2. 向量点乘的图形学意义
  3. Oracle 添加列、删除列
  4. RocketMQ 安装与遇到的问题
  5. 【AUTOSAR】【以太网】SD
  6. 安卓开发实现短信验证码的功能
  7. 关于利用金山词霸的词库
  8. SQL的7种连接查询
  9. 如何上手机上不了无线网络连接服务器,手机wifi连接上了但上不了网
  10. 铁路现代化技术系统整理(三)之5T系统