library IEEE; entity AT_ELEVATOR is end AT_ELEVATOR; architecture BENCH of AT_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); FLOOR_NUM : out integer); end component; constant NUM_FLOORS: integer:= 8; type bit_vector_array is array (Integer range <>) of bit_vector(1 to NUM_FLOORS); --resolved function function WiredOR( INPUT: bit_vector_array) return bit_vector is variable RESULT: bit_vector(1 to NUM_FLOORS):=(others=>'0'); begin for i in INPUT'range loop for j in 1 to NUM_FLOORS loop if(INPUT(i)(j)='1') then RESULT(j):='1'; end if; end loop; end loop; return RESULT; end WiredOR; -- local signal declarations signal DOORS_OPENED_T: bit_vector(1 to NUM_FLOORS):=(others=>'0'); signal BUTTONS_IN_T, BUTTONS_OUT_T: WiredOR bit_vector(1 to NUM_FLOORS):=(others=>'0'); signal LIGHT_UP_T, LIGHT_DN_T: bit; signal MOTOR_T: bit_vector(0 to 1); signal FLOOR_NUM_T : integer; 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, FLOOR_NUM_T); end BENCH;