-- --------------------------------------------------------------------------- -- BOARD -- TEST BENCH -- -- --------------------------------------------------------------------------- -- -- File : 'board_testbench.vhd' -- Author : Lars Larsson -- -- Date : February 8, 1999 -- -- --------------------------------------------------------------------------- -- -- Copyright (C) 1999 Lars Larsson, Dept. of Computer Science -- University of Hamburg -- Vogt-Koelln-Str. 30 -- D - 22041 Hamburg, Germany -- larsson@informatik.uni-hamburg.de -- http://tech-www.informatik.uni-hamburg.de/~larsson -- -- This program is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at your -- option) any later version. -- -- This program is distributed in the hope that it will be useful, but -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- --------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; library work; use work.components.all; use work.simulation.all; use work.chips.all; entity board_testbench is end board_testbench; architecture simulate of board_testbench is signal clk_s, nrst_s : std_ulogic; signal rs232_txd_s, rs232_rxd_s, irda_rxda_s, irda_txd_s : std_ulogic; signal baud_rate_select_s : std_ulogic_vector (2 downto 0); signal nsend_receive_s : std_ulogic; signal dip_switches_s : std_ulogic_vector (7 downto 0); signal led_array_s : std_ulogic_vector (7 downto 0); signal strobe_s, nkey_s : std_ulogic; signal HelloSUB : string (1 to 7) := "Hello!" & SUB; -- SUB = ^Z signal t_bit : time := 104.167 us; -- 9600 Baud begin clk_p: process begin clk_s <= '0'; wait for CLK_PERIOD / 2; clk_s <= '1'; wait for CLK_PERIOD / 2; end process; rst_p: process begin nrst_s <= '0'; wait for CLK_PERIOD; nrst_s <= '1'; wait; end process; ini_p: process begin baud_rate_select_s <= "010"; -- select 9600 Baud nsend_receive_s <= '0'; -- send only wait; end process; sim_p: process begin dip_switches_s <= "01000001"; strobe_s <= '0'; wait for 1 us; -- 'A' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "01000010"; strobe_s <= '0'; wait for 1 us; -- 'B' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "01000011"; strobe_s <= '0'; wait for 1 us; -- 'C' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "01000100"; strobe_s <= '0'; wait for 1 us; -- 'D' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "01000101"; strobe_s <= '0'; wait for 1 us; -- 'E' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "01000110"; strobe_s <= '0'; wait for 1 us; -- 'F' strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "00101110"; strobe_s <= '0'; wait for 1 us; -- '.' (2e) strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; dip_switches_s <= "00011010"; strobe_s <= '0'; wait for 1 us; -- '^Z' (1a) strobe_s <= '1'; wait for 100 ns; strobe_s <= '0'; wait for 500 ns; wait for 2 us; wait; end process; nkey_s <= not strobe_s; board_i: board port map ( clk=>clk_s, nrst=>nrst_s, baud_rate_select=>baud_rate_select_s, nsend_receive=>nsend_receive_s, rs232_txd=>rs232_txd_s, rs232_rxd=>rs232_rxd_s, irda_rxda=>irda_rxda_s, irda_txd=>irda_txd_s, nkey=>nkey_s, dip_switches=>dip_switches_s, led_array=>led_array_s ); s2txd_i : string2txd port map (t_bit,HelloSUB,rs232_txd_s); end simulate; -- ============================ CONFIGURATION ============================ configuration board_testbench_cfg of board_testbench is for simulate end for; end board_testbench_cfg; -- ======================== END OF CONFIGURATION =========================