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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [wrapper/] [usbSlaveCyc2Wrap.v] - Blame information for rev 43

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

Line No. Rev Author Line
1 38 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// usbSlaveCyc2Wrap.v                                           ////
4
////                                                              ////
5
//// This file is part of the usbhostslave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
////   Top level module wrapper. 
10
////                                                              ////
11
//// To Do:                                                       ////
12
//// 
13
////                                                              ////
14
//// Author(s):                                                   ////
15
//// - Steve Fielding, sfielding@base2designs.com                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2008 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
 
47
module usbSlaveCyc2Wrap(
48
  clk_i,
49
  rst_i,
50
  address_i,
51
  data_i,
52
  data_o,
53
  we_i,
54
  strobe_i,
55
  ack_o,
56
  irq,
57
  usbClk,
58
  USBWireVP,
59
  USBWireVM,
60
  USBWireOE_n,
61
  USBFullSpeed,
62
  USBDPlusPullup,
63
  USBDMinusPullup,
64
  vBusDetect
65
   );
66
 
67
input clk_i;
68
input rst_i;
69
input [7:0] address_i;
70
input [7:0] data_i;
71
output [7:0] data_o;
72
input we_i;
73
input strobe_i;
74
output ack_o;
75
output irq;
76
input usbClk;
77
inout USBWireVP /* synthesis useioff=1 */;
78
inout USBWireVM /* synthesis useioff=1 */;
79
output USBWireOE_n /* synthesis useioff=1 */;
80
output USBFullSpeed /* synthesis useioff=1 */;
81
output USBDPlusPullup;
82
output USBDMinusPullup;
83
input vBusDetect;
84
 
85
wire clk_i;
86
wire rst_i;
87
wire [7:0] address_i;
88
wire [7:0] data_i;
89
wire [7:0] data_o;
90
wire irq;
91
wire usbClk;
92
wire USBWireDataOutTick;
93
wire USBWireDataInTick;
94
wire USBFullSpeed;
95
 
96
//internal wiring 
97
wire slaveSOFRxedIntOut;
98
wire slaveResetEventIntOut;
99
wire slaveResumeIntOut;
100
wire slaveTransDoneIntOut;
101
wire slaveNAKSentIntOut;
102
wire slaveVBusDetIntOut;
103
wire USBWireCtrlOut;
104
wire [1:0] USBWireDataIn;
105
wire [1:0] USBWireDataOut;
106
 
107
 
108
assign irq = slaveSOFRxedIntOut | slaveResetEventIntOut |
109
             slaveResumeIntOut | slaveTransDoneIntOut |
110
             slaveNAKSentIntOut | slaveVBusDetIntOut;
111
 
112
assign USBWireDataIn = {USBWireVP, USBWireVM};
113
assign {USBWireVP, USBWireVM} = (USBWireCtrlOut == 1'b1) ? USBWireDataOut : 2'bzz;
114
assign USBWireOE_n = ~USBWireCtrlOut;
115
 
116
//Parameters declaration: 
117
defparam usbSlaveInst.EP0_FIFO_DEPTH = 64;
118
parameter EP0_FIFO_DEPTH = 64;
119
defparam usbSlaveInst.EP0_FIFO_ADDR_WIDTH = 6;
120
parameter EP0_FIFO_ADDR_WIDTH = 6;
121
defparam usbSlaveInst.EP1_FIFO_DEPTH = 64;
122
parameter EP1_FIFO_DEPTH = 64;
123
defparam usbSlaveInst.EP1_FIFO_ADDR_WIDTH = 6;
124
parameter EP1_FIFO_ADDR_WIDTH = 6;
125
defparam usbSlaveInst.EP2_FIFO_DEPTH = 64;
126
parameter EP2_FIFO_DEPTH = 64;
127
defparam usbSlaveInst.EP2_FIFO_ADDR_WIDTH = 6;
128
parameter EP2_FIFO_ADDR_WIDTH = 6;
129
defparam usbSlaveInst.EP3_FIFO_DEPTH = 64;
130
parameter EP3_FIFO_DEPTH = 64;
131
defparam usbSlaveInst.EP3_FIFO_ADDR_WIDTH = 6;
132
parameter EP3_FIFO_ADDR_WIDTH = 6;
133
usbSlave usbSlaveInst (
134
  .clk_i(clk_i),
135
  .rst_i(rst_i),
136
  .address_i(address_i),
137
  .data_i(data_i),
138
  .data_o(data_o),
139
  .we_i(we_i),
140
  .strobe_i(strobe_i),
141
  .ack_o(ack_o),
142
  .usbClk(usbClk),
143
  .slaveSOFRxedIntOut(slaveSOFRxedIntOut),
144
  .slaveResetEventIntOut(slaveResetEventIntOut),
145
  .slaveResumeIntOut(slaveResumeIntOut),
146
  .slaveTransDoneIntOut(slaveTransDoneIntOut),
147
  .slaveNAKSentIntOut(slaveNAKSentIntOut),
148
  .slaveVBusDetIntOut(slaveVBusDetIntOut),
149
  .USBWireDataIn(USBWireDataIn),
150
  .USBWireDataInTick(USBWireDataInTick),
151
  .USBWireDataOut(USBWireDataOut),
152
  .USBWireDataOutTick(USBWireDataOutTick),
153
  .USBWireCtrlOut(USBWireCtrlOut),
154
  .USBFullSpeed(USBFullSpeed),
155
  .USBDPlusPullup(USBDPlusPullup),
156
  .USBDMinusPullup(USBDMinusPullup),
157
  .vBusDetect(vBusDetect)
158
);
159
 
160
 
161
endmodule
162
 
163
 
164
 
165
 
166
 
167
 
168
 

powered by: WebSVN 2.1.0

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