Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - VHDL Compilation error. Please help

 
Thread Tools Search this Thread
Old 02-20-2004, 03:42 PM   #1
Default VHDL Compilation error. Please help


Hello,
I'm quite new to VHDL. I need to write VHDL code for a vending machine
as part of my assignment.

I get the following errors.
# Error: ELBWRITE_0028: vendingMachine.vhd : (199, 0):
Signal "Number_Of_Cans" has two sources, but is not
resolved signal (at line 199: Number_Of_Cans & at line
46: Number_Of_Cans).
# Error: ELBWRITE_0028: vendingMachine.vhd : (200, 0):
Signal "Next_State" has two sources, but is not
resolved signal (at line 200: Next_State & at line 58:
Next_State).
# Error: ELBWRITE_0028: vendingMachine.vhd : (241, 0):
Signal "Number_Of_Bottles" has two sources, but is not
resolved signal (at line 241: Number_Of_Bottles & at
line 45: Number_Of_Bottles).

Can someone please throw some light on these errors & any other
comments on the following code is greatly appreciated.

-------------------------------------------------------
-------------------------------------------------------

Library IEEE;
use IEEE.std_logic_1164.all;

------------------------------
-- Entity Definition
------------------------------

entity CokeMachine is
Port ( CLK : In std_logic ;
Reset_N : In std_logic ;
Money_In : In std_logic_vector ( 0 to 1 ) ;
CBR_Buttons : In std_logic_vector ( 0 to 1 ) ;

Bottle_Out : Out std_logic ;
Can_Out : Out std_logic ;
Refund_10p : Out std_logic ;
Refund_20p : Out std_logic ;
Refund_50p : Out std_logic ;
Refund_All : Out std_logic ;
No_Cans_Left : Out std_logic ;
No_Bottles_Left : Out std_logic ;
Need_More_Money : Out std_logic );
end CokeMachine ;

architecture RTL of CokeMachine is
type State_Type is ( Start, State_10p, State_20p,
State_30p, State_40p, State_50p,
State_60p, State_70p );

signal Current_State : State_Type ;
signal Next_State : State_Type ;

signal Number_Of_Bottles, Number_Of_Cans : integer := 0 ;

begin

State_Clock : process( Reset_N, CLK, Next_State )
begin
if rising_edge( CLK ) then
if Reset_N = '1' then
Current_State <= Start;
Number_Of_Bottles <= 10;
Number_Of_Cans <= 10;
else
Current_State <= Next_State ;
end if;
end if;
end process State_Clock;

Next_State_Control : process( Money_In, Current_State )
begin
case Current_State is
when Start =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_10p ;
elsif Money_In = "10" then
Next_State <= State_20p ;
elsif Money_In = "11" then
Next_State <= State_50p ;
end if ;
when State_10p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_20p ;
elsif Money_In = "10" then
Next_State <= State_30p ;
elsif Money_In = "11" then
Next_State <= State_60p ;
end if ;
when State_20p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_30p ;
elsif Money_In = "10" then
Next_State <= State_40p ;
elsif Money_In = "11" then
Next_State <= State_70p ;
end if ;
when State_30p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_40p ;
elsif Money_In = "10" then
Next_State <= State_50p ;
elsif Money_In = "11" then
Next_State <= Current_State ;
Refund_50p <= '1' ;
end if ;
when State_40p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_50p ;
elsif Money_In = "10" then
Next_State <= State_70p ;
elsif Money_In = "11" then
Next_State <= Current_State ;
Refund_50p <= '1' ;
end if ;
when State_50p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_60p ;
elsif Money_In = "10" then
Next_State <= State_70p ;
elsif Money_In = "11" then
Next_State <= Current_State ;
Refund_50p <= '1' ;
end if ;
when State_60p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= State_70p ;
elsif Money_In = "10" then
Next_State <= Current_State ;
Refund_20p <= '1' ;
elsif Money_In = "11" then
Next_State <= Current_State ;
Refund_50p <= '1' ;
end if ;
when State_70p =>
if Money_In = "00" then
Next_State <= Current_State ;
elsif Money_In = "01" then
Next_State <= Current_State ;
Refund_10p <= '1' ;
elsif Money_In = "10" then
Next_State <= Current_State ;
Refund_20p <= '1' ;
elsif Money_In = "11" then
Next_State <= Current_State ;
Refund_50p <= '1' ;
end if ;
end case ;
end process ;

