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

Subversion Repositories usbhostslave

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

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
//// 
10
////                                                              ////
11
//// To Do:                                                       ////
12
//// 
13
////                                                              ////
14
//// Author(s):                                                   ////
15
//// - Steve Fielding, sfielding@base2designs.com                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2004 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 5 sfielding
// $Id: hostSlaveMux.v,v 1.2 2004-12-18 14:36:12 sfielding Exp $
45 2 sfielding
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49 5 sfielding
// Revision 1.1.1.1  2004/10/11 04:00:56  sfielding
50
// Created
51 2 sfielding
//
52 5 sfielding
//
53 2 sfielding
 
54
module hostSlaveMux (
55 5 sfielding
  SIEPortCtrlInToSIE,
56
  SIEPortCtrlInFromHost,
57
  SIEPortCtrlInFromSlave,
58
  SIEPortDataInToSIE,
59
  SIEPortDataInFromHost,
60
  SIEPortDataInFromSlave,
61
  SIEPortWEnToSIE,
62
  SIEPortWEnFromHost,
63
  SIEPortWEnFromSlave,
64
  fullSpeedPolarityToSIE,
65
  fullSpeedPolarityFromHost,
66
  fullSpeedPolarityFromSlave,
67
  fullSpeedBitRateToSIE,
68
  fullSpeedBitRateFromHost,
69
  fullSpeedBitRateFromSlave,
70 2 sfielding
  dataIn,
71
  dataOut,
72
  writeEn,
73
  strobe_i,
74
  clk,
75
  rst,
76
  hostSlaveMuxSel  );
77
 
78
 
79
output [7:0] SIEPortCtrlInToSIE;
80
input [7:0] SIEPortCtrlInFromHost;
81
input [7:0] SIEPortCtrlInFromSlave;
82
output [7:0] SIEPortDataInToSIE;
83
input [7:0] SIEPortDataInFromHost;
84
input [7:0] SIEPortDataInFromSlave;
85
output SIEPortWEnToSIE;
86
input SIEPortWEnFromHost;
87
input SIEPortWEnFromSlave;
88
output fullSpeedPolarityToSIE;
89
input fullSpeedPolarityFromHost;
90
input fullSpeedPolarityFromSlave;
91
output fullSpeedBitRateToSIE;
92
input fullSpeedBitRateFromHost;
93
input fullSpeedBitRateFromSlave;
94
//hostSlaveMuxBI
95
input [7:0] dataIn;
96
input writeEn;
97
input strobe_i;
98
input clk;
99
input rst;
100
output [7:0] dataOut;
101
input hostSlaveMuxSel;
102
 
103
reg [7:0] SIEPortCtrlInToSIE;
104
wire [7:0] SIEPortCtrlInFromHost;
105
wire [7:0] SIEPortCtrlInFromSlave;
106
reg [7:0] SIEPortDataInToSIE;
107
wire [7:0] SIEPortDataInFromHost;
108
wire [7:0] SIEPortDataInFromSlave;
109
reg SIEPortWEnToSIE;
110
wire SIEPortWEnFromHost;
111
wire SIEPortWEnFromSlave;
112
reg fullSpeedPolarityToSIE;
113
wire fullSpeedPolarityFromHost;
114
wire fullSpeedPolarityFromSlave;
115
reg fullSpeedBitRateToSIE;
116
wire fullSpeedBitRateFromHost;
117
wire fullSpeedBitRateFromSlave;
118
//hostSlaveMuxBI
119
wire [7:0] dataIn;
120
wire writeEn;
121
wire strobe_i;
122
wire clk;
123
wire rst;
124
wire [7:0] dataOut;
125
wire hostSlaveMuxSel;
126
 
127
//internal wires and regs
128
wire hostMode;
129
 
130
always @(hostMode or
131 5 sfielding
  SIEPortCtrlInFromHost or
132
  SIEPortCtrlInFromSlave or
133
  SIEPortDataInFromHost or
134
  SIEPortDataInFromSlave or
135
  SIEPortWEnFromHost or
136
  SIEPortWEnFromSlave or
137
  fullSpeedPolarityFromHost or
138
  fullSpeedPolarityFromSlave or
139
  fullSpeedBitRateFromHost or
140
  fullSpeedBitRateFromSlave)
141 2 sfielding
begin
142
  if (hostMode == 1'b1)
143
  begin
144 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromHost;
145
    SIEPortDataInToSIE <=  SIEPortDataInFromHost;
146
    SIEPortWEnToSIE <= SIEPortWEnFromHost;
147 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromHost;
148
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromHost;
149
  end
150
  else
151
  begin
152 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromSlave;
153
    SIEPortDataInToSIE <=  SIEPortDataInFromSlave;
154
    SIEPortWEnToSIE <= SIEPortWEnFromSlave;
155 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromSlave;
156
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromSlave;
157
  end
158
end
159
 
160
hostSlaveMuxBI u_hostSlaveMuxBI (
161
  .dataIn(dataIn),
162
  .dataOut(dataOut),
163
  .writeEn(writeEn),
164
  .strobe_i(strobe_i),
165
  .clk(clk),
166
  .rst(rst),
167 5 sfielding
  .hostMode(hostMode),
168 2 sfielding
  .hostSlaveMuxSel(hostSlaveMuxSel)  );
169
 
170
 
171
endmodule

powered by: WebSVN 2.1.0

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