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

Subversion Repositories t400

[/] [t400/] [trunk/] [rtl/] [vhdl/] [t400_io_g.vhd] - Blame information for rev 179

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arniml
-------------------------------------------------------------------------------
2
--
3
-- The G port controller.
4
--
5 179 arniml
-- $Id: t400_io_g.vhd 179 2009-04-01 19:48:38Z arniml $
6 2 arniml
--
7
-- Copyright (c) 2006 Arnim Laeuger (arniml@opencores.org)
8
--
9
-- All rights reserved
10
--
11
-- Redistribution and use in source and synthezised forms, with or without
12
-- modification, are permitted provided that the following conditions are met:
13
--
14
-- Redistributions of source code must retain the above copyright notice,
15
-- this list of conditions and the following disclaimer.
16
--
17
-- Redistributions in synthesized form must reproduce the above copyright
18
-- notice, this list of conditions and the following disclaimer in the
19
-- documentation and/or other materials provided with the distribution.
20
--
21
-- Neither the name of the author nor the names of other contributors may
22
-- be used to endorse or promote products derived from this software without
23
-- specific prior written permission.
24
--
25
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
29
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
-- POSSIBILITY OF SUCH DAMAGE.
36
--
37
-- Please report bugs to the author, but before you do so, please
38
-- make sure that this is not a derivative work and that
39
-- you have the latest version of this file.
40
--
41
-- The latest version of this file can be found at:
42
--      http://www.opencores.org/cvsweb.shtml/t400/
43
--
44
-------------------------------------------------------------------------------
45
 
46
library ieee;
47
use ieee.std_logic_1164.all;
48
 
49
use work.t400_opt_pack.all;
50
use work.t400_pack.all;
51
 
52
entity t400_io_g is
53
 
54
  generic (
55
    opt_out_type_3_g : integer := t400_opt_out_type_std_c;
56
    opt_out_type_2_g : integer := t400_opt_out_type_std_c;
57
    opt_out_type_1_g : integer := t400_opt_out_type_std_c;
58 113 arniml
    opt_out_type_0_g : integer := t400_opt_out_type_std_c;
59
    opt_microbus_g   : integer := t400_opt_no_microbus_c
60 2 arniml
  );
61
  port (
62
    -- System Interface -------------------------------------------------------
63
    ck_i       : in  std_logic;
64
    ck_en_i    : in  boolean;
65
    por_i      : in  boolean;
66
    res_i      : in  boolean;
67
    -- Control Interface ------------------------------------------------------
68
    op_i       : in  io_g_op_t;
69
    m_i        : in  dw_t;
70
    dec_data_i : in  dec_data_t;
71 113 arniml
    cs_n_i     : in  std_logic;
72
    wr_n_i     : in  std_logic;
73 2 arniml
    -- Port G Interface -------------------------------------------------------
74
    io_g_o     : out dw_t;
75
    io_g_en_o  : out dw_t
76
  );
77
 
78
end t400_io_g;
79
 
80
 
81
use work.t400_io_pack.all;
82
 
83
architecture rtl of t400_io_g is
84
 
85
  signal g_q   : dw_t;
86
 
87
  signal vdd_s : std_logic;
88
 
89
begin
90
 
91
  vdd_s <= '1';
92
 
93
  -----------------------------------------------------------------------------
94
  -- Process g_reg
95
  --
96
  -- Purpose:
97
  --   Implements the G output register.
98
  --
99
  g_reg: process (ck_i, por_i)
100
  begin
101
    if por_i then
102
      g_q <= (others => '0');
103
 
104
    elsif ck_i'event and ck_i = '1' then
105
      if    res_i then
106
        -- synchronous reset upon external reset event
107
        g_q   <= (others => '0');
108
 
109
      elsif ck_en_i then
110
        case op_i is
111
          when IOG_LOAD_M =>
112
            g_q <= m_i;
113
          when IOG_LOAD_DEC =>
114
            g_q <= dec_data_i(dw_range_t);
115
          when others =>
116
            null;
117
        end case;
118 113 arniml
 
119 2 arniml
      end if;
120
 
121 113 arniml
      -- reset G(0) in MICROBUS operation upon write
122
      if opt_microbus_g = t400_opt_microbus_c and
123
         cs_n_i = '0' and wr_n_i = '0' then
124
        g_q(0) <= '0';
125
      end if;
126 2 arniml
    end if;
127
  end process g_reg;
128
  --
129
  -----------------------------------------------------------------------------
130
 
131
 
132
  -----------------------------------------------------------------------------
133
  -- Process out_driver
134
  --
135
  -- Purpose:
136
  --   Implements the output driver data and enable.
137
  --
138 12 arniml
  out_driver: process (g_q,
139
                       vdd_s)
140 2 arniml
  begin
141
    -- bit 3
142
    io_g_o(3)    <= io_out_f(dat => g_q(3),
143
                             opt => opt_out_type_3_g);
144
    io_g_en_o(3) <= io_en_f (en  => vdd_s, dat => g_q(3),
145
                             opt => opt_out_type_3_g);
146
 
147
     -- bit 2
148
    io_g_o(2)    <= io_out_f(dat => g_q(2),
149
                             opt => opt_out_type_2_g);
150
    io_g_en_o(2) <= io_en_f (en  => vdd_s, dat => g_q(2),
151
                             opt => opt_out_type_2_g);
152
 
153
    -- bit 1
154
    io_g_o(1)    <= io_out_f(dat => g_q(1),
155
                             opt => opt_out_type_1_g);
156
    io_g_en_o(1) <= io_en_f (en  => vdd_s, dat => g_q(1),
157
                             opt => opt_out_type_1_g);
158
 
159
    -- bit 0
160
    io_g_o(0)    <= io_out_f(dat => g_q(0),
161
                             opt => opt_out_type_0_g);
162
    io_g_en_o(0) <= io_en_f (en  => vdd_s, dat => g_q(0),
163
                             opt => opt_out_type_0_g);
164
 
165
  end process out_driver;
166
  --
167
  -----------------------------------------------------------------------------
168
 
169
end rtl;

powered by: WebSVN 2.1.0

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