Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

error in elevator code (vhdl)

Status
Not open for further replies.

jordi

Newbie level 3
Newbie level 3
Joined
May 31, 2007
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,313
no feasible entries for infix operator +.

hi,
i have some problems with my vhdl program i have to make for school..
there are some errors that i can't get rit of..
mayby someone here kan help me with this..

most text is in dutch.. but i'll hope you understand..
if not ask :)
these are the errors i get.. i marked the error lines..

Code:
# ** Error: /project/elevator.vhdl(18): near ")": expecting: IDENTIFIER
# ** Error: /project/elevator.vhdl(118): near "(": expecting: IDENTIFIER
# ** Error: /project/elevator.vhdl(118): near "'": syntax error
# ** Error: /project/elevator.vhdl(122): near ";": expecting: GENERATE THEN
# ** Error: /project/elevator.vhdl(125): near "(": expecting: IDENTIFIER
# ** Error: /project/elevator.vhdl(125): near "'": syntax error

Code:
library IEEE;
    use IEEE.std_logic_1164.all;
    use ieee.std_logic_unsigned.all;

entity elevator_car is 
 PORT(      		   
    reset             : in std_logic;                     --voor het initaliseren van de schakeling (niveau van de liftkooi=0)
    stop              : in std_logic;                     --de noodstop in de liftkooi
	 niveau_aanvraag   : in std_logic_vector(2 downto 0);  --niveau van de nieuwe passagier
	 niveau_bestemming : in std_logic_vector(2 downto 0);  --requested floor from passenger inside elevator
	 --beweging_lift     : out std_logic_vector(2 downto 0); --geeft weer of lift naar boven, onder of stillstaat 
	 move_up           : out std_logic;
	 move_down         : out std_logic;
	 sensor_deur       : in std_logic_vector(2 downto 0);  --sensor die weergeeft of de lift open of toe is
	 beweging_deur     : out std_logic_vector(2 downto 0); --geeft weer of de deuren open of toe gaan.
	 locatie_lift      : in std_logic_vector(2 downto 0);  --weergave van de locatie  
	 clk               : in std_logic_vector(2 downto 0);                    --lift clock signaal
[color=red]);[/color]
end elevator_car;

architecture behav of elevator_car is
   signal A : std_logic;
   signal registerinfo : std_logic_vector(2 downto 0);
   signal B : integer range 0 to 1;  
   signal niveau_aanvraag2 : std_logic_vector(2 downto 0);
   signal i : integer range 0 to 200; 
   signal niveaubestemming : std_logic_vector(2 downto 0);
   
begin	
process(clk, locatie_lift, niveau_aanvraag, niveau_bestemming)--stijgen
   begin 
      niveaubestemming <= niveau_bestemming;   
      if rising_edge(clk) then
         
            if (niveau_aanvraag > locatie_lift) then
                  move_up <= '1';
                  move_down <= '0';
                  if (niveau_aanvraag2 /= niveaubestemming) then
                     registerinfo <= niveaubestemming;  --maak register (3downto0)
                     niveaubestemming <= niveau_aanvraag2;
                  elsif (niveau_aanvraag2 = niveaubestemming) then --tussen oproepen
                     move_up <= '1';
                     move_down <= '0';
                  end if;
                  if (locatie_lift /= registerinfo) then
                     move_up <= '1';
                     move_down <= '0';
                  elsif (locatie_lift = registerinfo) then
                     move_up <= '0';
                     move_down <= '0';
                  end if;
                      
            elsif (niveau_aanvraag < locatie_lift) then
                  move_down <= '1';
                  move_up <= '0'; 
                  if (niveau_aanvraag2 /= niveaubestemming) then
                     registerinfo <= niveaubestemming;--maak register (3downto0)
                     niveaubestemming <= niveau_aanvraag2;
                  elsif (niveau_aanvraag2 = niveaubestemming) then --tussen oproepen
                        move_up <= '0';
                        move_down <= '1';
                  end if;
                  if (locatie_lift /= registerinfo) then
                     move_up <= '0';
                     move_down <= '1';
                  elsif (locatie_lift = registerinfo) then
                     move_up <= '0';
                     move_down <= '0';
                  end if;
                  
            elsif (niveau_aanvraag = locatie_lift) then
               move_up <= '0';
               move_down <= '0';
            end if;
      end if;
