EDA365电子工程师网
标题:
请帮我看下下面的代码错在什么地方,谢谢!
[打印本页]
作者:
freeunix
时间:
2013-7-24 15:01
标题:
请帮我看下下面的代码错在什么地方,谢谢!
我最近在看中国电力出版社出版的FPGA嵌入式系统设计与开发指南这本书,下面的代码是本书的第第一章的第三段代码,我使用QII 11.0WEB版本无论如何无法正确编译,总是提示10559错误,请各位高手帮我看下问题所在,谢谢!
/ l- o U- Q$ d( [: ?* p+ X
7 E8 Q) X0 K& w/ j* [
* k2 k( Y3 C. N s) M& R: {4 y4 c
library ieee;
! E# L2 r+ {# x/ ^
use ieee.std_logic_1164.all;
& m& q' n+ Y3 { k0 h
use ieee.std_logic_unsigned.all;
' T1 u& S. P7 l$ L# d5 f! C9 y
entity counter8bit is
8 W- p+ Y( r! @
port(int ,reset,enable: in std_logic;count_out: out std_logic_vector(7 to 0));
( c6 _8 d0 x- p6 Y1 `4 d, ~
end counter8bit;
, ]0 f0 d% a' L8 p& W& |5 m! E
architecture counter of counter8bit is
& I3 u( _3 e: ]6 e; u2 N4 U) S
signal count_in: std_logic_vector( 0 to 7);
( S1 S& S0 w: h1 P- G ^5 A
begin
, y5 H. {4 B; r6 r( {% Y
process(input,reset)
0 T3 r8 p, Q! ?9 C% ]5 `+ h
begin
1 b V; H/ N/ Z6 h' V+ I* J6 S% C
wait until rising_edge(input);
0 i. J. d/ |3 t. ?0 B
if reset='1' then
2 v5 Z+ m) a5 t, s
count_in<=(others =>'0');
$ J& W( |- W, ]5 I) v9 t. d
elsif enable= '1' then
4 j5 a4 ^ b* e6 Y( M+ z' z
if (count_in="11111110") then
$ q: H0 L) r9 ^
count_in<="00000000";
7 O. r2 M& o$ }& y( d0 b
else
6 x% p* v6 ^' Y/ Q- o* s
count_in<=count_in+1;
5 t8 V0 `7 \) Q/ p
end if;
+ I; }7 Q) N5 q# w& @! B% L$ i) f
end if;
" ?3 Y4 M( S% I. f; D: Q
end process;
1 A) J+ [1 i3 ~6 g
end counter;
- \' b) B: f1 R3 _& n& s$ q
$ H8 X. y& s& l- U
/ z1 u( ]* L. o: q0 _7 h
) O- T: z8 g" V8 L6 @! m X
lInfo: *******************************************************************
6 T, k J) e/ {4 G5 X1 X0 r
Info: Running Quartus II Create Symbol File
# w. X$ O* {# b$ E
Info: Version 11.0 Build 157 04/27/2011 SJ Web Edition
; z( i% K" q3 G: D0 {- z0 e/ y
Info: Processing started: Wed Jul 24 14:43:41 2013
% ~6 Y3 X) O* K7 n2 c {
Info: Version 11.0 Build 157 04/27/2011 SJ Web Edition
+ i' w$ K# h7 `' m. T$ ^) V
Info: Processing started: Wed Jul 24 14:43:41 2013
$ K0 X" B$ y, |0 L, E7 Q2 e4 f6 K
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off penlvji -c penlvji --generate_
l: T; L. o, j
Error (10482): VHDL error at counter8bit.vhd(12): object "input" is used but not declared
, X( ~( }9 A% o8 e; s
Error (10559): VHDL Subprogram Call error at counter8bit.vhd(12): actual for formal parameter "s" must be a "signal"
7 m* p6 Y4 d; w6 l$ I$ l% G, z; H$ [* N
Error (10482): VHDL error at counter8bit.vhd(10): object "input" is used but not declared
1 f" F8 N8 q, R( P5 x
Error: Quartus II Create Symbol File was unsuccessful. 3 errors, 0 warnings
! _- R. t$ ^5 [- D/ N u
作者:
gusumurong
时间:
2013-7-24 15:12
这个错误信息给的还不够明显?
作者:
freeunix
时间:
2013-7-24 16:56
但是我看了line12,没找到错误啊
q& P7 S, D9 s8 ~" M" t) E
作者:
gusumurong
时间:
2013-7-24 17:08
你的输入接口只有int ,reset,enable。"input"信号在哪里呢?
作者:
zgq800712
时间:
2013-7-25 22:50
object "input" is used but not declared
( i; R" r; A, K C! e
你先把这句话翻译了再说。
欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/)
Powered by Discuz! X3.2