找回密码
 注册
关于网站域名变更的通知
查看: 3870|回复: 1
打印 上一主题 下一主题

求救—谁能帮忙改一改

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
library ieee;
+ l# s8 ~( a4 y, e" w8 O2 s7 \/ Uuse ieee.std_logic_1164.all;5 r6 M" t. R- s0 [+ W, ?8 ?; m
use ieee.std_logic_arith.all;& s3 `* v' R% U6 e5 G! g, p* ]2 Y7 w0 V
use ieee.std_logic_unsigned.all;0 @6 T2 s6 U, F; d& Y
entity hour is- T2 y$ S3 ]0 r" O1 v
port(clk_h,clk_t,tp_h,res_h:in std_logic;
( M! \! _6 i" ?: @& a& H0 L8 z  hset:in std_logic;
1 }" f1 z# S& [6 A  sig_h:in std_logic_vector(2 downto 0);1 r( ~1 P7 ~7 E( {, }: G% R
  din_h1ut std_logic_vector(3 downto 0);
3 ^. H, E1 ~3 s0 S  din_h0ut std_logic_vector(3 downto 0);* b3 S2 A" D6 I! Y3 F$ }
  pmut std_logic;
9 b6 {6 w# q2 F. ?0 z4 v4 @% `  cp_h:out std_logic);
3 s, g) ^- B: |) e, X  4 h! \' X) x- b0 o# Z8 g/ d7 {
end hour;, f1 l; D  ~5 {& a5 f
architecture behav of hour is/ f* n; P3 Q! D1 N& Y/ Q
signal clk:std_logic;
4 g' T8 Q- P6 M$ Tbegin
) R9 b0 n  c# v* C/ @* [    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)
$ ?3 |- V% `; ^: D& k3 l     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);; i; E  U3 v8 Q
     variable co1:std_logic;
, ^6 K$ G( S6 h" d! h5 r9 t& p( s     variable co2: std_logic_vector(7 downto 0) ;% ]5 F* S! s& g; G& E& B! a! D
   begin 5 \- ^; [- k/ {( @) f& Q
    if sig_h="001"and tp_h='1' then clk<=clk_t;& V! r! z  D4 N% W& ~
   else clk<=clk_h;6 p% D3 _$ h1 {5 E- h% |
   end if;
/ Z* ?: B: q. i( V2 h1 }* D    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');$ ?" Z, S2 ]1 x- E% n
       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;; D- @0 e9 C; w1 r  g8 Y7 d1 p% B, X
      if cq1="1010" then cq2:=cq2+1;cq1:="0000";. Z& ^/ o! N" w+ M, p1 a
            end if;4 r" T6 k' L) G8 T% j3 v
            if  cq2="0010" and cq1="0100" then
* o( ~+ d+ H1 V" N  `9 C! Q; l    cq1:="0000";cq2:="0000";! O4 w( R. G  [6 |
    co1:='1';
  [% z  R! B5 G. E* w! }8 ]" h% |   else co1:='0';- Z" K/ Y$ F8 P+ `8 ?
      end if;. a/ F) e' N& V. n2 B, d. d
      if cq3="1010" then
) u1 j; m2 O1 l. [7 c      cq4:=cq4+1;/ D7 X* _" O+ L. T/ H% j. d5 Q
      cq3:="0000";0 X! b" Y$ D! e. B
    end if;
8 N( i* {- U' b; J0 v6 J8 A; u   if cq4="0001" and cq3="0010" then
2 [, w8 a' @% c+ Y         cq3:="0000";cq4:="0000";co2:=co2+1;$ {6 `0 m6 ?3 q, Z5 y0 p
      end if;) [, m  V; w$ l, Z
    end if;# r( J$ J& B  G0 Y+ ?( U
  if hset='1' then    4 {7 c# M: {& }% i9 p* s( I& h" G! {0 y
          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;/ b- G0 d1 y$ \$ A0 \
         else
9 m4 H& c8 h5 W. x5 c, c           if co2(0)='1' then 9 K8 S' t5 v; N6 V8 K4 A
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';+ b* h* h7 x8 K% c1 B- \& k" \
             end if;
1 A3 I$ B) F7 M' x8 Y$ g; y             pm<='1';
. H# E) {& h" ]- y            else pm<='0';
+ J8 R( e: P0 f" D- |            end if;  W6 N6 n+ ?! Z! o% P. @
            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';0 j  K' N6 T1 w+ @: W! E
              else cp_h<='0';8 j* l6 t4 A! x2 C6 w6 a- ]: S
             end if;
4 O: C- z. _) {$ m           din_h1<=cq4;din_h0<=cq3;  
" O  m' k$ z& I4 J5 T        end if;  --12/24转换% `1 N4 I: E8 d9 B$ A$ h
  
3 `$ [) {* s; I4 `) z) A     end process;3 T( q" U. r. l- ?4 [9 X2 e8 o
end behav;

该用户从未签到

2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:
& Q# x+ m$ k) NInfo: *******************************************************************0 }" g7 \7 I1 K2 a' m5 _
Info: Running Quartus II Analysis & Synthesis
' E7 a% T6 C& u' G: u! b2 \        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version
% a4 q  K7 T- z; G) l; T        Info: Processing started: Sat Oct 31 17:04:02 2009' e* d% v4 \1 w$ c) P
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour
" g, l/ ], e; F! k6 a* t. n) O6 K1 eInfo: Found 2 design units, including 1 entities, in source file hour.vhd- K9 E* p! D- N5 G% c7 f% m/ V
        Info: Found design unit 1: hour-behav
( o: ]2 m) {( ^: D. ~        Info: Found entity 1: hour$ p" i/ k3 s; x- u
Info: Elaborating entity "hour" for the top level hierarchy
# m$ E. s( f% EWarning (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& R) S4 m9 x- w* A+ l5 [0 Z
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
: V$ F) K  c$ _5 k: [6 OInfo (10041): Inferred latch for "pm" at hour.vhd(20)' ?6 z' w1 z! u% Y2 _5 Q
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
1 A* j) w' u  VError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[1]" because its behavior does not match any supported register model5 R9 q. n. r1 v  O4 _
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[2]" because its behavior does not match any supported register model8 u( b! N+ S/ ^
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' D! V6 g2 c% g7 }# E! L: c
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model
' i3 z, Q" p0 N8 Y2 n$ I$ @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( \* O/ l+ L2 }! ]2 w, J, N" Q. u
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! \5 ?8 a/ _3 ^3 `( V
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
) S- C$ m( c; A. mError: Can't elaborate top-level user hierarchy
+ h& O' Z! K' ?' X$ pError: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings% N) N8 o, m5 a" Q
        Error: Peak virtual memory: 184 megabytes
6 `3 y% ]' A- k0 [2 F; `  A5 ?1 T        Error: Processing ended: Sat Oct 31 17:04:04 2009# f* ~3 w  O) o3 D$ f" D3 z
        Error: Elapsed time: 00:00:02" S( _0 v$ f7 I( h) f! d6 L
        Error: Total CPU time (on all processors): 00:00:01
. H( l; v2 ^8 OError: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-7-19 23:51 , Processed in 0.125000 second(s), 25 queries , Gzip On.

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

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

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