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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [wrapper/] [usbHostSlaveCyc2Wrap.v] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// usbHostSlaveCyc2Wrap.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 usbHostSlaveCyc2Wrap(
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
   );
63
 
64
input clk_i;
65
input rst_i;
66
input [7:0] address_i;
67
input [7:0] data_i;
68
output [7:0] data_o;
69
input we_i;
70
input strobe_i;
71
output ack_o;
72
output irq;
73
input usbClk;
74
inout USBWireVP /* synthesis useioff=1 */;
75
inout USBWireVM /* synthesis useioff=1 */;
76
output USBWireOE_n /* synthesis useioff=1 */;
77
output USBFullSpeed /* synthesis useioff=1 */;
78
 
79
wire clk_i;
80
wire rst_i;
81
wire [7:0] address_i;
82
wire [7:0] data_i;
83
wire [7:0] data_o;
84
wire irq;
85
wire usbClk;
86
wire USBWireDataOutTick;
87
wire USBWireDataInTick;
88
wire USBFullSpeed;
89
 
90
//internal wiring 
91
wire hostSOFSentIntOut;
92
wire hostConnEventIntOut;
93
wire hostResumeIntOut;
94
wire hostTransDoneIntOut;
95
wire slaveSOFRxedIntOut;
96
wire slaveResetEventIntOut;
97
wire slaveResumeIntOut;
98
wire slaveTransDoneIntOut;
99
wire slaveNAKSentIntOut;
100
wire USBWireCtrlOut;
101
wire [1:0] USBWireDataIn;
102
wire [1:0] USBWireDataOut;
103
 
104
 
105
assign irq = hostSOFSentIntOut | hostConnEventIntOut |
106
             hostResumeIntOut | hostTransDoneIntOut |
107
             slaveSOFRxedIntOut | slaveResetEventIntOut |
108
             slaveResumeIntOut | slaveTransDoneIntOut |
109
             slaveNAKSentIntOut;
110
 
111
assign USBWireDataIn = {USBWireVP, USBWireVM};
112
assign {USBWireVP, USBWireVM} = (USBWireCtrlOut == 1'b1) ? USBWireDataOut : 2'bzz;
113
assign USBWireOE_n = ~USBWireCtrlOut;
114
 
115
//Parameters declaration: 
116
defparam usbHostSlaveInst.HOST_FIFO_DEPTH = 64;
117
parameter HOST_FIFO_DEPTH = 64;
118
defparam usbHostSlaveInst.HOST_FIFO_ADDR_WIDTH = 6;
119
parameter HOST_FIFO_ADDR_WIDTH = 6;
120
defparam usbHostSlaveInst.EP0_FIFO_DEPTH = 64;
121
parameter EP0_FIFO_DEPTH = 64;
122
defparam usbHostSlaveInst.EP0_FIFO_ADDR_WIDTH = 6;
123
parameter EP0_FIFO_ADDR_WIDTH = 6;
124
defparam usbHostSlaveInst.EP1_FIFO_DEPTH = 64;
125
parameter EP1_FIFO_DEPTH = 64;
126
defparam usbHostSlaveInst.EP1_FIFO_ADDR_WIDTH = 6;
127
parameter EP1_FIFO_ADDR_WIDTH = 6;
128
defparam usbHostSlaveInst.EP2_FIFO_DEPTH = 64;
129
parameter EP2_FIFO_DEPTH = 64;
130
defparam usbHostSlaveInst.EP2_FIFO_ADDR_WIDTH = 6;
131
parameter EP2_FIFO_ADDR_WIDTH = 6;
132
defparam usbHostSlaveInst.EP3_FIFO_DEPTH = 64;
133
parameter EP3_FIFO_DEPTH = 64;
134
defparam usbHostSlaveInst.EP3_FIFO_ADDR_WIDTH = 6;
135
parameter EP3_FIFO_ADDR_WIDTH = 6;
136
usbHostSlave usbHostSlaveInst (
137
  .clk_i(clk_i),
138
  .rst_i(rst_i),
139
  .address_i(address_i),
140
  .data_i(data_i),
141
  .data_o(data_o),
142
  .we_i(we_i),
143
  .strobe_i(strobe_i),
144
  .ack_o(ack_o),
145
  .usbClk(usbClk),
146
  .hostSOFSentIntOut(hostSOFSentIntOut),
147
  .hostConnEventIntOut(hostConnEventIntOut),
148
  .hostResumeIntOut(hostResumeIntOut),
149
  .hostTransDoneIntOut(hostTransDoneIntOut),
150
  .slaveSOFRxedIntOut(slaveSOFRxedIntOut),
151
  .slaveResetEventIntOut(slaveResetEventIntOut),
152
  .slaveResumeIntOut(slaveResumeIntOut),
153
  .slaveTransDoneIntOut(slaveTransDoneIntOut),
154
  .slaveNAKSentIntOut(slaveNAKSentIntOut),
155
  .USBWireDataIn(USBWireDataIn),
156
  .USBWireDataInTick(USBWireDataInTick),
157
  .USBWireDataOut(USBWireDataOut),
158
  .USBWireDataOutTick(USBWireDataOutTick),
159
  .USBWireCtrlOut(USBWireCtrlOut),
160
  .USBFullSpeed(USBFullSpeed));
161
 
162
 
163
endmodule
164
 
165
 
166
 
167
 
168
 
169
 
170
 

powered by: WebSVN 2.1.0

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