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

Subversion Repositories t400

[/] [t400/] [trunk/] [rtl/] [vhdl/] [t400_io_d.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 D port controller.
4
--
5
-- $Id: t400_io_d.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_d 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_d_op_t;
68
    bd_i      : in  bd_t;
69
    -- Port D Interface -------------------------------------------------------
70
    io_d_o    : out dw_t;
71
    io_d_en_o : out dw_t
72
  );
73
 
74
end t400_io_d;
75
 
76
 
77
use work.t400_io_pack.all;
78
 
79
architecture rtl of t400_io_d is
80
 
81
  signal d_q   : dw_t;
82
 
83
  signal vdd_s : std_logic;
84
 
85
begin
86
 
87
  vdd_s <= '1';
88
 
89
  -----------------------------------------------------------------------------
90
  -- Process d_reg
91
  --
92
  -- Purpose:
93
  --   Implements the D output register.
94
  --
95
  d_reg: process (ck_i, por_i)
96
  begin
97
    if por_i then
98
      d_q <= (others => '0');
99
 
100
    elsif ck_i'event and ck_i = '1' then
101
      if    res_i then
102
        -- synchronous reset upon external reset event
103
        d_q   <= (others => '0');
104
 
105
      elsif ck_en_i then
106
        if op_i = IOD_LOAD then
107
          d_q <= bd_i;
108
        end if;
109
      end if;
110
 
111
    end if;
112
  end process d_reg;
113
  --
114
  -----------------------------------------------------------------------------
115
 
116
 
117
  -----------------------------------------------------------------------------
118
  -- Process out_driver
119
  --
120
  -- Purpose:
121
  --   Implements the output driver data and enable.
122
  --
123
  out_driver: process (d_q)
124
  begin
125
    -- bit 3
126
    io_d_o(3)    <= io_out_f(dat => d_q(3),
127
                             opt => opt_out_type_3_g);
128
    io_d_en_o(3) <= io_en_f (en  => vdd_s, dat => d_q(3),
129
                             opt => opt_out_type_3_g);
130
 
131
     -- bit 2
132
    io_d_o(2)    <= io_out_f(dat => d_q(2),
133
                             opt => opt_out_type_2_g);
134
    io_d_en_o(2) <= io_en_f (en  => vdd_s, dat => d_q(2),
135
                             opt => opt_out_type_2_g);
136
 
137
    -- bit 1
138
    io_d_o(1)    <= io_out_f(dat => d_q(1),
139
                             opt => opt_out_type_1_g);
140
    io_d_en_o(1) <= io_en_f (en  => vdd_s, dat => d_q(1),
141
                             opt => opt_out_type_1_g);
142
 
143
    -- bit 0
144
    io_d_o(0)    <= io_out_f(dat => d_q(0),
145
                             opt => opt_out_type_0_g);
146
    io_d_en_o(0) <= io_en_f (en  => vdd_s, dat => d_q(0),
147
                             opt => opt_out_type_0_g);
148
 
149
  end process out_driver;
150
  --
151
  -----------------------------------------------------------------------------
152
 
153
end rtl;
154
 
155
 
156
-------------------------------------------------------------------------------
157
-- File History:
158
--
159
-- $Log: not supported by cvs2svn $
160
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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