找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

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

[复制链接]

604

主题

2859

帖子

1万

积分

EDA365版主(50)

Rank: 5

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

EDA365欢迎您!

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

x
对这段文字描述感觉有些困惑
. _( {: l8 G9 u+ h, [
8 U  E: R* t6 W% b  x; Y: f  J1 P' f/ _" K: R0 W# i6 T, B
8.0 Actual "full_case" design problem. M+ W/ Y8 q9 `, t
The 2-to-4 decoder with enable in Example 12, uses a case statement that is coded without using
& C4 z2 v7 x! A$ l# {% Q1 v; I$ Bany synthesis directives. The resultant design was a decoder built from 3-input and gates and
2 g% j8 i0 P! v; y$ F7 Winverters. No latch is inferred because all outputs are given a default assignment before the case( j, [! ~1 y" ^; ^, l
statement. For this example, the pre-synthesis and post-synthesis designs and simulations- e- m  x: w. d6 A/ T
matched. The 2-to-4 decoder with enable in Example 13, uses a case statement with the
. Z. u3 j+ X  M% p# G5 [9 O"full_case" synthesis directive. Because of this synthesis directive, the enable input (en) was1 r! Z+ X/ {- H& r
optimized away during synthesis and left as a dangling input. The pre-synthesis simulation; _/ o* w7 a' }& Q) w  M
results of modules code4a and code4b matched the post-synthesis simulation results of module
$ ]8 B8 o( H6 e8 lcode4a, but did not match the post-synthesis simulation results of module code4b [2].
" X, {# i" R; Q* {& Z// no full_case/ W7 \$ A/ c+ x) N( H
// Decoder built from four 3-input and gates
& ?% Y, H8 }  ]- u// and two inverters
1 k6 {1 Q( H3 |module code4a (y, a, en);5 o& M+ ^6 P/ b. M, X
output [3:0] y;
0 V( ^' k7 A' |7 J: Pinput [1:0] a;
9 i. c& P$ \% t) [5 S9 \2 h" xinput en;
- q+ k8 \! v: @) f+ E/ y; Kreg [3:0] y;
( [% \# u$ [' r2 ^always @(a or en) begin1 I; s! l) [7 Z$ T2 r6 X
y = 4'h0;
. l( O/ V% r7 T5 n/ L2 M+ ecase ({en,a})* C- y: V; F" c/ p" I+ R+ _# w  |7 K) D7 K
3'b1_00: y[a] = 1'b1;3 `8 K5 ?8 T% w' \+ `1 _
3'b1_01: y[a] = 1'b1;; m8 j; r' E# x2 d9 Z. X0 C
3'b1_10: y[a] = 1'b1;
7 S# W/ Q# B0 j2 u( @0 g  K3'b1_11: y[a] = 1'b1;/ \3 I% m9 r; @, j
endcase: z, ~5 i$ z5 T
end
; ?5 i- l2 _7 \1 }2 G8 ~- F5 Bendmodule+ S/ x2 h% j# Q9 ^4 f. u' u2 V9 c
Example 12 - Decoder example with no "full_case" directive
( Q4 s, P/ e0 uStatistics for case statements in always block at line 9 in file& h+ d* l1 e: {2 V
'.../code4a.v'8 O' {7 l8 V& I# `7 _2 n6 L- a
===============================================
- {0 `9 y. ^2 f/ P, k| Line | full/ parallel |
; w' f8 H- O& L! e% N===============================================( w: c) @* b3 I$ L% R2 f7 d
| 12 | no/auto |
6 v* z( F- S6 [===============================================- s& ?+ c& e. t% ^1 Y' C0 Y5 Y5 ?- X
Figure 19 - Case statement report for Example 12
% j1 G* Q9 C  B: e9 P
' @2 i. n) k& ~: W: Q' |; y1 W; J5 c2 Z! c% t; i* O; e
// full_case example
2 a2 T, O& L+ P// Decoder built from four 2-input nor gates7 N- _4 x& K4 \. d: ?7 F
// and two inverters/ R  @  q# S, b8 {- s
// The enable input is dangling (has been optimized away)& f  K- m  v, _( K* D# Y* x
module code4b (y, a, en);& k( s5 [1 T1 b. U/ q
output [3:0] y;& S9 l6 r0 Q4 s; ~8 Y
input [1:0] a;# l7 N5 y8 X2 d0 M) y: n" A
input en;
, [, R( i/ k8 A% D& Hreg [3:0] y;
) }3 ?! \  h  ~always @(a or en) begin4 C: I1 X8 W- L( U" U
y = 4'h0;( t$ Z& F' K- z3 `6 c- A: @4 }3 q2 ^
case ({en,a}) // synopsys full_case
1 T' }3 q6 C! Z2 @6 Q8 ^3'b1_00: y[a] = 1'b1;% M4 I$ {  Z6 |
3'b1_01: y[a] = 1'b1;
$ d5 H( w9 K1 z5 Y  y! U; s& }- n4 D3'b1_10: y[a] = 1'b1;4 C; N/ \0 F$ Q: u
3'b1_11: y[a] = 1'b1;/ U$ m( C- K& w* m. ]4 \
endcase* J; c) t, A/ i% G2 a% D/ G
end
5 ?/ j# s: q2 k. b9 sendmodule3 `/ L  ?, V2 l$ l) H% B2 |$ `+ L
Example 13 - Decoder example with "full_case" directive
) ]% q2 h7 b) U: f6 }Warning: You are using the full_case directive with a case statement in which; U. v) i$ S% J/ }
not all cases are covered3 d* p3 e" [+ s
Statistics for case statements in always block at line 10 in file, g6 }9 i; i/ m  l% K; e
'.../code4b.v'  w( L7 q' z: ?7 j* N* T
===============================================% g- O  k/ _9 `& }5 p; q/ Z2 V4 d
| Line | full/ parallel |
+ X+ d$ ?9 C/ z) e===============================================
. J! ?: e. S% F' z- D) K. || 13 | user/auto |
' C, u0 q( i/ e4 I/ L===============================================
' t0 }9 h9 D3 n9 N* {Figure 20 - Case statement report for Example 13- P' S( m! `% v1 j& w1 @7 I
2 k/ L6 W4 h" m7 D& m; \/ x5 C
谁给解释一下原因呢?7 O5 K2 Y9 Y0 b: ]1 v+ g0 H: \' b
为啥会有差异?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-1-10 11:35 , Processed in 0.053961 second(s), 33 queries , Gzip On.

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

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

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