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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [slaveController/] [USBSlaveControlBI.v] - Blame information for rev 22

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

Line No. Rev Author Line
1 22 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// USBSlaveControlBI.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
`include "usbSlaveControl_h.v"
46
 
47
module USBSlaveControlBI (address, dataIn, dataOut, writeEn,
48
  strobe_i,
49
  busClk,
50
  rstSyncToBusClk,
51
  usbClk,
52
  rstSyncToUsbClk,
53
  SOFRxedIntOut, resetEventIntOut, resumeIntOut, transDoneIntOut, NAKSentIntOut,
54
  endP0TransTypeReg, endP0NAKTransTypeReg,
55
  endP1TransTypeReg, endP1NAKTransTypeReg,
56
  endP2TransTypeReg, endP2NAKTransTypeReg,
57
  endP3TransTypeReg, endP3NAKTransTypeReg,
58
  endP0ControlReg,
59
  endP1ControlReg,
60
  endP2ControlReg,
61
  endP3ControlReg,
62
  EP0StatusReg,
63
  EP1StatusReg,
64
  EP2StatusReg,
65
  EP3StatusReg,
66
  SCAddrReg, frameNum,
67
  connectStateIn,
68
  SOFRxedIn, resetEventIn, resumeIntIn, transDoneIn, NAKSentIn,
69
  slaveControlSelect,
70
  clrEP0Ready, clrEP1Ready, clrEP2Ready, clrEP3Ready,
71
  TxLineState,
72
  LineDirectControlEn,
73
  fullSpeedPol,
74
  fullSpeedRate,
75
  SCGlobalEn
76
  );
77
input [4:0] address;
78
input [7:0] dataIn;
79
input writeEn;
80
input strobe_i;
81
input busClk;
82
input rstSyncToBusClk;
83
input usbClk;
84
input rstSyncToUsbClk;
85
output [7:0] dataOut;
86
output SOFRxedIntOut;
87
output resetEventIntOut;
88
output resumeIntOut;
89
output transDoneIntOut;
90
output NAKSentIntOut;
91
 
92
input [1:0] endP0TransTypeReg;
93
input [1:0] endP0NAKTransTypeReg;
94
input [1:0] endP1TransTypeReg;
95
input [1:0] endP1NAKTransTypeReg;
96
input [1:0] endP2TransTypeReg;
97
input [1:0] endP2NAKTransTypeReg;
98
input [1:0] endP3TransTypeReg;
99
input [1:0] endP3NAKTransTypeReg;
100
output [4:0] endP0ControlReg;
101
output [4:0] endP1ControlReg;
102
output [4:0] endP2ControlReg;
103
output [4:0] endP3ControlReg;
104
input [7:0] EP0StatusReg;
105
input [7:0] EP1StatusReg;
106
input [7:0] EP2StatusReg;
107
input [7:0] EP3StatusReg;
108
output [6:0] SCAddrReg;
109
input [10:0] frameNum;
110
input [1:0] connectStateIn;
111
input SOFRxedIn;
112
input resetEventIn;
113
input resumeIntIn;
114
input transDoneIn;
115
input NAKSentIn;
116
input slaveControlSelect;
117
input clrEP0Ready;
118
input clrEP1Ready;
119
input clrEP2Ready;
120
input clrEP3Ready;
121
output [1:0] TxLineState;
122
output LineDirectControlEn;
123
output fullSpeedPol;
124
output fullSpeedRate;
125
output SCGlobalEn;
126
 
127
wire [4:0] address;
128
wire [7:0] dataIn;
129
wire writeEn;
130
wire strobe_i;
131
wire busClk;
132
wire rstSyncToBusClk;
133
wire usbClk;
134
wire rstSyncToUsbClk;
135
reg [7:0] dataOut;
136
 
137
reg SOFRxedIntOut;
138
reg resetEventIntOut;
139
reg resumeIntOut;
140
reg transDoneIntOut;
141
reg NAKSentIntOut;
142
 
143
wire [1:0] endP0TransTypeReg;
144
wire [1:0] endP0NAKTransTypeReg;
145
wire [1:0] endP1TransTypeReg;
146
wire [1:0] endP1NAKTransTypeReg;
147
wire [1:0] endP2TransTypeReg;
148
wire [1:0] endP2NAKTransTypeReg;
149
wire [1:0] endP3TransTypeReg;
150
wire [1:0] endP3NAKTransTypeReg;
151
reg [4:0] endP0ControlReg;
152
reg [4:0] endP1ControlReg;
153
reg [4:0] endP2ControlReg;
154
reg [4:0] endP3ControlReg;
155
wire [7:0] EP0StatusReg;
156
wire [7:0] EP1StatusReg;
157
wire [7:0] EP2StatusReg;
158
wire [7:0] EP3StatusReg;
159
reg [6:0] SCAddrReg;
160
reg [3:0] TxEndPReg;
161
wire [10:0] frameNum;
162
wire [1:0] connectStateIn;
163
 
164
wire SOFRxedIn;
165
wire resetEventIn;
166
wire resumeIntIn;
167
wire transDoneIn;
168
wire NAKSentIn;
169
wire slaveControlSelect;
170
wire clrEP0Ready;
171
wire clrEP1Ready;
172
wire clrEP2Ready;
173
wire clrEP3Ready;
174
reg [1:0] TxLineState;
175
reg LineDirectControlEn;
176
reg fullSpeedPol;
177
reg fullSpeedRate;
178
reg SCGlobalEn;
179
 
180
//internal wire and regs
181
reg [5:0] SCControlReg;
182
reg clrNAKReq;
183
reg clrSOFReq;
184
reg clrResetReq;
185
reg clrResInReq;
186
reg clrTransDoneReq;
187
reg SOFRxedInt;
188
reg resetEventInt;
189
reg resumeInt;
190
reg transDoneInt;
191
reg NAKSentInt;
192
reg [4:0] interruptMaskReg;
193
reg EP0SetReady;
194
reg EP1SetReady;
195
reg EP2SetReady;
196
reg EP3SetReady;
197
reg EP0SendStall;
198
reg EP1SendStall;
199
reg EP2SendStall;
200
reg EP3SendStall;
201
reg EP0IsoEn;
202
reg EP1IsoEn;
203
reg EP2IsoEn;
204
reg EP3IsoEn;
205
reg EP0DataSequence;
206
reg EP1DataSequence;
207
reg EP2DataSequence;
208
reg EP3DataSequence;
209
reg EP0Enable;
210
reg EP1Enable;
211
reg EP2Enable;
212
reg EP3Enable;
213
reg EP0Ready;
214
reg EP1Ready;
215
reg EP2Ready;
216
reg EP3Ready;
217
 
218
//clock domain crossing sync registers
219
//STB = Sync To Busclk
220
reg [4:0] endP0ControlRegSTB;
221
reg [4:0] endP1ControlRegSTB;
222
reg [4:0] endP2ControlRegSTB;
223
reg [4:0] endP3ControlRegSTB;
224
reg NAKSentInSTB;
225
reg SOFRxedInSTB;
226
reg resetEventInSTB;
227
reg resumeIntInSTB;
228
reg transDoneInSTB;
229
reg clrEP0ReadySTB;
230
reg clrEP1ReadySTB;
231
reg clrEP2ReadySTB;
232
reg clrEP3ReadySTB;
233
reg SCGlobalEnSTB;
234
reg [1:0] TxLineStateSTB;
235
reg LineDirectControlEnSTB;
236
reg fullSpeedPolSTB;
237
reg fullSpeedRateSTB;
238
reg [7:0] EP0StatusRegSTB;
239
reg [7:0] EP1StatusRegSTB;
240
reg [7:0] EP2StatusRegSTB;
241
reg [7:0] EP3StatusRegSTB;
242
reg [1:0] endP0TransTypeRegSTB;
243
reg [1:0] endP0NAKTransTypeRegSTB;
244
reg [1:0] endP1TransTypeRegSTB;
245
reg [1:0] endP1NAKTransTypeRegSTB;
246
reg [1:0] endP2TransTypeRegSTB;
247
reg [1:0] endP2NAKTransTypeRegSTB;
248
reg [1:0] endP3TransTypeRegSTB;
249
reg [1:0] endP3NAKTransTypeRegSTB;
250
reg [10:0] frameNumSTB;
251
 
252
 
253
//sync write demux
254
always @(posedge busClk)
255
begin
256
  if (rstSyncToBusClk == 1'b1) begin
257
    EP0IsoEn <= 1'b0;
258
    EP0SendStall <= 1'b0;
259
    EP0DataSequence <= 1'b0;
260
    EP0Enable <= 1'b0;
261
    EP1IsoEn <= 1'b0;
262
    EP1SendStall <= 1'b0;
263
    EP1DataSequence <= 1'b0;
264
    EP1Enable <= 1'b0;
265
    EP2IsoEn <= 1'b0;
266
    EP2SendStall <= 1'b0;
267
    EP2DataSequence <= 1'b0;
268
    EP2Enable <= 1'b0;
269
    EP3IsoEn <= 1'b0;
270
    EP3SendStall <= 1'b0;
271
    EP3DataSequence <= 1'b0;
272
    EP3Enable <= 1'b0;
273
    SCControlReg <= 6'h00;
274
    SCAddrReg <= 7'h00;
275
    interruptMaskReg <= 5'h00;
276
  end
277
  else begin
278
    clrNAKReq <= 1'b0;
279
    clrSOFReq <= 1'b0;
280
    clrResetReq <= 1'b0;
281
    clrResInReq <= 1'b0;
282
    clrTransDoneReq <= 1'b0;
283
    EP0SetReady <= 1'b0;
284
    EP1SetReady <= 1'b0;
285
    EP2SetReady <= 1'b0;
286
    EP3SetReady <= 1'b0;
287
    if (writeEn == 1'b1 && strobe_i == 1'b1 && slaveControlSelect == 1'b1)
288
    begin
289
      case (address)
290
        `EP0_CTRL_REG : begin
