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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [tags/] [rel_01_00/] [RTL/] [hostSlaveMux/] [hostSlaveMux.v] - Blame information for rev 40

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 2 sfielding
  dataIn,
68 9 sfielding
  dataOut,
69
  address,
70 2 sfielding
  writeEn,
71
  strobe_i,
72 18 sfielding
  busClk,
73
  usbClk,
74
  hostSlaveMuxSel,
75
  rstFromWire,
76
  rstSyncToBusClkOut,
77
  rstSyncToUsbClkOut
78
);
79 2 sfielding
 
80
 
81
output [7:0] SIEPortCtrlInToSIE;
82
input [7:0] SIEPortCtrlInFromHost;
83
input [7:0] SIEPortCtrlInFromSlave;
84
output [7:0] SIEPortDataInToSIE;
85
input [7:0] SIEPortDataInFromHost;
86
input [7:0] SIEPortDataInFromSlave;
87
output SIEPortWEnToSIE;
88
input SIEPortWEnFromHost;
89
input SIEPortWEnFromSlave;
90
output fullSpeedPolarityToSIE;
91
input fullSpeedPolarityFromHost;
92
input fullSpeedPolarityFromSlave;
93
output fullSpeedBitRateToSIE;
94
input fullSpeedBitRateFromHost;
95
input fullSpeedBitRateFromSlave;
96
//hostSlaveMuxBI
97
input [7:0] dataIn;
98 9 sfielding
input address;
99 2 sfielding
input writeEn;
100
input strobe_i;
101 18 sfielding
input busClk;
102
input usbClk;
103
input rstFromWire;
104
output rstSyncToBusClkOut;
105
output rstSyncToUsbClkOut;
106 2 sfielding
output [7:0] dataOut;
107
input hostSlaveMuxSel;
108
 
109
reg [7:0] SIEPortCtrlInToSIE;
110
wire [7:0] SIEPortCtrlInFromHost;
111
wire [7:0] SIEPortCtrlInFromSlave;
112
reg [7:0] SIEPortDataInToSIE;
113
wire [7:0] SIEPortDataInFromHost;
114
wire [7:0] SIEPortDataInFromSlave;
115
reg SIEPortWEnToSIE;
116
wire SIEPortWEnFromHost;
117
wire SIEPortWEnFromSlave;
118
reg fullSpeedPolarityToSIE;
119
wire fullSpeedPolarityFromHost;
120
wire fullSpeedPolarityFromSlave;
121
reg fullSpeedBitRateToSIE;
122
wire fullSpeedBitRateFromHost;
123
wire fullSpeedBitRateFromSlave;
124
//hostSlaveMuxBI
125
wire [7:0] dataIn;
126 9 sfielding
wire address;
127 2 sfielding
wire writeEn;
128
wire strobe_i;
129 18 sfielding
wire busClk;
130
wire usbClk;
131
wire rstSyncToBusClkOut;
132
wire rstSyncToUsbClkOut;
133
wire rstFromWire;
134 2 sfielding
wire [7:0] dataOut;
135
wire hostSlaveMuxSel;
136
 
137
//internal wires and regs
138
wire hostMode;
139
 
140
always @(hostMode or
141 5 sfielding
  SIEPortCtrlInFromHost or
142
  SIEPortCtrlInFromSlave or
143
  SIEPortDataInFromHost or
144
  SIEPortDataInFromSlave or
145
  SIEPortWEnFromHost or
146
  SIEPortWEnFromSlave or
147
  fullSpeedPolarityFromHost or
148
  fullSpeedPolarityFromSlave or
149
  fullSpeedBitRateFromHost or
150
  fullSpeedBitRateFromSlave)
151 2 sfielding
begin
152
  if (hostMode == 1'b1)
153
  begin
154 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromHost;
155
    SIEPortDataInToSIE <=  SIEPortDataInFromHost;
156
    SIEPortWEnToSIE <= SIEPortWEnFromHost;
157 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromHost;
158
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromHost;
159
  end
160
  else
161
  begin
162 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromSlave;
163
    SIEPortDataInToSIE <=  SIEPortDataInFromSlave;
164
    SIEPortWEnToSIE <= SIEPortWEnFromSlave;
165 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromSlave;
166
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromSlave;
167
  end
168
end
169
 
170
hostSlaveMuxBI u_hostSlaveMuxBI (
171
  .dataIn(dataIn),
172 9 sfielding
  .dataOut(dataOut),
173
  .address(address),
174 2 sfielding
  .writeEn(writeEn),
175
  .strobe_i(strobe_i),
176 18 sfielding
  .busClk(busClk),
177
  .usbClk(usbClk),
178 5 sfielding
  .hostMode(hostMode),
179 18 sfielding
  .hostSlaveMuxSel(hostSlaveMuxSel),
180
  .rstFromWire(rstFromWire),
181
  .rstSyncToBusClkOut(rstSyncToBusClkOut),
182
  .rstSyncToUsbClkOut(rstSyncToUsbClkOut) );
183 2 sfielding
 
184
 
185
endmodule

powered by: WebSVN 2.1.0

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