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

Subversion Repositories spimaster

[/] [spimaster/] [trunk/] [RTL/] [sm_TxFifo.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// sm_TxFifo.v                                                  ////
4
////                                                              ////
5
//// This file is part of the spiMaster opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
////  parameterized TxFifo wrapper. Min depth = 2, Max depth = 65536
10
////  fifo write access via bus interface, fifo read 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) 2008 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
`include "timescale.v"
47
 
48
module sm_TxFifo(
49
  busClk,
50
  spiSysClk,
51
  rstSyncToBusClk,
52
  rstSyncToSpiClk,
53
  fifoREn,
54
  fifoEmpty,
55
  busAddress,
56
  busWriteEn,
57
  busStrobe_i,
58
  busFifoSelect,
59
  busDataIn,
60
  busDataOut,
61
  fifoDataOut );
62
  //FIFO_DEPTH = 2^ADDR_WIDTH
63
  parameter FIFO_DEPTH = 64;
64
  parameter ADDR_WIDTH = 6;
65
 
66
input busClk;
67
input spiSysClk;
68
input rstSyncToBusClk;
69
input rstSyncToSpiClk;
70
input fifoREn;
71
output fifoEmpty;
72
input [2:0] busAddress;
73
input busWriteEn;
74
input busStrobe_i;
75
input busFifoSelect;
76
input [7:0] busDataIn;
77
output [7:0] busDataOut;
78
output [7:0] fifoDataOut;
79
 
80
wire busClk;
81
wire spiSysClk;
82
wire rstSyncToBusClk;
83
wire rstSyncToSpiClk;
84
wire fifoREn;
85
wire fifoEmpty;
86
wire [2:0] busAddress;
87
wire busWriteEn;
88
wire busStrobe_i;
89
wire busFifoSelect;
90
wire [7:0] busDataIn;
91
wire [7:0] busDataOut;
92
wire [7:0] fifoDataOut;
93
 
94
//internal wires and regs
95
wire fifoWEn;
96
wire forceEmptySyncToSpiClk;
97
wire forceEmptySyncToBusClk;
98
wire [15:0] numElementsInFifo;
99
wire fifoFull;
100
 
101
sm_fifoRTL #(8, FIFO_DEPTH, ADDR_WIDTH) u_sm_fifo(
102
  .wrClk(busClk),
103
  .rdClk(spiSysClk),
104
  .rstSyncToWrClk(rstSyncToBusClk),
105
  .rstSyncToRdClk(rstSyncToSpiClk),
106
  .dataIn(busDataIn),
107
  .dataOut(fifoDataOut),
108
  .fifoWEn(fifoWEn),
109
  .fifoREn(fifoREn),
110
  .fifoFull(fifoFull),
111
  .fifoEmpty(fifoEmpty),
112
  .forceEmptySyncToWrClk(forceEmptySyncToBusClk),
113
  .forceEmptySyncToRdClk(forceEmptySyncToSpiClk),
114
  .numElementsInFifo(numElementsInFifo) );
115
 
116
sm_TxfifoBI u_sm_TxfifoBI(
117
  .address(busAddress),
118
  .writeEn(busWriteEn),
119
  .strobe_i(busStrobe_i),
120
  .busClk(busClk),
121
  .spiSysClk(spiSysClk),
122
  .rstSyncToBusClk(rstSyncToBusClk),
123
  .fifoSelect(busFifoSelect),
124
  .busDataIn(busDataIn),
125
  .busDataOut(busDataOut),
126
  .fifoWEn(fifoWEn),
127
  .forceEmptySyncToBusClk(forceEmptySyncToBusClk),
128
  .forceEmptySyncToSpiClk(forceEmptySyncToSpiClk),
129
  .numElementsInFifo(numElementsInFifo)
130
  );
131
 
132
endmodule

powered by: WebSVN 2.1.0

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