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

求救—谁能帮忙改一改

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
library ieee;
: W3 x( h& J* \. {+ H0 `* [use ieee.std_logic_1164.all;
7 E& U3 q$ Z& k3 Puse ieee.std_logic_arith.all;
0 h! w2 G' N! z; I) h  iuse ieee.std_logic_unsigned.all;
( L, ~9 y( r* ?+ r' Yentity hour is
  r$ p. g' g- J1 ^ port(clk_h,clk_t,tp_h,res_h:in std_logic;
& ^0 K. g4 O. s/ P9 F; x  }  hset:in std_logic;; D  ]3 c/ r/ @  g$ P# M
  sig_h:in std_logic_vector(2 downto 0);
: I$ ^/ K. ?$ R. `; X  din_h1ut std_logic_vector(3 downto 0);
3 I  Z8 t0 f+ p$ G& [$ B' K" I4 p! ^  din_h0ut std_logic_vector(3 downto 0);) d; H# Z% ^4 b5 ^* c9 [' r
  pmut std_logic;6 }8 M% [/ p$ s  {1 c( i
  cp_h:out std_logic);
5 E  T0 n9 L2 }. V) y  2 B: ^9 z' `& F7 f6 R  Y7 \
end hour;- l- E! R% c- o5 w/ ~; m5 y
architecture behav of hour is9 s% [( ^. m, B" B1 \; l
signal clk:std_logic;
$ W/ Q. a3 Z  C- |6 s& C' z3 Obegin' f, |4 G( ]& \" n
    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)
- H5 \7 F! {' B# ?9 e9 m     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);, V# ?8 M5 f4 k" P% c1 c
     variable co1:std_logic;
3 ]  S2 g! ?! E     variable co2: std_logic_vector(7 downto 0) ;7 x$ L: E7 |% ?5 x; D$ r0 z
   begin 7 W: V) V+ ]3 r6 H1 g
    if sig_h="001"and tp_h='1' then clk<=clk_t;
! a. S1 g, z  L! v   else clk<=clk_h;
/ o% M- D; }6 Y- a   end if;# I' t1 w) e% ?# t* S. T
    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');
# |; x8 Z2 h5 t+ J0 n7 g       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;
) T0 Y5 y# Q1 C7 _& y: i1 @5 O      if cq1="1010" then cq2:=cq2+1;cq1:="0000";
# F$ {( K- F" y+ i            end if;
- _) J& {$ W, i            if  cq2="0010" and cq1="0100" then6 x9 S: f6 k) p3 w, I$ c4 D1 E9 ^
    cq1:="0000";cq2:="0000";* h. v8 m; ~+ h5 \. V) Z0 _9 B
    co1:='1';! U7 W. f+ ~. c0 D
   else co1:='0';
! G% N6 b8 S3 b' r      end if;
; w9 l! @; w: w1 {+ E3 N      if cq3="1010" then
; S$ c& ^4 N: Q3 e7 H      cq4:=cq4+1;
- A# Z0 v( ^: `, @2 Z7 b      cq3:="0000";# \9 e! j2 C  A4 ]3 h' U
    end if;& w7 _8 p: T4 a$ E
   if cq4="0001" and cq3="0010" then 6 I% E" `' d; R2 V4 t
         cq3:="0000";cq4:="0000";co2:=co2+1;
- f) l( j/ A  f9 k, z      end if;
. d9 p( {) P0 t1 H/ S    end if;( @- Q) @0 v- O0 }: W: y" q7 O
  if hset='1' then   
5 Y9 g: O- ?, L          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;0 A0 L& `7 q+ q; H
         else1 P4 U6 W8 R& A  @) F
           if co2(0)='1' then : ~1 H2 L, S* c) t2 J$ b
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';7 M; ]9 X: y3 ?5 u
             end if;
0 p. x% K- D: w: K             pm<='1';
) I0 C' g& y1 T            else pm<='0';
+ z  k( X# S8 d( E7 b1 Y. ^7 t  t            end if;
- p4 N  a: y2 S& c            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';5 p; r9 s+ R$ f7 |  z# c5 K
              else cp_h<='0';5 Y; I5 a/ r) F
             end if;0 k9 Y6 x. [& ^; C
           din_h1<=cq4;din_h0<=cq3;  
& }( }: f0 y7 J5 A( |' I        end if;  --12/24转换
7 d5 C" P; H" I6 p; a  
" J& |- Z$ k! Q  B0 K; i; K     end process;
( |6 d  g* B- H+ i3 @end behav;

该用户从未签到

2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:, f" X9 C4 Q7 l% F) |
Info: *******************************************************************; B: w) q5 Q/ @/ b: r/ ]0 e
Info: Running Quartus II Analysis & Synthesis
) m/ I) m3 D2 I        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version
- Y& Y, V# z0 ]6 l6 B        Info: Processing started: Sat Oct 31 17:04:02 2009! t1 J. M; B7 Z' t" ~
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour
; }9 s# m" A5 x8 K( \$ VInfo: Found 2 design units, including 1 entities, in source file hour.vhd7 C4 m, `8 v  D2 \
        Info: Found design unit 1: hour-behav
& {2 W$ v" `% l3 o: N8 }# X        Info: Found entity 1: hour  T4 Z8 O+ P; G' ^7 c, g4 J4 `
Info: Elaborating entity "hour" for the top level hierarchy: T- O0 k, j9 x! P$ }7 n9 M
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
0 C" H% z+ V/ A2 d) BWarning (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
9 ^/ f5 t! M- a0 h# C3 j, P; BInfo (10041): Inferred latch for "pm" at hour.vhd(20)
1 s+ J7 Z. o' w3 S# K" E8 E$ ?Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model7 Y4 ~/ I* w0 i) A0 E7 O
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# n& }" |: D9 X2 G  i
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" X  v, v3 [- p/ m$ y. \" R5 F7 W7 I
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[3]" because its behavior does not match any supported register model6 I0 ?; ]' H; t1 @: G8 R+ y3 Q: z
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$ F8 F, O2 i1 V
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: ~' H/ x: w) G
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
, C' w  j( r8 [* `0 @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: A- X. P2 D, l8 t$ ^4 o0 o8 `
Error: Can't elaborate top-level user hierarchy9 D" f8 u: r, \0 k) y. Q
Error: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings
: i" F3 H0 O& b; H7 \# S        Error: Peak virtual memory: 184 megabytes
" ^3 k+ f7 h! n, d, T! q( z        Error: Processing ended: Sat Oct 31 17:04:04 20094 d. O: W+ k3 l1 D
        Error: Elapsed time: 00:00:02
% F( M( }2 Y4 W6 P1 C" }! H# K: N        Error: Total CPU time (on all processors): 00:00:01
3 l# t- D# {/ MError: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

EDA365公众号

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

GMT+8, 2025-7-19 22:11 , Processed in 0.109375 second(s), 24 queries , Gzip On.

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

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

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