Output_Control : process( CBR_Buttons, Current_State )
begin
if CBR_Buttons = "01" and Number_of_Cans = 0 then
No_Cans_Left <= '1' ;
elsif CBR_Buttons = "10" and Number_Of_Bottles = 0 then
No_Bottles_Left <= '1' ;
else
case Current_State is
when Start =>
if CBR_Buttons = "00" and CBR_Buttons = "11" then
-- do nothing ???
elsif CBR_Buttons = "01" or CBR_Buttons = "10"
then
Need_More_Money <= '1' ;
end if;
when State_10p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" or CBR_Buttons = "10"
then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_10p <= '1' ;
end if;
when State_20p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" or CBR_Buttons = "10"
then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
when State_30p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" or CBR_Buttons = "10"
then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
when State_40p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" or CBR_Buttons = "10"
then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
when State_50p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" then
if Number_Of_Cans > 0 then
Can_Out <= '1' ;
Number_Of_Cans <= Number_Of_Cans - 1 ;
Next_State <= Start ;
else
No_Cans_Left <= '1' ;
end if;
elsif CBR_Buttons = "10" then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
when State_60p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" then
if Number_Of_Cans > 0 then
Can_Out <= '1' ;
Refund_10p <= '1' ;
Number_Of_Cans <= Number_Of_Cans - 1 ;
Next_State <= Start ;
else
No_Cans_Left <= '1' ;
end if;
elsif CBR_Buttons = "10" then
Need_More_Money <= '1' ;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
when State_70p =>
if CBR_Buttons = "00" then
-- do nothing ???
elsif CBR_Buttons = "01" then
if Number_Of_Cans > 0 then
Can_Out <= '1' ;
Refund_20p <= '1' ;
Number_Of_Cans <= Number_Of_Cans - 1 ;
Next_State <= Start ;
else
No_Cans_Left <= '1' ;
end if;
elsif CBR_Buttons = "10" then
if Number_Of_Bottles > 0 then
Bottle_Out <= '1' ;
Number_Of_Bottles <= Number_Of_Bottles - 1
;
Next_State <= Start ;
else
No_Bottles_Left <= '1' ;
end if;
elsif CBR_Buttons = "11" then
Refund_All <= '1' ;
end if;
end case ;
end if ;
end process ;
end RTL ;


raju
  Reply With Quote
Old 02-20-2004, 04:04 PM   #2
Scott Thibault
 
Posts: n/a
Default Re: VHDL Compilation error. Please help
You cannot schedule values to a signal (i.e. Number_Of_Cans) in more than
one process. You need to put all the logic involved in determining the
value of Number_Of_Cans in a single process.

Forget about resolved signals. Those are for busses and that is not what
you need here.

--Scott Thibault
Green Mountain Computing Systems, Inc.
http://www.gmvhdl.com


