|
input [12:00] pac_leng_f; // pac_leng latch! Y7 n- x) K$ r5 f8 S6 ^
assign less_than_col_window = (spd1g) ? (pac_leng_f < 13'd552) : (pac_leng_f < 13'd104);
! O$ b6 p. W; ^
0 l3 I5 U3 Q; o可以改寫成
P( A3 a; t/ R5 b% l7 Q1 Qassign 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 )) :' W+ X+ j* A1 n; p6 @
((pac_leng_f[12:07]==6'h00) & ( {pac_leng_f[6], pac_leng_f[5] , pac_leng_f[3] } != 3'b111 ))0 N9 y3 X+ L* I$ K9 }! `
/ P% Z1 r4 B7 \6 E// 000 1000101000 = 13'd552
M: P% A. J! V# d+ O// 000000 1101000 = 13'd104
/ Z; j$ g! ?% M! \$ v, U0 x- h* M& ~" w- u6 q$ ~
一般人的寫法會使用 "<" 符號, Synthesize 時會形成下面這種多bits的比較器3 x) r6 f! `# F+ i8 p
這種寫法所 Synthesize 出來的 Combinational circuit 其 Propagation gate delay 會很長.% ~5 j; K4 ~, t1 J5 x o" S
改用新的寫法會變成 2 個 3bits 的比較器同時並行,各得到二個值後,最後再用一個 AND Gate 做輸出.
- i* m, ]( @6 |3 s8 G& r4 rPropagation gate delay 會短很多. |
|