找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
跳转到指定楼层
1#
发表于 2009-10-31 17:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您!

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

x
library ieee;
: `( I' I2 x9 G1 B$ ~' |9 c& Ause ieee.std_logic_1164.all;
: q3 t; I  P' ~8 q* v  ]use ieee.std_logic_arith.all;
! o3 [: s' q' o1 ?8 }; K; @; k; @( ~0 ]use ieee.std_logic_unsigned.all;
& z4 k/ N. d' M7 Aentity hour is0 l" t0 z3 m2 l  A1 D# i: m
port(clk_h,clk_t,tp_h,res_h:in std_logic;# J+ s( T+ M7 t3 k9 E
  hset:in std_logic;' `# ?9 N' ?; F$ j( p$ k3 @' F" Q
  sig_h:in std_logic_vector(2 downto 0);
, q$ _* c  F$ m7 M  din_h1ut std_logic_vector(3 downto 0);
- A+ q9 X: ?  T" E. s7 k( y7 T9 f0 X  din_h0ut std_logic_vector(3 downto 0);* g( h9 \' @! F+ D7 {/ X
  pmut std_logic;
# \3 u( x1 h9 V) Z  cp_h:out std_logic);8 l7 H2 ]6 N+ U2 n8 @  E! B$ F
  + U% R% g' Z" ]( |1 `8 V9 h
end hour;7 @; x2 v7 o; |: k/ i
architecture behav of hour is
# S6 ]- c2 l! t. T$ Psignal clk:std_logic;: P+ f% L/ ^1 _' D: K' J
begin4 I' {0 L/ @$ M; ^! k
    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)
  {4 |7 V. h1 J- U& F- i0 t     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);
/ B' f1 o" ?5 R% o4 d. E8 \; A, x; l     variable co1:std_logic;
+ w+ K+ ~$ z9 w4 b     variable co2: std_logic_vector(7 downto 0) ;8 r& v" l8 ], t1 o" N- w
   begin . A8 s2 H# `% S1 f) [& ~9 {7 K
    if sig_h="001"and tp_h='1' then clk<=clk_t;
* N. p9 J% F$ V( @( I% w   else clk<=clk_h;
+ b; l5 Z9 E8 P) `* `5 o; d( Y/ ?   end if;
8 ~' ~8 Y+ J9 H    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');
$ E6 V  n  v, f       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;
" R' i0 w$ [: m2 Q2 `      if cq1="1010" then cq2:=cq2+1;cq1:="0000";7 a/ N! z& ]0 w" Y* M3 j2 x
            end if;: q6 `; m5 H& k4 O
            if  cq2="0010" and cq1="0100" then, ~% r- B6 R9 @" [! u
    cq1:="0000";cq2:="0000";& p& ?6 l1 w7 }
    co1:='1';/ i9 h+ E" f5 ^, P. R7 b& t+ e1 b- r5 P7 K
   else co1:='0';. a- }  f* ~% [; ^8 F
      end if;$ H* Z- i) \8 G3 g
      if cq3="1010" then ' h7 u9 y7 R2 A# b; v
      cq4:=cq4+1;
. Y7 U% k5 J/ }7 j! [: a4 E      cq3:="0000";# i* z; X  y' V* j
    end if;: U) {. o" n. ?% [
   if cq4="0001" and cq3="0010" then
) {' @. g3 }) F3 A! H. L& S         cq3:="0000";cq4:="0000";co2:=co2+1;
* L: W2 ~% V3 w% f' R0 z      end if;9 \9 v1 S8 B* p  i
    end if;
+ [3 e: U! t4 ]1 j  if hset='1' then   
  [. Z# Q0 c) g7 a          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;
  ^/ k% J' F) ^7 m5 r/ s3 P         else; `& B8 m$ D; k
           if co2(0)='1' then
# R7 q# v% i7 w1 q% ?4 }1 F& H; l6 y             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';" J" w: j6 ~% V# M
             end if;4 U) ?; L  n2 L7 F% @, A& D6 }8 C
             pm<='1';
