modelsim(1) - 安裝和使用 心得


最近一段時間使用modelsim,

一,安裝

使用的時候,出現license驗證不對。

由於經常換虛擬機,要注意首先MAC地址是否換了,如果換了,license要重新做!

其次/etc/hosts的IP地址要和ifconfig的IP地址一致,這個估計是在license file中,會去通過機器名尋找IP地址。

如果仍然不行,就重啟linux。

 

quartus破解在不同的linux操作系統處理不一樣,centos是最穩定的操作系統,it can be installed correctly.

however ubuntu,fedora有些不一樣,這個花了我不少時間,need to change the file vco in the questa directory. vco is the tcl script ,it will call the vsim

afte 里面設置了LD_LIBRARY_PATH, run vco!

 

二)仿真工具使用

1)如何查看已經仿真的波形

vsim -view xx.wlf -do wave.do

 

2)后仿如何將頂層文件和sdf文件關聯,見下

vsim -L SmartFusion2 -L postlayout  -t 1ps -novopt -sdfmax /top_0=${PROJECT_DIR}/designer/top/top_ba.sdf postlayout.tb
add wave /tb/*
add log -r /*
vcd file power.vcd
vcd add -r /tb/top_0/*
run 500ns
vcd flush
echo "VCD file power.vcd was successfully exported under the project simulation/ directory"

 

3)后仿,帶優化,但是要保留信號,以及生成database (shannon,但是似乎不成功!!!,只能供參考

 vsim -postsimdataflow -debugDB=test.dbg -wlf test.wlf \
         -L Smartfusion2 -L work -t ns -voptargs=+acc -c -pli ./pslse-master/pslse/afu_driver/src/afu_driver.sl +nowarnTSCALE work.top

add log -r /*

 Recall the post-simulation debug database with the following:
dataset open <db_pathname.wlf>

 shannon注:

vsim -postsimdataflow -debugdb=<db_pathname> -wlf <db_pathname>  -voptargs=+acc

By default, the Dataflow window is not available for post simulation debug operations.
You must use the -postsimdataflow to make Dataflow window available during post-sim
debug.
Specify the post-simulation database file name with the -debugdb=<db_pathname>
argument to the vsim command. If a database pathname is not specified, ModelSim
creates a database with the file name vsim.dbg in the current working directory. This
database contains dataflow connectivity information.
Specify the dataset that will contain the database with -wlf <db_pathname>. If a dataset
name is not specified, the default name will be vsim.wlf.
The debug database and the dataset that contains it should have the same base name
(db_pathname).
The add log -r /* command instructs ModelSim to save all signal values generated when
the simulation is run.
3. Run the simulation.

 

3)在modelsim的仿真中,反標的verilog文件中信號名不僅僅是verilog的定義的標識符(有任意字母,數字,$和_),還包括空格(是否因為信號命名是\開頭?)

   所以出現仿真中找不到信號名,注意空格,如果修改verilog文件則也應包括空格  .

比如:

信號定義

wire  \wqueue_i/WRITE_QUEUE/mem_mem_0_4/A_ADDR_net[13]空格 ,....空格,

add wave -noupdate {/top/a0/\wqueue_i/WRITE_QUEUE/mem_mem_0_4/A_ADDR_net[13]空格}可以找到信號

add wave -noupdate {/top/a0/\wqueue_i/WRITE_QUEUE/mem_mem_0_4/A_ADDR_net[13]}就不能找到信號

4)在modelsim的object name中找信號(ctrl+F),對於數組的符號[],需要用正則表達\[, \]來表示

 比如在反標文件中查找arrayA[1],需要輸入arrayA\[1\]

5) 仿真的時候,memory can not show in the wave

 

6)function of add flow is usefull

 

 

 

三)Q&A

1)每次仿真會在仿真當前目錄產生modelsim.ini,里面會調用系統的modelsim.ini.

如果出現如下錯誤,std庫找不到

刪除modlesim.ini,讓其自動再產生一次

 

 

四,樣本

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM