1、延遲模型的類型
? ? ? ? verilog有三種類型的延遲模型:分布延遲 、 集總延遲 、 路徑延遲(pin to pin)
? ? ? ? 1.1、? ? ? ? 分布延遲
? ? ? ? ? ? ? ? 分布延遲是在每個獨立元件的基礎上進行定義的。??
module M(output wire out ,input wire a ,input wire b ,input wire c ,input wire d);wire e,f ;and #5 a1(e,a,b) ;and #7 a2(f,c,d) ;and #4 a3(out,e,f) ;endmodule//.............................................
module M(output wire out ,input wire a ,input wire b ,input wire c ,input wire d);wire e,f ;assign #5 e = a & b ;assign #7 f = c & d ;assign #4 out = e & f ; endmodule
? ? ? ? 1.2、? ? ? ? 集總延遲
? ? ? ? ? ? ? ? 集總延遲是在每個獨立模塊的基礎上定義的。
????????????????
module M(output wire out ,input wire a ,input wire b ,input wire c ,input wire d);wire e,f ;and a1(e,a,b) ;and a2(f,c,d) ;and #11 a3(out,e,f) ; //延遲只在輸出門外endmodule
? ? ? ? 1.3、? ? ? ? 路徑延遲
? ? ? ? ? ? ? ? 可以查閱數據手冊直接獲得標準組件的引腳到引腳的延遲(路徑延遲)。
2、路徑延遲建模
? ? ? ? 2.1、? ? ? ? specify塊
? ? ? ? ? ? ? ? 連接方式:
? ? ? ? ? ? ? ? ? ? ? ? 并行連接:=>
? ? ? ? ? ? ? ? ? ? ? ? 全連接? ?:*> ( in 和 out 兩兩連接?)
module M(output wire out ,input wire a ,input wire b ,input wire c ,input wire d);wire e,f ;specify(a => out) = 9 ; (b => out) = 9 ; (c => out) = 11 ; (d => out) = 11 ; endspecifyand a1(e,a,b) ;and a2(f,c,d) ;and a3(out,e,f) ; endmodule
?specparam
specifyspecparam d_to_q = 9 ;specparam clk_to_q = 11 ;(d => q) = d_to_q ;(clk => q) = clk_to_q ;endspecify
?條件路徑延遲
module M(output wire out ,input wire a ,input wire b ,input wire c ,input wire d);wire e,f ;specifyif( a == 1'b1 )(a => out) = 9 ;if( ~a == 1'b1 )(a => out) = 11 ;if( b & c )(b => out) = 9 ;if( ~(b & c) )(b => out) = 13 ;if( {c,d} == 2'b01 )(c,d *> out) = 11 ;if( {c,d} != 2'b01 )(c,d *> out) = 13 ;endspecifyand a1(e,a,b) ;and a2(f,c,d) ;and a3(out,e,f) ; endmodule
3、時序檢查
? ? ? ? 3.1、setup 和 hold檢查
? ? ?建立時間檢查? ?
specify$setup(data,posedge clk,3) ; //3是需要的最小建立時間 endspecify
?保持時間檢查
specify$hold(posedge clk ,data,5) ;//5是最小保持時間endspecify
? ? ? ? 3.2、width檢查
? ? ? ? 脈沖寬度檢查
specify$width(posedge clk , 6 ) ;endspecify
4、延遲反標注