Hi,
Can someone help as to what's wrong with the following line of code:
signal delay_needed : std_logic_vector(31 downto 0):=
"0000000000000000000000000010100";
Full Code:
1
libraryIEEE;
2
useIEEE.STD_LOGIC_1164.ALL;
3
4
5
useieee.numeric_std.all;
6
useIEEE.std_logic_unsigned.all;
7
useIEEE.numeric_std.all;
8
useIEEE.std_logic_arith.all;
9
10
11
entitydelayis
12
port(clk:instd_logic;
13
--delay to be generated.
14
a:instd_logic_vector(31downto0);
15
--this is a pulse to notify that time interval equal to delay is over.
16
flag:outstd_logic
17
);
18
enddelay;
19
20
architectureBehavioralofdelayis
21
signalcount:integer:=0;
22
begin
23
process(clk)
24
begin
25
if(clk'eventandclk='1')then
26
count<=count+1;--increment counter.
27
endif;
28
--see whether counter value is reached,if yes set the flag.
This is for:
inst_delay : test port map(clk,delay_needed,flag);
But I cannot find any component named test. Should it be delay?
Additionaly the architecture header is not for instantiation, you must
declare the component there. Instantiation is done later in the
architectures body:
After fixing that you will get some errors further on you have to dig
out...
And then this here:
1
useieee.numeric_std.all;
2
useIEEE.std_logic_unsigned.all;
3
useIEEE.numeric_std.all;-- second time: much is more?
4
useIEEE.std_logic_arith.all;
Never ever use the numeric_std and the std_logic_unsigned together. You
may encounter some strange error messages due to double definitions of
data types.
All in all: VHDL is not a programming language. Instead it is a
description language. So you should have a picture of the hardware you
want to describe (at least in mind). As far as I see you are
programming. This is very obviuos here:
type initvec is array (0 to 1022) of integer;
That becomes a huge distributed RAM, eating up lots of FPGA ressources.
BTW: pleas use the [vhdl] tags around VHDL code.