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

Subversion Repositories t400

[/] [t400/] [trunk/] [rtl/] [vhdl/] [t400_io_pack-p.vhd] - Blame information for rev 179

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arniml
-------------------------------------------------------------------------------
2
--
3 179 arniml
-- $Id: t400_io_pack-p.vhd 179 2009-04-01 19:48:38Z arniml $
4 2 arniml
--
5
-- Copyright (c) 2006, Arnim Laeuger (arniml@opencores.org)
6
--
7
-- All rights reserved
8
--
9
-------------------------------------------------------------------------------
10
 
11
library ieee;
12
use ieee.std_logic_1164.all;
13
 
14
package t400_io_pack is
15
 
16
  function io_out_f(dat : in std_logic;
17
                    opt : in integer) return std_logic;
18
 
19
  function io_en_f (en  : in std_logic;
20
                    dat : in std_logic;
21
                    opt : in integer) return std_logic;
22
 
23
end t400_io_pack;
24
 
25
 
26
use work.t400_opt_pack.all;
27
 
28
package body t400_io_pack is
29
 
30
  function io_out_f(dat : in std_logic;
31
                    opt : in integer) return std_logic is
32
    variable result_v : std_logic;
33
  begin
34
    result_v := '-';
35
 
36
    case opt is
37
      -- Open drain type output drivers ---------------------------------------
38
      when t400_opt_out_type_od_c  =>
39
        result_v := '0';
40
 
41
      -- Push/pull type output drivers ----------------------------------------
42
      when t400_opt_out_type_std_c |
43
           t400_opt_out_type_led_c |
44
           t400_opt_out_type_pp_c  =>
45
        result_v := dat;
46
 
47
      when others =>
48
        null;
49
    end case;
50
 
51
    return result_v;
52
  end io_out_f;
53
 
54
 
55
  function io_en_f (en  : in std_logic;
56
                    dat : in std_logic;
57
                    opt : in integer) return std_logic is
58
    variable result_v : std_logic;
59
  begin
60
    result_v := '0';
61
 
62
    case opt is
63
      -- Open drain type output drivers ---------------------------------------
64
      when t400_opt_out_type_od_c  =>
65
        if en = '1' and dat = '0' then
66
          result_v := '1';
67
        end if;
68
 
69
      -- Push/pull type output drivers ----------------------------------------
70
      when t400_opt_out_type_std_c |
71
           t400_opt_out_type_led_c |
72
           t400_opt_out_type_pp_c  =>
73
        result_v := en;
74
 
75
      when others =>
76
        null;
77
    end case;
78
 
79
    return result_v;
80
  end io_en_f;
81
 
82
end t400_io_pack;

powered by: WebSVN 2.1.0

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