VCS仿真選項
命令 | 含義 |
---|---|
+nospecify | 屏蔽specify塊中的路徑延時和時序檢查 |
+notimingcheck | 屏蔽specify塊中的時序檢查 |
在前仿真時打開這兩個選項,曾經遇到過一個BUG是在仿真綜合后的網表時,由於沒有打開+nospecify,有個寄存器沒有打拍成功。

FSDB波形控制相關系統函數
https://blog.csdn.net/zyn1347806/article/details/105554103
(1)$fsdbDumpfile("fsdb_file_name"); 指定fsdb文件名
(2)$fsdbDumpvars(1,nn_system)表示只Dump nn_system這一層的波形,$fsdbDumpvars(0,nn_system)表示只Dump nn_system這一層以及下面所有層的波形;
(3)$fsdbDumpoff()表示關閉波形dump;$fsdbDumpon()表示打開波形dump
將信號寫入文本
以下代碼將第1層的特征圖按照32個數據為一行寫入文件conv1_ch_0_16.txt
integer i;
integer conv1_file;
initial begin
conv1_file=$fopen("./1_feature_sram/conv1_ch_0_16.txt","w");
end
always @(posedge CLK) begin
if(u_nn_system.u_nn_top.u_conv1_ctrl.u_feature_sram_ctrl.conv1_finish) begin
@(posedge CLK);
for(i=0;i<2048;i=i+1) begin
$fwrite(conv1_file,"%0d",$signed(feature_mem[i][3:0]));
if((i+1)%32)==0 $fwrite(conv1_file,"\n");
end
end
end