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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [usbhostslave/] [usbSerialInterfaceEngine.v] - Blame information for rev 522

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

Line No. Rev Author Line
1 408 julius
//////////////////////////////////////////////////////////////////////
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
  );
220
 
221
processRxByte u_processRxByte
222
  (.CRC16En(RxCRC16En),
223
  .CRC16Result(RxCRC16Result),
224
  .CRC16UpdateRdy(RxCRC16UpdateRdy),
225
  .CRC5En(RxCRC5En),
226
  .CRC5Result(RxCRC5Result),
227
  .CRC5_8Bit(RxCRC5_8Bit),
228
  .CRC5UpdateRdy(RxCRC5UpdateRdy),
229
  .CRCData(RxCRCData),
230
  .RxByteIn(RxDataFromPrcRxBitToPrcRxByte),
231
  .RxCtrlIn(RxCtrlFromPrcRxBitToPrcRxByte),
232
  .RxCtrlOut(RxCtrlOut),
233
  .RxDataOutWEn(RxDataOutWEn),
234
  .RxDataOut(RxDataOut),
235
  .clk(clk),
236
  .processRxDataInWEn(processRxByteWEn),
237
  .rst(rst),
238
  .rstCRC(RxRstCRC),
239
  .processRxByteRdy(processRxByteRdy) );
240
 
241
 
242
updateCRC5 RxUpdateCRC5
243
  (.rstCRC(RxRstCRC),
244
  .CRCResult(RxCRC5Result),
245
  .CRCEn(RxCRC5En),
246
  .CRC5_8BitIn(RxCRC5_8Bit),
247
  .dataIn(RxCRCData),
248
  .ready(RxCRC5UpdateRdy),
249
  .clk(clk),
250
  .rst(rst) );
251
 
252
updateCRC16 RxUpdateCRC16
253
  (.rstCRC(RxRstCRC),
254
  .CRCResult(RxCRC16Result),
255
  .CRCEn(RxCRC16En),
256
  .dataIn(RxCRCData),
257
  .ready(RxCRC16UpdateRdy),
258
  .clk(clk),
259
  .rst(rst) );
260
 
261
SIETransmitter u_SIETransmitter
262
  (.CRC16En(TxCRC16En),
263
  .CRC16Result(TxCRC16Result),
264
  .CRC5En(TxCRC5En),
265
  .CRC5Result(TxCRC5Result),
266
  .CRC5_8Bit(TxCRC5_8Bit),
267
  .CRCData(TxCRCData),
268
  .CRC5UpdateRdy(TxCRC5UpdateRdy),
269
  .CRC16UpdateRdy(TxCRC16UpdateRdy),
270
  .JBit(JBit),
271
  .KBit(KBit),
272
  .SIEPortCtrlIn(SIEPortCtrlIn),
273
  .SIEPortDataIn(SIEPortDataIn),
274
  .SIEPortTxRdy(SIEPortTxRdy),
275
  .SIEPortWEn(SIEPortWEn),
276
  .TxByteOutCtrl(TxCtrlFromSIEToPrcTxByte),
277
  .TxByteOut(TxByteFromSIEToPrcTxByte),
278
  .USBWireCtrl(SIETxCtrl),
279
  .USBWireData(SIETxData),
280
  .USBWireGnt(SIETxGnt),
281
  .USBWireRdy(USBWireReadyFromTxArb),
282
  .USBWireReq(SIETxReq),
283
  .USBWireWEn(SIETxWEn),
284
  .clk(clk),
285
  .processTxByteRdy(processTxByteRdy),
286
  .processTxByteWEn(processTxByteWEn),
287
  .rst(rst),
288
  .rstCRC(TxRstCRC),
289
  .USBWireFullSpeedRate(SIEFsRate),
290
  .TxByteOutFullSpeedRate(TxFSRateFromSIETxToPrcTxByte),
291
  .fullSpeedRateIn(fullSpeedBitRate)
292
  );
293
 
294
updateCRC5 TxUpdateCRC5
295
  (.rstCRC(TxRstCRC),
296
  .CRCResult(TxCRC5Result),
297
  .CRCEn(TxCRC5En),
298
  .CRC5_8BitIn(TxCRC5_8Bit),
299
  .dataIn(TxCRCData),
300
  .ready(TxCRC5UpdateRdy),
301
  .clk(clk),
302
  .rst(rst) );
