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

Subversion Repositories t400

[/] [t400/] [tags/] [rel_0_1_beta/] [rtl/] [vhdl/] [t400_io_g.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 arniml
-------------------------------------------------------------------------------
2
--
3
-- The G port controller.
4
--
5
-- $Id: t400_io_g.vhd,v 1.1.1.1 2006-05-06 01:56:44 arniml Exp $
6
--
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
    opt_out_type_0_g : integer := t400_opt_out_type_std_c
59
  );
60
  port (
61
    -- System Interface -------------------------------------------------------
62
    ck_i       : in  std_logic;
63
    ck_en_i    : in  boolean;
64
    por_i      : in  boolean;
65
    res_i      : in  boolean;
66
    -- Control Interface ------------------------------------------------------
67
    op_i       : in  io_g_op_t;
68
    m_i        : in  dw_t;
69
    dec_data_i : in  dec_data_t;
70
    -- Port G Interface -------------------------------------------------------
71
    io_g_o     : out dw_t;
72
    io_g_en_o  : out dw_t
73
  );
74
 
75
end t400_io_g;
76
 
77
 
78
use work.t400_io_pack.all;
79
 
80
architecture rtl of t400_io_g is
81
 
82
  signal g_q   : dw_t;
83
 
84
  signal vdd_s : std_logic;
85
 
86
begin
87
 
88
  vdd_s <= '1';
89
 
90
  -----------------------------------------------------------------------------
91
  -- Process g_reg
92
  --
93
  -- Purpose:
94
  --   Implements the G output register.
95
  --
96
  g_reg: process (ck_i, por_i)
97
  begin
98
    if por_i then
99
      g_q <= (others => '0');
100
 
101
    elsif ck_i'event and ck_i = '1' then
102
      if    res_i then
103
        -- synchronous reset upon external reset event
104
        g_q   <= (others => '0');
105
 
106
      elsif ck_en_i then
107
        case op_i is
108
          when IOG_LOAD_M =>
109
            g_q <= m_i;
110
          when IOG_LOAD_DEC =>
111
            g_q <= dec_data_i(dw_range_t);
112
          when others =>
113
            null;
114
        end case;
115
      end if;
116
 
117
    end if;
118
  end process g_reg;
119
  --
120
  -----------------------------------------------------------------------------
121
 
122
 
123
  -----------------------------------------------------------------------------
124
  -- Process out_driver
125
  --
126
  -- Purpose:
127
  --   Implements the output driver data and enable.
128
  --
129
  out_driver: process (g_q)
130
  begin
131
    -- bit 3
132
    io_g_o(3)    <= io_out_f(dat => g_q(3),
133
                             opt => opt_out_type_3_g);
134
    io_g_en_o(3) <= io_en_f (en  => vdd_s, dat => g_q(3),
135
                             opt => opt_out_type_3_g);
136
 
137
     -- bit 2
138
    io_g_o(2)    <= io_out_f(dat => g_q(2),
139
                             opt => opt_out_type_2_g);
140
    io_g_en_o(2) <= io_en_f (en  => vdd_s, dat => g_q(2),
141
                             opt => opt_out_type_2_g);
142
 
143
    -- bit 1
144
    io_g_o(1)    <= io_out_f(dat => g_q(1),
145
                             opt => opt_out_type_1_g);
146
    io_g_en_o(1) <= io_en_f (en  => vdd_s, dat => g_q(1),
147
                             opt => opt_out_type_1_g);
148
 
149
    -- bit 0
150
    io_g_o(0)    <= io_out_f(dat => g_q(0),
151
                             opt => opt_out_type_0_g);
152
    io_g_en_o(0) <= io_en_f (en  => vdd_s, dat => g_q(0),
153
                             opt => opt_out_type_0_g);
154
 
155
  end process out_driver;
156
  --
157
  -----------------------------------------------------------------------------
158
 
159
end rtl;
160
 
161
 
162
-------------------------------------------------------------------------------
163
-- File History:
164
--
165
-- $Log: not supported by cvs2svn $
166
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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