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

对仿真glbl.v文件的理解的更多相关文章

  1. QuestaSim自动化仿真之do文件

    一.编写基本的do文件 下面按照实际仿真的步骤来说明do文件中需要用到的各个tcl命令. 1.quit -sim ---- 退出原来的仿真工程: 2.cd ---- 设置工作目录的路径,就是仿真工程路 ...

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

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

  3. VCS仿真生成fsdb文件(Verilog)

    VCS仿真生成fsdb文件(Verilog) 一.环境 Linux 平台 csh环境 VCS 64bit Verdi3 二.开始仿真 1. 联合仿真环境配置 a.在testbench中加入如下语句: ...

  4. VCS仿真生成vpd文件(verilog)

    VCS仿真生成vpd文件(verilog) 一.环境与文件 Linux平台  csh环境 VCS 64bit 代码文件请参考<一个简单的Verilog计数器模型> 二.开始仿真 1.com ...

  5. 在头文件中声明class 类 与 include类所在的头文件区别---理解

    在头文件中声明class 类 与 include类所在的头文件的理解: 在头文件中,声明类 它告诉编译器:存在这样的类.而实际的类则可以位于同一个编译单元中,也可以放在其他编译单元中.没有这个类原型, ...

  6. 如何对多个文件进行MODELSIM仿真? (由于是一个很大的项目,不可能把所有MODULE都放在一个文件里。 如何在ModelSim中对多个.V文件进行仿真?)

    可以将所有要编译的所有文件的名字做一个list.新建一个文本文档,重命名为vflist vflist内容例子如下(src为文件夹):src/base_addr_chk.vsrc/config_mux. ...

  7. Modelsim自动化仿真之do文件书写

    创建本地库 vlib ./work You must use vlib rather than operating system commands to creat a library directo ...

  8. C 头文件阅读理解

    __BEGIN_DECLS ..... ..... __END_DECLS 很多时候,为了使 C 代码和 C++ 代码保持互相兼容的过程调用接口,需要在 C++ 代码里加上 extern " ...

  9. stm32f10x.h文件分析理解

    今天再看过半年前自己写的这篇发现自己当时理解有误,stm32f10x.h与库开发并未存在太大关系,只是一个最为重要的寄存器地址到寄存器结构体变量的映射. stm32f10x.h 这个头文件是STM32 ...

随机推荐

  1. samtools faidx输出的fai文件格式解析 | fasta转bed | fasta to bed

    fai示例: Sc0000003 2774837 10024730 60 61 Sc0000004 2768176 12845826 60 61 Sc0000005 2756750 15660150 ...

  2. 自己动手编写IPv4地址包含关系测试的小脚本

    工作中需要对地址包含关系进行测试,现有ipaddress标准库和IPy无法满足,于是自己动手编写小脚本,主要实现== , in, <等专用功能,其他功能可以后续用到再补充,例如迭代打印网段内所有 ...

  3. LeetCode--404--左叶子之和

    问题描述: 计算给定二叉树的所有左叶子之和. 示例: 3 / \ 9 20 / \ 15 7 在这个二叉树中,有两个左叶子,分别是 9 和 15,所以返回 24 方法:recursive class ...

  4. 配置Tomcat配置路径

    <Host name="localhost" appBase="webapps" unpackWARs="true" autoDepl ...

  5. python记录_day04 列表 元组

    今日主要内容: 列表 和 元组 列表 一.列表介绍 列表是一种能存储大量数据的数据结构,是能装对象的对象.由方括号 [] 括起来,能放任意类型的数据,数据之间用逗号隔开 列表存储数据是有顺序的 二.增 ...

  6. 『Yaml』配置文件读写包

    YAML 在Python中的配置应用 YAML 是专门用来写配置文件的语言,和JSON相近,都是对字典做规范化文件输出的 一.简介 YAML 语言(发音 /ˈjæməl/ )的设计目标,就是方便人类读 ...

  7. javaee登录界面

    首先在此之前我们应该正确安装数据库,以及eclipse(javaee)文件包. 1.首先在javaee中建立新的项目 2.右键点击WebContent-New-JSP File,新建jsp(动态)文件 ...

  8. 第 3 章 HTML5 网页中的文本和图像

    文字和图像是网页中最主要.最常用的元素. 在互联网高速发展的今天,网站已经成为一个展示与宣传自我的通信工具(公司或个人可以通过网站介绍公司的服务与产品或介绍自己).这些都离不开网站中的网页,而网页的内 ...

  9. Visual Studio编译时报错“函数名:重定义;不同的基类型”

    错误原因: 方法在还未声明的地方就使用了.由于使用的地方与定义的地方都是在同一个.c文件中,所以没有报未声明的错误. 解决方法: 把实现放到使用的前面,或者在include语句和宏定义后面加上函数声明 ...

  10. 二十、MVC的WEB框架(Spring MVC)

    一.Spring MVC 运行原理:客户端请求提交到DispatcherServlet,由DispatcherServlet控制器查询HandlerMapping,找到并分发到指定的Controlle ...