找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

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

EDA365欢迎您!

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

x
library ieee;
5 a" D1 q, S! A; s, h: K* }7 xuse ieee.std_logic_1164.all;2 T* S; E/ F; Y: U6 |* q9 j7 ?
use ieee.std_logic_arith.all;2 x3 T1 P; Z3 l8 `
use ieee.std_logic_unsigned.all;2 Q* ?7 i! ^$ Z" X9 R8 A$ {% z' m
entity hour is6 `. ~, R, J# W9 K- y0 B3 I+ y" E8 O
port(clk_h,clk_t,tp_h,res_h:in std_logic;
7 U+ z/ L2 L& b) H# k  hset:in std_logic;
9 \; D. c% v: Z8 w, S/ x& y; y" t  sig_h:in std_logic_vector(2 downto 0);
0 F2 Q  Y2 y' p; `+ ^. u8 |+ S  din_h1ut std_logic_vector(3 downto 0);
+ s; p4 |' w; F. j  _, E* V  din_h0ut std_logic_vector(3 downto 0);
/ k; p* G+ l9 c% r$ g' b) L  pmut std_logic;
; \% j7 f9 |  f! E3 i) Y  cp_h:out std_logic);
3 c* p0 Z( _: x% ?  
" f" }" d& Q2 I3 c! ?) hend hour;+ \1 |& d7 ?  P. }( F
architecture behav of hour is+ _3 ?- v; g% b" L2 b. h
signal clk:std_logic;1 ~; u% o  c- [: ^- k! [2 I# q
begin
1 G/ R3 m3 t2 c& V6 `    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)
7 T6 Z4 K# j. V, }     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);
* O! p% S+ C3 p6 c" [     variable co1:std_logic;4 i7 _$ m4 ^6 ~9 n6 O" J+ Z
     variable co2: std_logic_vector(7 downto 0) ;  O* ?2 C- [. ?5 a) @& C1 ]  F6 W' S0 j
   begin
6 ^/ s  a4 _, {8 |4 j9 K: G    if sig_h="001"and tp_h='1' then clk<=clk_t;! _- Z$ x+ S* n9 |
   else clk<=clk_h;
1 c# Z5 r* I, l   end if;
; y% C; ~6 A0 j/ ?  O) y2 S    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');7 b9 i, [, a) S, B
       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;- J' r& X) ]" w2 O
      if cq1="1010" then cq2:=cq2+1;cq1:="0000";$ ^3 y) e6 [" i! h2 A- h+ L% Z! q6 J
            end if;
$ N* Q% J6 l) p            if  cq2="0010" and cq1="0100" then+ t9 p, l4 k2 l/ C% ?
    cq1:="0000";cq2:="0000";! j& I. G: M3 [; o) v, u) P" N! s
    co1:='1';8 S; A* S  j$ {9 U) E, V9 |+ g
   else co1:='0';
! E/ i  g  C+ q- Z2 j6 |/ t% V      end if;
" n) w9 x+ U3 A& `- G      if cq3="1010" then ' M! q" q4 o  D8 j
      cq4:=cq4+1;( H" N" G# u! v6 [1 {8 H9 g
      cq3:="0000";. `1 F% T  z6 p
    end if;
; v, A/ V8 m+ `# ]" L4 H   if cq4="0001" and cq3="0010" then
* L1 X' R  E! |( r+ v+ f& j# n         cq3:="0000";cq4:="0000";co2:=co2+1;: N! W5 z: W, I8 \9 i( Q
      end if;
& Y: \7 B' L; K" x; c* j9 d    end if;
0 T3 g' I8 v! K7 b2 O$ M: j) b  if hset='1' then   
" k; F( i: G. f8 v  _8 Y/ D; \2 Z          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;5 X0 ]6 B' w" N. a; ]7 C
         else
9 \! q8 b# l6 E" E  q           if co2(0)='1' then $ n3 J0 A( {; V& |# W! V0 e/ @7 `! Z
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';# U4 q$ z- z4 H# `  ~+ _
             end if;$ f( a# ]1 W) b: v) n
             pm<='1';& w( S, W7 _! r0 M( S  [
            else pm<='0';# M! R3 Z) ]. M& D/ A% O
            end if;
2 a& r  g% @9 S1 i' k6 [9 a! ~& s            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';% ~+ V, V& K1 }4 ~" N- d
              else cp_h<='0';7 g. B$ ?. ~* a+ I
             end if;
3 x8 E: o+ F* j( M0 d8 q7 `3 f" w           din_h1<=cq4;din_h0<=cq3;  % i: i  h: }9 j1 x3 P9 e9 m4 U
        end if;  --12/24转换, `3 W8 V# I8 R* ]  k
    q( Q6 }4 ?$ k/ _% q  L
     end process;6 d6 z8 Y( h2 p" \
end behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:& [1 D+ p/ K' \3 u- p( q
Info: *******************************************************************# ], w2 D/ r0 W3 y
Info: Running Quartus II Analysis & Synthesis
: F8 `4 W0 [1 u. n9 ?- r; G+ H. z        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version' {! p. q: q0 v) p" N
        Info: Processing started: Sat Oct 31 17:04:02 2009
6 h7 [* S  a9 I/ ~/ q; e8 |Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour- ]# y* }0 d3 m$ [1 ~, a  K6 T3 C
Info: Found 2 design units, including 1 entities, in source file hour.vhd0 Q1 |  `: {1 a! O
        Info: Found design unit 1: hour-behav
. g: `9 G2 l( g# E. I        Info: Found entity 1: hour
- P5 o4 a1 T7 C1 f8 o% XInfo: Elaborating entity "hour" for the top level hierarchy
6 f5 G0 m% B* i+ O% p, \! l0 F. X/ mWarning (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 list
" U1 \$ o& |+ W3 L. K8 B2 M! DWarning (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  L; C7 X6 K0 Q( t/ A6 {+ k
Info (10041): Inferred latch for "pm" at hour.vhd(20)
# Z, q# ]8 c" y; [: o. l7 `, uError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model3 X9 f- m3 ?9 Q" `+ G9 R* D
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
5 q% l* J) Q1 J1 G- B% t/ Y. gError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[2]" because its behavior does not match any supported register model/ q3 i: \; c( M. |( D- z; V  x2 _
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
* C% }4 p' z3 ]$ B' {5 E* p( y/ Y; Z4 d& RError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model$ V) b4 c) q) o- x) a* z  @/ W
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
$ @! I: j8 T: {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
  H; g2 m( |: @5 N) t+ l9 J7 NError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[3]" because its behavior does not match any supported register model
5 T- g4 C: `- t: Q) X. E! i8 yError: Can't elaborate top-level user hierarchy$ {8 _; j& F& W% `1 K
Error: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings2 `  s, Q9 A4 m2 W
        Error: Peak virtual memory: 184 megabytes
3 e6 L8 ^$ x- r  `        Error: Processing ended: Sat Oct 31 17:04:04 20091 y: f3 a. D) Z- t  d
        Error: Elapsed time: 00:00:02+ o, m  {; ?$ U% C. X7 f
        Error: Total CPU time (on all processors): 00:00:01$ ]% A! V/ v3 ~' z
Error: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-2-23 06:17 , Processed in 0.057837 second(s), 39 queries , Gzip On.

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

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

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