Hi, I'm doing some elevator logic for a school assignment. It is pretty basic with 4 floors and a button on each floor and some leds and a motor for the elevator to run (we have an elevator model here at school that we try our chips in).
So, I have done my elevator logic but my problem is that it looks good to me on papper but when I synthesize it in Warp6.0 the input never gets to any pins... I guess I don't assign them right somehow but I could really need some other persons prospective since I have tried to figure this out for a long time now...
When I have compiled the pinout looks like this in the report file:
It feel that I have missed some basic assignment somewhere or something like that but I just can't see it... :/
So, I have done my elevator logic but my problem is that it looks good to me on papper but when I synthesize it in Warp6.0 the input never gets to any pins... I guess I don't assign them right somehow but I could really need some other persons prospective since I have tried to figure this out for a long time now...
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity elevator is
port(
clock : in std_logic;
floor_switch : in std_logic_vector(0 to 3);
floor_sensor : in std_logic_vector(0 to 3);
-- light_inside : out std_logic_vector(0 to 3);
-- light_outside : out std_logic_vector(0 to 3);
motor_power : out std_logic_vector(0 to 1)
);
end entity elevator;
architecture elevator_arch of elevator is
type state is (floor_1, floor_2, floor_3, floor_4);
signal this_floor :state := floor_1;
signal next_floor :state := floor_1;
begin
elevator_switch: process(clock, floor_switch, this_floor, next_floor)
begin
case this_floor is
when floor_1 => case floor_switch is
when "1011" => next_floor <= floor_2;
when "1101" => next_floor <= floor_3;
when "1110" => next_floor <= floor_4;
when others => next_floor <= floor_1;
end case ;
when floor_2 => case floor_switch is
when "0111" => next_floor <= floor_1;
when "1101" => next_floor <= floor_3;
when "1110" => next_floor <= floor_4;
when others => next_floor <= floor_2;
end case;
when floor_3 => case floor_switch is
when "0111" => next_floor <= floor_1;
when "1011" => next_floor <= floor_2;
when "1110" => next_floor <= floor_4;
when others => next_floor <= floor_3;
end case;
when floor_4 => case floor_switch is
when "0111" => next_floor <= floor_1;
when "1011" => next_floor <= floor_2;
when "1101" => next_floor <= floor_3;
when others => next_floor <= floor_4;
end case;
end case;
end process elevator_switch;
elevator_action: process(next_floor, this_floor)
variable floor_sensor_var :std_logic_vector(0 to 3) := floor_sensor;
begin
case next_floor is
when floor_1 => case this_floor is
when floor_1 =>
motor_power <= "00";
when others =>
while (floor_sensor_var AND 1000) loop
motor_power <= "10";
end loop;
motor_power <= "00";
end case;
when floor_2 => case this_floor is
when floor_2 =>
motor_power <= "00";
when floor_1 =>
while (floor_sensor_var AND 0100) loop
motor_power <= "01";
end loop;
motor_power <= "00";
when floor_3 =>
while (floor_sensor_var AND 0100) loop
motor_power <= "10";
end loop;
motor_power <= "00";
when floor_4 =>
while (floor_sensor_var AND 0100) loop
motor_power <= "10";
end loop;
motor_power <= "00";
end case;
when floor_3 => case this_floor is
when floor_3 =>
motor_power <= "00";
when floor_1 =>
while (floor_sensor_var AND 0010) loop
motor_power <= "01";
end loop;
motor_power <= "00";
when floor_2 =>
while (floor_sensor_var AND 0010) loop
motor_power <= "01";
end loop;
motor_power <= "00";
when floor_4 =>
while (floor_sensor_var AND 0010) loop
motor_power <= "10";
end loop;
motor_power <= "00";
end case;
when floor_4 => case this_floor is
when floor_4 =>
motor_power <= "00";
when others =>
while (floor_sensor_var AND 0001) loop
motor_power <= "01";
end loop;
motor_power <= "00";
end case;
end case;
end process elevator_action;
-- elevator_light: process(clock)
check_floor: process(floor_sensor)
begin
case floor_sensor is
when "0111" => this_floor <= floor_1;
when "1011" => this_floor <= floor_2;
when "1101" => this_floor <= floor_3;
when "1110" => this_floor <= floor_4;
when others => this_floor <= floor_1;
end case;
end process check_floor;
end architecture elevator_arch;
When I have compiled the pinout looks like this in the report file:
Code:
PINOUT INFORMATION (00:04:35)
Messages:
Information: All signals pre-placed in user design.
C22V10
__________________________________________
not used *| 1| |24|* not used
not used *| 2| |23|* not used
not used *| 3| |22|* not used
not used *| 4| |21|* not used
not used *| 5| |20|* not used
not used *| 6| |19|= motor_power(1)
not used *| 7| |18|= motor_power(0)
not used *| 8| |17|* not used
not used *| 9| |16|* not used
not used *|10| |15|* not used
not used *|11| |14|* not used
not used *|12| |13|* not used
__________________________________________
It feel that I have missed some basic assignment somewhere or something like that but I just can't see it... :/