1. 仿真事件隊列
VCS仿真工具怎么處理交給他的代碼,VCS支持Verilog、SV、VHDL、C語言
PPT1
CPU的環境的基於指令的,硬件電路和軟件的不同,並發執行。怎么通過軟件模擬硬件的並發性
- IEEE1364: Verilog語言的仿真基於分層的事件隊列
- 執行事件的隊列
- 仿真時間的計算
- Verilog仿真器先從沒有延遲的事件開始,執行他們,然后把時間設成0,然后按照時間循序一次執行各個事件
- Verilog語言規范沒有規定當多個事件被安排在同一個時刻來 調度時,應該執行那個
- 只要在同一層的事件,什么執行循序都是可以的
- 設計師必須理解Verilog的分層次仿真事件隊列
PPT2
- 首先執行沒有延遲的語句(Iniital 語句)
- active區域:primitive input...特別的 是非阻塞賦值右邊的計算
- inactive區域:
- Nonblocking區域
- monitor是賦值后的新值,display是舊值
PPT3
VCS對仿真文件進行編譯
編譯后,得到了simv
的二進制可執行文件
define CASE1
VCS執行得到的結果為,時鍾跳變沿:a = 0, z = 1, zin = 1
modelsim的編譯后執行,得到的結果為: a = 0, z = 0, zin = 0
對於仿真這一段代碼來說,沒有正確之分
2. 課程介紹
PPT1
vcs在企業級的數字邏輯仿真里面用的十分的多
Prerequisites
You should have experience in the following areas:
- Understanding of digital IC design
- Familiarity with a Linux or Unix OS
- Familiarity with a Linux-based text editor (VI)
PPT2
Measurable Objectives
■ By the end of this workshop you should be able to:
- Simulate Verilog/SystemVerilog designs using VCS
- Debug VeriIpg/SystemVerilog designs using VCS
- Run fast RTL-Level regression tests for your design
- Run fasti Gate-Level regression tests for your design(回歸測試: 在新版本上運行所有已通過的測試用例以驗證有沒有“退化”情況發生,這個過程就是一個“Regression Test”。 )
- Acquire the skills and knowledge to successfully implement coverage driven verification methodology using VCS
代碼覆蓋率, 功能覆蓋率
PPT3
Agenda


3. VCS介紹
PPT1
A compiled simulator
- Verilog Compiled Simulator
- Digital functional simulator
- Complies with IEEE-1364
- Including PLI 1.0/VPI (PLI2.0) (Programming Language Interface)
- Supports simulation at multiple abstraction level(門級, RTL級)
PPT2
編譯后的文件稱為目標文件(object files)
4. 編譯時的開關
PPT1 基本的編譯
VCS Compilation Command Format
$ vcs source_files[compile_time_options]
- source_files
- All Verilog/SystemVerilog source files of the DUT
- Separated multiple source files by spaces
- Top module should contain testbench for the DUT(頂層文件包括DUT, Design Unit Test)
- compile time options
-
Control how VCS compiles the source files (如何去編譯)
-
Critical for optimization for visibility and performace (可視化,編譯的性能)
-
Each unit of this workshop will describe how best to use these compile time options ()
- Generates simulation binary executable simv (binary executable file)
PPT2 編譯選項1
增量編譯, 編譯后執行,打開GUI,將編譯過程記錄到文件,支持SV,支持verilog 2001的擴展
PPT3 編譯選項2
編譯使用了庫文件,編譯的文件在文件夾,編譯用到了宏
PPT4 增量編譯
cpu.o並沒有重新編譯
5. 仿真時的開關
PPT1 基本的仿真
PPT2 仿真的開關選項
6. 例子說明
PPT1 實例
PPT2 使用了DW的庫
7. 上機演示
- 編譯
- 打開仿真
- 查看編譯產生的內容
編譯的結果包括了Makefile,用來增量編譯的維護
- 增量編譯 Mupdate
增量編譯沒有任何改變,也就沒有提示
- 編譯的日志記錄
有錯可能是在那一行附近
- 編譯之后立即仿真
-
更改編譯的文件的名稱 -O
-
定義宏的方式
- 在文件頭中添加`define INC_COUNTER (control + p vi自動補齊)
- touch global_define.vh 生成一個文件,保存宏定義, include “global_define.vh”,增加文件查找,如下圖
- 通過開關定義宏