vcs -xprop的理解
一、vcs -xprop簡介
https://www.synopsys.com/zh-cn/verification/simulation/vcs-xprop.html
Verilog 和 VHDL 常用于數字設計建模。設計人員使用 RTL 構造描述硬件行為。然而,某些 RTL 仿真語義不足以準確地為硬件行為建模。因此,相比實際硬件行為,仿真結果要么太過樂觀,要么太過悲觀。
因為這些語義限制,Verilog 和 VHDL RTL 仿真器會忽略掉控制信號上的X不定態,在輸出上會分配一個固定的數值。這樣造成的結果就是,由于缺少X的傳播, RTL 仿真器往往無法檢測到和 X態相關的設計問題。然而,同樣的設計問題可以在門級仿真中檢測出來,因此許多時候必須運行大量的門級仿真,只是為了調試 X 相關問題。現在VCS在RTL階段提供了的全新 X 傳播(X-propagation)支持,使用該技術,工程師可以節省大量用于調試RTL和門級仿真的X建模的差異上的時間和精力。
VCS Xprop 旨在幫助尋找 RTL 中的 X 相關問題,減少對冗長的門級仿真的需求。兩種 HDL 語言,Verilog 和 VHDL 的條件構造仿真語義都不足以精確地為未初始化的寄存器和上電復位值中固有的模糊性建模。當建模為 ‘X’ 值的不確定狀態成為控制表達式時,這些問題格外棘手。
啟用 VCS Xprop 時,突出的仿真差異最常見的來源之一就是不正確的初始化序列。該行為通常因為復位/時鐘信號從 0 轉換至 X、從 1 轉換至 X,或反之亦然。如果觸發器對時鐘信號的上升沿敏感,X 到 1 的轉換將觸發觸發器,當使用 Verilog 上升沿或傳統 VHDL 觸發器行為代碼進行編碼時,輸入值傳遞至輸出,代碼為:clk’event 和 clk’1’。相反,如果觸發器使用 VHDL rising_edge(event) 構造編碼,則觸發器將不會加載新值。實際上,Verilog 構造以及一種 VHDL 構造認為 X 到 1 的轉換為真,而其他 VHDL 構造認為假。然而,在 VCS Xprop 仿真中,同樣的時鐘轉換將導致觸發器合并輸入和輸出,從而可能導致未知的值。因此,要想有效地將新值加載到觸發器,您必須確保時鐘信號的值有效且穩定,這樣的情況將通過啟用 VCS Xprop 的仿真顯示在 RTL 運行中。
二、仿真選項
如果不定義-xprop,則vcs 為vmerge mode,為典型的verilog behavior。
-xprop=tmerge,則vcs為tmerge mode,更接近實際的電路行為,也是使用比較多的。如果定義-xprop,則default 為tmerge mode。此模式下x態會傳播一段路徑后終結。
-xprop=xmerge,則vcs為xmerge mode,更悲觀的一種行為,此行為下x態會一直傳播。
-xprop是用來解決控制信號x態暴露問題的。
可以參考vcs user guide中Using X-Propaon章節。
VCS Xprop Introduction
The VCS Xprop simulator provides an effective simulation model that allows Xprop problems to be exposed by standard RTL simulations.
The VCS Xprop simulator provides two built-in merge modes that you can choose at either compile time or runtime:
==xmerge mode ==: This mode is more pessimistic than a standard gate-level simulation.
==tmerge mode ==: This mode is closer to actual hardware behavior and is the more commonly used mode.The merge result yields X when all output values of logic 0 and logic 1 control signal are different, similar to a ternary operator.
vmerge mode : This mode is the classic Verilog (optimistic) behavior, which effectively disables the enhanced Xprop semantics
The -xprop compile-time option is used to enable Xprop and to specify the merge mode at run time. By default, VCS uses the tmerge merge mode.
Following is the syntax of the -xprop option:
The merge mode can also be modified at runtime via the $set_x_prop() system task.
Xprop Config file
You can define the scope of the Xprop instrumentation and select the merge mode in the configuration file. The Xprop configuration file is used to define the scope of Xprop instrumentation in a design. The file allows you to specify the design hierarchies or modules to be excluded or included for Xprop.
If you use an Xprop configuration file, by default VCS does not perform Xprop instrumentation. You must use the xpropOn attribute to specify the design hierarchies or modules for Xprop instrumentation.
For instance,
Compile Time Diagnostic Report
When you compile a design with Xprop enabled, VCS generate reports that record all the statements considered for Xprop instrumentation, whether or not the statements are instrumented, and the reason for statements not being instrumented. Reports are generated with the name xprop.log for Verilog.
Querying X-Propagation at Runtime
You can use the $is_xprop_active Verilog system function to query the X-prop status for a particular module or an entity instance. The function returns an 1 if Xprop is enabled in the current instance
三、ius 仿真器
-xprop C x態傳播一段路徑后停止;
C模式是 如果0&x,那么得出的是0,x態就終結了,類似的1|| x,得出的是1。
-xprop F x態一直傳播 ;
F模式是 如果0&x,那么得出的是x,類似的1|| x,得出的是x,x態會一直在。
總結
以上是生活随笔為你收集整理的vcs -xprop的理解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 明日之后服务器什么时候维护好,明日之后选
- 下一篇: s3c2440移植MQTT