end process;

process(clk, reset)
	begin
	    if rising_edge(clk) then
	      if (reset = '1') then
        		move_up <= '0';
      		  move_down <= '0';
	      end if;
	    end if;
end process;

process(clk, locatie_lift)
    begin
        if rising_edge(clk) then
          if (locatie_lift = "00") then
              move_down <= '0';
          elsif (locatie_lift = "11") then
              move_up <= '0';
          end if;
        end if;
    end process;

process(clk, stop)
    begin
        if rising_edge(clk) then
           if (stop = '1') then
           move_up <= '0';
           move_down <= '0';
           end if;
        end if;
end process;
   
process(clk, sensor_deur)
    begin
        if rising_edge(clk) then
                B <= (niveau_bestemming = niveau_aanvraag);
                i <= '1';
                if B then
                    beweging_deur <= "10";  -- deur gaat open
                    if (sensor_deur = "10") then -- deur helemaal open
                       beweging_deur <= "00"; -- deur stop
                       [color=brown]for (i < '200') then[/color]
                          i = i + '1';
                       end for;
                    end if;
                    [color=red]beweging_deur <= "01";[/color] -- deur gaat toe
                    if (sensor_deur = "00") then -- deur toe
                       beweging_deur <= "00"; -- deur stop
                       [color=red]for (i < '200') then[/color]
                          i = i + '1';
                       end for;
                    end if;
                end if;
--            end if;
    end if;
end process;
   
end architecture;

i have added the code in an attachement

thanks!!
 

elevator.vhdl code

First for the port declaration at the entity :

clk : in std_logic_vector(2 downto 0);

it should be like :
clk : in std_logic_vector(2 downto 0));

Second :for the FOR loops :
integer values should not be placed inside quotations . I didn't try this for syntax before so you may also may want to try another way to write the for loop as :
FOR i IN 0 TO 199
LOOP
--place your instructions here

END LOOP;

That's all I can find now .
Hope it works .
[/quote]
 

    jordi

    Points: 2
    Helpful Answer Positive Rating
vhdl code for elevator

thanks that really helpt alot..

but still it doens't work :cry:

now the error is
No feasible entries for subprogram "rising_edge"

Code:
process(clk, reset)
	begin
	    if rising_edge(clk) then
	      if (reset = '1') then
        		move_up <= '0';
      		  move_down <= '0';
	      end if;
	    end if;
end process;
like here..
i hate it :)
 

no feasible entries for subprogram rising_edge.

