-- ----------------------------------------------------------------------------- -- EPLD - ENTITY with glue logic to compressor/decompressor & RAS devices -- -- ----------------------------------------------------------------------------- -- -- File : 'epld_glue.vhd' -- Author : Lars Larsson -- -- Date : February 11, 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; use work.chips.all; use work.components.all; entity epld_glue is port( clk : in std_ulogic; -- clock = 16 MHz nrst : in std_ulogic; -- *reset -- baud_rate_select : in std_ulogic_vector (2 downto 0); -- baud rate selection nsend_receive : in std_ulogic; -- send/receive selection (0:send,1:receive) -- rs232_txd : in std_ulogic; -- TXD signal (TTL) from RS232 rs232_rxd : out std_ulogic; -- RXD signal (TTL) to RS232 irda_rxda : in std_ulogic; -- RXD-A (IrDA 1.0) signal from HSDL-1100 irda_txd : out std_ulogic; -- TXD (IrDA 1.0 & 1.1) signal to HSDL-1100 -- nkey : in std_ulogic; -- strobe key (push down = '0', up = '1') dip_switches : in std_ulogic_vector ( 7 downto 0); -- DIP-Switches 1-2-3-4-5-6-7-8 -- idata : in std_ulogic_vector ( 7 downto 0); -- data bus input (if nwe='1') odata : out std_ulogic_vector ( 7 downto 0); -- data bus output (if nwe='0') address : out std_ulogic_vector (10 downto 0); -- address bits A10 downto A0 for SRAM xOR DRAM nwe : out std_ulogic; -- read / write selector for RAM (not write enable) -- ncs : out std_ulogic; -- not Chip Select of SRAM -- nras : out std_ulogic; -- not Row Address Strobe (nRAS) of DRAM ncas : out std_ulogic; -- not Column Address Strobe (nCAS) of DRAM type_of_ram : out ram_type; -- {SRAM,DRAM} -- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - to_flex : out std_logic; -- TriState IO contol for FLEXs flex_iodata : inout std_logic_vector ( 7 downto 0); -- TriState bus between EPLD, FLEXA, FLEXB flex_busy : out std_logic; -- to hold input of FLEX flex_request : in std_logic; -- from send output of FLEX flex_hold : in std_logic; -- from busy output of FLEX flex_send : out std_logic -- to request input of FLEX ); end epld_glue; architecture structure of epld_glue is -- INTERNAL SIGNAL DEFINITIONS HERE ----------------------------------------------------------------------- signal baud_clk_x16_s, baud_clk_s : std_ulogic; -- baud clock signals signal irdacodec_rs232_rxd_s : std_ulogic; signal irdacodec_rs232_txd_s : std_ulogic; signal rs232receiver_rxd_s : std_ulogic; signal rs232receiver_busy_s : std_ulogic; signal rs232receiver_akn_s : std_ulogic; signal rs232sender_request_s : std_ulogic; signal rs232sender_busy_s : std_ulogic; signal rs232sender_txd_s : std_ulogic; signal rs232receiver_dout_s, rs232sender_din_s : std_ulogic_vector (7 downto 0); -- text buffer data signal text_buffer_din_s, text_buffer_dout_s : std_ulogic_vector (7 downto 0); -- text buffer data signal glue_idata_s, glue_odata_s : std_ulogic_vector (7 downto 0); -- text buffer data signal ram_io_busy_s : std_ulogic; -- RAM IO busy indicator (DRAM only) -- --------------------------------------------------------------------------------------------------------- -- ADDITIONAL HELPER SIGNAL DEFINITIONS HERE --------------------------------------------------------------- signal nrefresh_s : std_ulogic; -- DRAM controller refresh request -- --------------------------------------------------------------------------------------------------------- -- DEFINE YOUR OWN ADDITIONAL INTERNAL SIGNALS HERE -------------------------------------------------------- -- signal my_signal_s : std_logic; -- just an example -- signal my_signal_vector_s : std_logic_vector (7 downto 0); -- just one more example -- --------------------------------------------------------------------------------------------------------- -- BEGIN OF ARCHITECTURE ----------------------------------------------------------------------------------- -- --------------------------------------------------------------------------------------------------------- begin -- ------------------------------------------------------------------------------------------------------ -- DEFINITION OF RAM TYPE ------------------------------------------------------------------------------- type_of_ram <= SRAM; -- ------------------------------------------------------------------------------------------------------ -- ALL UNUSED OUTPUT PORTS MUST BE DRIVEN --------------------------------------------------------------- address <= "00000000000"; odata <= "00000000"; nras <= '1'; ncas <= '1'; nwe <= '1'; ncs <= '1'; ram_io_busy_s <= '0'; -- ------------------------------------------------------------------------------------------------------ -- PORT MAPPING OF YOU OWN INSTANCES -------------------------------------------------------------------- irda_codec_i : irda_codec port map ( clk => clk, nrst => nrst, baud_rate_select => baud_rate_select, nsend_receive => nsend_receive, rs232_txd => irdacodec_rs232_txd_s, rs232_rxd => irdacodec_rs232_rxd_s, irda_rxda => irda_rxda, irda_txd => irda_txd, baud_clk_x16 => baud_clk_x16_s, baud_clk => baud_clk_s ); with nsend_receive select rs232receiver_rxd_s <= rs232_txd when '0', irdacodec_rs232_rxd_s when others; with nsend_receive select irdacodec_rs232_txd_s <= rs232sender_txd_s when '0', '0' when others; with nsend_receive select rs232_rxd <= irdacodec_rs232_rxd_s when '1', '1' when others; rs232receiver_i : rs232receiver port map ( clk => clk, nrst => nrst, baud_clk_x16 => baud_clk_x16_s, rxd => rs232receiver_rxd_s, dout => rs232receiver_dout_s, busy => rs232receiver_busy_s, akn => rs232receiver_akn_s ); -- text_buffer_i : text_buffer port map ( clk=>clk, nrst=>nrst, -- din=>rs232receiver_dout_s, -- request=>rs232receiver_akn_s, -- dout=>text_buffer_dout_s, -- hold=>rs232sender_busy_s, -- busy=>text_buffer_busy_s, -- io_busy=>ram_io_busy_s, -- -- send=>rs232sender_request_s, -- nwe=>nwe, -- ncs=>ncs, -- nrefresh=>nrefresh_s, -- buffer_address=>address_s, -- idata=>idata, odata=>odata ); rs232sender_i : rs232sender port map ( clk => clk, nrst => nrst, baud_clk => baud_clk_s, request => rs232sender_request_s, -- din => text_buffer_dout_s, din => rs232sender_din_s, busy => rs232sender_busy_s, txd => rs232sender_txd_s ); glue_idata_s <= rs232receiver_dout_s; rs232sender_din_s <= glue_odata_s; glue_i : glue port map ( clk => clk, nrst => nrst, nsend_receive => nsend_receive, -- rs232receiver_busy => rs232receiver_hold_s rs232receiver_request => rs232receiver_akn_s, rs232receiver_idata => glue_idata_s, rs232sender_hold => rs232sender_busy_s, rs232sender_send => rs232sender_request_s, rs232sender_odata => glue_odata_s, to_flex => to_flex, flex_iodata => flex_iodata, flex_busy => flex_busy, flex_request => flex_request, flex_hold => flex_hold, flex_send => flex_send ); end structure; -- --------------------------------------------------------------------------------------------------------- -- END OF ARCHITECTURE ------------------------------------------------------------------------------------- -- ---------------------------------------------------------------------------------------------------------