"raju" <> wrote in message
news: om...
> Hello,
> I'm quite new to VHDL. I need to write VHDL code for a vending machine
> as part of my assignment.
>
> I get the following errors.
> # Error: ELBWRITE_0028: vendingMachine.vhd : (199, 0):
> Signal "Number_Of_Cans" has two sources, but is not
> resolved signal (at line 199: Number_Of_Cans & at line
> 46: Number_Of_Cans).
> # Error: ELBWRITE_0028: vendingMachine.vhd : (200, 0):
> Signal "Next_State" has two sources, but is not
> resolved signal (at line 200: Next_State & at line 58:
> Next_State).
> # Error: ELBWRITE_0028: vendingMachine.vhd : (241, 0):
> Signal "Number_Of_Bottles" has two sources, but is not
> resolved signal (at line 241: Number_Of_Bottles & at
> line 45: Number_Of_Bottles).
>
> Can someone please throw some light on these errors & any other
> comments on the following code is greatly appreciated.
>
> -------------------------------------------------------
> -------------------------------------------------------
>
> Library IEEE;
> use IEEE.std_logic_1164.all;
>
> ------------------------------
> -- Entity Definition
> ------------------------------
>
> entity CokeMachine is
> Port ( CLK : In std_logic ;
> Reset_N : In std_logic ;
> Money_In : In std_logic_vector ( 0 to 1 ) ;
> CBR_Buttons : In std_logic_vector ( 0 to 1 ) ;
>
> Bottle_Out : Out std_logic ;
> Can_Out : Out std_logic ;
> Refund_10p : Out std_logic ;
> Refund_20p : Out std_logic ;
> Refund_50p : Out std_logic ;
> Refund_All : Out std_logic ;
> No_Cans_Left : Out std_logic ;
> No_Bottles_Left : Out std_logic ;
> Need_More_Money : Out std_logic );
> end CokeMachine ;
>
> architecture RTL of CokeMachine is
> type State_Type is ( Start, State_10p, State_20p,
> State_30p, State_40p, State_50p,
> State_60p, State_70p );
>
> signal Current_State : State_Type ;
> signal Next_State : State_Type ;
>
> signal Number_Of_Bottles, Number_Of_Cans : integer := 0 ;
>
> begin
>
> State_Clock : process( Reset_N, CLK, Next_State )
> begin
> if rising_edge( CLK ) then
> if Reset_N = '1' then
> Current_State <= Start;
> Number_Of_Bottles <= 10;
> Number_Of_Cans <= 10;
> else
> Current_State <= Next_State ;
> end if;
> end if;
> end process State_Clock;
>
> Next_State_Control : process( Money_In, Current_State )
> begin
> case Current_State is
> when Start =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_10p ;
> elsif Money_In = "10" then
> Next_State <= State_20p ;
> elsif Money_In = "11" then
> Next_State <= State_50p ;
> end if ;
> when State_10p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_20p ;
> elsif Money_In = "10" then
> Next_State <= State_30p ;
> elsif Money_In = "11" then
> Next_State <= State_60p ;
> end if ;
> when State_20p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_30p ;
> elsif Money_In = "10" then
> Next_State <= State_40p ;
> elsif Money_In = "11" then
> Next_State <= State_70p ;
> end if ;
> when State_30p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_40p ;
> elsif Money_In = "10" then
> Next_State <= State_50p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_40p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_50p ;
> elsif Money_In = "10" then
> Next_State <= State_70p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_50p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_60p ;
> elsif Money_In = "10" then
> Next_State <= State_70p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_60p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_70p ;
> elsif Money_In = "10" then
> Next_State <= Current_State ;
> Refund_20p <= '1' ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_70p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= Current_State ;
> Refund_10p <= '1' ;
> elsif Money_In = "10" then
> Next_State <= Current_State ;
> Refund_20p <= '1' ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> end case ;
> end process ;
>
> Output_Control : process( CBR_Buttons, Current_State )
> begin
> if CBR_Buttons = "01" and Number_of_Cans = 0 then
> No_Cans_Left <= '1' ;
> elsif CBR_Buttons = "10" and Number_Of_Bottles = 0 then
> No_Bottles_Left <= '1' ;
> else
> case Current_State is
> when Start =>
> if CBR_Buttons = "00" and CBR_Buttons = "11" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
> then
> Need_More_Money <= '1' ;
> end if;
> when State_10p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
> then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_10p <= '1' ;
> end if;
> when State_20p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
> then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_30p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
> then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_40p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
> then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_50p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_60p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Refund_10p <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_70p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Refund_20p <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> if Number_Of_Bottles > 0 then
> Bottle_Out <= '1' ;
> Number_Of_Bottles <= Number_Of_Bottles - 1
> ;
> Next_State <= Start ;
> else
> No_Bottles_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> end case ;
> end if ;
> end process ;
> end RTL ;





Scott Thibault
  Reply With Quote
Old 02-20-2004, 04:05 PM   #3
Cameron, Charles B.
 
Posts: n/a
Default Re: VHDL Compilation error. Please help
raju wrote:

