找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

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

[复制链接]

604

主题

2859

帖子

1万

积分

EDA365版主(50)

Rank: 5

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

EDA365欢迎您!

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

x
对这段文字描述感觉有些困惑
) l4 [  R) {7 x" p. G6 @* t' y6 O4 {/ I/ b# K) i! O

/ k& X) ?0 T. `9 z' B7 N8.0 Actual "full_case" design problem
8 S3 p6 v/ r* C: V. E* [The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using% r+ m: X2 ?" K1 A: Q8 w8 U
any synthesis directives. The resultant design was a decoder built from 3-input and gates and+ _- {, d, d9 c1 G
inverters. No latch is inferred because all outputs are given a default assignment before the case
/ ~; g7 W+ [& @, z7 l5 nstatement. For this example, the pre-synthesis and post-synthesis designs and simulations
3 f( D) B& C" P" y( u* Z% kmatched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the  N( A7 p; q, {( t4 n! _' u- V
"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was
8 @5 Q7 r5 L, U+ `0 Ooptimized away during synthesis and left as a dangling input. The pre-synthesis simulation# Y) d; ?' ?) R# {8 h' J/ D" @
results of modules code4a and code4b matched the post-synthesis simulation results of module& E3 E4 {6 a2 Q
code4a, but did not match the post-synthesis simulation results of module code4b [2].: R/ {: r/ {* |
// no full_case
% ?0 t( \; D) Z( s( V// Decoder built from four 3-input and gates
6 b+ d# `. G. r! n4 F# D  A  Y+ ^// and two inverters
5 N% s4 o+ A. i: hmodule code4a (y, a, en);/ y' W, Y  X( Z7 u% y
output [3:0] y;
2 b/ t4 a9 w' S+ _0 {9 z& V+ Winput [1:0] a;
5 V. a4 N9 H) n; r$ t7 Winput en;
1 N% F0 f& _. W) h4 Rreg [3:0] y;( c# \$ A5 c7 ~6 S; {' M: U
always @(a or en) begin( s$ m8 i/ m( B6 g- i
y = 4'h0;, Q0 P) ?2 x9 F. I* \' W( T) |
case ({en,a})
8 p4 w7 `+ u, D$ h3'b1_00: y[a] = 1'b1;
- o* ~4 Q5 l9 T3'b1_01: y[a] = 1'b1;
0 }( m, \7 A$ O1 q$ m3'b1_10: y[a] = 1'b1;% ~, m1 t1 f# m
3'b1_11: y[a] = 1'b1;/ [7 N3 {5 e7 o$ C: S  B* w1 ]
endcase: F- D/ j$ q5 Q" q. ^( _- V
end9 G$ F& F* m; L% M. ?
endmodule  _0 u2 c9 Y) S& v! n7 r7 w
Example 12 - Decoder example with no "full_case" directive. Y# u, \. {. s. E. x" p, Q
Statistics for case statements in always block at line 9 in file
% X' S2 z% i( n! q9 I: |# T'.../code4a.v'0 c9 B, ^" c  @) o
===============================================
) U9 L9 z# a8 j% @: Y" q$ F5 d| Line | full/ parallel |
1 \( p( j6 O* R===============================================7 s3 |$ f/ W' W( G, Z
| 12 | no/auto |
2 n) J# a  _: `( h- U5 R8 {===============================================6 R' v6 [& ~3 e$ w; ]0 J' w; M, v
Figure 19 - Case statement report for Example 12
; h; P# }) @6 e# _. ~/ \3 b' s$ a- p, K. ]% o, u9 t

  k. F( I9 a( Y  G& h// full_case example
. G: L0 y$ X; ~; X- w! i// Decoder built from four 2-input nor gates7 v, x. ]' \# ?/ S7 b+ w" {
// and two inverters1 D( g! y+ o5 |0 n: r( J
// The enable input is dangling (has been optimized away)2 \; @5 D1 A5 R* s( _: m7 T
module code4b (y, a, en);6 b1 y& d, q! _6 G. P1 h$ ?: x- D
output [3:0] y;/ S: N& p% D5 Z7 C( x: z
input [1:0] a;$ U4 r$ P' t' @, d: e; \. p3 _
input en;
$ X: @0 f- @3 s; L; E) K# vreg [3:0] y;8 G* h; P, U* Q( Q! X5 c& q
always @(a or en) begin
4 U$ ~' G( \: S: a! M" fy = 4'h0;  D! ~+ P0 ?  R& e1 n5 Y
case ({en,a}) // synopsys full_case
+ X, b7 Y/ ~  n  S. C- k3'b1_00: y[a] = 1'b1;
7 S9 Q5 y. p- \2 Q! Q3'b1_01: y[a] = 1'b1;
) L3 a" T' J* M; Q! p- Y( C3'b1_10: y[a] = 1'b1;
! ^9 _$ E( `3 M& ?! s/ U! H/ D3'b1_11: y[a] = 1'b1;
: l; t' _1 F- Q- U7 G3 w% ~endcase
. m3 o% i5 P. J+ d* H' yend& c0 N6 g! C6 I. ^
endmodule
" ^9 H) Q) V. t( o; KExample 13 - Decoder example with "full_case" directive
! |, Z8 c  s  H" iWarning: You are using the full_case directive with a case statement in which
. T# S8 ^9 l6 Ynot all cases are covered
1 {0 q+ K9 H4 D, kStatistics for case statements in always block at line 10 in file* @6 |6 r- _' K) r  I# A
'.../code4b.v'+ r% A0 n: w5 J1 \) w: b* s
===============================================
8 N$ h; S# L! M+ @6 C" {| Line | full/ parallel |
2 }- F/ N* n" n, Y* ?===============================================; ?' {2 s" X/ W7 [, T
| 13 | user/auto |6 a$ W% K' W4 |; [4 c9 W" x6 J
===============================================( v1 V& ]6 c+ d* n9 r5 U
Figure 20 - Case statement report for Example 13, K  l9 ^) L! G% g% U; t; p* M
1 E7 h+ A. ]0 U# x! M. Z
谁给解释一下原因呢?
4 d( y+ w2 c1 {  s" K为啥会有差异?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-1-10 17:18 , Processed in 0.056748 second(s), 32 queries , Gzip On.

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

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

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