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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [tags/] [rel_00_07_alpha/] [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
//// 
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 9 sfielding
`timescale 1ns / 1ps
45 2 sfielding
 
46 9 sfielding
 
47 2 sfielding
module hostSlaveMux (
48 5 sfielding
  SIEPortCtrlInToSIE,
49
  SIEPortCtrlInFromHost,
50
  SIEPortCtrlInFromSlave,
51
  SIEPortDataInToSIE,
52
  SIEPortDataInFromHost,
53
  SIEPortDataInFromSlave,
54
  SIEPortWEnToSIE,
55
  SIEPortWEnFromHost,
56
  SIEPortWEnFromSlave,
57
  fullSpeedPolarityToSIE,
58
  fullSpeedPolarityFromHost,
59
  fullSpeedPolarityFromSlave,
60
  fullSpeedBitRateToSIE,
61
  fullSpeedBitRateFromHost,
62
  fullSpeedBitRateFromSlave,
63 2 sfielding
  dataIn,
64 9 sfielding
  dataOut,
65
  address,
66 2 sfielding
  writeEn,
67
  strobe_i,
68
  clk,
69
  rst,
70
  hostSlaveMuxSel  );
71
 
72
 
73
output [7:0] SIEPortCtrlInToSIE;
74
input [7:0] SIEPortCtrlInFromHost;
75
input [7:0] SIEPortCtrlInFromSlave;
76
output [7:0] SIEPortDataInToSIE;
77
input [7:0] SIEPortDataInFromHost;
78
input [7:0] SIEPortDataInFromSlave;
79
output SIEPortWEnToSIE;
80
input SIEPortWEnFromHost;
81
input SIEPortWEnFromSlave;
82
output fullSpeedPolarityToSIE;
83
input fullSpeedPolarityFromHost;
84
input fullSpeedPolarityFromSlave;
85
output fullSpeedBitRateToSIE;
86
input fullSpeedBitRateFromHost;
87
input fullSpeedBitRateFromSlave;
88
//hostSlaveMuxBI
89
input [7:0] dataIn;
90 9 sfielding
input address;
91 2 sfielding
input writeEn;
92
input strobe_i;
93
input clk;
94
input rst;
95
output [7:0] dataOut;
96
input hostSlaveMuxSel;
97
 
98
reg [7:0] SIEPortCtrlInToSIE;
99
wire [7:0] SIEPortCtrlInFromHost;
100
wire [7:0] SIEPortCtrlInFromSlave;
101
reg [7:0] SIEPortDataInToSIE;
102
wire [7:0] SIEPortDataInFromHost;
103
wire [7:0] SIEPortDataInFromSlave;
104
reg SIEPortWEnToSIE;
105
wire SIEPortWEnFromHost;
106
wire SIEPortWEnFromSlave;
107
reg fullSpeedPolarityToSIE;
108
wire fullSpeedPolarityFromHost;
109
wire fullSpeedPolarityFromSlave;
110
reg fullSpeedBitRateToSIE;
111
wire fullSpeedBitRateFromHost;
112
wire fullSpeedBitRateFromSlave;
113
//hostSlaveMuxBI
114
wire [7:0] dataIn;
115 9 sfielding
wire address;
116 2 sfielding
wire writeEn;
117
wire strobe_i;
118
wire clk;
119
wire rst;
120
wire [7:0] dataOut;
121
wire hostSlaveMuxSel;
122
 
123
//internal wires and regs
124
wire hostMode;
125
 
126
always @(hostMode or
127 5 sfielding
  SIEPortCtrlInFromHost or
128
  SIEPortCtrlInFromSlave or
129
  SIEPortDataInFromHost or
130
  SIEPortDataInFromSlave or
131
  SIEPortWEnFromHost or
132
  SIEPortWEnFromSlave or
133
  fullSpeedPolarityFromHost or
134
  fullSpeedPolarityFromSlave or
135
  fullSpeedBitRateFromHost or
136
  fullSpeedBitRateFromSlave)
137 2 sfielding
begin
138
  if (hostMode == 1'b1)
139
  begin
140 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromHost;
141
    SIEPortDataInToSIE <=  SIEPortDataInFromHost;
142
    SIEPortWEnToSIE <= SIEPortWEnFromHost;
143 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromHost;
144
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromHost;
145
  end
146
  else
147
  begin
148 5 sfielding
    SIEPortCtrlInToSIE <= SIEPortCtrlInFromSlave;
149
    SIEPortDataInToSIE <=  SIEPortDataInFromSlave;
150
    SIEPortWEnToSIE <= SIEPortWEnFromSlave;
151 2 sfielding
    fullSpeedPolarityToSIE <= fullSpeedPolarityFromSlave;
152
    fullSpeedBitRateToSIE <= fullSpeedBitRateFromSlave;
153
  end
154
end
155
 
156
hostSlaveMuxBI u_hostSlaveMuxBI (
157
  .dataIn(dataIn),
158 9 sfielding
  .dataOut(dataOut),
159
  .address(address),
160 2 sfielding
  .writeEn(writeEn),
161
  .strobe_i(strobe_i),
162
  .clk(clk),
163
  .rst(rst),
164 5 sfielding
  .hostMode(hostMode),
165 2 sfielding
  .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.