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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_0/] [rtl/] [vhdl/] [system/] [t8039.vhd] - Blame information for rev 292

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 62 arniml
-------------------------------------------------------------------------------
2
--
3
-- T8039 Microcontroller System
4
--
5 262 arniml
-- $Id: t8039.vhd,v 1.7 2006-07-14 01:13:32 arniml Exp $
6
-- $Name: not supported by cvs2svn $
7 62 arniml
--
8
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
9
--
10
-- All rights reserved
11
--
12
-- Redistribution and use in source and synthezised forms, with or without
13
-- modification, are permitted provided that the following conditions are met:
14
--
15
-- Redistributions of source code must retain the above copyright notice,
16
-- this list of conditions and the following disclaimer.
17
--
18
-- Redistributions in synthesized form must reproduce the above copyright
19
-- notice, this list of conditions and the following disclaimer in the
20
-- documentation and/or other materials provided with the distribution.
21
--
22
-- Neither the name of the author nor the names of other contributors may
23
-- be used to endorse or promote products derived from this software without
24
-- specific prior written permission.
25
--
26
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
30
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
-- POSSIBILITY OF SUCH DAMAGE.
37
--
38
-- Please report bugs to the author, but before you do so, please
39
-- make sure that this is not a derivative work and that
40
-- you have the latest version of this file.
41
--
42
-- The latest version of this file can be found at:
43
--      http://www.opencores.org/cvsweb.shtml/t48/
44
--
45
-------------------------------------------------------------------------------
46
 
47
library ieee;
48
use ieee.std_logic_1164.all;
49
 
50
entity t8039 is
51
 
52
  port (
53
    xtal_i    : in    std_logic;
54
    reset_n_i : in    std_logic;
55
    t0_b      : inout std_logic;
56
    int_n_i   : in    std_logic;
57
    ea_i      : in    std_logic;
58
    rd_n_o    : out   std_logic;
59
    psen_n_o  : out   std_logic;
60
    wr_n_o    : out   std_logic;
61
    ale_o     : out   std_logic;
62
    db_b      : inout std_logic_vector( 7 downto 0);
63
    t1_i      : in    std_logic;
64
    p2_b      : inout std_logic_vector( 7 downto 0);
65
    p1_b      : inout std_logic_vector( 7 downto 0);
66
    prog_n_o  : out   std_logic
67
  );
68
 
69
end t8039;
70
 
71
 
72 156 arniml
use work.t48_system_comp_pack.t8039_notri;
73 62 arniml
 
74
architecture struct of t8039 is
75
 
76
  signal t0_s             : std_logic;
77
  signal t0_dir_s         : std_logic;
78
  signal db_s             : std_logic_vector( 7 downto 0);
79
  signal db_dir_s         : std_logic;
80
  signal p2_s             : std_logic_vector( 7 downto 0);
81 211 arniml
  signal p2l_low_imp_s    : std_logic;
82
  signal p2h_low_imp_s    : std_logic;
83 62 arniml
  signal p1_s             : std_logic_vector( 7 downto 0);
84
  signal p1_low_imp_s     : std_logic;
85
 
86 220 arniml
  signal vdd_s            : std_logic;
87
 
88 62 arniml
begin
89
 
90 220 arniml
  vdd_s <= '1';
91
 
92 156 arniml
  t8039_notri_b : t8039_notri
93 62 arniml
    generic map (
94 156 arniml
      -- we don't need explicit gating of input ports
95
      -- this is done implicitely by the bidirectional pads
96
      gate_port_input_g => 0
97 62 arniml
    )
98 156 arniml
 
