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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [slaveController/] [fifoMux.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
//// fifoMux.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: fifoMux.v,v 1.1.1.1 2004-10-11 04:01:05 sfielding Exp $
45
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49
//
50
 
51
module fifoMux (
52
  currEndP,
53
  //TxFifo
54
  TxFifoREn,
55
  TxFifoEP0REn,
56
  TxFifoEP1REn,
57
  TxFifoEP2REn,
58
  TxFifoEP3REn,
59
  TxFifoData,
60
  TxFifoEP0Data,
61
  TxFifoEP1Data,
62
  TxFifoEP2Data,
63
  TxFifoEP3Data,
64
  TxFifoEmpty,
65
  TxFifoEP0Empty,
66
  TxFifoEP1Empty,
67
  TxFifoEP2Empty,
68
  TxFifoEP3Empty,
69
  //RxFifo
70
  RxFifoWEn,
71
  RxFifoEP0WEn,
72
  RxFifoEP1WEn,
73
  RxFifoEP2WEn,
74
  RxFifoEP3WEn,
75
  RxFifoFull,
76
  RxFifoEP0Full,
77
  RxFifoEP1Full,
78
  RxFifoEP2Full,
79
  RxFifoEP3Full
80
    );
81
 
82
 
83
input [3:0] currEndP;
84
//TxFifo
85
input TxFifoREn;
86
output TxFifoEP0REn;
87
output TxFifoEP1REn;
88
output TxFifoEP2REn;
89
output TxFifoEP3REn;
90
output [7:0] TxFifoData;
91
input [7:0] TxFifoEP0Data;
92
input [7:0] TxFifoEP1Data;
93
input [7:0] TxFifoEP2Data;
94
input [7:0] TxFifoEP3Data;
95
output TxFifoEmpty;
96
input TxFifoEP0Empty;
97
input TxFifoEP1Empty;
98
input TxFifoEP2Empty;
99
input TxFifoEP3Empty;
100
  //RxFifo
101
input RxFifoWEn;
102
output RxFifoEP0WEn;
103
output RxFifoEP1WEn;
104
output RxFifoEP2WEn;
105
output RxFifoEP3WEn;
106
output RxFifoFull;
107
input RxFifoEP0Full;
108
input RxFifoEP1Full;
109
input RxFifoEP2Full;
110
input RxFifoEP3Full;
111
 
112
wire [3:0] currEndP;
113
//TxFifo
114
wire TxFifoREn;
115
reg TxFifoEP0REn;
116
reg TxFifoEP1REn;
117
reg TxFifoEP2REn;
118
reg TxFifoEP3REn;
119
reg [7:0] TxFifoData;
120
wire [7:0] TxFifoEP0Data;
121
wire [7:0] TxFifoEP1Data;
122
wire [7:0] TxFifoEP2Data;
123
wire [7:0] TxFifoEP3Data;
124
reg TxFifoEmpty;
125
wire TxFifoEP0Empty;
126
wire TxFifoEP1Empty;
127
wire TxFifoEP2Empty;
128
wire TxFifoEP3Empty;
129
  //RxFifo
130
wire RxFifoWEn;
131
reg RxFifoEP0WEn;
132
reg RxFifoEP1WEn;
133
reg RxFifoEP2WEn;
134
reg RxFifoEP3WEn;
135
reg RxFifoFull;
136
wire RxFifoEP0Full;
137
wire RxFifoEP1Full;
138
wire RxFifoEP2Full;
139
wire RxFifoEP3Full;
140
 
141
//internal wires and regs
142
 
143
//combinatorially mux TX and RX fifos for end points 0 through 3
144
always @(currEndP or
145
  TxFifoREn or
146
  RxFifoWEn or
147
  TxFifoEP0Data or
148
  TxFifoEP1Data or
149
  TxFifoEP2Data or
150
  TxFifoEP3Data or
151
  TxFifoEP0Empty or
152
  TxFifoEP1Empty or
153
  TxFifoEP2Empty or
154
  TxFifoEP3Empty or
155
  RxFifoEP0Full or
156
  RxFifoEP1Full or
157
  RxFifoEP2Full or
158
  RxFifoEP3Full)
159
begin
160
  case (currEndP[1:0])
161
    2'b00: begin
162
      TxFifoEP0REn <= TxFifoREn;
163
      TxFifoEP1REn <= 1'b0;
164
      TxFifoEP2REn <= 1'b0;
165
      TxFifoEP3REn <= 1'b0;
166
      TxFifoData <= TxFifoEP0Data;
167
      TxFifoEmpty <= TxFifoEP0Empty;
168
      RxFifoEP0WEn <= RxFifoWEn;
169
      RxFifoEP1WEn <= 1'b0;
170
      RxFifoEP2WEn <= 1'b0;
171
      RxFifoEP3WEn <= 1'b0;
172
      RxFifoFull <= RxFifoEP0Full;
173
    end
174
    2'b01: begin
175
      TxFifoEP0REn <= 1'b0;
176
      TxFifoEP1REn <= TxFifoREn;
177
      TxFifoEP2REn <= 1'b0;
178
      TxFifoEP3REn <= 1'b0;
179
      TxFifoData <= TxFifoEP1Data;
180
      TxFifoEmpty <= TxFifoEP1Empty;
181
      RxFifoEP0WEn <= 1'b0;
182
      RxFifoEP1WEn <= RxFifoWEn;
183
      RxFifoEP2WEn <= 1'b0;
184
      RxFifoEP3WEn <= 1'b0;
185
      RxFifoFull <= RxFifoEP1Full;
186
    end
187
    2'b10: begin
188
      TxFifoEP0REn <= 1'b0;
189
      TxFifoEP1REn <= 1'b0;
190
      TxFifoEP2REn <= TxFifoREn;
191
      TxFifoEP3REn <= 1'b0;
192
      TxFifoData <= TxFifoEP2Data;
193
      TxFifoEmpty <= TxFifoEP2Empty;
194
      RxFifoEP0WEn <= 1'b0;
195
      RxFifoEP1WEn <= 1'b0;
196
      RxFifoEP2WEn <= RxFifoWEn;
197
      RxFifoEP3WEn <= 1'b0;
198
      RxFifoFull <= RxFifoEP2Full;
199
    end
200
    2'b11: begin
201
      TxFifoEP0REn <= 1'b0;
202
      TxFifoEP1REn <= 1'b0;
203
      TxFifoEP2REn <= 1'b0;
204
      TxFifoEP3REn <= TxFifoREn;
205
      TxFifoData <= TxFifoEP3Data;
206
      TxFifoEmpty <= TxFifoEP3Empty;
207
      RxFifoEP0WEn <= 1'b0;
208
      RxFifoEP1WEn <= 1'b0;
209
      RxFifoEP2WEn <= 1'b0;
210
      RxFifoEP3WEn <= RxFifoWEn;
211
      RxFifoFull <= RxFifoEP3Full;
212
    end
213
  endcase
214
end
215
 
216
 
217
endmodule

powered by: WebSVN 2.1.0

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