OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.5/] [rtl/] [bplib/] [s3board/] [s3_rs232_iob_int_ext.vhd] - Blame information for rev 37

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wfjm
-- $Id: s3_rs232_iob_int_ext.vhd 314 2010-07-09 17:38:41Z mueller $
2
--
3
-- Copyright 2010- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
--
14
------------------------------------------------------------------------------
15
-- Module Name:    s3_rs232_iob_int_ext - syn
16
-- Description:    iob's for internal + external rs232, with select
17
--
18
-- Dependencies:   s3_rs232_iob_int
19
--                 s3_rs232_iob_ext
20
--
21
-- Test bench:     -
22
--
23
-- Target Devices: generic
24
-- Tool versions:  xst 11.4; ghdl 0.26
25
--
26
-- Revision History: 
27
-- Date         Rev Version  Comment
28
-- 2010-04-17   278   1.0    Initial version
29
------------------------------------------------------------------------------
30
--    
31
 
32
library ieee;
33
use ieee.std_logic_1164.all;
34
use ieee.std_logic_arith.all;
35
 
36
use work.slvtypes.all;
37
use work.s3boardlib.all;
38
 
39
-- ----------------------------------------------------------------------------
40
 
41
entity s3_rs232_iob_int_ext is          -- iob's for int+ext rs232, with select
42
  port (
43
    CLK : in slbit;                     -- clock
44
    SEL : in slbit;                     -- select, '0' for port 0
45
    RXD : out slbit;                    -- receive data (board view)
46
    TXD : in slbit;                     -- transmit data (board view)
47
    CTS_N : out slbit;                  -- clear to send   (act. low)
48
    RTS_N : in slbit;                   -- request to send (act. low)
49
    I_RXD0 : in slbit;                  -- pad-i: p0: receive data (board view)
50
    O_TXD0 : out slbit;                 -- pad-o: p0: transmit data (board view)
51
    I_RXD1 : in slbit;                  -- pad-i: p1: receive data (board view)
52
    O_TXD1 : out slbit;                 -- pad-o: p1: transmit data (board view)
53
    I_CTS1_N : in slbit;                -- pad-i: p1: clear to send   (act. low)
54
    O_RTS1_N : out slbit                -- pad-o: p1: request to send (act. low)
55
  );
56
end s3_rs232_iob_int_ext;
57
 
58
architecture syn of s3_rs232_iob_int_ext is
59
  signal RXD0 : slbit := '0';
60
  signal TXD0 : slbit := '0';
61
  signal RXD1 : slbit := '0';
62
  signal TXD1 : slbit := '0';
63
  signal CTS1_N : slbit := '0';
64
  signal RTS1_N : slbit := '0';
65
begin
66
 
67
  P0 : s3_rs232_iob_int
68
    port map (
69
      CLK   => CLK,
70
      RXD   => RXD0,
71
      TXD   => TXD0,
72
      I_RXD => I_RXD0,
73
      O_TXD => O_TXD0
74
    );
75
 
76
  P1 : s3_rs232_iob_ext
77
    port map (
78
      CLK     => CLK,
79
      RXD     => RXD1,
80
      TXD     => TXD1,
81
      CTS_N   => CTS1_N,
82
      RTS_N   => RTS1_N,
83
      I_RXD   => I_RXD1,
84
      O_TXD   => O_TXD1,
85
      I_CTS_N => I_CTS1_N,
86
      O_RTS_N => O_RTS1_N
87
    );
88
 
89
  proc_port_mux: process (SEL, RXD0, TXD, RXD1, CTS1_N, RTS_N)
90
  begin
91
    if SEL = '0' then                -- use main board rs232, no flow cntl
92
      RXD      <= RXD0;                   -- get port 0 inputs
93
      CTS_N    <= '0';
94
      TXD0     <= TXD;                    -- set port 0 output 
95
      TXD1     <= '1';                    -- port 1 outputs to idle state
96
      RTS1_N   <= '0';
97
    else                                -- otherwise use pmod1 rs232
98
      RXD      <= RXD1;                   -- get port 1 inputs
99
      CTS_N    <= CTS1_N;
100
      TXD1     <= TXD;                    -- set port 1 outputs
101
      RTS1_N   <= RTS_N;
102
      TXD0     <= '1';                    -- port 0 output to idle state
103
    end if;
104
  end process proc_port_mux;
105
 
106
end syn;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.