找回密码
 注册
关于网站域名变更的通知
查看: 2507|回复: 0
打印 上一主题 下一主题

对这段文字描述感觉有些困惑

[复制链接]
  • TA的每日心情
    擦汗
    2020-1-14 15:59
  • 签到天数: 1 天

    [LV.1]初来乍到

    跳转到指定楼层
    1#
    发表于 2007-12-21 18:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

    EDA365欢迎您登录!

    您需要 登录 才可以下载或查看,没有帐号?注册

    x
    对这段文字描述感觉有些困惑0 C+ d( Q& H: I& v5 u- _
    & g0 P2 ^6 D7 p, Z7 Z, L

    8 W, U. Y$ Z0 Q( C2 l& N8.0 Actual "full_case" design problem% n( H+ h3 D) T5 f% U( D4 k/ ^
    The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using
    2 q  e: K2 a9 d1 ?9 \; b; bany synthesis directives. The resultant design was a decoder built from 3-input and gates and
    : R* y3 T% L- einverters. No latch is inferred because all outputs are given a default assignment before the case
    . Q7 Y% W0 u) W/ `" f; a! U5 v) Xstatement. For this example, the pre-synthesis and post-synthesis designs and simulations( S; P' f! h7 _6 s8 W  z# f0 ?
    matched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the
    : o/ g8 _0 b8 ]% V) m# y- p' W"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was5 q+ l3 @3 ^6 r2 ?$ }2 I$ M7 M, X
    optimized away during synthesis and left as a dangling input. The pre-synthesis simulation2 x$ Z8 ?/ ]" g# x* k; W: |9 V
    results of modules code4a and code4b matched the post-synthesis simulation results of module) N/ J  I& w) b- ~% c1 ^3 Y5 v
    code4a, but did not match the post-synthesis simulation results of module code4b [2].
    , x( h! }# H4 r) P% [- O// no full_case
    & h. `5 [. ]$ M// Decoder built from four 3-input and gates
    9 P( k( {4 ?; G! h// and two inverters1 u4 w: N2 Y0 A7 l. _' d7 u
    module code4a (y, a, en);
    . `9 e& h7 q$ Q1 soutput [3:0] y;/ Z) k- r1 V7 N: w: z* H, r
    input [1:0] a;- g9 S  o; C* ?  I3 f# L) J1 U7 |
    input en;
    ' J9 I# F1 u2 Q6 oreg [3:0] y;
    ) d, l4 V' e) v( G$ calways @(a or en) begin  [) ?1 \. ~, N. W
    y = 4'h0;
    * H: F) s8 n6 a7 h8 Xcase ({en,a})) O" ^8 d  X$ M8 e# y" L
    3'b1_00: y[a] = 1'b1;
    * K; d9 f, g8 V3'b1_01: y[a] = 1'b1;
    7 q% g9 C% Q0 x! b& y3'b1_10: y[a] = 1'b1;" p. U7 N$ ?# y' _" }- A
    3'b1_11: y[a] = 1'b1;1 i2 i; G! y7 i* Y" R5 C
    endcase
    # N2 n* g/ Q# w# V7 ^end- N2 `/ k  `% i# o' f6 j
    endmodule4 S% Y9 u; e7 A7 n; }/ E
    Example 12 - Decoder example with no "full_case" directive1 I! \$ T$ }* z% S3 Q4 ?
    Statistics for case statements in always block at line 9 in file
    $ R1 |# q# }- z$ l" A; f# u'.../code4a.v'% ?) N! N1 _' k" I* g1 o2 l. B
    ===============================================
    ! ~! B, v0 k- b3 K/ D& h( O9 x| Line | full/ parallel |
    - x; h9 ?) l3 d& n. Y4 G$ |===============================================
    ! j  {4 @& ~! X. x4 [5 o| 12 | no/auto |, h" p" W/ p% f3 n( q' l; Q
    ===============================================
    ( p+ ]$ [: p+ m( ^+ BFigure 19 - Case statement report for Example 12. D9 X4 `$ G$ {4 K4 x( B
    ( y1 o* p; l( C# P& h6 X1 x

    & ^7 B9 F0 U, I6 \5 s// full_case example
    4 q* S) w- z7 b  G& `9 \2 t// Decoder built from four 2-input nor gates
    ; k6 Q1 I( |: i+ A! F6 H// and two inverters4 s0 b5 H- m4 t+ q9 K
    // The enable input is dangling (has been optimized away)) D$ R% A* j3 G$ i$ g
    module code4b (y, a, en);
    - f& O6 G) |6 z3 e# o# `  y0 Voutput [3:0] y;
    ! v- S: w$ P9 \5 c' \input [1:0] a;0 B0 I  X0 H- }
    input en;9 O: H' i6 a; ^6 ~' y
    reg [3:0] y;
    5 L) {9 p" O) ralways @(a or en) begin. \0 C  k! U9 j: q% V: |$ c) i
    y = 4'h0;
    . V2 C6 e2 I4 y' n2 r3 x. Ncase ({en,a}) // synopsys full_case
    5 I; G! Q% _. [  E/ e; r6 Q, L3'b1_00: y[a] = 1'b1;
    . }1 h( K. f/ E5 x  O  P3'b1_01: y[a] = 1'b1;
    - \7 G* K  C1 k- V3'b1_10: y[a] = 1'b1;, F3 k. b/ b* O9 d7 G
    3'b1_11: y[a] = 1'b1;
    0 A  }" z/ S# g8 W# V# ?endcase
    2 r! n0 g( ~, }  d  }. hend
    # e( G) b% Q# X) R$ c  g2 Gendmodule
    3 V' e; X! E1 b: t9 ^7 {; [/ V' bExample 13 - Decoder example with "full_case" directive' ?+ f, C/ P7 v
    Warning: You are using the full_case directive with a case statement in which
    5 }1 p* P/ h9 Enot all cases are covered
    * {8 F8 z6 r- w1 rStatistics for case statements in always block at line 10 in file2 S: Z5 y& y4 c( b, z. R% @2 B, W
    '.../code4b.v'
    * V' N4 v2 I  O7 G===============================================
    1 P4 A) c8 }6 G) M7 Z0 x| Line | full/ parallel |
    - s& D5 i! v' U" L===============================================
    : j, J1 `  x4 x% c0 I| 13 | user/auto |6 w2 ~( B  b# l, b+ t
    ===============================================
    + L" N8 {- Z7 g1 LFigure 20 - Case statement report for Example 13- I* q2 t5 ^. t$ w
    0 ]; T! j3 `( g) o+ q  P3 ^. f' j
    谁给解释一下原因呢?! r# Y6 n1 ^5 {) S+ X% w' h
    为啥会有差异?
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-11-4 21:30 , Processed in 0.125000 second(s), 24 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

    快速回复 返回顶部 返回列表