library IEEE; entity T_ELEVATOR is end T_ELEVATOR; architecture BENCH of T_ELEVATOR is -- component declaration component ELEVATOR is generic (NUM_FLOORS: positive); port (BUTTONS_IN : in bit_vector(1 to NUM_FLOORS); BUTTONS_OUT : in bit_vector(1 to NUM_FLOORS); LIGHT_UP : out bit; LIGHT_DN : out bit; DOORS_OPENED : out bit_vector(1 to NUM_FLOORS); MOTOR : out bit_vector(0 to 1)); end component; constant NUM_FLOORS: integer:= 8; -- local signal declarations signal BUTTONS_IN_T, BUTTONS_OUT_T, DOORS_OPENED_T: bit_vector(1 to NUM_FLOORS):=(others=>'0'); signal LIGHT_UP_T, LIGHT_DN_T: bit; signal MOTOR_T: bit_vector(0 to 1); begin --component instantiation of ELEVATOR ELEV7: ELEVATOR generic map(NUM_FLOORS) port map (BUTTONS_IN_T, BUTTONS_OUT_T, LIGHT_UP_T, LIGHT_DN_T, DOORS_OPENED_T, MOTOR_T); STIMULUS: process begin BUTTONS_IN_T <= "00100000"; BUTTONS_OUT_T<= "00000000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 20 sec; --elevator is on the 3-th floor BUTTONS_IN_T <="00000000"; BUTTONS_OUT_T<="01001000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 20 sec; --elevator is on the 2-nd floor BUTTONS_IN_T <= "00000001"; BUTTONS_OUT_T<= "10000000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 20 sec; --elevator is on the 1-st floor BUTTONS_IN_T <= "01010100"; BUTTONS_OUT_T<= "00010000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 20 sec; --elevator is on the 6-th floor BUTTONS_IN_T <= "00000000"; BUTTONS_OUT_T<= "00000000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 20 sec; --elevator is on the 6-th floor BUTTONS_IN_T <= "00100000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for 5 sec; BUTTONS_OUT_T<= "00000010"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); --elevator is on the 7-th floor wait for 20 sec; BUTTONS_OUT_T <= "00100000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); wait for sec; BUTTONS_OUT_T<= "00010000"; wait for sec; BUTTONS_IN_T <= (others=>'0'); BUTTONS_OUT_T<= (others=>'0'); -- elevator is on the 3-rd floor wait; end process STIMULUS; end BENCH;