| 
                 
TA的每日心情|  | 擦汗 2020-1-14 15:59
 | 
|---|
 签到天数: 1 天 [LV.1]初来乍到 | 
 
| 
对这段文字描述感觉有些困惑/ X" B: i* {# s  O, p3 j" S( X1 U
x
EDA365欢迎您登录!您需要 登录 才可以下载或查看,没有帐号?注册  . ~/ l% `3 |7 ^  @
 
 - z( Y2 r% W9 N3 P8.0 Actual "full_case" design problem# t% v" z3 x, I9 h" q
 The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using/ Y2 t# M# {/ Y4 |3 J2 I" q
 any synthesis directives. The resultant design was a decoder built from 3-input and gates and( w2 ~& I" @" }8 Z3 N# {/ T
 inverters. No latch is inferred because all outputs are given a default assignment before the case
 ' v4 L$ f$ [2 Z2 h8 estatement. For this example, the pre-synthesis and post-synthesis designs and simulations
 6 Z1 ?1 q6 L0 s0 |- G' l, ?* smatched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the
 . b7 x2 K7 f4 M' c6 i"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was
 2 X3 W/ ]2 c! T0 L, ]optimized away during synthesis and left as a dangling input. The pre-synthesis simulation0 A6 i8 e1 @- S. A& P5 f2 {- T
 results of modules code4a and code4b matched the post-synthesis simulation results of module7 s+ ~$ e1 F: `! x
 code4a, but did not match the post-synthesis simulation results of module code4b [2].* \! }- B# T* N7 |* j9 H
 // no full_case
 1 M6 A0 ^" d, r2 m+ j) ^// Decoder built from four 3-input and gates
 ) X& a/ Y9 ]( I3 `; u9 W% c+ G% i! c// and two inverters& N, m; C' }+ i( i6 ^" k
 module code4a (y, a, en);0 u9 e. {5 ~6 _. H
 output [3:0] y;
 & L% T1 X, b3 u& @  n' Ainput [1:0] a;7 {: t  W5 {0 {8 t9 h
 input en;0 U$ [$ l% D4 V! }- v
 reg [3:0] y;" e! x. ]' f3 Y" E7 P; [
 always @(a or en) begin3 ?' Z& p# Z0 Z$ I' S
 y = 4'h0;5 n7 J$ S* k, P$ s) V2 J
 case ({en,a})1 R# ?" H$ V) |9 \- ^1 u0 p1 l+ ^* E
 3'b1_00: y[a] = 1'b1;. H% s4 C5 Q' t9 U1 L. e( \
 3'b1_01: y[a] = 1'b1;
 5 t0 @/ H) U0 W1 S# E3'b1_10: y[a] = 1'b1;3 K8 \+ g6 F& g# c$ L, O
 3'b1_11: y[a] = 1'b1;
 [' K% {5 k, g3 z. F% k& b1 q. Bendcase
 ; o8 t# |" U! {6 u& }end
 # f7 G0 \1 C- R9 g7 M# Yendmodule: b2 g$ n3 W' v, c
 Example 12 - Decoder example with no "full_case" directive
 6 ~: C+ T. y+ H( L6 KStatistics for case statements in always block at line 9 in file
 ; ^" K, [# J( Q: o% s: w5 |'.../code4a.v'
 / M; Y5 T. B* m2 Q( [3 r===============================================  I( @% y5 b6 p8 I' K0 N
 | Line | full/ parallel |
 0 b9 h$ Y: n. D1 \2 F' T5 w+ N  y===============================================' t# n- L4 q1 ?' O0 |
 | 12 | no/auto |
 ! c# S) U0 C& k( a5 ?! C===============================================
 ! @8 i2 g: Q" i+ sFigure 19 - Case statement report for Example 12
 x/ M' e% }. J1 V. ]  O
 * ~* z0 c+ @8 [& @- I! T. q7 l) y  k7 p2 {  F; v9 r3 @' F
 // full_case example
 : E0 H% l# C5 Z' J% s% I- |, n// Decoder built from four 2-input nor gates
 7 z: f4 J# ?$ r% I: T- x// and two inverters7 P: Q4 B( M; V* U% a( T2 y
 // The enable input is dangling (has been optimized away)
 * d" v4 g; _5 U7 Jmodule code4b (y, a, en);
 3 O$ l, ?9 H8 q. boutput [3:0] y;$ c/ y: F# E* T4 G3 u  t
 input [1:0] a;" n/ R3 k1 n  k
 input en;7 i* I- ]! w/ S! q2 T
 reg [3:0] y;8 c5 E& e; e& I  T- v- P& b) s/ n
 always @(a or en) begin5 M# }) ?; q5 e* ~
 y = 4'h0;' z7 {; S% g/ J! m, `, ]- F3 r
 case ({en,a}) // synopsys full_case
 4 f! j/ G/ l8 H4 _! w" F( z1 q3'b1_00: y[a] = 1'b1;* ?$ T1 }4 _0 a
 3'b1_01: y[a] = 1'b1;
 # u3 O8 F1 ^% ]" [3'b1_10: y[a] = 1'b1;
 ! J) E2 |  Z4 p, r3'b1_11: y[a] = 1'b1;* Y( E1 ^. b& `$ N# L* y" q
 endcase6 D8 H0 W9 o' W3 A: b
 end) ?- i, L) Z3 \; C% v8 M
 endmodule
 & Y4 S: C# N  YExample 13 - Decoder example with "full_case" directive0 |1 t% r% G0 \8 X4 y
 Warning: You are using the full_case directive with a case statement in which& ^3 P# B7 C- G4 X4 C$ [* r( O
 not all cases are covered
 : x9 U: o* L( _: Q+ @  cStatistics for case statements in always block at line 10 in file
 + Q/ Z4 p  R* w" K'.../code4b.v'
 2 V: w- p0 a) }! X  S===============================================
 ( a6 G9 [2 V$ I) G| Line | full/ parallel |
 $ c( r4 R3 W$ Z0 `, z) {===============================================
 6 J7 b9 U! e/ a| 13 | user/auto |3 M1 i: g/ q% W, O; u5 w- c/ u
 ===============================================. |0 L8 l$ N; d0 e
 Figure 20 - Case statement report for Example 13. @8 G: K! `' x
 $ y/ L. ?" \; ?8 i  I, Z. a& l
 谁给解释一下原因呢?
 " w0 H5 }/ L2 h. d. j4 C3 S  y+ b; ^为啥会有差异?
 | 
 |