Hello,
Try using :
if (clk='1' and clk'event )

instead of using rising_edge; it works with me .Just make sure that clk is a signal of type std_logic .You declared it as a std_logic_vector(3 downto 0) which means that it consists of 3 bits .You must either change it to std_logic or use single bit of it ,clk(0) for example .
 

    jordi

    Points: 2
    Helpful Answer Positive Rating
no feasible entries for infix operator - vhdl

thanks it seems that my clk was a vector..
now i've got other errors :p
it keeps on comming

i'll first check them out

Added after 16 minutes:

ok i filterd some errors out.. but still
it will nog compile..
i think that the warnings are not important

Code:
# ** Error: /project/elevator.vhdl(110): Type error resolving infix expression "=" as type ieee.std_logic_1164.std_logic.
# ** Error: /project/elevator.vhdl(112): Signal "b" is type ieee.std_logic_1164.std_logic; expecting type std.standard.boolean.
# ** Warning: [14] /project/elevator.vhdl(113): Array length is 3; string literal length is 2.
# ** Warning: [14] /project/elevator.vhdl(115): Array length is 3; string literal length is 2.
# ** Error: /project/elevator.vhdl(117): Target of signal assignment is not a signal.
# ** Error: /project/elevator.vhdl(117): No feasible entries for infix operator "+".
# ** Error: /project/elevator.vhdl(117): Type error resolving infix expression "+" as type std.standard.integer.
# ** Warning: [14] /project/elevator.vhdl(120): Array length is 3; string literal length is 2.
# ** Warning: [14] /project/elevator.vhdl(122): Array length is 3; string literal length is 2.
# ** Error: /project/elevator.vhdl(124): Target of signal assignment is not a signal.
# ** Error: /project/elevator.vhdl(124): No feasible entries for infix operator "+".
# ** Error: /project/elevator.vhdl(124): Type error resolving infix expression "+" as type std.standard.integer.
# ** Error: /project/elevator.vhdl(129): VHDL Compiler exiting

Here is my updated code
Code:
library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.std_logic_unsigned.all;
    use IEEE.std_logic_arith.all;

entity elevator_car is 
 PORT(      		   
    reset             : in std_logic;                     --voor het initaliseren van de schakeling (niveau van de liftkooi=0)
    stop              : in std_logic;                     --de noodstop in de liftkooi
	 niveau_aanvraag   : in std_logic_vector(2 downto 0);  --niveau van de nieuwe passagier
	 niveau_bestemming : in std_logic_vector(2 downto 0);  --requested floor from passenger inside elevator
	 move_up           : out std_logic;
	 move_down         : out std_logic;
	 sensor_deur       : in std_logic_vector(2 downto 0);  --sensor die weergeeft of de lift open of toe is
	 beweging_deur     : out std_logic_vector(2 downto 0); --geeft weer of de deuren open of toe gaan.
	 locatie_lift      : in std_logic_vector(2 downto 0);  --weergave van de locatie  
	 clk               : in std_logic);                    --lift clock signaal
end elevator_car;

architecture behav of elevator_car is
   signal A : std_logic;
   signal registerinfo : std_logic_vector(2 downto 0);
   signal B : std_logic;  
   signal niveau_aanvraag2 : std_logic_vector(2 downto 0);
   signal i : integer; 
   signal niveaubestemming : std_logic_vector(2 downto 0);
   
begin	
process(clk, locatie_lift, niveau_aanvraag, niveau_bestemming)--stijgen
   begin 
      niveaubestemming <= niveau_bestemming;   
      if rising_edge(clk) then
            if (niveau_aanvraag > locatie_lift) then
                  move_up <= '1';
                  move_down <= '0';
                  if (niveau_aanvraag2 /= niveaubestemming) then
                     registerinfo <= niveaubestemming;  --maak register (3downto0)
                     niveaubestemming <= niveau_aanvraag2;
                  elsif (niveau_aanvraag2 = niveaubestemming) then --tussen oproepen
                     move_up <= '1';
                     move_down <= '0';
                  end if;
                  if (locatie_lift /= registerinfo) then
                     move_up <= '1';
                     move_down <= '0';
                  elsif (locatie_lift = registerinfo) then
                     move_up <= '0';
                     move_down <= '0';
                  end if;
                      
            elsif (niveau_aanvraag < locatie_lift) then
                  move_down <= '1';
                  move_up <= '0'; 
                  if (niveau_aanvraag2 /= niveaubestemming) then
                     registerinfo <= niveaubestemming;--maak register (3downto0)
                     niveaubestemming <= niveau_aanvraag2;
                  elsif (niveau_aanvraag2 = niveaubestemming) then --tussen oproepen
                        move_up <= '0';
                        move_down <= '1';
                  end if;
                  if (locatie_lift /= registerinfo) then
                     move_up <= '0';
                     move_down <= '1';
                  elsif (locatie_lift = registerinfo) then
                     move_up <= '0';
                     move_down <= '0';
                  end if;
                  
            elsif (niveau_aanvraag = locatie_lift) then
               move_up <= '0';
               move_down <= '0';
            end if;
      end if;
end process;

process(clk, reset)
	begin
	    if rising_edge(clk) then
	      if (reset = '1') then
        		move_up <= '0';
      		  move_down <= '0';
	      end if;
	    end if;
end process;

process(clk, locatie_lift)
    begin
        if rising_edge(clk) then
          if (locatie_lift = "00") then
              move_down <= '0';
          elsif (locatie_lift = "11") then
              move_up <= '0';
          end if;
        end if;
    end process;

process(clk, stop)
    begin
        if rising_edge(clk) then
           if (stop = '1') then
           move_up <= '0';
           move_down <= '0';
           end if;
        end if;
end process;
   
process(clk, sensor_deur)
    begin
        if rising_edge(clk) then
           [color=redB] <= (niveau_bestemming = niveau_aanvraag);[/color]
           [color=redB]i <= '0';[/color]
           [color=redB]if B then[/color]
              beweging_deur <= "10";  -- deur gaat open
              if (sensor_deur = "10") then -- deur helemaal open
                 beweging_deur <= "00"; -- deur stop
                 for i in 0 to 200 loop
                    [color=redB]i <= (i + '1');[/color]
                 end loop;
              end if;
              beweging_deur <= "01"; -- deur gaat toe
              if (sensor_deur = "00") then -- deur toe
                 beweging_deur <= "00"; -- deur stop
                 for i in 0 to 200 loop
                    [color=redB]i <= (i + '1');[/color]
                 end loop;
              end if;
        end if;
    end if;
end process;
end architecture;
errors are coloured

thanks again for the good response
 
no feasible entries for infix operator +

i <= '0';

Try : i<= 0;

if B then

Try : if B=1 then

for i in 0 to 200 loop
i <= (i + '1');
end loop;
If you really need to add 1 to i ,try : i<=i+1;
But I think that the for instruction already adds one to i at each iteration .

for :
<= (niveau_bestemming = niveau_aanvraag);

Well, there's no signal at the left side to assign to, also you may need to place it in an if instruction like :
if (niveau_bestemming = niveau_aanvraag) then
reqSig<='1';--assuming that reqSig is where you want to place the value and it's of type std_logic
else reqSig<='0';
end if;
 
  • Like
Reactions: shahede

    jordi

    Points: 2
    Helpful Answer Positive Rating

    shahede

    Points: 2
    Helpful Answer Positive Rating
elevator vhdl code

thanks :)

