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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [hostController/] [usbHostControl.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// usbHostControl.v                                             ////
4
////                                                              ////
5
//// This file is part of the usbhostslave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
//// 
10
////                                                              ////
11
//// To Do:                                                       ////
12
//// 
13
////                                                              ////
14
//// Author(s):                                                   ////
15
//// - Steve Fielding, sfielding@base2designs.com                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE. See the GNU Lesser General Public License for more  ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from <http://www.opencores.org/lgpl.shtml>                   ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// $Id: usbHostControl.v,v 1.1.1.1 2004-10-11 04:00:56 sfielding Exp $
45
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49
//
50
module usbHostControl(
51
        clk, rst,
52
        //sendPacket
53
        TxFifoRE, TxFifoData, TxFifoEmpty,
54
        //getPacket
55
        RxFifoWE, RxFifoData, RxFifoFull,
56
        RxByteStatus, RxData, RxDataValid,
57
        SIERxTimeOut,
58
        //speedCtrlMux
59
        fullSpeedRate, fullSpeedPol,
60
        //HCTxPortArbiter
61
        HCTxPortEn, HCTxPortRdy,
62
        HCTxPortData, HCTxPortCtrl,
63
        //rxStatusMonitor
64
        connectStateIn,
65
        resumeDetectedIn,
66
  //USBHostControlBI 
67
  busAddress,
68
  busDataIn,
69
  busDataOut,
70
  busWriteEn,
71
  busStrobe_i,
72
        SOFSentIntOut,
73
  connEventIntOut,
74
  resumeIntOut,
75
  transDoneIntOut,
76
  hostControlSelect
77
         );
78
 
79
input clk, rst;
80
//sendPacket
81
output TxFifoRE;
82
input [7:0] TxFifoData;
83
input TxFifoEmpty;
84
//getPacket
85
output RxFifoWE;
86
output [7:0] RxFifoData;
87
input RxFifoFull;
88
input [7:0] RxByteStatus;
89
input [7:0] RxData;
90
input RxDataValid;
91
input SIERxTimeOut;
92
//speedCtrlMux
93
output fullSpeedRate;
94
output fullSpeedPol;
95
//HCTxPortArbiter
96
output HCTxPortEn;
97
input HCTxPortRdy;
98
output [7:0] HCTxPortData;
99
output [7:0] HCTxPortCtrl;
100
//rxStatusMonitor
101
input [1:0] connectStateIn;
102
input resumeDetectedIn;
103
//USBHostControlBI 
104
input [3:0] busAddress;
105
input [7:0] busDataIn;
106
output [7:0] busDataOut;
107
input busWriteEn;
108
input busStrobe_i;
109
output SOFSentIntOut;
110
output connEventIntOut;
111
output resumeIntOut;
112
output transDoneIntOut;
113
input hostControlSelect;
114
 
115
wire clk;
116
wire rst;
117
wire [10:0] frameNum;
118
wire SOFSent;
119
wire TxFifoRE;
120
wire [7:0] TxFifoData;
121
wire TxFifoEmpty;
122
wire RxFifoWE;
123
wire [7:0] RxFifoData;
124
wire RxFifoFull;
125
wire [7:0] RxByteStatus;
126
wire [7:0] RxData;
127
wire RxDataValid;
128
wire SIERxTimeOut;
129
wire fullSpeedRate;
130
wire fullSpeedPol;
131
wire HCTxPortEn;
132
wire HCTxPortRdy;
133
wire [7:0] HCTxPortData;
134
wire [7:0] HCTxPortCtrl;
135
wire [1:0] connectStateIn;
136
wire resumeDetectedIn;
137
wire [3:0] busAddress;
138
wire [7:0] busDataIn;
139
wire [7:0] busDataOut;
140
wire busWriteEn;
141
wire busStrobe_i;
142
wire SOFSentIntOut;
143
wire connEventIntOut;
144
wire resumeIntOut;
145
wire transDoneIntOut;
146
wire hostControlSelect;
147
 
148
//internal wiring
149
wire SOFTimerClr;
150
wire getPacketREn;
151
wire getPacketRdy;
152
wire HCTxGnt;
153
wire HCTxReq;
154
wire [3:0] HC_PID;
155
wire HC_SP_WEn;
156
wire SOFTxGnt;
157
wire SOFTxReq;
158
wire SOF_SP_WEn;
159
wire SOFEnable;
160
wire SOFSyncEn;
161
wire sendPacketCPReadyIn;
162
wire sendPacketCPReadyOut;
163
wire [3:0] sendPacketCPPIDIn;
164
wire [3:0] sendPacketCPPIDOut;
165
wire sendPacketCPWEnIn;
166
wire sendPacketCPWEnOut;
167
wire sendPacketCPFSRate;
168
wire sendPacketCPFSPol;
169
wire sendPacketCPGrabLine;
170
wire [7:0] SOFCntlCntl;
171
wire [7:0] SOFCntlData;
172
wire SOFCntlGnt;
173
wire SOFCntlReq;
174
wire SOFCntlWEn;
175
wire [7:0] directCntlCntl;
176
wire [7:0] directCntlData;
177
wire directCntlGnt;
178
wire directCntlReq;
179
wire directCntlWEn;
180
wire [7:0] sendPacketCntl;
181
wire [7:0] sendPacketData;
182
wire sendPacketGnt;
183
wire sendPacketReq;
184
wire sendPacketWEn;
185
wire [15:0] SOFTimer;
186
wire clrTxReq;
187
wire transDone;
188
wire transReq;
189
wire [1:0] transType;
190
wire preAmbleEnable;
191
wire [1:0] directLineState;
192
wire directLineCtrlEn;
193
wire [6:0] TxAddr;
194
wire [3:0] TxEndP;
195
wire [7:0] RxPktStatus;
196
wire [3:0] RxPID;
197
wire directCtrlRate;
198
wire directCtrlPol;
199
wire [1:0] connectStateOut;
200
wire resumeIntFromRxStatusMon;
201
wire connectionEventFromRxStatusMon;
202
 
203
USBHostControlBI u_USBHostControlBI
204
  (.address(busAddress),
205
  .dataIn(busDataIn),
206
  .dataOut(busDataOut),
207
  .writeEn(busWriteEn),
208
  .strobe_i(busStrobe_i),
209
  .clk(clk),
210
  .rst(rst),
211
        .SOFSentIntOut(SOFSentIntOut),
212
  .connEventIntOut(connEventIntOut),
213
  .resumeIntOut(resumeIntOut),
214
  .transDoneIntOut(transDoneIntOut),
215
  .TxTransTypeReg(transType),
216
  .TxSOFEnableReg(SOFEnable),
217
        .TxAddrReg(TxAddr),
218
  .TxEndPReg(TxEndP),
219
  .frameNumIn(frameNum),
220
  .RxPktStatusIn(RxPktStatus),
221
  .RxPIDIn(RxPID),
222
  .connectStateIn(connectStateOut),
223
        .SOFSentIn(SOFSent),
224
  .connEventIn(connectionEventFromRxStatusMon),
225
  .resumeIntIn(resumeIntFromRxStatusMon),
226
  .transDoneIn(transDone),
227
  .hostControlSelect(hostControlSelect),
228
  .clrTransReq(clrTxReq),
229
  .preambleEn(preAmbleEnable),
230
  .SOFSync(SOFSyncEn),
231
  .TxLineState(directLineState),
232
  .LineDirectControlEn(directLineCtrlEn),
233
  .fullSpeedPol(directCtrlPol),
234
  .fullSpeedRate(directCtrlRate),
235
  .transReq(transReq)
236
 
237
  );
238
 
239
 
240
hostcontroller u_hostController
241
        (.RXStatus(RxPktStatus),
242
        .clearTXReq(clrTxReq),
243
        .clk(clk),
244
        .getPacketREn(getPacketREn),
245
        .getPacketRdy(getPacketRdy),
246
        .rst(rst),
247
        .sendPacketArbiterGnt(HCTxGnt),
248
        .sendPacketArbiterReq(HCTxReq),
249
        .sendPacketPID(HC_PID),
250
        .sendPacketRdy(sendPacketCPReadyOut),
251
        .sendPacketWEn(HC_SP_WEn),
252
        .transDone(transDone),
253
        .transReq(transReq),
254
        .transType(transType) );
255
 
256
SOFController u_SOFController
257
        (.HCTxPortCntl(SOFCntlCntl),
258
        .HCTxPortData(SOFCntlData),
259
        .HCTxPortGnt(SOFCntlGnt),
260
        .HCTxPortRdy(HCTxPortRdy),
261
        .HCTxPortReq(SOFCntlReq),
262
        .HCTxPortWEn(SOFCntlWEn),
263
        .SOFEnable(SOFEnable),
264
        .SOFTimerClr(SOFTimerClr),
265
        .SOFTimer(SOFTimer),
266
        .clk(clk),
267
        .rst(rst) );
268
 
269
SOFTransmit u_SOFTransmit
270
        (.SOFEnable(SOFEnable),
271
        .SOFSent(SOFSent),
272
        .SOFSyncEn(SOFSyncEn),
273
        .SOFTimerClr(SOFTimerClr),
274
        .SOFTimer(SOFTimer),
275
        .clk(clk),
276
        .rst(rst),
277
        .sendPacketArbiterGnt(SOFTxGnt),
278
        .sendPacketArbiterReq(SOFTxReq),
279
        .sendPacketRdy(sendPacketCPReadyOut),
280
        .sendPacketWEn(SOF_SP_WEn) );
281
 
282
 
283
sendPacketArbiter u_sendPacketArbiter
284
        (.HCTxGnt(HCTxGnt),
285
        .HCTxReq(HCTxReq),
286
        .HC_PID(HC_PID),
287
        .HC_SP_WEn(HC_SP_WEn),
288
        .SOFTxGnt(SOFTxGnt),
289
        .SOFTxReq(SOFTxReq),
290
        .SOF_SP_WEn(SOF_SP_WEn),
291
        .clk(clk),
292
        .rst(rst),
293
        .sendPacketPID(sendPacketCPPIDIn),
294
        .sendPacketWEnable(sendPacketCPWEnIn) );
295
 
296
sendPacketCheckPreamble u_sendPacketCheckPreamble
297
        (.sendPacketCPPID(sendPacketCPPIDIn),
298
        .clk(clk),
299
        .fullSpeedBitRate(sendPacketCPFSRate),
300
        .fullSpeedPolarity(sendPacketCPFSPol),
301
        .grabLineControl(sendPacketCPGrabLine),
302
        .preAmbleEnable(preAmbleEnable),
303
        .rst(rst),
304
        .sendPacketCPReady(sendPacketCPReadyOut),
305
        .sendPacketCPWEn(sendPacketCPWEnIn),
306
        .sendPacketPID(sendPacketCPPIDOut),
307
        .sendPacketRdy(sendPacketCPReadyIn),
308
        .sendPacketWEn(sendPacketCPWEnOut) );
309
 
310
sendPacket u_sendPacket
311
        (.HCTxPortCntl(sendPacketCntl),
312
        .HCTxPortData(sendPacketData),
313
        .HCTxPortGnt(sendPacketGnt),
314
        .HCTxPortRdy(HCTxPortRdy),
315
        .HCTxPortReq(sendPacketReq),
316
        .HCTxPortWEn(sendPacketWEn),
317
        .PID(sendPacketCPPIDOut),
318
        .TxAddr(TxAddr),
319
        .TxEndP(TxEndP),
320
        .clk(clk),
321
        .fifoData(TxFifoData),
322
        .fifoEmpty(TxFifoEmpty),
323
        .fifoReadEn(TxFifoRE),
324
        .frameNum(frameNum),
325
        .rst(rst),
326
        .sendPacketRdy(sendPacketCPReadyIn),
327
        .sendPacketWEn(sendPacketCPWEnOut) );
328
 
329
directControl u_directControl
330
        (.HCTxPortCntl(directCntlCntl),
331
        .HCTxPortData(directCntlData),
332
        .HCTxPortGnt(directCntlGnt),
333
        .HCTxPortRdy(HCTxPortRdy),
334
        .HCTxPortReq(directCntlReq),
335
        .HCTxPortWEn(directCntlWEn),
336
        .clk(clk),
337
        .directControlEn(directLineCtrlEn),
338
        .directControlLineState(directLineState),
339
        .rst(rst) );
340
 
341
HCTxPortArbiter u_HCTxPortArbiter
342
        (.HCTxPortCntl(HCTxPortCtrl),
343
        .HCTxPortData(HCTxPortData),
344
        .HCTxPortWEnable(HCTxPortEn),
345
        .SOFCntlCntl(SOFCntlCntl),
346
        .SOFCntlData(SOFCntlData),
347
        .SOFCntlGnt(SOFCntlGnt),
348
        .SOFCntlReq(SOFCntlReq),
349
        .SOFCntlWEn(SOFCntlWEn),
350
        .clk(clk),
351
        .directCntlCntl(directCntlCntl),
352
        .directCntlData(directCntlData),
353
        .directCntlGnt(directCntlGnt),
354
        .directCntlReq(directCntlReq),
355
        .directCntlWEn(directCntlWEn),
356
        .rst(rst),
357
        .sendPacketCntl(sendPacketCntl),
358
        .sendPacketData(sendPacketData),
359
        .sendPacketGnt(sendPacketGnt),
360
        .sendPacketReq(sendPacketReq),
361
        .sendPacketWEn(sendPacketWEn) );
362
 
363
getPacket u_getPacket
364
        (.RXDataIn(RxData),
365
        .RXDataValid(RxDataValid),
366
        .RXFifoData(RxFifoData),
367
        .RXFifoFull(RxFifoFull),
368
        .RXFifoWEn(RxFifoWE),
369
        .RXPacketRdy(getPacketRdy),
370
        .RXPktStatus(RxPktStatus),
371
        .RXStreamStatusIn(RxByteStatus),
372
        .RxPID(RxPID),
373
        .SIERxTimeOut(SIERxTimeOut),
374
        .clk(clk),
375
        .getPacketEn(getPacketREn),
376
        .rst(rst) );
377
 
378
speedCtrlMux u_speedCtrlMux
379
        (.directCtrlRate(directCtrlRate),
380
        .directCtrlPol(directCtrlPol),
381
        .sendPacketRate(sendPacketCPFSRate),
382
        .sendPacketPol(sendPacketCPFSPol),
383
        .sendPacketSel(sendPacketCPGrabLine),
384
        .fullSpeedRate(fullSpeedRate),
385
        .fullSpeedPol(fullSpeedPol) );
386
 
387
rxStatusMonitor u_rxStatusMonitor
388
        (.connectStateIn(connectStateIn),
389
        .connectStateOut(connectStateOut),
390
        .resumeDetectedIn(resumeDetectedIn),
391
        .connectionEventOut(connectionEventFromRxStatusMon),
392
        .resumeIntOut(resumeIntFromRxStatusMon),
393
        .clk(clk),
394
        .rst(rst)  );
395
 
396
endmodule
397
 
398
 
399
 
400
 
401
 
402
 
403
 

powered by: WebSVN 2.1.0

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