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

Subversion Repositories t48

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 arniml
-------------------------------------------------------------------------------
2
--
3
-- T8048 Microcontroller System
4
--
5 262 arniml
-- $Id: t8048.vhd,v 1.11 2006-07-14 01:13:32 arniml Exp $
6
-- $Name: not supported by cvs2svn $
7 7 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 t8048 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 t8048;
70
 
71
 
72 108 arniml
library ieee;
73
use ieee.numeric_std.all;
74
 
75 150 arniml
use work.t48_system_comp_pack.t8048_notri;
76 7 arniml
 
77
architecture struct of t8048 is
78
 
79
  signal t0_s             : std_logic;
80
  signal t0_dir_s         : std_logic;
81
  signal db_s             : std_logic_vector( 7 downto 0);
82
  signal db_dir_s         : std_logic;
83
  signal p2_s             : std_logic_vector( 7 downto 0);
84 211 arniml
  signal p2l_low_imp_s    : std_logic;
85
  signal p2h_low_imp_s    : std_logic;
86 7 arniml
  signal p1_s             : std_logic_vector( 7 downto 0);
87 32 arniml
  signal p1_low_imp_s     : std_logic;
88 7 arniml
 
89 220 arniml
  signal vdd_s            : std_logic;
90
 
91 7 arniml
begin
92
 
93 220 arniml
  vdd_s <= '1';
94
 
95 150 arniml
  t8048_notri_b : t8048_notri
96 153 arniml
    generic map (
97
      -- we don't need explicit gating of input ports
98
      -- this is done implicitely by the bidirectional pads
99
      gate_port_input_g => 0
100
    )
101
 
102 7 arniml
    port map (
103 211 arniml
      xtal_i        => xtal_i,
104 220 arniml
      xtal_en_i     => vdd_s,
105 211 arniml
      reset_n_i     => reset_n_i,
106
      t0_i          => t0_b,
107
      t0_o          => t0_s,
108
      t0_dir_o      => t0_dir_s,
109
      int_n_i       => int_n_i,
110
      ea_i          => ea_i,
111
      rd_n_o        => rd_n_o,
112
      psen_n_o      => psen_n_o,
113
      wr_n_o        => wr_n_o,
114
      ale_o         => ale_o,
115
      db_i          => db_b,
116
      db_o          => db_s,
117
      db_dir_o      => db_dir_s,
118
      t1_i          => t1_i,
119
      p2_i          => p2_b,
120
      p2_o          => p2_s,
121
      p2l_low_imp_o => p2l_low_imp_s,
122
      p2h_low_imp_o => p2h_low_imp_s,
123
      p1_i          => p1_b,
124
      p1_o          => p1_s,
125
      p1_low_imp_o  => p1_low_imp_s,
126
      prog_n_o      => prog_n_o
127 7 arniml
    );
128
 
129
  -----------------------------------------------------------------------------
130
  -- Process bidirs
131
  --
132
  -- Purpose:
133
  --   Assign bidirectional signals.
134
  --
135
  bidirs: process (t0_b, t0_s, t0_dir_s,
136
                   db_b, db_s, db_dir_s,
137 32 arniml
                   p1_b, p1_s, p1_low_imp_s,
138 211 arniml
                   p2_b, p2_s, p2l_low_imp_s, p2h_low_imp_s)
139 7 arniml
 
140 213 arniml
    function port_bidir_f(port_value : in std_logic_vector;
141
                          low_imp    : in std_logic) return std_logic_vector is
142
      variable result_v : std_logic_vector(port_value'range);
143 7 arniml
    begin
144 213 arniml
      for idx in port_value'high downto port_value'low loop
145
        if low_imp = '1' then
146
          result_v(idx) := port_value(idx);
147
        elsif port_value(idx) = '0' then
148
          result_v(idx) := '0';
149
        else
150
          result_v(idx) := 'Z';
151
        end if;
152
      end loop;
153 7 arniml
 
154 213 arniml
      return result_v;
155 7 arniml
    end;
156
 
157
  begin
158
    -- Test 0 -----------------------------------------------------------------
159
    if t0_dir_s = '1' then
160
      t0_b <= t0_s;
161
    else
162
      t0_b <= 'Z';
163
    end if;
164
 
165
    -- Data Bus ---------------------------------------------------------------
166
    if db_dir_s = '1' then
167
      db_b <= db_s;
168
    else
169
      db_b <= (others => 'Z');
170
    end if;
171
 
172
    -- Port 1 -----------------------------------------------------------------
173 213 arniml
    p1_b <= port_bidir_f(port_value => p1_s,
174
                         low_imp => p1_low_imp_s);
175 7 arniml
 
176
    -- Port 2 -----------------------------------------------------------------
177 213 arniml
    p2_b(3 downto 0) <= port_bidir_f(port_value => p2_s(3 downto 0),
178
                                     low_imp    => p2l_low_imp_s);
179
    p2_b(7 downto 4) <= port_bidir_f(port_value => p2_s(7 downto 4),
180
                                     low_imp    => p2h_low_imp_s);
181 7 arniml
 
182
  end process bidirs;
183
  --
184
  -----------------------------------------------------------------------------
185
 
186 108 arniml
 
187 7 arniml
end struct;
188
 
189
 
190
-------------------------------------------------------------------------------
191
-- File History:
192
--
193
-- $Log: not supported by cvs2svn $
194 262 arniml
-- Revision 1.10  2006/06/20 00:47:08  arniml
195
-- new input xtal_en_i
196
--
197 220 arniml
-- Revision 1.9  2005/11/02 23:41:43  arniml
198
-- properly drive P1 and P2 with low impedance markers
199
--
200 213 arniml
-- Revision 1.8  2005/11/01 21:38:31  arniml
201
-- wire signals for P2 low impedance marker issue
202
--
203 211 arniml
-- Revision 1.7  2004/12/03 19:44:36  arniml
204
-- removed obsolete constant
205
--
206 157 arniml
-- Revision 1.6  2004/12/02 22:08:42  arniml
207
-- introduced generic gate_port_input_g
208
-- forces masking of P1 and P2 input bus
209
--
210 153 arniml
-- Revision 1.5  2004/12/01 23:09:47  arniml
211
-- intruduced hierarchy t8048_notri where all system functionality
212
-- except bidirectional ports is handled
213
--
214 150 arniml
-- Revision 1.4  2004/10/24 09:10:16  arniml
215
-- Fix for:
216
-- P1 constantly in push-pull mode in t8048
217
--
218 138 arniml
-- Revision 1.3  2004/05/20 21:58:26  arniml
219
-- Fix for:
220
-- External Program Memory ignored when EA = 0
221
--
222 108 arniml
-- Revision 1.2  2004/03/29 19:40:14  arniml
223
-- rename pX_limp to pX_low_imp
224
--
225 32 arniml
-- Revision 1.1  2004/03/24 21:32:27  arniml
226
-- initial check-in
227
--
228 7 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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