1 |
3 |
ultra_embe |
//-----------------------------------------------------------------
|
2 |
|
|
// USB Full Speed Host
|
3 |
|
|
// V0.5
|
4 |
|
|
// Ultra-Embedded.com
|
5 |
|
|
// Copyright 2015-2019
|
6 |
|
|
//
|
7 |
|
|
// Email: admin@ultra-embedded.com
|
8 |
|
|
//
|
9 |
|
|
// License: GPL
|
10 |
|
|
// If you would like a version with a more permissive license for
|
11 |
|
|
// use in closed source commercial applications please contact me
|
12 |
|
|
// for details.
|
13 |
|
|
//-----------------------------------------------------------------
|
14 |
|
|
//
|
15 |
|
|
// This file is open source HDL; you can redistribute it and/or
|
16 |
|
|
// modify it under the terms of the GNU General Public License as
|
17 |
|
|
// published by the Free Software Foundation; either version 2 of
|
18 |
|
|
// the License, or (at your option) any later version.
|
19 |
|
|
//
|
20 |
|
|
// This file is distributed in the hope that it will be useful,
|
21 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
|
|
// GNU General Public License for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public
|
26 |
|
|
// License along with this file; if not, write to the Free Software
|
27 |
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
28 |
|
|
// USA
|
29 |
|
|
//-----------------------------------------------------------------
|
30 |
|
|
|
31 |
|
|
//-----------------------------------------------------------------
|
32 |
|
|
// Generated File
|
33 |
|
|
//-----------------------------------------------------------------
|
34 |
|
|
|
35 |
|
|
`define USB_CTRL 8'h0
|
36 |
|
|
|
37 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN 7
|
38 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN_DEFAULT 0
|
39 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN_B 7
|
40 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN_T 7
|
41 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN_W 1
|
42 |
|
|
`define USB_CTRL_PHY_DMPULLDOWN_R 7:7
|
43 |
|
|
|
44 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN 6
|
45 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN_DEFAULT 0
|
46 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN_B 6
|
47 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN_T 6
|
48 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN_W 1
|
49 |
|
|
`define USB_CTRL_PHY_DPPULLDOWN_R 6:6
|
50 |
|
|
|
51 |
|
|
`define USB_CTRL_PHY_TERMSELECT 5
|
52 |
|
|
`define USB_CTRL_PHY_TERMSELECT_DEFAULT 0
|
53 |
|
|
`define USB_CTRL_PHY_TERMSELECT_B 5
|
54 |
|
|
`define USB_CTRL_PHY_TERMSELECT_T 5
|
55 |
|
|
`define USB_CTRL_PHY_TERMSELECT_W 1
|
56 |
|
|
`define USB_CTRL_PHY_TERMSELECT_R 5:5
|
57 |
|
|
|
58 |
|
|
`define USB_CTRL_PHY_XCVRSELECT_DEFAULT 0
|
59 |
|
|
`define USB_CTRL_PHY_XCVRSELECT_B 3
|
60 |
|
|
`define USB_CTRL_PHY_XCVRSELECT_T 4
|
61 |
|
|
`define USB_CTRL_PHY_XCVRSELECT_W 2
|
62 |
|
|
`define USB_CTRL_PHY_XCVRSELECT_R 4:3
|
63 |
|
|
|
64 |
|
|
`define USB_CTRL_PHY_OPMODE_DEFAULT 0
|
65 |
|
|
`define USB_CTRL_PHY_OPMODE_B 1
|
66 |
|
|
`define USB_CTRL_PHY_OPMODE_T 2
|
67 |
|
|
`define USB_CTRL_PHY_OPMODE_W 2
|
68 |
|
|
`define USB_CTRL_PHY_OPMODE_R 2:1
|
69 |
|
|
|
70 |
|
|
`define USB_CTRL_TX_FLUSH 1
|
71 |
|
|
`define USB_CTRL_TX_FLUSH_DEFAULT 0
|
72 |
|
|
`define USB_CTRL_TX_FLUSH_B 1
|
73 |
|
|
`define USB_CTRL_TX_FLUSH_T 1
|
74 |
|
|
`define USB_CTRL_TX_FLUSH_W 1
|
75 |
|
|
`define USB_CTRL_TX_FLUSH_R 1:1
|
76 |
|
|
|
77 |
|
|
`define USB_CTRL_ENABLE_SOF 0
|
78 |
|
|
`define USB_CTRL_ENABLE_SOF_DEFAULT 0
|
79 |
|
|
`define USB_CTRL_ENABLE_SOF_B 0
|
80 |
|
|
`define USB_CTRL_ENABLE_SOF_T 0
|
81 |
|
|
`define USB_CTRL_ENABLE_SOF_W 1
|
82 |
|
|
`define USB_CTRL_ENABLE_SOF_R 0:0
|
83 |
|
|
|
84 |
|
|
`define USB_STATUS 8'h4
|
85 |
|
|
|
86 |
|
|
`define USB_STATUS_SOF_TIME_DEFAULT 0
|
87 |
|
|
`define USB_STATUS_SOF_TIME_B 16
|
88 |
|
|
`define USB_STATUS_SOF_TIME_T 31
|
89 |
|
|
`define USB_STATUS_SOF_TIME_W 16
|
90 |
|
|
`define USB_STATUS_SOF_TIME_R 31:16
|
91 |
|
|
|
92 |
|
|
`define USB_STATUS_RX_ERROR 2
|
93 |
|
|
`define USB_STATUS_RX_ERROR_DEFAULT 0
|
94 |
|
|
`define USB_STATUS_RX_ERROR_B 2
|
95 |
|
|
`define USB_STATUS_RX_ERROR_T 2
|
96 |
|
|
`define USB_STATUS_RX_ERROR_W 1
|
97 |
|
|
`define USB_STATUS_RX_ERROR_R 2:2
|
98 |
|
|
|
99 |
|
|
`define USB_STATUS_LINESTATE_BITS_DEFAULT 0
|
100 |
|
|
`define USB_STATUS_LINESTATE_BITS_B 0
|
101 |
|
|
`define USB_STATUS_LINESTATE_BITS_T 1
|
102 |
|
|
`define USB_STATUS_LINESTATE_BITS_W 2
|
103 |
|
|
`define USB_STATUS_LINESTATE_BITS_R 1:0
|
104 |
|
|
|
105 |
|
|
`define USB_IRQ_ACK 8'h8
|
106 |
|
|
|
107 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT 3
|
108 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT_DEFAULT 0
|
109 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT_B 3
|
110 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT_T 3
|
111 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT_W 1
|
112 |
|
|
`define USB_IRQ_ACK_DEVICE_DETECT_R 3:3
|
113 |
|
|
|
114 |
|
|
`define USB_IRQ_ACK_ERR 2
|
115 |
|
|
`define USB_IRQ_ACK_ERR_DEFAULT 0
|
116 |
|
|
`define USB_IRQ_ACK_ERR_B 2
|
117 |
|
|
`define USB_IRQ_ACK_ERR_T 2
|
118 |
|
|
`define USB_IRQ_ACK_ERR_W 1
|
119 |
|
|
`define USB_IRQ_ACK_ERR_R 2:2
|
120 |
|
|
|
121 |
|
|
`define USB_IRQ_ACK_DONE 1
|
122 |
|
|
`define USB_IRQ_ACK_DONE_DEFAULT 0
|
123 |
|
|
`define USB_IRQ_ACK_DONE_B 1
|
124 |
|
|
`define USB_IRQ_ACK_DONE_T 1
|
125 |
|
|
`define USB_IRQ_ACK_DONE_W 1
|
126 |
|
|
`define USB_IRQ_ACK_DONE_R 1:1
|
127 |
|
|
|
128 |
|
|
`define USB_IRQ_ACK_SOF 0
|
129 |
|
|
`define USB_IRQ_ACK_SOF_DEFAULT 0
|
130 |
|
|
`define USB_IRQ_ACK_SOF_B 0
|
131 |
|
|
`define USB_IRQ_ACK_SOF_T 0
|
132 |
|
|
`define USB_IRQ_ACK_SOF_W 1
|
133 |
|
|
`define USB_IRQ_ACK_SOF_R 0:0
|
134 |
|
|
|
135 |
|
|
`define USB_IRQ_STS 8'hc
|
136 |
|
|
|
137 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT 3
|
138 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT_DEFAULT 0
|
139 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT_B 3
|
140 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT_T 3
|
141 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT_W 1
|
142 |
|
|
`define USB_IRQ_STS_DEVICE_DETECT_R 3:3
|
143 |
|
|
|
144 |
|
|
`define USB_IRQ_STS_ERR 2
|
145 |
|
|
`define USB_IRQ_STS_ERR_DEFAULT 0
|
146 |
|
|
`define USB_IRQ_STS_ERR_B 2
|
147 |
|
|
`define USB_IRQ_STS_ERR_T 2
|
148 |
|
|
`define USB_IRQ_STS_ERR_W 1
|
149 |
|
|
`define USB_IRQ_STS_ERR_R 2:2
|
150 |
|
|
|
151 |
|
|
`define USB_IRQ_STS_DONE 1
|
152 |
|
|
`define USB_IRQ_STS_DONE_DEFAULT 0
|
153 |
|
|
`define USB_IRQ_STS_DONE_B 1
|
154 |
|
|
`define USB_IRQ_STS_DONE_T 1
|
155 |
|
|
`define USB_IRQ_STS_DONE_W 1
|
156 |
|
|
`define USB_IRQ_STS_DONE_R 1:1
|
157 |
|
|
|
158 |
|
|
`define USB_IRQ_STS_SOF 0
|
159 |
|
|
`define USB_IRQ_STS_SOF_DEFAULT 0
|
160 |
|
|
`define USB_IRQ_STS_SOF_B 0
|
161 |
|
|
`define USB_IRQ_STS_SOF_T 0
|
162 |
|
|
`define USB_IRQ_STS_SOF_W 1
|
163 |
|
|
`define USB_IRQ_STS_SOF_R 0:0
|
164 |
|
|
|
165 |
|
|
`define USB_IRQ_MASK 8'h10
|
166 |
|
|
|
167 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT 3
|
168 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT_DEFAULT 0
|
169 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT_B 3
|
170 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT_T 3
|
171 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT_W 1
|
172 |
|
|
`define USB_IRQ_MASK_DEVICE_DETECT_R 3:3
|
173 |
|
|
|
174 |
|
|
`define USB_IRQ_MASK_ERR 2
|
175 |
|
|
`define USB_IRQ_MASK_ERR_DEFAULT 0
|
176 |
|
|
`define USB_IRQ_MASK_ERR_B 2
|
177 |
|
|
`define USB_IRQ_MASK_ERR_T 2
|
178 |
|
|
`define USB_IRQ_MASK_ERR_W 1
|
179 |
|
|
`define USB_IRQ_MASK_ERR_R 2:2
|
180 |
|
|
|
181 |
|
|
`define USB_IRQ_MASK_DONE 1
|
182 |
|
|
`define USB_IRQ_MASK_DONE_DEFAULT 0
|
183 |
|
|
`define USB_IRQ_MASK_DONE_B 1
|
184 |
|
|
`define USB_IRQ_MASK_DONE_T 1
|
185 |
|
|
`define USB_IRQ_MASK_DONE_W 1
|
186 |
|
|
`define USB_IRQ_MASK_DONE_R 1:1
|
187 |
|
|
|
188 |
|
|
`define USB_IRQ_MASK_SOF 0
|
189 |
|
|
`define USB_IRQ_MASK_SOF_DEFAULT 0
|
190 |
|
|
`define USB_IRQ_MASK_SOF_B 0
|
191 |
|
|
`define USB_IRQ_MASK_SOF_T 0
|
192 |
|
|
`define USB_IRQ_MASK_SOF_W 1
|
193 |
|
|
`define USB_IRQ_MASK_SOF_R 0:0
|
194 |
|
|
|
195 |
|
|
`define USB_XFER_DATA 8'h14
|
196 |
|
|
|
197 |
|
|
`define USB_XFER_DATA_TX_LEN_DEFAULT 0
|
198 |
|
|
`define USB_XFER_DATA_TX_LEN_B 0
|
199 |
|
|
`define USB_XFER_DATA_TX_LEN_T 15
|
200 |
|
|
`define USB_XFER_DATA_TX_LEN_W 16
|
201 |
|
|
`define USB_XFER_DATA_TX_LEN_R 15:0
|
202 |
|
|
|
203 |
|
|
`define USB_XFER_TOKEN 8'h18
|
204 |
|
|
|
205 |
|
|
`define USB_XFER_TOKEN_START 31
|
206 |
|
|
`define USB_XFER_TOKEN_START_DEFAULT 0
|
207 |
|
|
`define USB_XFER_TOKEN_START_B 31
|
208 |
|
|
`define USB_XFER_TOKEN_START_T 31
|
209 |
|
|
`define USB_XFER_TOKEN_START_W 1
|
210 |
|
|
`define USB_XFER_TOKEN_START_R 31:31
|
211 |
|
|
|
212 |
|
|
`define USB_XFER_TOKEN_IN 30
|
213 |
|
|
`define USB_XFER_TOKEN_IN_DEFAULT 0
|
214 |
|
|
`define USB_XFER_TOKEN_IN_B 30
|
215 |
|
|
`define USB_XFER_TOKEN_IN_T 30
|
216 |
|
|
`define USB_XFER_TOKEN_IN_W 1
|
217 |
|
|
`define USB_XFER_TOKEN_IN_R 30:30
|
218 |
|
|
|
219 |
|
|
`define USB_XFER_TOKEN_ACK 29
|
220 |
|
|
`define USB_XFER_TOKEN_ACK_DEFAULT 0
|
221 |
|
|
`define USB_XFER_TOKEN_ACK_B 29
|
222 |
|
|
`define USB_XFER_TOKEN_ACK_T 29
|
223 |
|
|
`define USB_XFER_TOKEN_ACK_W 1
|
224 |
|
|
`define USB_XFER_TOKEN_ACK_R 29:29
|
225 |
|
|
|
226 |
|
|
`define USB_XFER_TOKEN_PID_DATAX 28
|
227 |
|
|
`define USB_XFER_TOKEN_PID_DATAX_DEFAULT 0
|
228 |
|
|
`define USB_XFER_TOKEN_PID_DATAX_B 28
|
229 |
|
|
`define USB_XFER_TOKEN_PID_DATAX_T 28
|
230 |
|
|
`define USB_XFER_TOKEN_PID_DATAX_W 1
|
231 |
|
|
`define USB_XFER_TOKEN_PID_DATAX_R 28:28
|
232 |
|
|
|
233 |
|
|
`define USB_XFER_TOKEN_PID_BITS_DEFAULT 0
|
234 |
|
|
`define USB_XFER_TOKEN_PID_BITS_B 16
|
235 |
|
|
`define USB_XFER_TOKEN_PID_BITS_T 23
|
236 |
|
|
`define USB_XFER_TOKEN_PID_BITS_W 8
|
237 |
|
|
`define USB_XFER_TOKEN_PID_BITS_R 23:16
|
238 |
|
|
|
239 |
|
|
`define USB_XFER_TOKEN_DEV_ADDR_DEFAULT 0
|
240 |
|
|
`define USB_XFER_TOKEN_DEV_ADDR_B 9
|
241 |
|
|
`define USB_XFER_TOKEN_DEV_ADDR_T 15
|
242 |
|
|
`define USB_XFER_TOKEN_DEV_ADDR_W 7
|
243 |
|
|
`define USB_XFER_TOKEN_DEV_ADDR_R 15:9
|
244 |
|
|
|
245 |
|
|
`define USB_XFER_TOKEN_EP_ADDR_DEFAULT 0
|
246 |
|
|
`define USB_XFER_TOKEN_EP_ADDR_B 5
|
247 |
|
|
`define USB_XFER_TOKEN_EP_ADDR_T 8
|
248 |
|
|
`define USB_XFER_TOKEN_EP_ADDR_W 4
|
249 |
|
|
`define USB_XFER_TOKEN_EP_ADDR_R 8:5
|
250 |
|
|
|
251 |
|
|
`define USB_RX_STAT 8'h1c
|
252 |
|
|
|
253 |
|
|
`define USB_RX_STAT_START_PEND 31
|
254 |
|
|
`define USB_RX_STAT_START_PEND_DEFAULT 0
|
255 |
|
|
`define USB_RX_STAT_START_PEND_B 31
|
256 |
|
|
`define USB_RX_STAT_START_PEND_T 31
|
257 |
|
|
`define USB_RX_STAT_START_PEND_W 1
|
258 |
|
|
`define USB_RX_STAT_START_PEND_R 31:31
|
259 |
|
|
|
260 |
|
|
`define USB_RX_STAT_CRC_ERR 30
|
261 |
|
|
`define USB_RX_STAT_CRC_ERR_DEFAULT 0
|
262 |
|
|
`define USB_RX_STAT_CRC_ERR_B 30
|
263 |
|
|
`define USB_RX_STAT_CRC_ERR_T 30
|
264 |
|
|
`define USB_RX_STAT_CRC_ERR_W 1
|
265 |
|
|
`define USB_RX_STAT_CRC_ERR_R 30:30
|
266 |
|
|
|
267 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT 29
|
268 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT_DEFAULT 0
|
269 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT_B 29
|
270 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT_T 29
|
271 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT_W 1
|
272 |
|
|
`define USB_RX_STAT_RESP_TIMEOUT_R 29:29
|
273 |
|
|
|
274 |
|
|
`define USB_RX_STAT_IDLE 28
|
275 |
|
|
`define USB_RX_STAT_IDLE_DEFAULT 0
|
276 |
|
|
`define USB_RX_STAT_IDLE_B 28
|
277 |
|
|
`define USB_RX_STAT_IDLE_T 28
|
278 |
|
|
`define USB_RX_STAT_IDLE_W 1
|
279 |
|
|
`define USB_RX_STAT_IDLE_R 28:28
|
280 |
|
|
|
281 |
|
|
`define USB_RX_STAT_RESP_BITS_DEFAULT 0
|
282 |
|
|
`define USB_RX_STAT_RESP_BITS_B 16
|
283 |
|
|
`define USB_RX_STAT_RESP_BITS_T 23
|
284 |
|
|
`define USB_RX_STAT_RESP_BITS_W 8
|
285 |
|
|
`define USB_RX_STAT_RESP_BITS_R 23:16
|
286 |
|
|
|
287 |
|
|
`define USB_RX_STAT_COUNT_BITS_DEFAULT 0
|
288 |
|
|
`define USB_RX_STAT_COUNT_BITS_B 0
|
289 |
|
|
`define USB_RX_STAT_COUNT_BITS_T 15
|
290 |
|
|
`define USB_RX_STAT_COUNT_BITS_W 16
|
291 |
|
|
`define USB_RX_STAT_COUNT_BITS_R 15:0
|
292 |
|
|
|
293 |
|
|
`define USB_WR_DATA 8'h20
|
294 |
|
|
|
295 |
|
|
`define USB_WR_DATA_DATA_DEFAULT 0
|
296 |
|
|
`define USB_WR_DATA_DATA_B 0
|
297 |
|
|
`define USB_WR_DATA_DATA_T 7
|
298 |
|
|
`define USB_WR_DATA_DATA_W 8
|
299 |
|
|
`define USB_WR_DATA_DATA_R 7:0
|
300 |
|
|
|
301 |
|
|
`define USB_RD_DATA 8'h20
|
302 |
|
|
|
303 |
|
|
`define USB_RD_DATA_DATA_DEFAULT 0
|
304 |
|
|
`define USB_RD_DATA_DATA_B 0
|
305 |
|
|
`define USB_RD_DATA_DATA_T 7
|
306 |
|
|
`define USB_RD_DATA_DATA_W 8
|
307 |
|
|
`define USB_RD_DATA_DATA_R 7:0
|
308 |
|
|
|