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

Subversion Repositories t48

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

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

Line No. Rev Author Line
1 148 arniml
-------------------------------------------------------------------------------
2
--
3
-- T8048 Microcontroller System
4
-- 8048 toplevel without tri-states
5
--
6 262 arniml
-- $Id: t8048_notri.vhd,v 1.7 2006-07-14 01:13:32 arniml Exp $
7
-- $Name: not supported by cvs2svn $
8 148 arniml
--
9
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
10
--
11
-- All rights reserved
12
--
13
-- Redistribution and use in source and synthezised forms, with or without
14
-- modification, are permitted provided that the following conditions are met:
15
--
16
-- Redistributions of source code must retain the above copyright notice,
17
-- this list of conditions and the following disclaimer.
18
--
19
-- Redistributions in synthesized form must reproduce the above copyright
20
-- notice, this list of conditions and the following disclaimer in the
21
-- documentation and/or other materials provided with the distribution.
22
--
23
-- Neither the name of the author nor the names of other contributors may
24
-- be used to endorse or promote products derived from this software without
25
-- specific prior written permission.
26
--
27
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
29
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
31
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37
-- POSSIBILITY OF SUCH DAMAGE.
38
--
39
-- Please report bugs to the author, but before you do so, please
40
-- make sure that this is not a derivative work and that
41
-- you have the latest version of this file.
42
--
43
-- The latest version of this file can be found at:
44
--      http://www.opencores.org/cvsweb.shtml/t48/
45
--
46
-------------------------------------------------------------------------------
47
 
48
library ieee;
49
use ieee.std_logic_1164.all;
50
 
51
entity t8048_notri is
52
 
53 153 arniml
  generic (
54
    gate_port_input_g : integer := 1
55
  );
56
 
57 148 arniml
  port (
58 211 arniml
    xtal_i        : in  std_logic;
59 220 arniml
    xtal_en_i     : in  std_logic;
60 211 arniml
    reset_n_i     : in  std_logic;
61
    t0_i          : in  std_logic;
62
    t0_o          : out std_logic;
63
    t0_dir_o      : out std_logic;
64
    int_n_i       : in  std_logic;
65
    ea_i          : in  std_logic;
66
    rd_n_o        : out std_logic;
67
    psen_n_o      : out std_logic;
68
    wr_n_o        : out std_logic;
69
    ale_o         : out std_logic;
70
    db_i          : in  std_logic_vector( 7 downto 0);
71
    db_o          : out std_logic_vector( 7 downto 0);
72
    db_dir_o      : out std_logic;
73
    t1_i          : in  std_logic;
74
    p2_i          : in  std_logic_vector( 7 downto 0);
75
    p2_o          : out std_logic_vector( 7 downto 0);
76
    p2l_low_imp_o : out std_logic;
77
    p2h_low_imp_o : out std_logic;
78
    p1_i          : in  std_logic_vector( 7 downto 0);
79
    p1_o          : out std_logic_vector( 7 downto 0);
80
    p1_low_imp_o  : out std_logic;
81
    prog_n_o      : out std_logic
82 148 arniml
  );
83
 
84
end t8048_notri;
85
 
86
 
87
library ieee;
88
use ieee.numeric_std.all;
89
 
90
use work.t48_core_comp_pack.t48_core;
91 225 arniml
use work.t48_core_comp_pack.t48_rom;
92
use work.t48_core_comp_pack.generic_ram_ena;
93 148 arniml
 
94
architecture struct of t8048_notri is
95
 
96
  -- Address width of internal ROM
97
  constant rom_addr_width_c : natural := 10;
98
 
99
  signal xtal3_s          : std_logic;
100
  signal dmem_addr_s      : std_logic_vector( 7 downto 0);
101
  signal dmem_we_s        : std_logic;
102
  signal dmem_data_from_s : std_logic_vector( 7 downto 0);
103
  signal dmem_data_to_s   : std_logic_vector( 7 downto 0);
104
  signal pmem_addr_s      : std_logic_vector(11 downto 0);
105
  signal pmem_data_s      : std_logic_vector( 7 downto 0);
106
 
107
  signal ea_s             : std_logic;
108
 
109 153 arniml
  signal p1_in_s,
110
         p1_out_s         : std_logic_vector( 7 downto 0);
111
  signal p2_in_s,
112
         p2_out_s         : std_logic_vector( 7 downto 0);
113
 
114 225 arniml
  signal vdd_s            : std_logic;
115
 
116 148 arniml
begin
117
 
118 225 arniml
  vdd_s <= '1';
119
 
120 153 arniml
  -----------------------------------------------------------------------------
121
  -- Check generics for valid values.
122
  -----------------------------------------------------------------------------
123
  -- pragma translate_off
124
  assert gate_port_input_g = 0 or gate_port_input_g = 1
125
    report "gate_port_input_g must be either 1 or 0!"
126
    severity failure;
127
  -- pragma translate_on
128
 
129
 
130 148 arniml
  t48_core_b : t48_core
131
    generic map (
132
      xtal_div_3_g        => 1,
133
      register_mnemonic_g => 1,
134
      include_port1_g     => 1,
135
      include_port2_g     => 1,
136
      include_bus_g       => 1,
137
      include_timer_g     => 1,
138
      sample_t1_state_g   => 4
139
    )
