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

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

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

    [LV.1]初来乍到

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

    EDA365欢迎您登录!

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

    x
    对这段文字描述感觉有些困惑- f5 ~8 c: R. `$ ^) x

    " Q. h3 [- `' A7 H% N$ }! q& @$ O% Y+ W0 O
    8.0 Actual "full_case" design problem0 }9 h" R0 \7 r, q! r$ N" u4 u
    The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using' Y, v, r9 a( h; Z5 l0 a! I
    any synthesis directives. The resultant design was a decoder built from 3-input and gates and
    4 V4 }7 E' @% @, O$ N' ?' Jinverters. No latch is inferred because all outputs are given a default assignment before the case9 }: H+ m$ h  G8 S  a
    statement. For this example, the pre-synthesis and post-synthesis designs and simulations
    / T, K; n( b1 smatched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the
    7 e' |# Y% z6 u- j! h: g"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was& [0 _8 _7 T0 ]8 g3 j5 s# j
    optimized away during synthesis and left as a dangling input. The pre-synthesis simulation
    1 O' b; f9 L$ G' `results of modules code4a and code4b matched the post-synthesis simulation results of module& ^/ ^. \' c2 k! M- U. D5 D! {
    code4a, but did not match the post-synthesis simulation results of module code4b [2].3 ?" L  Y6 \, v7 y8 s
    // no full_case) u, {9 Z, r4 g" g& n
    // Decoder built from four 3-input and gates
    . O/ ~3 N+ K; n! A; f, |1 @// and two inverters/ a, Z8 T1 r; n5 C/ _- c& H
    module code4a (y, a, en);/ @5 S0 s3 D3 y$ }8 c3 R' q* X
    output [3:0] y;; t# N2 z, X& `
    input [1:0] a;6 m; o9 y. O  c, n
    input en;
    8 v/ o8 q( H: C; H4 H- |reg [3:0] y;
    - [3 ?" X8 p4 Y  [: ]) ^4 walways @(a or en) begin' {* a3 o( Y) g: W( |6 n
    y = 4'h0;
    * o1 V9 A) V- x' v/ x8 F- Y; q% B* Scase ({en,a})3 U% {2 P3 s' g2 g
    3'b1_00: y[a] = 1'b1;
    , n$ c+ S$ {) b- H* b' Y) O. G3'b1_01: y[a] = 1'b1;; |! {- F" w7 x4 \/ N$ w
    3'b1_10: y[a] = 1'b1;  n( g! L$ D( C: X5 b
    3'b1_11: y[a] = 1'b1;
    8 w# z5 j+ n! I* A% L/ e1 u! kendcase  V+ u: T5 C& g3 q6 J9 p( G
    end9 Q! D2 j+ \5 d2 [4 j
    endmodule. t' L# t: @  ?9 q; `5 E
    Example 12 - Decoder example with no "full_case" directive8 s- J/ L$ ~3 `" d
    Statistics for case statements in always block at line 9 in file3 ?& A+ P; Q0 M) M
    '.../code4a.v'
    " M# i& K- K: T8 O! b===============================================
    & S$ s0 h! J" c  ]% j* Q, r| Line | full/ parallel |
    0 t9 h' j0 s; q% M===============================================3 J7 ~# P$ x0 _( X5 u/ q
    | 12 | no/auto |
    8 t, D2 G1 e/ Y, y; ], b0 A' j===============================================
    : J# I# S: m& P7 J3 R0 VFigure 19 - Case statement report for Example 12
      f+ K3 }, n$ `9 T- y$ s" `
    ! b7 `) _% n1 n0 F( e9 c
    3 M, \0 a$ |" V9 m, _! {* s+ o. N" w// full_case example
    : n3 N9 P% r/ x* _% V* _6 \// Decoder built from four 2-input nor gates& g6 l: l3 g+ g9 P$ H6 b- ?( }+ G
    // and two inverters
    " y# U! s; P1 N// The enable input is dangling (has been optimized away)
    1 E5 l1 b( w+ p9 I6 Bmodule code4b (y, a, en);6 Q7 Z8 T" Y$ v5 m* b
    output [3:0] y;- n+ c0 r* U/ W. K1 N
    input [1:0] a;6 G$ C+ W- `+ H% r/ q$ @
    input en;
    2 H( p+ f9 U8 {$ {8 V# u. qreg [3:0] y;
    . b% H4 r) p7 E0 F4 f6 x4 walways @(a or en) begin
    - p5 D+ j! Y9 sy = 4'h0;
      P2 k5 U2 Y+ n8 u* B9 b* @; u) scase ({en,a}) // synopsys full_case
    5 W7 _; ]  X7 z# u3'b1_00: y[a] = 1'b1;
    . ~" U9 m% U, O  Z3'b1_01: y[a] = 1'b1;( j: l* a; X1 f8 _' R
    3'b1_10: y[a] = 1'b1;
      ]0 f% [- G7 D9 L# a0 j" L3'b1_11: y[a] = 1'b1;! ^& [; l% m3 G* h# c
    endcase
      |, Z; j4 o2 _( G2 L& r* J% ~end
    1 q% q' ]4 j$ p/ \3 r# `endmodule* a/ z8 Q# C8 |2 h( S. l, Z
    Example 13 - Decoder example with "full_case" directive& K6 G8 F( B7 s- \" w3 q1 S# N
    Warning: You are using the full_case directive with a case statement in which5 R/ o2 l* G' S6 e5 V8 m
    not all cases are covered
    9 k" {& i2 y, k2 zStatistics for case statements in always block at line 10 in file
    ( K0 B9 [6 l7 l( S'.../code4b.v'' M% F0 Y( ?- Y9 Y3 L. X9 v
    ===============================================4 k+ P0 M6 H6 V* ?2 B2 \5 V
    | Line | full/ parallel |
    . r) x. }) Z8 i===============================================1 F* B7 W: M8 g$ I
    | 13 | user/auto |
    , M, \. C0 F- r+ W0 {===============================================
    7 x' S+ D* L3 O' x7 T  CFigure 20 - Case statement report for Example 13+ I  A) T* N% k/ p+ o* q
    3 J5 r  {  x3 D8 L
    谁给解释一下原因呢?
    / n  |2 X7 r+ @1 ~3 \为啥会有差异?
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

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

    EDA365公众号

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

    GMT+8, 2025-11-28 19:08 , Processed in 0.156250 second(s), 25 queries , Gzip On.

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

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

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