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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_6_1_beta/] [rtl/] [vhdl/] [p1.vhd] - Blame information for rev 256

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

Line No. Rev Author Line
1 4 arniml
-------------------------------------------------------------------------------
2
--
3
-- The Port 1 unit.
4
-- Implements the Port 1 logic.
5
--
6 179 arniml
-- $Id: p1.vhd,v 1.5 2005-06-11 10:08:43 arniml Exp $
7 4 arniml
--
8 129 arniml
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
9
--
10 4 arniml
-- 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
use work.t48_pack.word_t;
51
 
52 179 arniml
entity t48_p1 is
53 4 arniml
 
54
  port (
55
    -- Global Interface -------------------------------------------------------
56 32 arniml
    clk_i        : in  std_logic;
57
    res_i        : in  std_logic;
58
    en_clk_i     : in  boolean;
59 4 arniml
    -- T48 Bus Interface ------------------------------------------------------
60 32 arniml
    data_i       : in  word_t;
61
    data_o       : out word_t;
62
    write_p1_i   : in  boolean;
63
    read_p1_i    : in  boolean;
64
    read_reg_i   : in  boolean;
65 4 arniml
    -- Port 1 Interface -------------------------------------------------------
66 32 arniml
    p1_i         : in  word_t;
67
    p1_o         : out word_t;
68
    p1_low_imp_o : out std_logic
69 4 arniml
  );
70
 
71 179 arniml
end t48_p1;
72 4 arniml
 
73
 
74
use work.t48_pack.clk_active_c;
75
use work.t48_pack.res_active_c;
76
use work.t48_pack.bus_idle_level_c;
77
 
78 179 arniml
architecture rtl of t48_p1 is
79 4 arniml
 
80
  -- the port output register
81
  signal p1_q   : word_t;
82
 
83
  -- the low impedance marker
84 32 arniml
  signal low_imp_q : std_logic;
85 4 arniml
 
86
begin
87
 
88
  -----------------------------------------------------------------------------
89
  -- Process p1_reg
90
  --
91
  -- Purpose:
92
  --   Implements the port output register.
93
  --
94
  p1_reg: process (res_i, clk_i)
95
  begin
96
    if res_i = res_active_c then
97 32 arniml
      p1_q          <= (others => '1');
98
      low_imp_q     <= '0';
99 4 arniml
 
100
    elsif clk_i'event and clk_i = clk_active_c then
101
      if en_clk_i then
102
 
103
        if write_p1_i then
104 32 arniml
          p1_q      <= data_i;
105
          low_imp_q <= '1';
106 4 arniml
        else
107 32 arniml
          low_imp_q <= '0';
108 4 arniml
        end if;
109
 
110
      end if;
111
 
112
    end if;
113
 
114
  end process p1_reg;
115
  --
116
  -----------------------------------------------------------------------------
117
 
118
 
119
  -----------------------------------------------------------------------------
120 100 arniml
  -- Process p1_data
121
  --
122
  -- Purpose:
123
  --   Generates the T48 bus data.
124
  --
125
  p1_data: process (read_p1_i,
126
                    p1_i,
127
                    read_reg_i,
128
                    p1_q)
129
  begin
130
    data_o   <= (others => bus_idle_level_c);
131
 
132
    if read_p1_i then
133
      if read_reg_i then
134
        data_o <= p1_q;
135
      else
136
        data_o <= p1_i;
137
      end if;
138
    end if;
139
 
140
  end process p1_data;
141
  --
142
  -----------------------------------------------------------------------------
143
 
144
 
145
  -----------------------------------------------------------------------------
146 4 arniml
  -- Output Mapping.
147
  -----------------------------------------------------------------------------
148 32 arniml
  p1_o         <= p1_q;
149
  p1_low_imp_o <= low_imp_q;
150 4 arniml
 
151
end rtl;
152
 
153
 
154
-------------------------------------------------------------------------------
155
-- File History:
156
--
157
-- $Log: not supported by cvs2svn $
158 179 arniml
-- Revision 1.4  2004/07/11 16:51:33  arniml
159
-- cleanup copyright notice
160
--
161 129 arniml
-- Revision 1.3  2004/05/17 14:37:53  arniml
162
-- reorder data_o generation
163
--
164 100 arniml
-- Revision 1.2  2004/03/29 19:39:58  arniml
165
-- rename pX_limp to pX_low_imp
166
--
167 32 arniml
-- Revision 1.1  2004/03/23 21:31:52  arniml
168
-- initial check-in
169 4 arniml
--
170
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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