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

Subversion Repositories usbhostslave

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

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

powered by: WebSVN 2.1.0

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