找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

巢课
电巢直播8月计划
查看: 1579|回复: 0
打印 上一主题 下一主题

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

[复制链接]

604

主题

2859

帖子

1万

积分

EDA365版主(50)

Rank: 5

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

EDA365欢迎您!

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

x
对这段文字描述感觉有些困惑
: V- B, I) K1 O/ |; L
& c% `0 V  H! ?+ B; }
5 g7 A5 S4 o  l& c8.0 Actual "full_case" design problem3 H4 a( Q. O! q6 m$ X, h/ a
The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using6 Y2 i6 _* Y8 r. r& C4 ~
any synthesis directives. The resultant design was a decoder built from 3-input and gates and
& l9 j$ R# L. g1 w! {/ r! iinverters. No latch is inferred because all outputs are given a default assignment before the case
/ X2 [# g: x! ?/ U: ystatement. For this example, the pre-synthesis and post-synthesis designs and simulations- a3 y  U) ?8 h* Z* ^& L; v$ g
matched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the
# [9 c' R7 s: a"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was  n9 r) P; e5 ~5 `0 Q
optimized away during synthesis and left as a dangling input. The pre-synthesis simulation
1 F" N& p( M: ~9 L0 m' \results of modules code4a and code4b matched the post-synthesis simulation results of module
" D6 I5 Z* _5 M3 E9 [. A& Fcode4a, but did not match the post-synthesis simulation results of module code4b [2].& U$ \9 W7 E9 q6 g9 M
// no full_case( b5 H( P8 ]) H! v0 k9 Y
// Decoder built from four 3-input and gates
' H7 A0 [4 E; ^1 w// and two inverters  }* }/ _: b8 Q& {' ?- B
module code4a (y, a, en);+ w5 d3 P) J4 N5 p! y
output [3:0] y;5 F) M# F8 s* _& O
input [1:0] a;
$ h) q' L! ?5 S; Z  yinput en;/ \- J# g; o. Z$ p
reg [3:0] y;  }* E- J! Z$ _( h1 K
always @(a or en) begin) `# L( w0 J# h
y = 4'h0;
7 T5 }! s+ n0 ^  l" I% D9 Y  Scase ({en,a})9 T  k8 C7 z' e6 h
3'b1_00: y[a] = 1'b1;  \& o/ t% y. O
3'b1_01: y[a] = 1'b1;. b9 Y( e, P5 D& Q, I( G
3'b1_10: y[a] = 1'b1;1 [4 `; I: D- g1 P* s4 j/ ?; b6 V
3'b1_11: y[a] = 1'b1;; g% T0 Q; F* V0 a
endcase: C% G0 T1 u1 @1 U- d& m! c  @
end$ b7 l# `( ]. X9 N3 ]1 g" p+ T9 l
endmodule
" \4 y- o* X5 B6 k3 p+ q% PExample 12 - Decoder example with no "full_case" directive# u/ @  [9 a$ c0 U1 c
Statistics for case statements in always block at line 9 in file
& B: o% [8 h4 F& w7 v* v'.../code4a.v'( q4 m6 F- ?/ `9 y
===============================================
3 G1 x- j4 b# ]| Line | full/ parallel |
2 N0 X( L0 C% I/ N- o9 P===============================================$ A1 X8 d/ k  C) J* R4 q
| 12 | no/auto |
" ~. X/ g% x/ @& ~5 M2 c( \7 _/ n===============================================
- A, L# @( E9 o0 nFigure 19 - Case statement report for Example 12
  _, S& o. y8 a; x, \: `& V) h: v2 k3 O6 P% n7 f
3 k" m) n" C! O7 c
// full_case example* _, e9 c# E* w8 D0 R
// Decoder built from four 2-input nor gates
/ _$ f& y$ m/ ]9 n! o// and two inverters
4 U# Z% o9 W3 q9 j. k3 u9 k// The enable input is dangling (has been optimized away)
6 y& B4 n' i' f4 S# jmodule code4b (y, a, en);5 q& W6 l, W2 M5 k% E$ }
output [3:0] y;4 O* K- K3 p% V3 b
input [1:0] a;. r7 C8 U) g+ A6 G8 R2 K4 T* T
input en;
1 n- X/ `9 Q# ~: k, z" Kreg [3:0] y;
, c) k1 \; ^) l, B& ^2 Palways @(a or en) begin. n2 I# m& r( ]8 U) t2 _
y = 4'h0;
6 k5 ]. Z7 ?* n3 fcase ({en,a}) // synopsys full_case  h" w$ o, W0 @
3'b1_00: y[a] = 1'b1;' O$ U0 d% W+ t3 c7 Y- F
3'b1_01: y[a] = 1'b1;
  U4 R) j) e2 ]6 R5 U  }3'b1_10: y[a] = 1'b1;8 H8 w. {; ^% l' j+ Q0 W
3'b1_11: y[a] = 1'b1;
& p& e$ l$ ~6 eendcase
4 v/ X4 [7 e9 Lend; A5 l/ E& E! j
endmodule
+ L& u8 ~4 Y; zExample 13 - Decoder example with "full_case" directive' l; Q4 p: M+ \: B3 J: D, L
Warning: You are using the full_case directive with a case statement in which" h& _4 u# I7 R8 \
not all cases are covered  o. O. A# Y) y6 ]
Statistics for case statements in always block at line 10 in file" L0 |* W2 y5 k1 M" A! k  H7 C
'.../code4b.v'& s/ L" _) \4 N' e* _& e' G
===============================================0 v! s! S( `* E4 \  C% r' D
| Line | full/ parallel |
6 k. q0 @( Y& N- E* t5 n7 N  p===============================================
7 R4 b4 f1 X. I2 k2 q% r6 R* V. f| 13 | user/auto |6 L2 F0 e- ?' Z8 K! U# O# m  B. G0 G/ S
===============================================
, X3 I9 w; ]; Q8 `4 `1 EFigure 20 - Case statement report for Example 13
4 V; y5 W- [2 P# o2 }
% P: V7 S; i6 `+ Y) `* i谁给解释一下原因呢?
/ D+ Z; I9 k% d3 T8 g为啥会有差异?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

关于我们|手机版|EDA365 ( 粤ICP备18020198号 )

GMT+8, 2025-1-10 21:33 , Processed in 0.062714 second(s), 32 queries , Gzip On.

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

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

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