291
          EP0IsoEn <= dataIn[`ENDPOINT_ISO_ENABLE_BIT];
292
          EP0SendStall <= dataIn[`ENDPOINT_SEND_STALL_BIT];
293
          EP0DataSequence <= dataIn[`ENDPOINT_OUTDATA_SEQUENCE_BIT];
294
          EP0SetReady <= dataIn[`ENDPOINT_READY_BIT];
295
          EP0Enable <= dataIn[`ENDPOINT_ENABLE_BIT];
296
        end
297
        `EP1_CTRL_REG : begin
298
          EP1IsoEn <= dataIn[`ENDPOINT_ISO_ENABLE_BIT];
299
          EP1SendStall <= dataIn[`ENDPOINT_SEND_STALL_BIT];
300
          EP1DataSequence <= dataIn[`ENDPOINT_OUTDATA_SEQUENCE_BIT];
301
          EP1SetReady <= dataIn[`ENDPOINT_READY_BIT];
302
          EP1Enable <= dataIn[`ENDPOINT_ENABLE_BIT];
303
        end
304
        `EP2_CTRL_REG : begin
305
          EP2IsoEn <= dataIn[`ENDPOINT_ISO_ENABLE_BIT];
306
          EP2SendStall <= dataIn[`ENDPOINT_SEND_STALL_BIT];
307
          EP2DataSequence <= dataIn[`ENDPOINT_OUTDATA_SEQUENCE_BIT];
308
          EP2SetReady <= dataIn[`ENDPOINT_READY_BIT];
309
          EP2Enable <= dataIn[`ENDPOINT_ENABLE_BIT];
310
        end
311
        `EP3_CTRL_REG : begin
312
          EP3IsoEn <= dataIn[`ENDPOINT_ISO_ENABLE_BIT];
313
          EP3SendStall <= dataIn[`ENDPOINT_SEND_STALL_BIT];
314
          EP3DataSequence <= dataIn[`ENDPOINT_OUTDATA_SEQUENCE_BIT];
315
          EP3SetReady <= dataIn[`ENDPOINT_READY_BIT];
316
          EP3Enable <= dataIn[`ENDPOINT_ENABLE_BIT];
317
        end
318
        `SC_CONTROL_REG : SCControlReg <= dataIn[5:0];
319
        `SC_ADDRESS : SCAddrReg <= dataIn[6:0];
320
        `SC_INTERRUPT_STATUS_REG : begin
321
          clrNAKReq <= dataIn[`NAK_SENT_INT_BIT];
322
          clrSOFReq <= dataIn[`SOF_RECEIVED_BIT];
323
          clrResetReq <= dataIn[`RESET_EVENT_BIT];
324
          clrResInReq <= dataIn[`RESUME_INT_BIT];
325
          clrTransDoneReq <= dataIn[`TRANS_DONE_BIT];
326
        end
327
        `SC_INTERRUPT_MASK_REG  : interruptMaskReg <= dataIn[4:0];
328
      endcase
329
    end
330
  end
331
end
332
 
333
//interrupt control 
334
always @(posedge busClk)
335
begin
336
  if (rstSyncToBusClk == 1'b1) begin
337
    NAKSentInt <= 1'b0;
338
    SOFRxedInt <= 1'b0;
339
    resetEventInt <= 1'b0;
340
    resumeInt <= 1'b0;
341
    transDoneInt <= 1'b0;
342
  end
343
  else begin
344
    if (NAKSentInSTB == 1'b1)
345
      NAKSentInt <= 1'b1;
346
    else if (clrNAKReq == 1'b1)
347
      NAKSentInt <= 1'b0;
348
 
349
    if (SOFRxedInSTB == 1'b1)
350
      SOFRxedInt <= 1'b1;
351
    else if (clrSOFReq == 1'b1)
352
      SOFRxedInt <= 1'b0;
353
 
354
    if (resetEventInSTB == 1'b1)
355
      resetEventInt <= 1'b1;
356
    else if (clrResetReq == 1'b1)
357
      resetEventInt <= 1'b0;
358
 
359
    if (resumeIntInSTB == 1'b1)
360
      resumeInt <= 1'b1;
361
    else if (clrResInReq == 1'b1)
362
      resumeInt <= 1'b0;
363
 
364
    if (transDoneInSTB == 1'b1)
365
      transDoneInt <= 1'b1;
366
    else if (clrTransDoneReq == 1'b1)
367
      transDoneInt <= 1'b0;
368
  end
369
end
370
 
371
//mask interrupts
372
always @(interruptMaskReg or transDoneInt or resumeInt or resetEventInt or SOFRxedInt or NAKSentInt) begin
373
  transDoneIntOut <= transDoneInt & interruptMaskReg[`TRANS_DONE_BIT];
374
  resumeIntOut <= resumeInt & interruptMaskReg[`RESUME_INT_BIT];
375
  resetEventIntOut <= resetEventInt & interruptMaskReg[`RESET_EVENT_BIT];
376
  SOFRxedIntOut <= SOFRxedInt & interruptMaskReg[`SOF_RECEIVED_BIT];
377
  NAKSentIntOut <= NAKSentInt & interruptMaskReg[`NAK_SENT_INT_BIT];
378
end
379
 
380
//end point ready, set/clear
381
//Since 'busClk' can be a higher freq than 'usbClk',
382
//'EP0SetReady' etc must be delayed with respect to other control signals, thus
383
//ensuring that control signals have been clocked through to 'usbClk' clock
384
//domain before the ready is asserted.
385
//Not sure this is required because there is at least two 'usbClk' ticks between
386
//detection of 'EP0Ready' and sampling of related control signals.always @(posedge busClk)
387
always @(posedge busClk)
388
begin
389
  if (rstSyncToBusClk == 1'b1) begin
390
    EP0Ready <= 1'b0;
391
    EP1Ready <= 1'b0;
392
    EP2Ready <= 1'b0;
393
    EP3Ready <= 1'b0;
394
  end
395
  else begin
396
    if (EP0SetReady == 1'b1)
397
      EP0Ready <= 1'b1;
398
    else if (clrEP0ReadySTB == 1'b1)
399
      EP0Ready <= 1'b0;
400
 
401
    if (EP1SetReady == 1'b1)
402
      EP1Ready <= 1'b1;
403
    else if (clrEP1ReadySTB == 1'b1)
404
      EP1Ready <= 1'b0;
405
 
406
    if (EP2SetReady == 1'b1)
407
      EP2Ready <= 1'b1;
408
    else if (clrEP2ReadySTB == 1'b1)
409
      EP2Ready <= 1'b0;
410
 
411
    if (EP3SetReady == 1'b1)
412
      EP3Ready <= 1'b1;
413
    else if (clrEP3ReadySTB == 1'b1)
414
      EP3Ready <= 1'b0;
415
  end
416
end
417
 
418
//break out control signals
419
always @(SCControlReg) begin
420
  SCGlobalEnSTB <= SCControlReg[`SC_GLOBAL_ENABLE_BIT];
421
  TxLineStateSTB <= SCControlReg[`SC_TX_LINE_STATE_MSBIT:`SC_TX_LINE_STATE_LSBIT];
422
  LineDirectControlEnSTB <= SCControlReg[`SC_DIRECT_CONTROL_BIT];
423
  fullSpeedPolSTB <= SCControlReg[`SC_FULL_SPEED_LINE_POLARITY_BIT];
424
  fullSpeedRateSTB <= SCControlReg[`SC_FULL_SPEED_LINE_RATE_BIT];
425
end
426
 
427
//combine endpoint control signals 
428
always @(EP0IsoEn or EP0SendStall or EP0Ready or EP0DataSequence or EP0Enable or
429
  EP1IsoEn or EP1SendStall or EP1Ready or EP1DataSequence or EP1Enable or
430
  EP2IsoEn or EP2SendStall or EP2Ready or EP2DataSequence or EP2Enable or
431
  EP3IsoEn or EP3SendStall or EP3Ready or EP3DataSequence or EP3Enable)
432
begin
433
  endP0ControlRegSTB <= {EP0IsoEn, EP0SendStall, EP0DataSequence, EP0Ready, EP0Enable};
434
  endP1ControlRegSTB <= {EP1IsoEn, EP1SendStall, EP1DataSequence, EP1Ready, EP1Enable};
435
  endP2ControlRegSTB <= {EP2IsoEn, EP2SendStall, EP2DataSequence, EP2Ready, EP2Enable};
436
  endP3ControlRegSTB <= {EP3IsoEn, EP3SendStall, EP3DataSequence, EP3Ready, EP3Enable};
437
end
438
 
439
 
440
// async read mux
441
// FIX ME
442
// Not sure why 'EP0SendStall' etc are in sensitivity list. May be related to
443
// some translation bug
444
always @(address or
445
  EP0SendStall or EP0Ready or EP0DataSequence or EP0Enable or
446
  EP1SendStall or EP1Ready or EP1DataSequence or EP1Enable or
447
  EP2SendStall or EP2Ready or EP2DataSequence or EP2Enable or
448
  EP3SendStall or EP3Ready or EP3DataSequence or EP3Enable or
449
  EP0StatusRegSTB or EP1StatusRegSTB or EP2StatusRegSTB or EP3StatusRegSTB or
450
  endP0ControlRegSTB or endP1ControlRegSTB or endP2ControlRegSTB or endP3ControlRegSTB or
451
  endP0NAKTransTypeRegSTB or endP1NAKTransTypeRegSTB or endP2NAKTransTypeRegSTB or endP3NAKTransTypeRegSTB or
452
  endP0TransTypeRegSTB or endP1TransTypeRegSTB or endP2TransTypeRegSTB or endP3TransTypeRegSTB or
453
  SCControlReg or connectStateIn or
454
  NAKSentInt or SOFRxedInt or resetEventInt or resumeInt or transDoneInt or
455
  interruptMaskReg or SCAddrReg or frameNumSTB)
456
begin
457
  case (address)
458
      `EP0_CTRL_REG : dataOut <= endP0ControlRegSTB;
459
      `EP0_STS_REG : dataOut <= EP0StatusRegSTB;
460
      `EP0_TRAN_TYPE_STS_REG : dataOut <= endP0TransTypeRegSTB;
461
      `EP0_NAK_TRAN_TYPE_STS_REG : dataOut <= endP0NAKTransTypeRegSTB;
462
      `EP1_CTRL_REG : dataOut <= endP1ControlRegSTB;
463
      `EP1_STS_REG :  dataOut <= EP1StatusRegSTB;
464
      `EP1_TRAN_TYPE_STS_REG : dataOut <= endP1TransTypeRegSTB;
465
      `EP1_NAK_TRAN_TYPE_STS_REG : dataOut <= endP1NAKTransTypeRegSTB;
466
      `EP2_CTRL_REG : dataOut <= endP2ControlRegSTB;
467
      `EP2_STS_REG :  dataOut <= EP2StatusRegSTB;
468
      `EP2_TRAN_TYPE_STS_REG : dataOut <= endP2TransTypeRegSTB;
469
      `EP2_NAK_TRAN_TYPE_STS_REG : dataOut <= endP2NAKTransTypeRegSTB;
470
      `EP3_CTRL_REG : dataOut <= endP3ControlRegSTB;
471
      `EP3_STS_REG :  dataOut <= EP3StatusRegSTB;
472
      `EP3_TRAN_TYPE_STS_REG : dataOut <= endP3TransTypeRegSTB;
473
      `EP3_NAK_TRAN_TYPE_STS_REG : dataOut <= endP3NAKTransTypeRegSTB;
474
      `SC_CONTROL_REG : dataOut <= SCControlReg;
475
      `SC_LINE_STATUS_REG : dataOut <= {6'b000000, connectStateIn};
476
      `SC_INTERRUPT_STATUS_REG :  dataOut <= {3'b000, NAKSentInt, SOFRxedInt, resetEventInt, resumeInt, transDoneInt};
477
      `SC_INTERRUPT_MASK_REG  : dataOut <= {3'b000, interruptMaskReg};
478
      `SC_ADDRESS : dataOut <= {1'b0, SCAddrReg};
479
      `SC_FRAME_NUM_MSP : dataOut <= {5'b00000, frameNumSTB[10:8]};
480
      `SC_FRAME_NUM_LSP : dataOut <= frameNumSTB[7:0];
481
      default: dataOut <= 8'h00;
482
  endcase
483
end
484
 
485
//re-sync from busClk to usbClk. 
486
always @(posedge usbClk) begin
487
  endP0ControlReg <= endP0ControlRegSTB;
488
  endP1ControlReg <= endP1ControlRegSTB;
489
  endP2ControlReg <= endP2ControlRegSTB;
490
  endP3ControlReg <= endP3ControlRegSTB;
491
  SCGlobalEn <= SCGlobalEnSTB;
492
  TxLineState <= TxLineStateSTB;
493
  LineDirectControlEn <= LineDirectControlEnSTB;
494
  fullSpeedPol <= fullSpeedPolSTB;
495
  fullSpeedRate <= fullSpeedRateSTB;
496
end
497
 
498
//re-sync from usbClk to busClk. Since 'NAKSentIn', 'SOFRxedIn' etc are only asserted 
499
//for one 'usbClk' tick, busClk freq must be greater than or equal to usbClk freq
500
always @(posedge busClk) begin
501
  NAKSentInSTB <= NAKSentIn;
502
  SOFRxedInSTB <= SOFRxedIn;
503
  resetEventInSTB <= resetEventIn;
504
  resumeIntInSTB <= resumeIntIn;
505
  transDoneInSTB <= transDoneIn;
506
  clrEP0ReadySTB <= clrEP0Ready;
507
  clrEP1ReadySTB <= clrEP1Ready;
508
  clrEP2ReadySTB <= clrEP2Ready;
509
  clrEP3ReadySTB <= clrEP3Ready;
510
  EP0StatusRegSTB <= EP0StatusReg;
511
  EP1StatusRegSTB <= EP1StatusReg;
512
  EP2StatusRegSTB <= EP2StatusReg;
513
  EP3StatusRegSTB <= EP3StatusReg;
514
  endP0TransTypeRegSTB <= endP0TransTypeReg;
515
  endP1TransTypeRegSTB <= endP1TransTypeReg;
516
  endP2TransTypeRegSTB <= endP2TransTypeReg;
517
  endP3TransTypeRegSTB <= endP3TransTypeReg;
518
  endP0NAKTransTypeRegSTB <= endP0NAKTransTypeReg;
519
  endP1NAKTransTypeRegSTB <= endP1NAKTransTypeReg;
520
  endP2NAKTransTypeRegSTB <= endP2NAKTransTypeReg;
521
  endP3NAKTransTypeRegSTB <= endP3NAKTransTypeReg;
522
  frameNumSTB <= frameNum;
523
end
524
 
525
endmodule

powered by: WebSVN 2.1.0

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