140
    port map (
141 211 arniml
      xtal_i        => xtal_i,
142 220 arniml
      xtal_en_i     => xtal_en_i,
143 211 arniml
      reset_i       => reset_n_i,
144
      t0_i          => t0_i,
145
      t0_o          => t0_o,
146
      t0_dir_o      => t0_dir_o,
147
      int_n_i       => int_n_i,
148
      ea_i          => ea_s,
149
      rd_n_o        => rd_n_o,
150
      psen_n_o      => psen_n_o,
151
      wr_n_o        => wr_n_o,
152
      ale_o         => ale_o,
153
      db_i          => db_i,
154
      db_o          => db_o,
155
      db_dir_o      => db_dir_o,
156
      t1_i          => t1_i,
157
      p2_i          => p2_in_s,
158
      p2_o          => p2_out_s,
159
      p2l_low_imp_o => p2l_low_imp_o,
160
      p2h_low_imp_o => p2h_low_imp_o,
161
      p1_i          => p1_in_s,
162
      p1_o          => p1_out_s,
163
      p1_low_imp_o  => p1_low_imp_o,
164
      prog_n_o      => prog_n_o,
165
      clk_i         => xtal_i,
166
      en_clk_i      => xtal3_s,
167
      xtal3_o       => xtal3_s,
168
      dmem_addr_o   => dmem_addr_s,
169
      dmem_we_o     => dmem_we_s,
170
      dmem_data_i   => dmem_data_from_s,
171
      dmem_data_o   => dmem_data_to_s,
172
      pmem_addr_o   => pmem_addr_s,
173
      pmem_data_i   => pmem_data_s
174 148 arniml
    );
175
 
176
 
177
  -----------------------------------------------------------------------------
178 153 arniml
  -- Gate port 1 and 2 input bus with respetive output value
179
  -----------------------------------------------------------------------------
180
  gate_ports: if gate_port_input_g = 1 generate
181
    p1_in_s <= p1_i and p1_out_s;
182
    p2_in_s <= p2_i and p2_out_s;
183
  end generate;
184
 
185
  pass_ports: if gate_port_input_g = 0 generate
186
    p1_in_s <= p1_i;
187
    p2_in_s <= p2_i;
188
  end generate;
189
 
190
  p1_o <= p1_out_s;
191
  p2_o <= p2_out_s;
192
 
193
 
194
  -----------------------------------------------------------------------------
195 148 arniml
  -- Process ea
196
  --
197
  -- Purpose:
198
  --   Detects access to external program memory.
199
  --   Either by ea_i = '1' or when program memory address leaves address
200
  --   range of internal ROM.
201
  --
202
  ea: process (ea_i,
203
               pmem_addr_s)
204
  begin
205
    if ea_i = '1' then
206
      -- Forced external access
207
      ea_s <= '1';
208
 
209
    elsif unsigned(pmem_addr_s(11 downto rom_addr_width_c)) = 0 then
210
      -- Internal access
211
      ea_s <= '0';
212
 
213
    else
214
      -- Access to program memory out of internal range
215
      ea_s <= '1';
216
 
217
    end if;
218
 
219
  end process ea;
220
  --
221
  -----------------------------------------------------------------------------
222
 
223
 
224 225 arniml
  rom_1k_b : t48_rom
225 148 arniml
    port map (
226
      clk_i      => xtal_i,
227
      rom_addr_i => pmem_addr_s(rom_addr_width_c-1 downto 0),
228
      rom_data_o => pmem_data_s
229
    );
230
 
231 225 arniml
  ram_64_b : generic_ram_ena
232 148 arniml
    generic map (
233 225 arniml
      addr_width_g => 6,
234
      data_width_g => 8
235 148 arniml
    )
236
    port map (
237 225 arniml
      clk_i => xtal_i,
238
      a_i   => dmem_addr_s(5 downto 0),
239
      we_i  => dmem_we_s,
240
      ena_i => vdd_s,
241
      d_i   => dmem_data_to_s,
242
      d_o   => dmem_data_from_s
243 148 arniml
    );
244
 
245
end struct;
246
 
247
 
248
-------------------------------------------------------------------------------
249
-- File History:
250 149 arniml
--
251
-- $Log: not supported by cvs2svn $
252 262 arniml
-- Revision 1.6  2006/06/21 01:02:16  arniml
253
-- replaced syn_rom and syn_ram with t48_rom and generic_ram_ena
254
--
255 225 arniml
-- Revision 1.5  2006/06/20 00:47:08  arniml
256
-- new input xtal_en_i
257
--
258 220 arniml
-- Revision 1.4  2005/11/01 21:38:48  arniml
259
-- wire signals for P2 low impedance marker issue
260
--
261 211 arniml
-- Revision 1.3  2004/12/02 22:08:42  arniml
262
-- introduced generic gate_port_input_g
263
-- forces masking of P1 and P2 input bus
264
--
265 153 arniml
-- Revision 1.2  2004/12/01 23:08:08  arniml
266
-- update
267
--
268 148 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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