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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [serialInterfaceEngine/] [usbSerialInterfaceEngine.v] - Blame information for rev 44

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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