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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [tags/] [rel_01_01/] [RTL/] [serialInterfaceEngine/] [usbSerialInterfaceEngine.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
//// usbSerialInterfaceEngine.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: usbSerialInterfaceEngine.v,v 1.1.1.1 2004-10-11 04:01:04 sfielding Exp $
45
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49
//
50
 
51
module usbSerialInterfaceEngine(
52
        clk, rst,
53
        //readUSBWireData
54
        USBWireDataIn,
55
        USBWireDataInTick,
56
        //writeUSBWireData
57
        USBWireDataOut,
58
        USBWireCtrlOut,
59
        USBWireDataOutTick,
60
        //SIEReceiver
61
        connectState,
62
        //processRxBit
63
        resumeDetected,
64
        //processRxByte
65
        RxCtrlOut,
66
        RxDataOutWEn,
67
        RxDataOut,
68
    //SIETransmitter
69
        SIEPortCtrlIn,
70
        SIEPortDataIn,
71
        SIEPortTxRdy,
72
        SIEPortWEn,
73
    //lineControlUpdate
74
        fullSpeedPolarity,
75
        fullSpeedBitRate,
76
  noActivityTimeOut
77
);
78
 
79
input clk, rst;
80
//readUSBWireData
81
input [1:0] USBWireDataIn;
82
output USBWireDataInTick;
83
 
84
//writeUSBWireData
85
output [1:0] USBWireDataOut;
86
output USBWireCtrlOut;
87
output noActivityTimeOut;
88
output USBWireDataOutTick;
89
 
90
//SIEReceiver
91
output [1:0] connectState;
92
//processRxBit
93
output resumeDetected;
94
//processRxByte
95
output [7:0] RxCtrlOut;
96
output RxDataOutWEn;
97
output [7:0] RxDataOut;
98
//SIETransmitter
99
input [7:0] SIEPortCtrlIn;
100
input [7:0] SIEPortDataIn;
101
output SIEPortTxRdy;
102
input SIEPortWEn;
103
//lineControlUpdate
104
input fullSpeedPolarity;
105
input fullSpeedBitRate;
106
 
107
wire clk, rst;
108
//readUSBWireData
109
wire [1:0] USBWireDataIn;
110
wire USBWireDataInTick;
111
//writeUSBWireData
112
wire [1:0] USBWireDataOut;
113
wire USBWireCtrlOut;
114
wire noActivityTimeOut;
115
wire USBWireDataOutTick;
116
//SIEReceiver
117
wire [1:0] connectState;
118
//processRxBit
119
wire resumeDetected;
120
//processRxByte
121
wire [7:0] RxCtrlOut;
122
wire RxDataOutWEn;
123
wire [7:0] RxDataOut;
124
//SIETransmitter
125
wire [7:0] SIEPortCtrlIn;
126
wire [7:0] SIEPortDataIn;
127
wire SIEPortTxRdy;
128
wire SIEPortWEn;
129
//lineControlUpdate
130
wire fullSpeedPolarity;
131
wire fullSpeedBitRate;
132
 
133
//internal wiring
134
wire [1:0] RxBitsFromSIERxToPrRxBit;
135
wire processRxBitsWEn;
136
wire processRxBitRdy;
137
wire [1:0] RxWireDataFromWireRxToSIERx;
138
wire RxWireDataWEn;
139
wire SIERxRdyOut;
140
wire disableWireRead;
141
wire [1:0] TxBitsFromArbToWire;
142
wire TxCtrlFromArbToWire;
143
wire USBWireRdy;
144
wire USBWireWEn;
145
wire USBWireReadyFromTxArb;
146
wire prcTxByteCtrl;
147
wire [1:0] prcTxByteData;
148
wire prcTxByteGnt;
149
wire prcTxByteReq;
150
wire prcTxByteWEn;
151
wire SIETxCtrl;
152
wire [1:0] SIETxData;
153
wire SIETxGnt;
154
wire SIETxReq;
155
wire SIETxWEn;
156
wire [7:0] TxByteFromSIEToPrcTxByte;
157
wire [7:0] TxCtrlFromSIEToPrcTxByte;
158
wire [1:0] JBit;
159
wire [1:0] KBit;
160
wire processRxByteWEn;
161
wire [7:0] RxDataFromPrcRxBitToPrcRxByte;
162
wire [7:0] RxCtrlFromPrcRxBitToPrcRxByte;
163
wire processRxByteRdy;
164
//Rx CRC
165
wire RxCRC16En;
166
wire [15:0] RxCRC16Result;
167
wire RxCRC16UpdateRdy;
168
wire RxCRC5En;
169
wire [4:0] RxCRC5Result;
170
wire RxCRC5_8Bit;
171
wire [7:0] RxCRCData;
172
wire RxRstCRC;
173
wire RxCRC5UpdateRdy;
174
//Tx CRC
175
wire TxCRC16En;
176
wire [15:0] TxCRC16Result;
177
wire TxCRC16UpdateRdy;
178
wire TxCRC5En;
179
wire [4:0] TxCRC5Result;
180
wire TxCRC5_8Bit;
181
wire [7:0] TxCRCData;
182
wire TxRstCRC;
183
wire TxCRC5UpdateRdy;
184
 
185
wire processTxByteRdy;
186
wire processTxByteWEn;
187
 
188
lineControlUpdate u_lineControlUpdate
189
        (.fullSpeedPolarity(fullSpeedPolarity),
190
        .fullSpeedBitRate(fullSpeedBitRate),
191
        .JBit(JBit),
192
        .KBit(KBit) );
193
 
194
SIEReceiver u_SIEReceiver
195
        (.RxBitsOut(RxBitsFromSIERxToPrRxBit),
196
        .RxWireDataIn(RxWireDataFromWireRxToSIERx),
197
        .RxWireDataWEn(RxWireDataWEn),
198
        .SIERxRdyOut(SIERxRdyOut),
199
        .clk(clk),
200
        .connectState(connectState),
201
        .processRxBitRdyIn(processRxBitRdy),
202
        .processRxBitsWEn(processRxBitsWEn),
203
        .rst(rst) );
204
 
205
processRxBit u_processRxBit
206
        (.JBit(JBit),
207
        .KBit(KBit),
208
        .RxBitsIn(RxBitsFromSIERxToPrRxBit),
209
        .RxCtrlOut(RxCtrlFromPrcRxBitToPrcRxByte),
210
        .RxDataOut(RxDataFromPrcRxBitToPrcRxByte),
211
        .clk(clk),
212
        .processRxBitRdy(processRxBitRdy),
213
        .processRxBitsWEn(processRxBitsWEn),
214
        .processRxByteWEn(processRxByteWEn),
215
        .resumeDetected(resumeDetected),
216
        .rst(rst),
217
  .processRxByteRdy(processRxByteRdy) );
218
 
219
processRxByte u_processRxByte
220
        (.CRC16En(RxCRC16En),
221
        .CRC16Result(RxCRC16Result),
222
  .CRC16UpdateRdy(RxCRC16UpdateRdy),
223
        .CRC5En(RxCRC5En),
224
        .CRC5Result(RxCRC5Result),
225
        .CRC5_8Bit(RxCRC5_8Bit),
226
  .CRC5UpdateRdy(RxCRC5UpdateRdy),
227
        .CRCData(RxCRCData),
228
        .RxByteIn(RxDataFromPrcRxBitToPrcRxByte),
229
        .RxCtrlIn(RxCtrlFromPrcRxBitToPrcRxByte),
230
        .RxCtrlOut(RxCtrlOut),
231
        .RxDataOutWEn(RxDataOutWEn),
232
        .RxDataOut(RxDataOut),
233
        .clk(clk),
234
        .processRxDataInWEn(processRxByteWEn),
235
        .rst(rst),
236
        .rstCRC(RxRstCRC),
237
  .processRxByteRdy(processRxByteRdy) );
238
 
239
 
240
updateCRC5 RxUpdateCRC5
241
        (.rstCRC(RxRstCRC),
242
        .CRCResult(RxCRC5Result),
243
        .CRCEn(RxCRC5En),
244
        .CRC5_8BitIn(RxCRC5_8Bit),
245
        .dataIn(RxCRCData),
246
  .ready(RxCRC5UpdateRdy),
247
        .clk(clk),
248
        .rst(rst) );
249
 
250
updateCRC16 RxUpdateCRC16
251
        (.rstCRC(RxRstCRC),
252
        .CRCResult(RxCRC16Result),
253
        .CRCEn(RxCRC16En),
254
        .dataIn(RxCRCData),
255
  .ready(RxCRC16UpdateRdy),
256
        .clk(clk),
257
        .rst(rst) );
258
 
259
SIETransmitter u_SIETransmitter
260
        (.CRC16En(TxCRC16En),
261
        .CRC16Result(TxCRC16Result),
262
        .CRC5En(TxCRC5En),
263
        .CRC5Result(TxCRC5Result),
264
        .CRC5_8Bit(TxCRC5_8Bit),
265
        .CRCData(TxCRCData),
266
  .CRC5UpdateRdy(TxCRC5UpdateRdy),
267
  .CRC16UpdateRdy(TxCRC16UpdateRdy),
268
        .JBit(JBit),
269
        .KBit(KBit),
270
        .SIEPortCtrlIn(SIEPortCtrlIn),
271
        .SIEPortDataIn(SIEPortDataIn),
272
        .SIEPortTxRdy(SIEPortTxRdy),
273
        .SIEPortWEn(SIEPortWEn),
274
        .TxByteOutCtrl(TxCtrlFromSIEToPrcTxByte),
275
        .TxByteOut(TxByteFromSIEToPrcTxByte),
276
        .USBWireCtrl(SIETxCtrl),
277
        .USBWireData(SIETxData),
278
        .USBWireGnt(SIETxGnt),
279
        .USBWireRdy(USBWireReadyFromTxArb),
280
        .USBWireReq(SIETxReq),
281
        .USBWireWEn(SIETxWEn),
282
        .clk(clk),
283
        .processTxByteRdy(processTxByteRdy),
284
        .processTxByteWEn(processTxByteWEn),
285
        .rst(rst),
286
        .rstCRC(TxRstCRC) );
287
 
288
updateCRC5 TxUpdateCRC5
289
        (.rstCRC(TxRstCRC),
290
        .CRCResult(TxCRC5Result),
291
        .CRCEn(TxCRC5En),
292
        .CRC5_8BitIn(TxCRC5_8Bit),
293
        .dataIn(TxCRCData),
294
  .ready(TxCRC5UpdateRdy),
295
        .clk(clk),
296
        .rst(rst) );
297
 
298
updateCRC16 TxUpdateCRC16
299
        (.rstCRC(TxRstCRC),
300
        .CRCResult(TxCRC16Result),
301
        .CRCEn(TxCRC16En),
302
        .dataIn(TxCRCData),
303
  .ready(TxCRC16UpdateRdy),
304
        .clk(clk),
305
        .rst(rst) );
306
 
307
processTxByte u_processTxByte
308
        (.JBit(JBit),
309
        .KBit(KBit),
310
        .TxByteCtrlIn(TxCtrlFromSIEToPrcTxByte),
311
        .TxByteIn(TxByteFromSIEToPrcTxByte),
312
        .USBWireCtrl(prcTxByteCtrl),
313
        .USBWireData(prcTxByteData),
314
        .USBWireGnt(prcTxByteGnt),
315
        .USBWireRdy(USBWireReadyFromTxArb),
316
        .USBWireReq(prcTxByteReq),
317
        .USBWireWEn(prcTxByteWEn),
318
        .clk(clk),
319
        .processTxByteRdy(processTxByteRdy),
320
        .processTxByteWEn(processTxByteWEn),
321
        .rst(rst) );
322
 
323
USBWireTxArbiter u_USBWireTxArbiter
324
        (.SIETxCtrl(SIETxCtrl),
325
        .SIETxData(SIETxData),
326
        .SIETxGnt(SIETxGnt),
327
        .SIETxReq(SIETxReq),
328
        .SIETxWEn(SIETxWEn),
329
        .TxBits(TxBitsFromArbToWire),
330
        .TxCtl(TxCtrlFromArbToWire),
331
        .USBWireRdyIn(USBWireRdy),
332
        .USBWireRdyOut(USBWireReadyFromTxArb),
333
        .USBWireWEn(USBWireWEn),
334
        .clk(clk),
335
        .prcTxByteCtrl(prcTxByteCtrl),
336
        .prcTxByteData(prcTxByteData),
337
        .prcTxByteGnt(prcTxByteGnt),
338
        .prcTxByteReq(prcTxByteReq),
339
        .prcTxByteWEn(prcTxByteWEn),
340
        .rst(rst) );
341
 
342
writeUSBWireData u_writeUSBWireData
343
        (.TxBitsIn(TxBitsFromArbToWire),
344
        .TxBitsOut(USBWireDataOut),
345
        .TxDataOutTick(USBWireDataOutTick),
346
        .TxCtrlIn(TxCtrlFromArbToWire),
347
        .TxCtrlOut(USBWireCtrlOut),
348
        .USBWireRdy(USBWireRdy),
349
        .USBWireWEn(USBWireWEn),
350
        .disableWireReadOut(disableWireRead),
351
        .fullSpeedRate(fullSpeedBitRate),
352
        .clk(clk),
353
        .rst(rst),
354
  .noActivityTimeOut(noActivityTimeOut) );
355
 
356
readUSBWireData u_readUSBWireData
357
        (.RxBitsIn(USBWireDataIn),
358
        .RxDataInTick(USBWireDataInTick),
359
        .RxBitsOut(RxWireDataFromWireRxToSIERx),
360
        .SIERxRdyIn(SIERxRdyOut),
361
        .SIERxWEn(RxWireDataWEn),
362
        .fullSpeedRate(fullSpeedBitRate),
363
        .disableWireRead(disableWireRead),
364
        .clk(clk),
365
        .rst(rst) );
366
 
367
 
368
endmodule
369
 
370
 
371
 
372
 
373
 
374
 
375
 

powered by: WebSVN 2.1.0

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