>Hello,
>I'm quite new to VHDL. I need to write VHDL code for a vending machine
>as part of my assignment.
>
>I get the following errors.
># Error: ELBWRITE_0028: vendingMachine.vhd : (199, 0):
>Signal "Number_Of_Cans" has two sources, but is not
>resolved signal (at line 199: Number_Of_Cans & at line
>46: Number_Of_Cans).
># Error: ELBWRITE_0028: vendingMachine.vhd : (200, 0):
>Signal "Next_State" has two sources, but is not
>resolved signal (at line 200: Next_State & at line 58:
>Next_State).
># Error: ELBWRITE_0028: vendingMachine.vhd : (241, 0):
>Signal "Number_Of_Bottles" has two sources, but is not
>resolved signal (at line 241: Number_Of_Bottles & at
>line 45: Number_Of_Bottles).
>
>Can someone please throw some light on these errors & any other
>comments on the following code is greatly appreciated.
>
>-------------------------------------------------------
>-------------------------------------------------------
>
>Library IEEE;
>use IEEE.std_logic_1164.all;
>
>------------------------------
>-- Entity Definition
>------------------------------
>
>entity CokeMachine is
> Port ( CLK : In std_logic ;
> Reset_N : In std_logic ;
> Money_In : In std_logic_vector ( 0 to 1 ) ;
> CBR_Buttons : In std_logic_vector ( 0 to 1 ) ;
>
> Bottle_Out : Out std_logic ;
> Can_Out : Out std_logic ;
> Refund_10p : Out std_logic ;
> Refund_20p : Out std_logic ;
> Refund_50p : Out std_logic ;
> Refund_All : Out std_logic ;
> No_Cans_Left : Out std_logic ;
> No_Bottles_Left : Out std_logic ;
> Need_More_Money : Out std_logic );
>end CokeMachine ;
>
>architecture RTL of CokeMachine is
>type State_Type is ( Start, State_10p, State_20p,
> State_30p, State_40p, State_50p,
> State_60p, State_70p );
>
>signal Current_State : State_Type ;
>signal Next_State : State_Type ;
>
>signal Number_Of_Bottles, Number_Of_Cans : integer := 0 ;
>
>begin
>
> State_Clock : process( Reset_N, CLK, Next_State )
> begin
> if rising_edge( CLK ) then
> if Reset_N = '1' then
> Current_State <= Start;
> Number_Of_Bottles <= 10;
> Number_Of_Cans <= 10;
> else
> Current_State <= Next_State ;
> end if;
> end if;
> end process State_Clock;
>
> Next_State_Control : process( Money_In, Current_State )
> begin
> case Current_State is
> when Start =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_10p ;
> elsif Money_In = "10" then
> Next_State <= State_20p ;
> elsif Money_In = "11" then
> Next_State <= State_50p ;
> end if ;
> when State_10p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_20p ;
> elsif Money_In = "10" then
> Next_State <= State_30p ;
> elsif Money_In = "11" then
> Next_State <= State_60p ;
> end if ;
> when State_20p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_30p ;
> elsif Money_In = "10" then
> Next_State <= State_40p ;
> elsif Money_In = "11" then
> Next_State <= State_70p ;
> end if ;
> when State_30p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_40p ;
> elsif Money_In = "10" then
> Next_State <= State_50p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_40p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_50p ;
> elsif Money_In = "10" then
> Next_State <= State_70p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_50p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_60p ;
> elsif Money_In = "10" then
> Next_State <= State_70p ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_60p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= State_70p ;
> elsif Money_In = "10" then
> Next_State <= Current_State ;
> Refund_20p <= '1' ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> when State_70p =>
> if Money_In = "00" then
> Next_State <= Current_State ;
> elsif Money_In = "01" then
> Next_State <= Current_State ;
> Refund_10p <= '1' ;
> elsif Money_In = "10" then
> Next_State <= Current_State ;
> Refund_20p <= '1' ;
> elsif Money_In = "11" then
> Next_State <= Current_State ;
> Refund_50p <= '1' ;
> end if ;
> end case ;
> end process ;
>
> Output_Control : process( CBR_Buttons, Current_State )
> begin
> if CBR_Buttons = "01" and Number_of_Cans = 0 then
> No_Cans_Left <= '1' ;
> elsif CBR_Buttons = "10" and Number_Of_Bottles = 0 then
> No_Bottles_Left <= '1' ;
> else
> case Current_State is
> when Start =>
> if CBR_Buttons = "00" and CBR_Buttons = "11" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
>then
> Need_More_Money <= '1' ;
> end if;
> when State_10p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
>then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_10p <= '1' ;
> end if;
> when State_20p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
>then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_30p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
>then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_40p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" or CBR_Buttons = "10"
>then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_50p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_60p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Refund_10p <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> Need_More_Money <= '1' ;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> when State_70p =>
> if CBR_Buttons = "00" then
> -- do nothing ???
> elsif CBR_Buttons = "01" then
> if Number_Of_Cans > 0 then
> Can_Out <= '1' ;
> Refund_20p <= '1' ;
> Number_Of_Cans <= Number_Of_Cans - 1 ;
> Next_State <= Start ;
> else
> No_Cans_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "10" then
> if Number_Of_Bottles > 0 then
> Bottle_Out <= '1' ;
> Number_Of_Bottles <= Number_Of_Bottles - 1
>;
> Next_State <= Start ;
> else
> No_Bottles_Left <= '1' ;
> end if;
> elsif CBR_Buttons = "11" then
> Refund_All <= '1' ;
> end if;
> end case ;
> end if ;
> end process ;
>end RTL ;
>


