nWave - 用來觀察訊號的工具,可以觀察每一條訊號在每個時間點的對應輸出,方便於debug。
initial begin
$fsdbDumpfile("TBT.fsdb");
$fsdbDumpvars;
end
模擬驗證後,產生出一個 TBT.fsdb 檔。接著我們就可以用 nWave 這個工具將 fsdb 檔案打開,觀察模擬時的訊號變化。
在使用ncverilog模擬驗證時,加上「+access+r」參數。例如:
ncverilog TBT.v TBT_tb.v +access+r
Note:如何將「+access+r」加到 makefile 中,請參考 makefile 教學。
ncverilog中指令加的 " +access+r ",會產生出 fsdb 檔案可以讓我們在 Waveform 中看到我們給予信號線的變換,在往後 Debug 程式會滿常用到的!
步驟:
( 1 ) 在模擬驗證程式碼時加上 " +access+r "
例如:
ncverilog TBT.v TBT_tb.v +access+r
或是,如果你要使用makefile來執行指令,則加入一個+access+r的替代變數,如下:
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 2 ) 登入機器後,輸入 nWave 指令,開啟Waveform。(記得登入時,ssh一定要有-X參數)
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 3 ) 開啟後的視窗:
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 4 ) 開啟fsdb file (File -> Open):
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 5 ) 選擇要開的fsdb file後,按下ok!
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 6 ) 就可以選想要觀察的信號 (點選 Signal -> Get Siginals):
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 7 ) 開啟後就可以選要觀察之信號
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 8 ) Waveform 圖示,裡面的值預設是 16 進位表示法,左邊順序可以按下滑鼠滾輪做更改!
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
( 9 ) 更改進位表示法 ( Waveform -> Signal Value Radix -> Decimal ( 十進位 ) ):
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
就會顯示下圖