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

Subversion Repositories usbhostslave

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// usbHostCyc2Wrap.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 usbHostCyc2Wrap(
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
 
108
assign USBWireDataIn = {USBWireVP, USBWireVM};
109
assign {USBWireVP, USBWireVM} = (USBWireCtrlOut == 1'b1) ? USBWireDataOut : 2'bzz;
110
assign USBWireOE_n = ~USBWireCtrlOut;
111
 
112
//Parameters declaration: 
113
defparam usbHostInst.HOST_FIFO_DEPTH = 64;
114
parameter HOST_FIFO_DEPTH = 64;
115
defparam usbHostInst.HOST_FIFO_ADDR_WIDTH = 6;
116
parameter HOST_FIFO_ADDR_WIDTH = 6;
117
 
118
usbHost usbHostInst (
119
  .clk_i(clk_i),
120
  .rst_i(rst_i),
121
  .address_i(address_i),
122
  .data_i(data_i),
123
  .data_o(data_o),
124
  .we_i(we_i),
125
  .strobe_i(strobe_i),
126
  .ack_o(ack_o),
127
  .usbClk(usbClk),
128
  .hostSOFSentIntOut(hostSOFSentIntOut),
129
  .hostConnEventIntOut(hostConnEventIntOut),
130
  .hostResumeIntOut(hostResumeIntOut),
131
  .hostTransDoneIntOut(hostTransDoneIntOut),
132
  .USBWireDataIn(USBWireDataIn),
133
  .USBWireDataInTick(USBWireDataInTick),
134
  .USBWireDataOut(USBWireDataOut),
135
  .USBWireDataOutTick(USBWireDataOutTick),
136
  .USBWireCtrlOut(USBWireCtrlOut),
137
  .USBFullSpeed(USBFullSpeed));
138
 
139
 
140
endmodule
141
 
142
 
143
 
144
 
145
 
146
 
147
 

powered by: WebSVN 2.1.0

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