You have two processes, Next_State_Control and Output_Control, both of
which modify, for example, Number_Of_Cans. The compiler can't tell
which signal source you really mean to use. I think you would do well
to let Output_Control be in charge of modifying Number_Of_Cans and that
will eliminate the conflict. Likewise for the other signals with
multiple sources. I haven't checked carefully, but for all I know there
may be other sources for these signals, too, aside from the two I
spotted quite readily.

Charles B. Cameron



Cameron, Charles B.
  Reply With Quote
Old 02-20-2004, 07:50 PM   #4
Ralf Hildebrandt
 
Posts: n/a
Default Re: VHDL Compilation error. Please help
raju wrote:


> I get the following errors.
> # Error: ELBWRITE_0028: vendingMachine.vhd : (199, 0):
> Signal "Number_Of_Cans" has two sources, but is not
> resolved signal (at line 199: Number_Of_Cans & at line
> 46: Number_Of_Cans).


You write to the signal "Number_Of_Cans" from more than one process.
Normally this should be avoided.

An exception are tri-state busses, but as you said you are a newbie:
forget this for a while.


Ralf



Ralf Hildebrandt
  Reply With Quote
Old 02-23-2004, 10:22 AM   #5
raju
 
Posts: n/a
Default Re: VHDL Compilation error. Please help
Thanks Folks,
I merged the two processes. It compiles fine now.

Thanks
Raju

Ralf Hildebrandt <Ralf-> wrote in message news:<c17gbh$1f9om7$>...
> raju wrote:
>
>
> > I get the following errors.
> > # Error: ELBWRITE_0028: vendingMachine.vhd : (199, 0):
> > Signal "Number_Of_Cans" has two sources, but is not
> > resolved signal (at line 199: Number_Of_Cans & at line
> > 46: Number_Of_Cans).

>
> You write to the signal "Number_Of_Cans" from more than one process.
> Normally this should be avoided.
>
> An exception are tri-state busses, but as you said you are a newbie:
> forget this for a while.
>
>
> Ralf



raju
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an external software from VHDL? And how to interface VHDL with JAVA? becool_nikks Software 0 03-06-2009 07:08 PM
Vending machine using VHDL arie General Help Related Topics 0 03-05-2009 05:45 AM
Help on auto conversion from Matlab to vhdl on filter design hardheart Hardware 0 12-07-2007 09:19 AM
ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL freitass Hardware 0 11-01-2007 03:44 PM
vhdl code amirster Hardware 0 05-10-2007 07:28 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46