99 62 arniml
    port map (
100 211 arniml
      xtal_i        => xtal_i,
101 220 arniml
      xtal_en_i     => vdd_s,
102 211 arniml
      reset_n_i     => reset_n_i,
103
      t0_i          => t0_b,
104
      t0_o          => t0_s,
105
      t0_dir_o      => t0_dir_s,
106
      int_n_i       => int_n_i,
107
      ea_i          => ea_i,
108
      rd_n_o        => rd_n_o,
109
      psen_n_o      => psen_n_o,
110
      wr_n_o        => wr_n_o,
111
      ale_o         => ale_o,
112
      db_i          => db_b,
113
      db_o          => db_s,
114
      db_dir_o      => db_dir_s,
115
      t1_i          => t1_i,
116
      p2_i          => p2_b,
117
      p2_o          => p2_s,
118
      p2l_low_imp_o => p2l_low_imp_s,
119
      p2h_low_imp_o => p2h_low_imp_s,
120
      p1_i          => p1_b,
121
      p1_o          => p1_s,
122
      p1_low_imp_o  => p1_low_imp_s,
123
      prog_n_o      => prog_n_o
124 62 arniml
    );
125
 
126
  -----------------------------------------------------------------------------
127
  -- Process bidirs
128
  --
129
  -- Purpose:
130
  --   Assign bidirectional signals.
131
  --
132
  bidirs: process (t0_b, t0_s, t0_dir_s,
133
                   db_b, db_s, db_dir_s,
134
                   p1_b, p1_s, p1_low_imp_s,
135 211 arniml
                   p2_b, p2_s, p2l_low_imp_s, p2h_low_imp_s)
136 62 arniml
 
137 213 arniml
    function port_bidir_f(port_value : in std_logic_vector;
138
                          low_imp    : in std_logic) return std_logic_vector is
139
      variable result_v : std_logic_vector(port_value'range);
140 62 arniml
    begin
141 213 arniml
      for idx in port_value'high downto port_value'low loop
142
        if low_imp = '1' then
143
          result_v(idx) := port_value(idx);
144
        elsif port_value(idx) = '0' then
145
          result_v(idx) := '0';
146
        else
147
          result_v(idx) := 'Z';
148
        end if;
149
      end loop;
150 62 arniml
 
151 213 arniml
      return result_v;
152 62 arniml
    end;
153
 
154
  begin
155
    -- Test 0 -----------------------------------------------------------------
156
    if t0_dir_s = '1' then
157
      t0_b <= t0_s;
158
    else
159
      t0_b <= 'Z';
160
    end if;
161
 
162
    -- Data Bus ---------------------------------------------------------------
163
    if db_dir_s = '1' then
164
      db_b <= db_s;
165
    else
166
      db_b <= (others => 'Z');
167
    end if;
168
 
169
    -- Port 1 -----------------------------------------------------------------
170 213 arniml
    p1_b <= port_bidir_f(port_value => p1_s,
171
                         low_imp => p1_low_imp_s);
172 62 arniml
 
173
    -- Port 2 -----------------------------------------------------------------
174 213 arniml
    p2_b(3 downto 0) <= port_bidir_f(port_value => p2_s(3 downto 0),
175
                                     low_imp    => p2l_low_imp_s);
176
    p2_b(7 downto 4) <= port_bidir_f(port_value => p2_s(7 downto 4),
177
                                     low_imp    => p2h_low_imp_s);
178 62 arniml
 
179
  end process bidirs;
180
  --
181
  -----------------------------------------------------------------------------
182
 
183
end struct;
184
 
185
 
186
-------------------------------------------------------------------------------
187
-- File History:
188
--
189
-- $Log: not supported by cvs2svn $
190 262 arniml
-- Revision 1.6  2006/06/20 00:47:08  arniml
191
-- new input xtal_en_i
192
--
193 220 arniml
-- Revision 1.5  2005/11/02 23:41:43  arniml
194
-- properly drive P1 and P2 with low impedance markers
195
--
196 213 arniml
-- Revision 1.4  2005/11/01 21:37:45  arniml
197
-- wire signals for P2 low impedance marker issue
198
--
199 211 arniml
-- Revision 1.3  2004/12/03 19:43:12  arniml
200
-- added hierarchy t8039_notri
201
--
202 62 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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