-- ----------------------------------------------------------------------------- -- -- RXD2CHAR - RS232 TxD to ASCII character converter -- TEST BENCH -- -- ----------------------------------------------------------------------------- -- -- File : 'rxd2char_testbench.vhd' -- Author : Lars Larsson -- -- Date : February 16, 1999 -- -- Description : This is an example test bench for the rxd2char.vhd'. -- -- Hint : Package simulation (file 'simulation.vhd') is required. -- -- ----------------------------------------------------------------------------- -- -- 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; use work.simulation.all; entity rxd2char_testbench is end rxd2char_testbench; architecture simulate of rxd2char_testbench is constant T_BAUD : time := 104167 ns; -- 1 / 9600 bps = 104.16666666 us signal txd_s,rxd_s, strobe_s : std_ulogic; signal bin_s : std_ulogic_vector (7 downto 0); signal chr_s : character; signal t_s : time := T_BAUD; signal HelloSUB : string (1 to 7) := "Hello!" & SUB; -- SUB = ^Z signal The_fox : string (1 to 45) := "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. "; begin s2txd_i : string2txd port map (t_s,The_fox,txd_s); rxd_s <= txd_s; rxd2c_i : rxd2char port map (t_s,rxd_s,bin_s,chr_s,strobe_s); end simulate; -- ----------------------------------------------------------------------------- configuration rxd2char_testbench_cfg of rxd2char_testbench is for simulate end for; end rxd2char_testbench_cfg; -- -----------------------------------------------------------------------------