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

Subversion Repositories usbhostslave

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

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

powered by: WebSVN 2.1.0

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