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

Subversion Repositories ps2

[/] [ps2/] [trunk/] [rtl/] [verilog/] [ps2_top.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  ps2_top.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
//
47
 
48
`include "ps2_defines.v"
49
// synopsys translate_off
50
`include "timescale.v"
51
// synopsys translate_on
52
 
53
module ps2_top
54
(
55
    wb_clk_i,
56
    wb_rst_i,
57
    wb_cyc_i,
58
    wb_stb_i,
59
    wb_we_i,
60
    wb_sel_i,
61
    wb_adr_i,
62
    wb_dat_i,
63
    wb_dat_o,
64
    wb_ack_o,
65
 
66
    wb_int_o,
67
 
68
    ps2_kbd_clk_pad_i,
69
    ps2_kbd_data_pad_i,
70
    ps2_kbd_clk_pad_o,
71
    ps2_kbd_data_pad_o,
72
    ps2_kbd_clk_pad_oe_o,
73
    ps2_kbd_data_pad_oe_o
74
) ;
75
 
76
input wb_clk_i,
77
      wb_rst_i,
78
      wb_cyc_i,
79
      wb_stb_i,
80
      wb_we_i ;
81
 
82
input [3:0] wb_sel_i ;
83
 
84
input [31:0]wb_adr_i,
85
            wb_dat_i ;
86
 
87
output [31:0] wb_dat_o ;
88
 
89
output wb_ack_o ;
90
 
91
output wb_int_o ;
92
 
93
input ps2_kbd_clk_pad_i,
94
      ps2_kbd_data_pad_i ;
95
 
96
output ps2_kbd_clk_pad_o,
97
       ps2_kbd_data_pad_o,
98
       ps2_kbd_clk_pad_oe_o,
99
       ps2_kbd_data_pad_oe_o ;
100
 
101
wire rx_extended,
102
     rx_released,
103
     rx_shift_key_on,
104
     rx_data_ready,
105
     rx_translated_data_ready,
106
     rx_read_wb,
107
     rx_read_tt,
108
     tx_write,
109
     tx_write_ack,
110
     tx_error_no_keyboard_ack,
111
     ps2_ctrl_kbd_data_en_,
112
     ps2_ctrl_kbd_clk_en_,
113
     ps2_ctrl_kbd_clk,
114
     inhibit_kbd_if ;
115
 
116
wire [7:0] rx_scan_code,
117
           rx_translated_scan_code,
118
           rx_ascii,
119
           tx_data ;
120
 
121
assign ps2_kbd_clk_pad_o  = 1'b0 ;
122
assign ps2_kbd_data_pad_o = 1'b0 ;
123
 
124
ps2_io_ctrl i_ps2_io_ctrl
125
(
126
    .clk_i                   (wb_clk_i),
127
    .rst_i                   (wb_rst_i),
128
    .ps2_ctrl_kbd_clk_en_i_  (ps2_ctrl_kbd_clk_en_),
129
    .ps2_ctrl_kbd_data_en_i_ (ps2_ctrl_kbd_data_en_),
130
    .ps2_kbd_clk_pad_i       (ps2_kbd_clk_pad_i),
131
    .ps2_kbd_clk_pad_oe_o    (ps2_kbd_clk_pad_oe_o),
132
    .ps2_kbd_data_pad_oe_o   (ps2_kbd_data_pad_oe_o),
133
    .inhibit_kbd_if_i        (inhibit_kbd_if),
134
    .ps2_ctrl_kbd_clk_o      (ps2_ctrl_kbd_clk)
135
);
136
 
137
ps2_keyboard #(`PS2_TIMER_60USEC_VALUE_PP, `PS2_TIMER_60USEC_BITS_PP, `PS2_TIMER_5USEC_VALUE_PP, `PS2_TIMER_5USEC_BITS_PP, 0)
138
i_ps2_keyboard
139
(
140
    .clk                         (wb_clk_i),
141
    .reset                       (wb_rst_i),
142
    .ps2_clk_en_o_               (ps2_ctrl_kbd_clk_en_),
143
    .ps2_data_en_o_              (ps2_ctrl_kbd_data_en_),
144
    .ps2_clk_i                   (ps2_ctrl_kbd_clk),
145
    .ps2_data_i                  (ps2_kbd_data_pad_i),
146
    .rx_extended                 (rx_extended),
147
    .rx_released                 (rx_released),
148
    .rx_shift_key_on             (rx_shift_key_on),
149
    .rx_scan_code                (rx_scan_code),
150
    .rx_ascii                    (rx_ascii),
151
    .rx_data_ready               (rx_data_ready),
152
    .rx_read                     (rx_read_tt),
153
    .tx_data                     (tx_data),
154
    .tx_write                    (tx_write),
155
    .tx_write_ack_o              (tx_write_ack),
156
    .tx_error_no_keyboard_ack    (tx_error_no_keyboard_ack),
157
    .translate                   (translate)
158
);
159
 
160
ps2_wb_if i_ps2_wb_if
161
(
162
    .wb_clk_i                      (wb_clk_i),
163
    .wb_rst_i                      (wb_rst_i),
164
    .wb_cyc_i                      (wb_cyc_i),
165
    .wb_stb_i                      (wb_stb_i),
166
    .wb_we_i                       (wb_we_i),
167
    .wb_sel_i                      (wb_sel_i),
168
    .wb_adr_i                      (wb_adr_i),
169
    .wb_dat_i                      (wb_dat_i),
170
    .wb_dat_o                      (wb_dat_o),
171
    .wb_ack_o                      (wb_ack_o),
172
 
173
    .wb_int_o                      (wb_int_o),
174
 
175
    .rx_scancode_i                 (rx_translated_scan_code),
176
    .rx_data_ready_i               (rx_translated_data_ready),
177
    .rx_read_o                     (rx_read_wb),
178
    .tx_data_o                     (tx_data),
179
    .tx_write_o                    (tx_write),
180
    .tx_write_ack_i                (tx_write_ack),
181
    .translate_o                   (translate),
182
    .ps2_clk_i                     (ps2_kbd_clk_pad_i),
183
    .inhibit_kbd_if_o              (inhibit_kbd_if)
184
) ;
185
 
186
ps2_translation_table i_ps2_translation_table
187
(
188
    .reset_i                    (wb_rst_i),
189
    .clock_i                    (wb_clk_i),
190
    .translate_i                (translate),
191
    .code_i                     (rx_scan_code),
192
    .code_o                     (rx_translated_scan_code),
193
    .address_i                  (8'h00),
194
    .data_i                     (8'h00),
195
    .we_i                       (1'b0),
196
    .re_i                       (1'b0),
197
    .data_o                     (),
198
    .rx_data_ready_i            (rx_data_ready),
199
    .rx_translated_data_ready_o (rx_translated_data_ready),
200
    .rx_read_i                  (rx_read_wb),
201
    .rx_read_o                  (rx_read_tt),
202
    .rx_released_i              (rx_released),
203
    .rx_extended_i              (rx_extended)
204
) ;
205
 
206
endmodule // ps2_top

powered by: WebSVN 2.1.0

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