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

Subversion Repositories usbhostslave

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

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

powered by: WebSVN 2.1.0

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