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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_2_beta/] [rtl/] [vhdl/] [p1.vhd] - Blame information for rev 294

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 100 arniml
-- $Id: p1.vhd,v 1.3 2004-05-17 14:37:53 arniml Exp $
7 4 arniml
--
8
-- All rights reserved
9
--
10
-- Redistribution and use in source and synthezised forms, with or without
11
-- modification, are permitted provided that the following conditions are met:
12
--
13
-- Redistributions of source code must retain the above copyright notice,
14
-- this list of conditions and the following disclaimer.
15
--
16
-- Redistributions in synthesized form must reproduce the above copyright
17
-- notice, this list of conditions and the following disclaimer in the
18
-- documentation and/or other materials provided with the distribution.
19
--
20
-- Neither the name of the author nor the names of other contributors may
21
-- be used to endorse or promote products derived from this software without
22
-- specific prior written permission.
23
--
24
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
28
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
-- POSSIBILITY OF SUCH DAMAGE.
35
--
36
-- Please report bugs to the author, but before you do so, please
37
-- make sure that this is not a derivative work and that
38
-- you have the latest version of this file.
39
--
40
-- The latest version of this file can be found at:
41
--      http://www.opencores.org/cvsweb.shtml/t48/
42
--
43
-------------------------------------------------------------------------------
44
 
45
library ieee;
46
use ieee.std_logic_1164.all;
47
 
48
use work.t48_pack.word_t;
49
 
50
entity p1 is
51
 
52
  port (
53
    -- Global Interface -------------------------------------------------------
54 32 arniml
    clk_i        : in  std_logic;
55
    res_i        : in  std_logic;
56
    en_clk_i     : in  boolean;
57 4 arniml
    -- T48 Bus Interface ------------------------------------------------------
58 32 arniml
    data_i       : in  word_t;
59
    data_o       : out word_t;
60
    write_p1_i   : in  boolean;
61
    read_p1_i    : in  boolean;
62
    read_reg_i   : in  boolean;
63 4 arniml
    -- Port 1 Interface -------------------------------------------------------
64 32 arniml
    p1_i         : in  word_t;
65
    p1_o         : out word_t;
66
    p1_low_imp_o : out std_logic
67 4 arniml
  );
68
 
69
end p1;
70
 
71
 
72
use work.t48_pack.clk_active_c;
73
use work.t48_pack.res_active_c;
74
use work.t48_pack.bus_idle_level_c;
75
 
76
architecture rtl of p1 is
77
 
78
  -- the port output register
79
  signal p1_q   : word_t;
80
 
81
  -- the low impedance marker
82 32 arniml
  signal low_imp_q : std_logic;
83 4 arniml
 
84
begin
85
 
86
  -----------------------------------------------------------------------------
87
  -- Process p1_reg
88
  --
89
  -- Purpose:
90
  --   Implements the port output register.
91
  --
92
  p1_reg: process (res_i, clk_i)
93
  begin
94
    if res_i = res_active_c then
95 32 arniml
      p1_q          <= (others => '1');
96
      low_imp_q     <= '0';
97 4 arniml
 
98
    elsif clk_i'event and clk_i = clk_active_c then
99
      if en_clk_i then
100
 
101
        if write_p1_i then
102 32 arniml
          p1_q      <= data_i;
103
          low_imp_q <= '1';
104 4 arniml
        else
105 32 arniml
          low_imp_q <= '0';
106 4 arniml
        end if;
107
 
108
      end if;
109
 
110
    end if;
111
 
112
  end process p1_reg;
113
  --
114
  -----------------------------------------------------------------------------
115
 
116
 
117
  -----------------------------------------------------------------------------
118 100 arniml
  -- Process p1_data
119
  --
120
  -- Purpose:
121
  --   Generates the T48 bus data.
122
  --
123
  p1_data: process (read_p1_i,
124
                    p1_i,
125
                    read_reg_i,
126
                    p1_q)
127
  begin
128
    data_o   <= (others => bus_idle_level_c);
129
 
130
    if read_p1_i then
131
      if read_reg_i then
132
        data_o <= p1_q;
133
      else
134
        data_o <= p1_i;
135
      end if;
136
    end if;
137
 
138
  end process p1_data;
139
  --
140
  -----------------------------------------------------------------------------
141
 
142
 
143
  -----------------------------------------------------------------------------
144 4 arniml
  -- Output Mapping.
145
  -----------------------------------------------------------------------------
146 32 arniml
  p1_o         <= p1_q;
147
  p1_low_imp_o <= low_imp_q;
148 4 arniml
 
149
end rtl;
150
 
151
 
152
-------------------------------------------------------------------------------
153
-- File History:
154
--
155
-- $Log: not supported by cvs2svn $
156 100 arniml
-- Revision 1.2  2004/03/29 19:39:58  arniml
157
-- rename pX_limp to pX_low_imp
158
--
159 32 arniml
-- Revision 1.1  2004/03/23 21:31:52  arniml
160
-- initial check-in
161 4 arniml
--
162
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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