找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

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

EDA365欢迎您!

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

x
library ieee;( ?+ c# A1 ?, o+ Z/ e1 Z$ y; C
use ieee.std_logic_1164.all;
, V# v' m4 ^! k8 O3 O% I8 C2 I3 |- m+ nuse ieee.std_logic_arith.all;
5 S& @3 x( L3 o  `use ieee.std_logic_unsigned.all;, y5 o  I: t5 \! z& a( M4 N& ^
entity hour is+ ?( W, t: R5 ~" Y' h
port(clk_h,clk_t,tp_h,res_h:in std_logic;+ E+ p3 U: {' G. W+ `
  hset:in std_logic;
! o& [% G6 B$ T( R* e  sig_h:in std_logic_vector(2 downto 0);9 U+ u' ~2 p4 f# H( E) l
  din_h1ut std_logic_vector(3 downto 0);- c3 k. L" z% q9 ]" w
  din_h0ut std_logic_vector(3 downto 0);
0 {% k( R; n: j& L  L  pmut std_logic;7 a0 v; L4 w' P1 u. Q: U! Y
  cp_h:out std_logic);/ v; T7 u) x% \( c6 l
  # `: j$ A. I# D6 |; k
end hour;
* g3 n% c" K0 K7 b( v8 varchitecture behav of hour is
# H1 j: h& D! [9 |1 r3 B4 ?1 ]signal clk:std_logic;$ H  w/ I4 R( Q' b' a7 W3 {
begin
3 O  s% b, ^" B. a/ N    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)4 I. D& T6 B1 V+ M- v2 I; ~4 u
     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);$ i6 ^! B: t  }2 V( @
     variable co1:std_logic;6 A# G7 q9 I+ D% e8 ]% V* P
     variable co2: std_logic_vector(7 downto 0) ;% }3 R: D5 J" H5 {5 V2 `$ w: q! U
   begin 1 u0 f2 R% Z$ G* `4 m
    if sig_h="001"and tp_h='1' then clk<=clk_t;
* i3 }& T* v* i6 ?   else clk<=clk_h;
; g7 B" ^3 p- o5 M# `   end if;
5 R2 Y/ m& s, p  t% x$ J) @    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');! m1 ~0 W* v: }, j+ g+ w
       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;$ e) |* N) B8 N: T9 W
      if cq1="1010" then cq2:=cq2+1;cq1:="0000";2 r6 j# D0 b$ k
            end if;
) h' \3 @. J& u& K            if  cq2="0010" and cq1="0100" then
, Y7 F$ F- b0 e3 j    cq1:="0000";cq2:="0000";; d: w+ {+ f2 i3 ^
    co1:='1';4 o# h" w# d  q$ H' o
   else co1:='0';% y1 x' S" i* k) q1 `7 c3 ~
      end if;
7 N# S+ N4 f4 `& j      if cq3="1010" then
! k+ h' ~1 B. {$ O% N" N0 Y4 X8 O/ A      cq4:=cq4+1;
  T. {% V6 a6 F  f      cq3:="0000";0 ~( M* s: n2 s+ F
    end if;
0 e4 l( ]; Q: a, O$ R0 t' j   if cq4="0001" and cq3="0010" then 2 U% A$ C6 u+ w) Z! X8 A
         cq3:="0000";cq4:="0000";co2:=co2+1;0 T# j, [# |5 t7 K
      end if;: Q! ^( r; a8 c! J, E4 v
    end if;
+ N$ y: k8 w. g0 z/ s3 m. V* A  if hset='1' then    . c, f9 J; P. Y7 {2 X1 v! h6 v
          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;2 S% x8 R( Q( {& v0 K2 Z7 Y
         else
% ?% B) {; o: f( R- P: V           if co2(0)='1' then 1 J, x$ p1 z/ P: _1 }8 g6 \
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';
. H7 ]; Z7 t7 y/ L+ d1 C% m& T             end if;- N9 |+ Y2 E' C, I/ j8 U6 V% R
             pm<='1';8 k9 ^3 E! ~- k- ^& v; {
            else pm<='0';
( O6 {1 \: k0 [' ^. l& \            end if;/ p+ Q4 o" ~; ?- ]# A: S( b; e' ^3 Z
            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';  Y% r" f: h7 T) G
              else cp_h<='0';
) w: e; v3 H5 M2 |/ O5 Z% S- z             end if;. }. G+ p  o& r& u5 L6 }/ w- b
           din_h1<=cq4;din_h0<=cq3;  
. r+ C/ e5 B, f, _! j% q' \* _        end if;  --12/24转换- g' ^2 f$ m+ S/ Z3 g" j3 o1 M' [
  
# w' I# ]+ b: j, i, y     end process;
3 q0 L9 o: F9 I, L+ M' mend behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:+ f. J4 L4 j3 a1 Y; Y$ u% v
Info: *******************************************************************& Y5 S0 A+ s/ S% [4 W
Info: Running Quartus II Analysis & Synthesis
+ O8 z" q/ o4 v# l% U/ ]! Q# ^        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version, p9 t1 k' u* i7 b6 t! F
        Info: Processing started: Sat Oct 31 17:04:02 20092 Q( a2 n% C+ x
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour% }9 D6 n  B) A! y
Info: Found 2 design units, including 1 entities, in source file hour.vhd
+ |% M9 U4 d0 a; Y8 @! L' w        Info: Found design unit 1: hour-behav
6 v+ L4 I, `2 X        Info: Found entity 1: hour1 f' U6 z7 U! ~; V6 l
Info: Elaborating entity "hour" for the top level hierarchy
9 k; ~8 o- |6 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 list
4 |: i# z9 j7 Y* fWarning (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 process7 d) ~) O% e$ [4 L) j
Info (10041): Inferred latch for "pm" at hour.vhd(20)
# I+ a* ?  A$ ~) \& G/ F$ nError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model7 V0 f% ?( x; t- s3 @$ a0 Q( W$ J
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[1]" because its behavior does not match any supported register model1 c4 q3 d1 f7 d4 }& `
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
- y6 t/ ^& p6 d+ JError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[3]" because its behavior does not match any supported register model
; Z& ]5 H+ _# d/ MError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model
# H  H0 F3 i" J8 K/ C* pError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[1]" because its behavior does not match any supported register model
0 L+ H' _7 e" F8 xError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[2]" because its behavior does not match any supported register model
$ o$ Y5 ?$ P* Q2 M; c( YError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[3]" because its behavior does not match any supported register model2 `. V( B5 s9 o( h
Error: Can't elaborate top-level user hierarchy
' y8 I* c) Q4 n0 `# m& nError: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings
7 e' H7 `" W% k1 M( e        Error: Peak virtual memory: 184 megabytes
5 }/ F7 o" A- N: X8 Y" b! u/ S        Error: Processing ended: Sat Oct 31 17:04:04 2009
& `4 K. z6 A' N/ \+ h0 v# @        Error: Elapsed time: 00:00:02$ |9 b/ ?8 f1 L3 o( y
        Error: Total CPU time (on all processors): 00:00:016 p8 O0 i( a% K0 o: N
Error: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-2-22 23:29 , Processed in 0.059709 second(s), 38 queries , Gzip On.

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

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

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