1 |
2 |
dinesha |
/////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// Descriptor ROM ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// ////
|
6 |
|
|
//// Author: Rudolf Usselmann ////
|
7 |
|
|
//// rudi@asics.ws ////
|
8 |
|
|
//// ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// Downloaded from: http://www.opencores.org/cores/usb1_funct/////
|
11 |
|
|
//// ////
|
12 |
|
|
/////////////////////////////////////////////////////////////////////
|
13 |
|
|
//// ////
|
14 |
|
|
//// Copyright (C) 2000-2002 Rudolf Usselmann ////
|
15 |
|
|
//// www.asics.ws ////
|
16 |
|
|
//// rudi@asics.ws ////
|
17 |
|
|
//// ////
|
18 |
|
|
//// This source file may be used and distributed without ////
|
19 |
|
|
//// restriction provided that this copyright statement is not ////
|
20 |
|
|
//// removed from the file and that any derivative work contains ////
|
21 |
|
|
//// the original copyright notice and the associated disclaimer.////
|
22 |
|
|
//// ////
|
23 |
|
|
//// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ////
|
24 |
|
|
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ////
|
25 |
|
|
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ////
|
26 |
|
|
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR ////
|
27 |
|
|
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
|
28 |
|
|
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ////
|
29 |
|
|
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ////
|
30 |
|
|
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ////
|
31 |
|
|
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ////
|
32 |
|
|
//// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
|
33 |
|
|
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ////
|
34 |
|
|
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ////
|
35 |
|
|
//// POSSIBILITY OF SUCH DAMAGE. ////
|
36 |
|
|
//// ////
|
37 |
|
|
/////////////////////////////////////////////////////////////////////
|
38 |
|
|
|
39 |
|
|
// CVS Log
|
40 |
|
|
//
|
41 |
|
|
// $Id: usb1_rom1.v,v 1.1.1.1 2002-09-19 12:07:29 rudi Exp $
|
42 |
|
|
//
|
43 |
|
|
// $Date: 2002-09-19 12:07:29 $
|
44 |
|
|
// $Revision: 1.1.1.1 $
|
45 |
|
|
// $Author: rudi $
|
46 |
|
|
// $Locker: $
|
47 |
|
|
// $State: Exp $
|
48 |
|
|
//
|
49 |
|
|
// Change History:
|
50 |
|
|
// $Log: not supported by cvs2svn $
|
51 |
|
|
//
|
52 |
|
|
//
|
53 |
|
|
//
|
54 |
|
|
//
|
55 |
|
|
//
|
56 |
|
|
|
57 |
|
|
`include "usb1_defines.v"
|
58 |
|
|
|
59 |
|
|
module usb1_rom1(clk, adr, dout);
|
60 |
|
|
input clk;
|
61 |
|
|
input [6:0] adr;
|
62 |
|
|
output [7:0] dout;
|
63 |
|
|
|
64 |
|
|
reg [7:0] dout;
|
65 |
|
|
|
66 |
|
|
always @(posedge clk)
|
67 |
|
|
case(adr) // synopsys full_case parallel_case
|
68 |
|
|
|
69 |
|
|
// ====================================
|
70 |
|
|
// ===== DEVICE Descriptor =====
|
71 |
|
|
// ====================================
|
72 |
|
|
|
73 |
|
|
7'h00: dout <= #1 8'd18; // this descriptor length
|
74 |
|
|
7'h01: dout <= #1 8'h01; // descriptor type
|
75 |
|
|
7'h02: dout <= #1 8'h00; // USB version low byte
|
76 |
|
|
7'h03: dout <= #1 8'h01; // USB version high byte
|
77 |
|
|
7'h04: dout <= #1 8'hff; // device class
|
78 |
|
|
7'h05: dout <= #1 8'h00; // device sub class
|
79 |
|
|
7'h06: dout <= #1 8'hff; // device protocol
|
80 |
|
|
7'h07: dout <= #1 8'd64; // max packet size
|
81 |
|
|
7'h08: dout <= #1 8'h34; // vendor ID low byte
|
82 |
|
|
7'h09: dout <= #1 8'h12; // vendor ID high byte
|
83 |
|
|
7'h0a: dout <= #1 8'h78; // product ID low byte
|
84 |
|
|
7'h0b: dout <= #1 8'h56; // product ID high byte
|
85 |
|
|
7'h0c: dout <= #1 8'h10; // device rel. number low byte
|
86 |
|
|
7'h0d: dout <= #1 8'h00; // device rel. number high byte
|
87 |
|
|
7'h0e: dout <= #1 8'h00; // Manufacturer String Index
|
88 |
|
|
7'h0f: dout <= #1 8'h00; // Product Descr. String Index
|
89 |
|
|
7'h10: dout <= #1 8'h00; // S/N String Index
|
90 |
|
|
7'h11: dout <= #1 8'h01; // Number of possible config.
|
91 |
|
|
|
92 |
|
|
// ====================================
|
93 |
|
|
// ===== Configuration Descriptor =====
|
94 |
|
|
// ====================================
|
95 |
|
|
7'h12: dout <= #1 8'h09; // this descriptor length
|
96 |
|
|
7'h13: dout <= #1 8'h02; // descriptor type
|
97 |
|
|
7'h14: dout <= #1 8'd53; // total data length low byte
|
98 |
|
|
7'h15: dout <= #1 8'd00; // total data length high byte
|
99 |
|
|
7'h16: dout <= #1 8'h01; // number of interfaces
|
100 |
|
|
7'h17: dout <= #1 8'h01; // number of configurations
|
101 |
|
|
7'h18: dout <= #1 8'h00; // Conf. String Index
|
102 |
|
|
7'h19: dout <= #1 8'h40; // Config. Characteristics
|
103 |
|
|
7'h1a: dout <= #1 8'h00; // Max. Power Consumption
|
104 |
|
|
|
105 |
|
|
// ====================================
|
106 |
|
|
// ===== Interface Descriptor =====
|
107 |
|
|
// ====================================
|
108 |
|
|
7'h1b: dout <= #1 8'h09; // this descriptor length
|
109 |
|
|
7'h1c: dout <= #1 8'h04; // descriptor type
|
110 |
|
|
7'h1d: dout <= #1 8'h00; // interface number
|
111 |
|
|
7'h1e: dout <= #1 8'h00; // alternate setting
|
112 |
|
|
7'h1f: dout <= #1 8'h05; // number of endpoints
|
113 |
|
|
7'h20: dout <= #1 8'hff; // interface class
|
114 |
|
|
7'h21: dout <= #1 8'h01; // interface sub class
|
115 |
|
|
7'h22: dout <= #1 8'hff; // interface protocol
|
116 |
|
|
7'h23: dout <= #1 8'h00; // interface string index
|
117 |
|
|
|
118 |
|
|
// ====================================
|
119 |
|
|
// ===== Endpoint 1 Descriptor =====
|
120 |
|
|
// ====================================
|
121 |
|
|
7'h24: dout <= #1 8'h07; // this descriptor length
|
122 |
|
|
7'h25: dout <= #1 8'h05; // descriptor type
|
123 |
|
|
7'h26: dout <= #1 8'h81; // endpoint address
|
124 |
|
|
7'h27: dout <= #1 8'h01; // endpoint attributes
|
125 |
|
|
7'h28: dout <= #1 8'h00; // max packet size low byte
|
126 |
|
|
7'h29: dout <= #1 8'h01; // max packet size high byte
|
127 |
|
|
7'h2a: dout <= #1 8'h01; // polling interval
|
128 |
|
|
|
129 |
|
|
// ====================================
|
130 |
|
|
// ===== Endpoint 2 Descriptor =====
|
131 |
|
|
// ====================================
|
132 |
|
|
7'h2b: dout <= #1 8'h07; // this descriptor length
|
133 |
|
|
7'h2c: dout <= #1 8'h05; // descriptor type
|
134 |
|
|
7'h2d: dout <= #1 8'h02; // endpoint address
|
135 |
|
|
7'h2e: dout <= #1 8'h01; // endpoint attributes
|
136 |
|
|
7'h2f: dout <= #1 8'h00; // max packet size low byte
|
137 |
|
|
7'h30: dout <= #1 8'h01; // max packet size high byte
|
138 |
|
|
7'h31: dout <= #1 8'h01; // polling interval
|
139 |
|
|
|
140 |
|
|
// ====================================
|
141 |
|
|
// ===== Endpoint 3 Descriptor =====
|
142 |
|
|
// ====================================
|
143 |
|
|
7'h32: dout <= #1 8'h07; // this descriptor length
|
144 |
|
|
7'h33: dout <= #1 8'h05; // descriptor type
|
145 |
|
|
7'h34: dout <= #1 8'h83; // endpoint address
|
146 |
|
|
7'h35: dout <= #1 8'h02; // endpoint attributes
|
147 |
|
|
7'h36: dout <= #1 8'd64; // max packet size low byte
|
148 |
|
|
7'h37: dout <= #1 8'd00; // max packet size high byte
|
149 |
|
|
7'h38: dout <= #1 8'h01; // polling interval
|
150 |
|
|
|
151 |
|
|
// ====================================
|
152 |
|
|
// ===== Endpoint 4 Descriptor =====
|
153 |
|
|
// ====================================
|
154 |
|
|
7'h39: dout <= #1 8'h07; // this descriptor length
|
155 |
|
|
7'h3a: dout <= #1 8'h05; // descriptor type
|
156 |
|
|
7'h3b: dout <= #1 8'h04; // endpoint address
|
157 |
|
|
7'h3c: dout <= #1 8'h02; // endpoint attributes
|
158 |
|
|
7'h3d: dout <= #1 8'd64; // max packet size low byte
|
159 |
|
|
7'h3e: dout <= #1 8'd00; // max packet size high byte
|
160 |
|
|
7'h3f: dout <= #1 8'h01; // polling interval
|
161 |
|
|
|
162 |
|
|
// ====================================
|
163 |
|
|
// ===== Endpoint 5 Descriptor =====
|
164 |
|
|
// ====================================
|
165 |
|
|
7'h40: dout <= #1 8'h07; // this descriptor length
|
166 |
|
|
7'h41: dout <= #1 8'h05; // descriptor type
|
167 |
|
|
7'h42: dout <= #1 8'h85; // endpoint address
|
168 |
|
|
7'h43: dout <= #1 8'h03; // endpoint attributes
|
169 |
|
|
7'h44: dout <= #1 8'd64; // max packet size low byte
|
170 |
|
|
7'h45: dout <= #1 8'd00; // max packet size high byte
|
171 |
|
|
7'h46: dout <= #1 8'h01; // polling interval
|
172 |
|
|
|
173 |
|
|
/*
|
174 |
|
|
// ====================================
|
175 |
|
|
// ===== String Descriptor Lang ID=====
|
176 |
|
|
// ====================================
|
177 |
|
|
|
178 |
|
|
7'h47: dout <= #1 8'd06; // this descriptor length
|
179 |
|
|
7'h48: dout <= #1 8'd03; // descriptor type
|
180 |
|
|
|
181 |
|
|
7'h49: dout <= #1 8'd09; // Language ID 0 low byte
|
182 |
|
|
7'h4a: dout <= #1 8'd04; // Language ID 0 high byte
|
183 |
|
|
|
184 |
|
|
7'h4b: dout <= #1 8'd09; // Language ID 1 low byte
|
185 |
|
|
7'h4c: dout <= #1 8'd04; // Language ID 1 high byte
|
186 |
|
|
|
187 |
|
|
7'h4d: dout <= #1 8'd09; // Language ID 2 low byte
|
188 |
|
|
7'h4e: dout <= #1 8'd04; // Language ID 2 high byte
|
189 |
|
|
|
190 |
|
|
// ====================================
|
191 |
|
|
// ===== String Descriptor 0 =====
|
192 |
|
|
// ====================================
|
193 |
|
|
|
194 |
|
|
7'h50: dout <= #1 8'd010; // this descriptor length
|
195 |
|
|
7'h51: dout <= #1 8'd03; // descriptor type
|
196 |
|
|
7'h52: dout <= #1 "0";
|
197 |
|
|
7'h53: dout <= #1 " ";
|
198 |
|
|
7'h54: dout <= #1 "g";
|
199 |
|
|
7'h55: dout <= #1 "n";
|
200 |
|
|
7'h56: dout <= #1 "i";
|
201 |
|
|
7'h57: dout <= #1 "r";
|
202 |
|
|
7'h58: dout <= #1 "t";
|
203 |
|
|
7'h59: dout <= #1 "S";
|
204 |
|
|
|
205 |
|
|
// ====================================
|
206 |
|
|
// ===== String Descriptor 1 =====
|
207 |
|
|
// ====================================
|
208 |
|
|
|
209 |
|
|
7'h60: dout <= #1 8'd010; // this descriptor length
|
210 |
|
|
7'h61: dout <= #1 8'd03; // descriptor type
|
211 |
|
|
7'h62: dout <= #1 "1";
|
212 |
|
|
7'h63: dout <= #1 " ";
|
213 |
|
|
7'h64: dout <= #1 "g";
|
214 |
|
|
7'h65: dout <= #1 "n";
|
215 |
|
|
7'h66: dout <= #1 "i";
|
216 |
|
|
7'h67: dout <= #1 "r";
|
217 |
|
|
7'h68: dout <= #1 "t";
|
218 |
|
|
7'h69: dout <= #1 "S";
|
219 |
|
|
|
220 |
|
|
// ====================================
|
221 |
|
|
// ===== String Descriptor 2 =====
|
222 |
|
|
// ====================================
|
223 |
|
|
|
224 |
|
|
7'h70: dout <= #1 8'd010; // this descriptor length
|
225 |
|
|
7'h71: dout <= #1 8'd03; // descriptor type
|
226 |
|
|
7'h72: dout <= #1 "2";
|
227 |
|
|
7'h73: dout <= #1 " ";
|
228 |
|
|
7'h74: dout <= #1 "g";
|
229 |
|
|
7'h75: dout <= #1 "n";
|
230 |
|
|
7'h76: dout <= #1 "i";
|
231 |
|
|
7'h77: dout <= #1 "r";
|
232 |
|
|
7'h78: dout <= #1 "t";
|
233 |
|
|
7'h79: dout <= #1 "S";
|
234 |
|
|
|
235 |
|
|
*/
|
236 |
|
|
|
237 |
|
|
// ====================================
|
238 |
|
|
// ====================================
|
239 |
|
|
|
240 |
|
|
//default: dout <= #1 8'd00;
|
241 |
|
|
endcase
|
242 |
|
|
|
243 |
|
|
endmodule
|