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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [usbhostslave/] [fifoMux.v] - Blame information for rev 703

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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