now it works :)

you are my hero :D
 

infix operator in vhdl

good you solved the problem, keep it up
 

vhdl elevator

hi, i need an elevator program coding vhdl of altera apex20ke ep20k200efc484-2x, 4 floors, up down buttons with lights outside elevator, floor buttons with lights and open and close door button inside elevator, and when door is open it open for 30sec,and when open door is press it add 10sec if timer is less than or equal to 20sec and when close door is press it closes in 10sec,and a display of floors on each floor,soory for the high demand but its urgent,need it in 2 days :cry:
 

vhdl+infix operator

no reply??
 

vhdl program for elevator

It's not a too hard program my friend, firstly it'd better that you make your own detail datasheet and state machines. After that you can assign the aprppriate signals and biuld the HDL Code.
For your program, it'd will be the best if you break it into some sub-design. For example a timer section and the comparator must be there for auto increments the count and for comparing the idle time with ur desire. Sorry,dont have enough time to give you all the code you need .
 

vhdl example elevator

can anyone help me with this...i'm not good...i still dont know how to write vhdl..

error:


code:
 

Re: vhdl example elevator

Hello
I have a project and need this code please
Thank you very much

This is my email : mraq100@hotmail.com
 
Last edited:

Hi,
Alina here.
I also doing project title "elevator based fpga".
i do need this code.if you mind,can you gave me the code.
Thank you.

Regards,
Alina.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top