1. 仿真事件隊列
VCS仿真工具怎麼處理交給他的代碼,VCS支持Verilog、SV、VHDL、C語言git
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 = 0ui

對於仿真這一段代碼來講,沒有正確之分this
2. 課程介紹
PPT1
vcs在企業級的數字邏輯仿真裏面用的十分的多spa
Prerequisites.net
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
<img src="https://i.loli.net/2019/12/07/MC46fm5aqlZRQTD.png" style="zoom:80%;" />
<img src="C:\Users\XuZhikang\AppData\Roaming\Typora\typora-user-images\1575723017507.png" alt="1575723017507" style="zoom: 80%;" />
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]
- 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)
-
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」,增長文件查找,以下圖

- 經過開關定義宏
