|
input [12:00] pac_leng_f; // pac_leng latch8 t' n% X( P$ x, D( V# \
assign less_than_col_window = (spd1g) ? (pac_leng_f < 13'd552) : (pac_leng_f < 13'd104);
# W' A9 x0 e" J! V) Y* Q% T
: e, I5 F. i4 O& o可以改寫成 . h5 K0 J& N' w
assign less_than_col_window = (spd1g) ? ((pac_leng_f[12:10]==3'b000) & ( {pac_leng_f[9], pac_leng_f[5] , pac_leng_f[3] } != 3'b111 )) :/ i( R8 i# t! H4 d+ V* H7 Q
((pac_leng_f[12:07]==6'h00) & ( {pac_leng_f[6], pac_leng_f[5] , pac_leng_f[3] } != 3'b111 ))8 X1 t# w0 x# i9 q" D4 |1 S1 }8 t
7 v- Z G6 q$ x/ U7 c
// 000 1000101000 = 13'd552
* J! F8 S& }2 A Y// 000000 1101000 = 13'd104& A2 H% D2 _2 w% `8 h
: h7 h0 O" G1 }" j) P; i
一般人的寫法會使用 "<" 符號, Synthesize 時會形成下面這種多bits的比較器+ R) @" w- ^8 D; e
這種寫法所 Synthesize 出來的 Combinational circuit 其 Propagation gate delay 會很長.
3 E. V1 c! l1 J6 G$ H! a改用新的寫法會變成 2 個 3bits 的比較器同時並行,各得到二個值後,最後再用一個 AND Gate 做輸出.5 ?- K9 M! f1 H+ ?! C" f7 }
Propagation gate delay 會短很多. |
|