VHDL Compilation error. Please help

Discussion in 'VHDL' started by raju, Feb 20, 2004.

  1. raju

    raju Guest

    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, Feb 20, 2004
    #1
    1. Advertising

  2. 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:...
    > 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, Feb 20, 2004
    #2
    1. Advertising

  3. 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., Feb 20, 2004
    #3
  4. 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, Feb 20, 2004
    #4
  5. raju

    raju Guest

    Thanks Folks,
    I merged the two processes. It compiles fine now.

    Thanks
    Raju

    Ralf Hildebrandt <> wrote in message news:<c17gbh$1f9om7$-berlin.de>...
    > 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, Feb 23, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Zhuo

    Compilation Error - Please Help

    James Zhuo, Aug 25, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,330
    James Zhuo
    Aug 25, 2003
  2. KK
    Replies:
    2
    Views:
    550
    Big Brian
    Oct 14, 2003
  3. Replies:
    4
    Views:
    322
  4. afd
    Replies:
    1
    Views:
    8,319
    Colin Paul Gloster
    Mar 23, 2007
  5. C__chp
    Replies:
    4
    Views:
    501
    Puppet_Sock
    Feb 15, 2008
Loading...

Share This Page