最近開始自學數字IC驗證的內容,驗證平臺的環境安裝、配置并不是很難,但是對于小白來說,獨自摸索還真不容易,接下來我將步驟單獨列出,供后續學習者參考,
- 準備UVM標準庫檔案,網上版本較多,我們以uvm-1.1d版本為例進行說明,UVM標準庫檔案已上傳到CSDN中[鏈接:https://download.csdn.net/download/programmer_guan/14991340]
- 把uvm-1.1d.tar.gz放在linux系統中進行解壓,也可以在window系統下解壓后上傳到linux系統中,
- 打開.bashrc進行環境變數的配置
gvim .bashrc#打開.bashrc export UVM_HOME=/home/guanjw356/synopsys/uvm-1.1d#這里需要填寫你解壓檔案的目錄 source .bashrc#使配置生效 - 進入標準庫檔案自帶的example目錄,會發現Makefile.vcs檔案,此檔案對于所有驗證平臺通用,里面主要是對UVM庫進行編譯,但是要注意,并不能在此目錄下此檔案的編譯,繼續進入integrated/ubus/examples目錄,此處才是UVM進行編譯的目錄,輸入命令后運行若不報錯則說明編譯成功,
make -f makefile.vcs - 在我的Ubuntu系統中發現報錯,修改如下:將前一個ma kefile.vcs中的部分配置內容修改如下,運行后正常,
VCS =vcs -sverilog -timescale=1ns/1ns \ -full64 -cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed\ +acc +vpi \ +define+UVM_OBJECT_MUST_HAVE_CONSTRUCTOR \ +incdir+$(UVM_HOME)/src $(UVM_HOME)/src/uvm.sv \ $(UVM_HOME)/src/dpi/uvm_dpi.cc -CFLAGS -DVCS - 自帶案例測驗成功后,進行首個最簡單的UVM平臺代碼top_tb.sv的撰寫,
`include "uvm_pkg.sv" `include "uvm.sv" module hello_uvm; import uvm_pkg::*; `include "uvm_macros.svh" initial begin `uvm_info("infol","\n===\nUVM_Hello\n==\n",UVM_LOW) end endmodule:hello_uvm - 進行makefile腳本的撰寫
vcs引數決議如下:.PHONY:com sim clean UVM_VERBOSITY = UVM_LOW OUTPUT = demo_top VCS =vcs -R -sverilog -timescale=1ns/1ns \ -full64 -cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed\ +acc +vpi \ +define+UVM_OBJECT_MUST_HAVE_CONSTRUCTOR \ +incdir+$(UVM_HOME)/src $(UVM_HOME)/src/uvm.sv \ $(UVM_HOME)/src/dpi/uvm_dpi.cc -CFLAGS -DVCS #SIM = ./${OUTPUT} -l run.log SIMV = ./simv +UVM_VERBOSITY=$(UVM_VERBOSITY) -l vcs.log URG = urg -format text -dir simv.vdb CHECK = \ @$(TEST) \( `grep -c 'UVM_ERROR : $(N_ERRS)' vcs.log` -eq 1 \) -a \ \( `grep -c 'UVM_FATAL : $(N_FATALS)' vcs.log` -eq 1 \) run_all: ${VCS} -f filelist.f sim: ${SIM} clean: rm -rf *~ core csrc simv* vc_hdrs.h ucli.key urg* *.log
其中filelist.f中內容如下:+incdir+directory 添加檔案的搜索路徑 -CC "opts" pass 'opts' to C compiler -CFLAGS "opts" pass 'opts' to C compiler // cc 和 cflags 作用相同 -DVCS 當我們使用外部的UVM源(庫?)時,必須使用-DVCS選項 $(UVM_HOME)/src/dpi/uvm_dpi.cc 匯入 DPI-C 的程式 (一般要和 -CC 和 -DVCS 一起用) +acc Enable pli applications to use acc routines (see manual) -sverilog Enables the use of SystemVerilog code +vcs+lic+wait 等待vcs的license -l file_name logfile檔案名 -R 在編譯之后立即執行產生的可執行檔案$UVM_HOME/src/uvm_pkg.sv top_tb.sv - 最后運行make run_all,運行結果如下圖所示,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/255987.html
標籤:其他
下一篇:Jenkins更換初始登錄密碼
