1.$width語(yǔ)法
在verilog中,$width是時(shí)序檢查函數(shù),用于檢查脈沖的位寬是否符合要求。
$width ( reference_event , timing_check_limit , threshold [ , [ notify_reg ] ] ) ;
reference_event代表一個(gè)上升沿(下降沿)觸發(fā)事件。
語(yǔ)法中隱形地表達(dá)了data_event。
data event = reference event signal with opposite edge。
如果reference_event為上升沿,則最近的一個(gè)下降沿是data_event,兩者的時(shí)間間隔為脈沖寬度。
如果reference_event為下升沿,則最近的一個(gè)上降沿是data_event,兩者的時(shí)間間隔為脈沖寬度。
	
圖1:event示意圖[1]
	
圖2:參數(shù)說(shuō)明[2]
	
?期望的場(chǎng)景:脈沖寬度 >= limit
?不期望的場(chǎng)景:
?產(chǎn)生timing violation場(chǎng)景的:threshold < 脈沖寬度< limit
?不產(chǎn)生timing violation場(chǎng)景的:脈沖寬度
	
圖2:width檢測(cè)時(shí)序示意圖[1]
NOTE:很多時(shí)候threshold的值為0.
2.案例說(shuō)明
此案例中,使用的仿真工具為VCS,limit為 6000ps。小于6000ps的脈沖位寬均產(chǎn)生了Timing violation。
threshold為2000ps,位寬小于threshold的脈沖也產(chǎn)生了Timing violation,此處檢查比協(xié)議要求得更加嚴(yán)格。
	
"/auto/asic/design/try/top/rtl/width_tb.v", 34: Timing violation in width_tb $width( posedge clk:1000, : 2000, limit: 6000 ); "/auto/asic/design/try/top/rtl/width_tb.v", 34: Timing violation in width_tb $width( posedge clk:5000, : 10000, limit: 6000 ); $finish called from file "/auto/asic/design/try/top/rtl/width_tb.v", line 10. $finish at simulation time 100000 V C S S i m u l a t i o n R e p o r t
module width_tb;
   
      reg clk;
            
      initial begin
        $fsdbDumpfile("width_tb.fsdb");
        $fsdbDumpvars(0, width_tb);
        #100;
        $finish;
      end
      
      initial begin
        clk = 1'b0;
                #1;
        clk = 1'b1;
                #1;
        clk = 1'b0;
        #3;
        clk = 1'b1;
        #5;
        clk = 1'b0;
                #5;
        clk = 1'b1;
                #10;
        clk = 1'b0;
                #5;
        clk = 1'b1;
                #15;
        clk = 1'b0;
      end
      
      specify
        $width(posedge clk,6,2); 
      endspecify
   
   endmodule
   
	
	
- 
                                Verilog
                                +關(guān)注
關(guān)注
30文章
1369瀏覽量
113903 - 
                                VCS
                                +關(guān)注
關(guān)注
0文章
80瀏覽量
10212 - 
                                CLK
                                +關(guān)注
關(guān)注
0文章
132瀏覽量
17906 - 
                                時(shí)序仿真
                                +關(guān)注
關(guān)注
0文章
14瀏覽量
7566 
原文標(biāo)題:網(wǎng)表時(shí)序仿真,淺說(shuō)$width
文章出處:【微信號(hào):處芯積律,微信公眾號(hào):處芯積律】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
基于 FPAG xilinx vivado 仿真模式介紹
PCB設(shè)計(jì)│網(wǎng)表導(dǎo)入的雷區(qū),你還在踩?
什么是Modelsim的功能仿真和時(shí)序仿真?
請(qǐng)問(wèn)用什么語(yǔ)法可以實(shí)現(xiàn)這個(gè)max=val?
視覺(jué)模塊OpenMV淺說(shuō)LED燈
時(shí)序計(jì)算和Cadence仿真結(jié)果的運(yùn)用
Modelsim的功能仿真和時(shí)序仿真
modelsim仿真詳細(xì)過(guò)程(功能仿真與時(shí)序仿真)
    
基于ModelSim使用modelsim手動(dòng)時(shí)序仿真教程
時(shí)序分析概念min pulse width介紹
    
          
        
        
網(wǎng)表時(shí)序仿真案例:淺說(shuō)$width語(yǔ)法
                
 
    
           
            
            
                
            
評(píng)論