. q( c' E0 S' }3 H) Z* H            else pm<='0';
0 }. B8 L+ W7 l' n% u" j' y3 v2 a            end if;
( C! n  d+ Z9 l% q$ i            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';
: R9 G% V: V$ \3 Z& Z8 L7 y/ s              else cp_h<='0';
) i6 J: P7 L! L' z7 c             end if;
) Y8 S( ?% j, `  X5 z' H2 q: }2 f           din_h1<=cq4;din_h0<=cq3;  
8 @5 @) v- R3 D8 S& N0 N8 [5 W4 B        end if;  --12/24转换8 T1 b! ^1 |; w' Y2 ]% G) v
  
+ O# {1 S! _2 e- |* w' S! ?) U' X     end process;
" N  m. ~; J) {8 N% X2 \4 tend behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:4 c) A" G8 C' _$ h! S8 {9 H8 a5 F
Info: *******************************************************************9 a$ `- K9 `! D% m- l9 P
Info: Running Quartus II Analysis & Synthesis0 O* }8 |# C; C
        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version
2 [/ O5 m( F6 `0 l9 \4 d) m7 s        Info: Processing started: Sat Oct 31 17:04:02 2009
* \) @. t5 R; Y& @3 G. Z: kInfo: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour) d9 @0 s) ~/ E$ t  V% ?: h
Info: Found 2 design units, including 1 entities, in source file hour.vhd
7 f7 w) k$ N# J$ ^! W        Info: Found design unit 1: hour-behav5 d  H* E1 l( j
        Info: Found entity 1: hour
; W9 E3 p) l4 m. A2 _5 O! c) m/ [. I3 pInfo: Elaborating entity "hour" for the top level hierarchy) c9 N( }* e! K6 K- b4 f2 |& E
Warning (10492): VHDL Process Statement warning at hour.vhd(29): signal "clk" is read inside the Process Statement but isn't in the Process Statement's sensitivity list5 V4 B& t" }4 }+ ]+ f: v
Warning (10631): VHDL Process Statement warning at hour.vhd(20): inferring latch(es) for signal or variable "pm", which holds its previous value in one or more paths through the process
, j9 `3 o7 I8 [  ?Info (10041): Inferred latch for "pm" at hour.vhd(20)4 k( e& i8 S! I
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model, Y9 v! w" e- ?) @
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[1]" because its behavior does not match any supported register model+ h5 ]: }; g" N5 {. t! j4 q3 R
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[2]" because its behavior does not match any supported register model, r/ P6 U1 m, B% i1 c# T
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[3]" because its behavior does not match any supported register model
9 f4 l, D7 U. Q$ @1 cError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model0 z6 I7 @4 C" b" m; J/ U6 O: M0 l
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[1]" because its behavior does not match any supported register model/ L  ?4 y- ?& A& e9 |
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[2]" because its behavior does not match any supported register model" {* r' C+ T# H$ d
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[3]" because its behavior does not match any supported register model! B8 t4 N2 U+ V) l, {/ D: M  e- y; Q
Error: Can't elaborate top-level user hierarchy' j1 V5 L, M& p- h# k5 f, F
Error: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings4 R$ }% R( Q4 G$ b# i
        Error: Peak virtual memory: 184 megabytes, M  m- K: Y, M$ S: s
        Error: Processing ended: Sat Oct 31 17:04:04 20095 n/ G0 d5 k6 _: |* T. ^
        Error: Elapsed time: 00:00:02
1 b4 f# q% p0 g; b) h" |        Error: Total CPU time (on all processors): 00:00:01. H2 x" V& P  W, c; D9 _* ]& }
Error: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-2-22 14:27 , Processed in 0.058811 second(s), 39 queries , Gzip On.

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

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

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