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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [tags/] [rel_00_06_alpha/] [RTL/] [buffers/] [RxFifo.v] - Blame information for rev 9

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
`timescale 1ns / 1ps
47
 
48
module RxFifo(
49
  clk,
50
  rst,
51
  fifoWEn,
52
  fifoFull,
53
  busAddress,
54
  busWriteEn,
55
  busStrobe_i,
56
  busFifoSelect,
57
  busDataIn,
58
  busDataOut,
59
  fifoDataIn  );
60
  //FIFO_DEPTH = ADDR_WIDTH^2
61 5 sfielding
  parameter FIFO_DEPTH = 64;
62 2 sfielding
  parameter ADDR_WIDTH = 6;
63
 
64
input clk;
65
input rst;
66
input fifoWEn;
67
output fifoFull;
68
input [2:0] busAddress;
69
input busWriteEn;
70
input busStrobe_i;
71
input busFifoSelect;
72
input [7:0] busDataIn;
73
output [7:0] busDataOut;
74
input [7:0] fifoDataIn;
75
 
76
wire clk;
77
wire rst;
78
wire fifoWEn;
79
wire fifoFull;
80
wire [2:0] busAddress;
81
wire busWriteEn;
82
wire busStrobe_i;
83
wire busFifoSelect;
84
wire [7:0] busDataIn;
85
wire [7:0] busDataOut;
86
wire [7:0] fifoDataIn;
87
 
88
//internal wires and regs
89
wire [7:0] dataFromFifoToBus;
90
wire fifoREn;
91
wire forceEmpty;
92
wire [15:0] numElementsInFifo;
93
wire fifoEmpty;
94
 
95
fifoRTL #(8, FIFO_DEPTH, ADDR_WIDTH) u_fifo(
96
  .clk(clk),
97
  .rst(rst),
98
  .dataIn(fifoDataIn),
99
  .dataOut(dataFromFifoToBus),
100
  .fifoWEn(fifoWEn),
101
  .fifoREn(fifoREn),
102
  .fifoFull(fifoFull),
103
  .fifoEmpty(fifoEmpty),
104
  .forceEmpty(forceEmpty),
105
  .numElementsInFifo(numElementsInFifo) );
106
 
107
RxfifoBI u_RxfifoBI(
108
  .address(busAddress),
109
  .writeEn(busWriteEn),
110
  .strobe_i(busStrobe_i),
111
  .clk(clk),
112
  .rst(rst),
113
  .fifoSelect(busFifoSelect),
114
  .fifoDataIn(dataFromFifoToBus),
115
  .busDataIn(busDataIn),
116
  .busDataOut(busDataOut),
117
  .fifoREn(fifoREn),
118
  .fifoEmpty(fifoEmpty),
119
  .forceEmpty(forceEmpty),
120
  .numElementsInFifo(numElementsInFifo)
121
  );
122
 
123
endmodule

powered by: WebSVN 2.1.0

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