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

Subversion Repositories usbhostslave

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

powered by: WebSVN 2.1.0

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