303
 
304
updateCRC16 TxUpdateCRC16
305
  (.rstCRC(TxRstCRC),
306
  .CRCResult(TxCRC16Result),
307
  .CRCEn(TxCRC16En),
308
  .dataIn(TxCRCData),
309
  .ready(TxCRC16UpdateRdy),
310
  .clk(clk),
311
  .rst(rst) );
312
 
313
processTxByte u_processTxByte
314
  (.JBit(JBit),
315
  .KBit(KBit),
316
  .TxByteCtrlIn(TxCtrlFromSIEToPrcTxByte),
317
  .TxByteIn(TxByteFromSIEToPrcTxByte),
318
  .USBWireCtrl(prcTxByteCtrl),
319
  .USBWireData(prcTxByteData),
320
  .USBWireGnt(prcTxByteGnt),
321
  .USBWireRdy(USBWireReadyFromTxArb),
322
  .USBWireReq(prcTxByteReq),
323
  .USBWireWEn(prcTxByteWEn),
324
  .clk(clk),
325
  .processTxByteRdy(processTxByteRdy),
326
  .processTxByteWEn(processTxByteWEn),
327
  .rst(rst),
328
  .USBWireFullSpeedRate(prcTxByteFSRate),
329
  .TxByteFullSpeedRateIn(TxFSRateFromSIETxToPrcTxByte)
330
  );
331
 
332
USBTxWireArbiter u_USBTxWireArbiter
333
  (.SIETxCtrl(SIETxCtrl),
334
  .SIETxData(SIETxData),
335
  .SIETxGnt(SIETxGnt),
336
  .SIETxReq(SIETxReq),
337
  .SIETxWEn(SIETxWEn),
338
  .TxBits(TxBitsFromArbToWire),
339
  .TxCtl(TxCtrlFromArbToWire),
340
  .USBWireRdyIn(USBWireRdy),
341
  .USBWireRdyOut(USBWireReadyFromTxArb),
342
  .USBWireWEn(USBWireWEn),
343
  .clk(clk),
344
  .prcTxByteCtrl(prcTxByteCtrl),
345
  .prcTxByteData(prcTxByteData),
346
  .prcTxByteGnt(prcTxByteGnt),
347
  .prcTxByteReq(prcTxByteReq),
348
  .prcTxByteWEn(prcTxByteWEn),
349
  .rst(rst),
350
  .SIETxFSRate(SIEFsRate),
351
  .prcTxByteFSRate(prcTxByteFSRate),
352
  .TxFSRate(FSRateFromArbiterToWire)
353
  );
354
 
355
writeUSBWireData u_writeUSBWireData
356
  (.TxBitsIn(TxBitsFromArbToWire),
357
  .TxBitsOut(USBWireDataOut),
358
  .TxDataOutTick(USBWireDataOutTick),
359
  .TxCtrlIn(TxCtrlFromArbToWire),
360
  .TxCtrlOut(USBWireCtrlOut),
361
  .USBWireRdy(USBWireRdy),
362
  .USBWireWEn(USBWireWEn),
363
  .TxWireActiveDrive(TxWireActiveDrive),
364
  .fullSpeedRate(FSRateFromArbiterToWire),
365
  .clk(clk),
366
  .rst(rst)
367
   );
368
 
369
 
370
 
371
readUSBWireData u_readUSBWireData
372
  (.RxBitsIn(USBWireDataIn),
373
  .RxDataInTick(USBWireDataInTick),
374
  .RxBitsOut(RxWireDataFromWireRx),
375
  .SIERxRdyIn(processRxBitRdy),
376
  .SIERxWEn(RxWireDataWEn),
377
  .fullSpeedRate(fullSpeedBitRate),
378
  .TxWireActiveDrive(TxWireActiveDrive),
379
  .clk(clk),
380
  .rst(rst),
381
  .noActivityTimeOut(noActivityTimeOut),
382
  .RxWireActive(RxWireActive),
383
  .noActivityTimeOutEnable(noActivityTimeOutEnable)
384
  );
385
 
386
 
387
endmodule
388
 
389
 
390
 
391
 
392
 
393
 
394
 

powered by: WebSVN 2.1.0

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