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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [hostSlaveMux/] [hostSlaveMux.v] - Blame information for rev 20

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

Line No. Rev Author Line
1 2 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// hostSlaveMux.v                                               ////
4
////                                                              ////
5
//// This file is part of the usbhostslave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9 18 sfielding
//// Controls the select line for the mux that enables the sharing
10
//// of a single SerialInterfaceEgine between the hostController
11
//// and slaveController
12
//// Also a dumping area for any features common to host and slave 
13
//// operation. That is reset control and version number report.
14 2 sfielding
////                                                              ////
15
//// To Do:                                                       ////
16
//// 
17
////                                                              ////
18
//// Author(s):                                                   ////
19
//// - Steve Fielding, sfielding@base2designs.com                 ////
20
////                                                              ////
21
//////////////////////////////////////////////////////////////////////
22
////                                                              ////
23
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
24
////                                                              ////
25
//// This source file may be used and distributed without         ////
26
//// restriction provided that this copyright statement is not    ////
27
//// removed from the file and that any derivative work contains  ////
28
//// the original copyright notice and the associated disclaimer. ////
29
////                                                              ////
30
//// This source file is free software; you can redistribute it   ////
31
//// and/or modify it under the terms of the GNU Lesser General   ////
32
//// Public License as published by the Free Software Foundation; ////
33
//// either version 2.1 of the License, or (at your option) any   ////
34
//// later version.                                               ////
35
////                                                              ////
36
//// This source is distributed in the hope that it will be       ////
37
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
38
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
39
//// PURPOSE. See the GNU Lesser General Public License for more  ////
40
//// details.                                                     ////
41
////                                                              ////
42
//// You should have received a copy of the GNU Lesser General    ////
43
//// Public License along with this source; if not, download it   ////
44
//// from <http://www.opencores.org/lgpl.shtml>                   ////
45
////                                                              ////
46
//////////////////////////////////////////////////////////////////////
47
//
48 9 sfielding
`timescale 1ns / 1ps
49 2 sfielding
 
50 9 sfielding
 
51 2 sfielding
module hostSlaveMux (
52 5 sfielding
  SIEPortCtrlInToSIE,
53
  SIEPortCtrlInFromHost,
54
  SIEPortCtrlInFromSlave,
55
  SIEPortDataInToSIE,
56
  SIEPortDataInFromHost,
57
  SIEPortDataInFromSlave,
58
  SIEPortWEnToSIE,
59
  SIEPortWEnFromHost,
60
  SIEPortWEnFromSlave,
61
  fullSpeedPolarityToSIE,
62
  fullSpeedPolarityFromHost,
63
  fullSpeedPolarityFromSlave,
64
  fullSpeedBitRateToSIE,
65
  fullSpeedBitRateFromHost,
66
  fullSpeedBitRateFromSlave,
67 20 sfielding
  noActivityTimeOutEnableToSIE,
68
  noActivityTimeOutEnableFromHost,
69
  noActivityTimeOutEnableFromSlave,
70 2 sfielding
  dataIn,
71 9 sfielding
  dataOut,
72
  address,
73 2 sfielding
  writeEn,
74
  strobe_i,
75 18 sfielding
  busClk,
76
  usbClk,
77
  hostSlaveMuxSel,
78
  rstFromWire,
79
  rstSyncToBusClkOut,
80
  rstSyncToUsbClkOut
81
);
82 2 sfielding
 
83
 
84
output [7:0] SIEPortCtrlInToSIE;
85
input [7:0] SIEPortCtrlInFromHost;
86
input [7:0] SIEPortCtrlInFromSlave;
87
output [7:0] SIEPortDataInToSIE;
88
input [7:0] SIEPortDataInFromHost;
89
input [7:0] SIEPortDataInFromSlave;
90
output SIEPortWEnToSIE;
91
input SIEPortWEnFromHost;
92
input SIEPortWEnFromSlave;
93
output fullSpeedPolarityToSIE;
94
input fullSpeedPolarityFromHost;
95
input fullSpeedPolarityFromSlave;
96
output fullSpeedBitRateToSIE;
97
input fullSpeedBitRateFromHost;
98
input fullSpeedBitRateFromSlave;
99 20 sfielding
output noActivityTimeOutEnableToSIE;
100
input noActivityTimeOutEnableFromHost;
101
input noActivityTimeOutEnableFromSlave;
102 2 sfielding
//hostSlaveMuxBI
103
input [7:0] dataIn;
104 9 sfielding
input address;
105 2 sfielding
input writeEn;
106
input strobe_i;
107 18 sfielding
input busClk;
108
input usbClk;
109
input rstFromWire;
110
output rstSyncToBusClkOut;
111
output rstSyncToUsbClkOut;
112 2 sfielding
output [7:0] dataOut;
113
input hostSlaveMuxSel;
114
 
115
reg [7:0] SIEPortCtrlInToSIE;
116
wire [7:0] SIEPortCtrlInFromHost;
117
wire [7:0] SIEPortCtrlInFromSlave;
118
reg [7:0] SIEPortDataInToSIE;
119
wire [7:0] SIEPortDataInFromHost;
120
wire [7:0] SIEPortDataInFromSlave;
121
reg SIEPortWEnToSIE;
122
wire SIEPortWEnFromHost;
123
wire SIEPortWEnFromSlave;
124
reg fullSpeedPolarityToSIE;
125
wire fullSpeedPolarityFromHost;
126
wire fullSpeedPolarityFromSlave;
127
reg fullSpeedBitRateToSIE;
128
wire fullSpeedBitRateFromHost;
129
wire fullSpeedBitRateFromSlave;
130 20 sfielding
reg noActivityTimeOutEnableToSIE;
131
wire noActivityTimeOutEnableFromHost;
132
wire noActivityTimeOutEnableFromSlave;
133 2 sfielding
//hostSlaveMuxBI
134
wire [7:0] dataIn;
135 9 sfielding
wire address;
136 2 sfielding
wire writeEn;
137
wire strobe_i;
138 18 sfielding
wire busClk;
139
wire usbClk;
140
wire rstSyncToBusClkOut;
141
wire rstSyncToUsbClkOut;
142
wire rstFromWire;
143 2 sfielding
wire [7:0] dataOut;
144
wire hostSlaveMuxSel;
145
 
146
//internal wires and regs
147
wire hostMode;
148
 
149
always @(hostMode or
150 5 sfielding
  SIEPortCtrlInFromHost or
151
  SIEPortCtrlInFromSlave or
152
  SIEPortDataInFromHost or
153
  SIEPortDataInFromSlave or
154
  SIEPortWEnFromHost or
155
  SIEPortWEnFromSlave or
156
  fullSpeedPolarityFromHost or
157
  fullSpeedPolarityFromSlave or
158
  fullSpeedBitRateFromHost or
159 20 sfielding
  fullSpeedBitRateFromSlave or
160
  noActivityTimeOutEnableFromHost or
161
  noActivityTimeOutEnableFromSlave)
162 2 sfielding
begin
163
  if (hostMode == 1'b1)
164
  begin
165 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromHost;
166
    SIEPortDataInToSIE <=  SIEPortDataInFromHost;
167
    SIEPortWEnToSIE <= SIEPortWEnFromHost;
168 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromHost;
169
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromHost;
170 20 sfielding
    noActivityTimeOutEnableToSIE <= noActivityTimeOutEnableFromHost;
171 2 sfielding
  end
172
  else
173
  begin
174 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromSlave;
175
    SIEPortDataInToSIE <=  SIEPortDataInFromSlave;
176
    SIEPortWEnToSIE <= SIEPortWEnFromSlave;
177 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromSlave;
178
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromSlave;
179 20 sfielding
    noActivityTimeOutEnableToSIE <= noActivityTimeOutEnableFromSlave;
180 2 sfielding
  end
181
end
182
 
183
hostSlaveMuxBI u_hostSlaveMuxBI (
184
  .dataIn(dataIn),
185 9 sfielding
  .dataOut(dataOut),
186
  .address(address),
187 2 sfielding
  .writeEn(writeEn),
188
  .strobe_i(strobe_i),
189 18 sfielding
  .busClk(busClk),
190
  .usbClk(usbClk),
191 5 sfielding
  .hostMode(hostMode),
192 18 sfielding
  .hostSlaveMuxSel(hostSlaveMuxSel),
193
  .rstFromWire(rstFromWire),
194
  .rstSyncToBusClkOut(rstSyncToBusClkOut),
195
  .rstSyncToUsbClkOut(rstSyncToUsbClkOut) );
196 2 sfielding
 
197
 
198
endmodule

powered by: WebSVN 2.1.0

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