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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_6__beta/] [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 157 arniml
-- $Id: t8048.vhd,v 1.7 2004-12-03 19:44:36 arniml Exp $
6 7 arniml
--
7
-- Copyright (c) 2004, 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/t48/
43
--
44
-------------------------------------------------------------------------------
45
 
46
library ieee;
47
use ieee.std_logic_1164.all;
48
 
49
entity t8048 is
50
 
51
  port (
52
    xtal_i    : in    std_logic;
53
    reset_n_i : in    std_logic;
54
    t0_b      : inout std_logic;
55
    int_n_i   : in    std_logic;
56
    ea_i      : in    std_logic;
57
    rd_n_o    : out   std_logic;
58
    psen_n_o  : out   std_logic;
59
    wr_n_o    : out   std_logic;
60
    ale_o     : out   std_logic;
61
    db_b      : inout std_logic_vector( 7 downto 0);
62
    t1_i      : in    std_logic;
63
    p2_b      : inout std_logic_vector( 7 downto 0);
64
    p1_b      : inout std_logic_vector( 7 downto 0);
65
    prog_n_o  : out   std_logic
66
  );
67
 
68
end t8048;
69
 
70
 
71 108 arniml
library ieee;
72
use ieee.numeric_std.all;
73
 
74 150 arniml
use work.t48_system_comp_pack.t8048_notri;
75 7 arniml
 
76
architecture struct of t8048 is
77
 
78
  signal t0_s             : std_logic;
79
  signal t0_dir_s         : std_logic;
80
  signal db_s             : std_logic_vector( 7 downto 0);
81
  signal db_dir_s         : std_logic;
82
  signal p2_s             : std_logic_vector( 7 downto 0);
83 32 arniml
  signal p2_low_imp_s     : std_logic;
84 7 arniml
  signal p1_s             : std_logic_vector( 7 downto 0);
85 32 arniml
  signal p1_low_imp_s     : std_logic;
86 7 arniml
 
87
begin
88
 
89 150 arniml
  t8048_notri_b : t8048_notri
90 153 arniml
    generic map (
91
      -- we don't need explicit gating of input ports
92
      -- this is done implicitely by the bidirectional pads
93
      gate_port_input_g => 0
94
    )
95
 
96 7 arniml
    port map (
97 32 arniml
      xtal_i       => xtal_i,
98 150 arniml
      reset_n_i    => reset_n_i,
99 32 arniml
      t0_i         => t0_b,
100
      t0_o         => t0_s,
101
      t0_dir_o     => t0_dir_s,
102
      int_n_i      => int_n_i,
103 150 arniml
      ea_i         => ea_i,
104 32 arniml
      rd_n_o       => rd_n_o,
105
      psen_n_o     => psen_n_o,
106
      wr_n_o       => wr_n_o,
107
      ale_o        => ale_o,
108
      db_i         => db_b,
109
      db_o         => db_s,
110
      db_dir_o     => db_dir_s,
111
      t1_i         => t1_i,
112
      p2_i         => p2_b,
113
      p2_o         => p2_s,
114
      p2_low_imp_o => p2_low_imp_s,
115
      p1_i         => p1_b,
116
      p1_o         => p1_s,
117
      p1_low_imp_o => p1_low_imp_s,
118 150 arniml
      prog_n_o     => prog_n_o
119 7 arniml
    );
120
 
121
  -----------------------------------------------------------------------------
122
  -- Process bidirs
123
  --
124
  -- Purpose:
125
  --   Assign bidirectional signals.
126
  --
127
  bidirs: process (t0_b, t0_s, t0_dir_s,
128
                   db_b, db_s, db_dir_s,
129 32 arniml
                   p1_b, p1_s, p1_low_imp_s,
130
                   p2_b, p2_s, p2_low_imp_s)
131 7 arniml
 
132
    function open_collector_f(sig : std_logic) return std_logic is
133
      variable sig_v : std_logic;
134
    begin
135
      sig_v   := 'Z';
136
 
137
      if sig = '0' then
138
        sig_v := '0';
139
      end if;
140
 
141
      return sig_v;
142
    end;
143
 
144
  begin
145
    -- Test 0 -----------------------------------------------------------------
146
    if t0_dir_s = '1' then
147
      t0_b <= t0_s;
148
    else
149
      t0_b <= 'Z';
150
    end if;
151
 
152
    -- Data Bus ---------------------------------------------------------------
153
    if db_dir_s = '1' then
154
      db_b <= db_s;
155
    else
156
      db_b <= (others => 'Z');
157
    end if;
158
 
159
    -- Port 1 -----------------------------------------------------------------
160
    for i in p1_b'range loop
161 138 arniml
      p1_b(i) <= open_collector_f(p1_s(i));
162 7 arniml
    end loop;
163 32 arniml
--     if p1_low_imp_s = '1' then
164 7 arniml
--       p1_b <= p1_s;
165
--     else
166
--       p1_b <= (others => 'Z');
167
--     end if;
168
 
169
    -- Port 2 -----------------------------------------------------------------
170
    for i in p2_b'range loop
171
      p2_b(i) <= open_collector_f(p2_s(i));
172
    end loop;
173 32 arniml
--     if p2_low_imp_s = '1' then
174 7 arniml
--       p2_b <= p2_b_s;
175
--     else
176
--       p2_b <= (others => 'Z');
177
--     end if;
178
 
179
  end process bidirs;
180
  --
181
  -----------------------------------------------------------------------------
182
 
183 108 arniml
 
184 7 arniml
end struct;
185
 
186
 
187
-------------------------------------------------------------------------------
188
-- File History:
189
--
190
-- $Log: not supported by cvs2svn $
191 157 arniml
-- Revision 1.6  2004/12/02 22:08:42  arniml
192
-- introduced generic gate_port_input_g
193
-- forces masking of P1 and P2 input bus
194
--
195 153 arniml
-- Revision 1.5  2004/12/01 23:09:47  arniml
196
-- intruduced hierarchy t8048_notri where all system functionality
197
-- except bidirectional ports is handled
198
--
199 150 arniml
-- Revision 1.4  2004/10/24 09:10:16  arniml
200
-- Fix for:
201
-- P1 constantly in push-pull mode in t8048
202
--
203 138 arniml
-- Revision 1.3  2004/05/20 21:58:26  arniml
204
-- Fix for:
205
-- External Program Memory ignored when EA = 0
206
--
207 108 arniml
-- Revision 1.2  2004/03/29 19:40:14  arniml
208
-- rename pX_limp to pX_low_imp
209
--
210 32 arniml
-- Revision 1.1  2004/03/24 21:32:27  arniml
211
-- initial check-in
212
--
213 7 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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