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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [orp/] [orp_soc/] [rtl/] [verilog/] [ps2.old/] [ps2_io_ctrl.v] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 746 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  ps2_io_ctrl.v                                               ////
4
////                                                              ////
5
////  This file is part of the "ps2" project                      ////
6
////  http://www.opencores.org/cores/ps2/                         ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - mihad@opencores.org                                   ////
10
////      - Miha Dolenc                                           ////
11
////                                                              ////
12
////  All additional information is avaliable in the README.txt   ////
13
////  file.                                                       ////
14
////                                                              ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2000 Miha Dolenc, mihad@opencores.org          ////
19
////                                                              ////
20
//// This source file may be used and distributed without         ////
21
//// restriction provided that this copyright statement is not    ////
22
//// removed from the file and that any derivative work contains  ////
23
//// the original copyright notice and the associated disclaimer. ////
24
////                                                              ////
25
//// This source file is free software; you can redistribute it   ////
26
//// and/or modify it under the terms of the GNU Lesser General   ////
27
//// Public License as published by the Free Software Foundation; ////
28
//// either version 2.1 of the License, or (at your option) any   ////
29
//// later version.                                               ////
30
////                                                              ////
31
//// This source is distributed in the hope that it will be       ////
32
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
33
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
34
//// PURPOSE.  See the GNU Lesser General Public License for more ////
35
//// details.                                                     ////
36
////                                                              ////
37
//// You should have received a copy of the GNU Lesser General    ////
38
//// Public License along with this source; if not, download it   ////
39
//// from http://www.opencores.org/lgpl.shtml                     ////
40
////                                                              ////
41
//////////////////////////////////////////////////////////////////////
42
//
43
// CVS Revision History
44
//
45
// $Log: not supported by cvs2svn $
46
// Revision 1.1.1.1  2002/02/18 16:16:56  mihad
47
// Initial project import - working
48
//
49
//
50
 
51
// synopsys translate_off
52
`include "timescale.v"
53
// synopsys translate_on
54
 
55
module ps2_io_ctrl
56
(
57
    clk_i,
58
    rst_i,
59
    ps2_ctrl_kbd_clk_en_i_,
60
    ps2_ctrl_kbd_data_en_i_,
61
    ps2_kbd_clk_pad_i,
62
    ps2_kbd_clk_pad_oe_o,
63
    ps2_kbd_data_pad_oe_o,
64
    inhibit_kbd_if_i,
65
    ps2_ctrl_kbd_clk_o
66
);
67
 
68
input clk_i,
69
      rst_i,
70
      ps2_ctrl_kbd_clk_en_i_,
71
      ps2_ctrl_kbd_data_en_i_,
72
      ps2_kbd_clk_pad_i,
73
      inhibit_kbd_if_i ;
74
 
75
output ps2_kbd_clk_pad_oe_o,
76
       ps2_kbd_data_pad_oe_o,
77
       ps2_ctrl_kbd_clk_o ;
78
 
79
reg    ps2_kbd_clk_pad_oe_o,
80
       ps2_kbd_data_pad_oe_o ;
81
 
82
always@(posedge clk_i or posedge rst_i)
83
begin
84
    if ( rst_i )
85
    begin
86
        ps2_kbd_clk_pad_oe_o  <= #1 1'b0 ;
87
        ps2_kbd_data_pad_oe_o <= #1 1'b0 ;
88
    end
89
    else
90
    begin
91
        ps2_kbd_clk_pad_oe_o  <= #1 !ps2_ctrl_kbd_clk_en_i_ || inhibit_kbd_if_i ;
92
        ps2_kbd_data_pad_oe_o <= #1 !ps2_ctrl_kbd_data_en_i_ ;
93
    end
94
end
95
 
96
reg inhibit_kbd_if_previous ;
97
always@(posedge clk_i or posedge rst_i)
98
begin
99
    if ( rst_i )
100
        inhibit_kbd_if_previous <= #1 1'b1 ;
101
    else
102
        inhibit_kbd_if_previous <= #1 inhibit_kbd_if_i ;
103
end
104
 
105
assign ps2_ctrl_kbd_clk_o = ps2_kbd_clk_pad_i || ps2_kbd_clk_pad_oe_o && inhibit_kbd_if_previous ;
106
endmodule // ps2_io_ctrl

powered by: WebSVN 2.1.0

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