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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [tags/] [start/] [RTL/] [buffers/] [RxFifo.v] - Blame information for rev 43

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

Line No. Rev Author Line
1 2 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// RxFifo.v                                                     ////
4
////                                                              ////
5
//// This file is part of the usbhostslave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
////  parameterized RxFifo wrapper. Min depth = 2, Max depth = 65536
10
////  fifo read access via bus interface, fifo write access is direct
11
//// 
12
////                                                              ////
13
//// To Do:                                                       ////
14
//// 
15
////                                                              ////
16
//// Author(s):                                                   ////
17
//// - Steve Fielding, sfielding@base2designs.com                 ////
18
////                                                              ////
19
//////////////////////////////////////////////////////////////////////
20
////                                                              ////
21
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
22
////                                                              ////
23
//// This source file may be used and distributed without         ////
24
//// restriction provided that this copyright statement is not    ////
25
//// removed from the file and that any derivative work contains  ////
26
//// the original copyright notice and the associated disclaimer. ////
27
////                                                              ////
28
//// This source file is free software; you can redistribute it   ////
29
//// and/or modify it under the terms of the GNU Lesser General   ////
30
//// Public License as published by the Free Software Foundation; ////
31
//// either version 2.1 of the License, or (at your option) any   ////
32
//// later version.                                               ////
33
////                                                              ////
34
//// This source is distributed in the hope that it will be       ////
35
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
36
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
37
//// PURPOSE. See the GNU Lesser General Public License for more  ////
38
//// details.                                                     ////
39
////                                                              ////
40
//// You should have received a copy of the GNU Lesser General    ////
41
//// Public License along with this source; if not, download it   ////
42
//// from <http://www.opencores.org/lgpl.shtml>                   ////
43
////                                                              ////
44
//////////////////////////////////////////////////////////////////////
45
//
46
// $Id: RxFifo.v,v 1.1.1.1 2004-10-11 04:00:51 sfielding Exp $
47
//
48
// CVS Revision History
49
//
50
// $Log: not supported by cvs2svn $
51
//
52
 
53
`timescale 1ns / 1ps
54
 
55
module RxFifo(
56
  clk,
57
  rst,
58
  fifoWEn,
59
  fifoFull,
60
  busAddress,
61
  busWriteEn,
62
  busStrobe_i,
63
  busFifoSelect,
64
  busDataIn,
65
  busDataOut,
66
  fifoDataIn  );
67
  //FIFO_DEPTH = ADDR_WIDTH^2
68
        parameter FIFO_DEPTH = 64;
69
  parameter ADDR_WIDTH = 6;
70
 
71
input clk;
72
input rst;
73
input fifoWEn;
74
output fifoFull;
75
input [2:0] busAddress;
76
input busWriteEn;
77
input busStrobe_i;
78
input busFifoSelect;
79
input [7:0] busDataIn;
80
output [7:0] busDataOut;
81
input [7:0] fifoDataIn;
82
 
83
wire clk;
84
wire rst;
85
wire fifoWEn;
86
wire fifoFull;
87
wire [2:0] busAddress;
88
wire busWriteEn;
89
wire busStrobe_i;
90
wire busFifoSelect;
91
wire [7:0] busDataIn;
92
wire [7:0] busDataOut;
93
wire [7:0] fifoDataIn;
94
 
95
//internal wires and regs
96
wire [7:0] dataFromFifoToBus;
97
wire fifoREn;
98
wire forceEmpty;
99
wire [15:0] numElementsInFifo;
100
wire fifoEmpty;
101
 
102
fifoRTL #(8, FIFO_DEPTH, ADDR_WIDTH) u_fifo(
103
  .clk(clk),
104
  .rst(rst),
105
  .dataIn(fifoDataIn),
106
  .dataOut(dataFromFifoToBus),
107
  .fifoWEn(fifoWEn),
108
  .fifoREn(fifoREn),
109
  .fifoFull(fifoFull),
110
  .fifoEmpty(fifoEmpty),
111
  .forceEmpty(forceEmpty),
112
  .numElementsInFifo(numElementsInFifo) );
113
 
114
RxfifoBI u_RxfifoBI(
115
  .address(busAddress),
116
  .writeEn(busWriteEn),
117
  .strobe_i(busStrobe_i),
118
  .clk(clk),
119
  .rst(rst),
120
  .fifoSelect(busFifoSelect),
121
  .fifoDataIn(dataFromFifoToBus),
122
  .busDataIn(busDataIn),
123
  .busDataOut(busDataOut),
124
  .fifoREn(fifoREn),
125
  .fifoEmpty(fifoEmpty),
126
  .forceEmpty(forceEmpty),
127
  .numElementsInFifo(numElementsInFifo)
128
  );
129
 
130
endmodule

powered by: WebSVN 2.1.0

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