1. 程式人生 > 其它 >【VCS版】【mentor公司的例子】基於UVM的UART驗證環境

【VCS版】【mentor公司的例子】基於UVM的UART驗證環境

之前偶然在群裡看到有人分享了Mentor Graphics提供的一個UART的UVM驗證環境程式碼,包含了UVM的基本使用以及進階的UVM暫存器模型。這裡也分享給大家。

檔案說明

agents/apb_agent - APB agent used in the UVM testbench
agents/uart_agent - UART agent user in the UVM testbench
agents/modem_agent - UART Modem interface agent, used in the UVM testbench
docs
protocol_monitor - contains an example APB protocol monitor
rtl - Contains the UART RTL source code***
sim - Simulation directory for the example, contains the Makefile
uvm_tb/tb - Top level testbench
uvm_tb/tests
uvm_tb/virtual_sequences
uvm_tb/sequences
uvm_tb/register_model
uvm_tb/env - contains the functional coverage monitors described in the cookbook

DUT是16550A UART模組,介面主要包含apb、uart以及一些狀態訊號,agents下是不同介面的agent。16550A UART推薦大家自己搜尋下載詳細的spec。

docs是uart模組的簡單說明,包含了一些暫存器的說明

protocol_monitor是一個協議檢查模組,通過斷言對apb協議進行檢查

環境整合以及sequence等編寫在uvm_tb下。

執行模擬

由於是mentor公司提供的例子,所以原來的makefile呼叫的是Questa,本次改了一下makefile,用vcs執行,然後生成覆蓋率之後可以匯出網頁報告,或者用verdi檢視覆蓋率。

make all執行

覆蓋率報告生成在cg_report目錄下

make verdi_cg使用verdi檢視覆蓋率

例子中的編寫的testcase並不能達到100%覆蓋率,有興趣可以自己試著寫新的case,去提高覆蓋率

後臺回覆uart_vcs獲得驗證環境

另外,模擬的EDA工具也可以看下面的文章

https://www.cnblogs.com/icparadigm/p/13827684.html