Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
9d88f217
Commit
9d88f217
authored
Dec 02, 2022
by
Sebastian Owarzany
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/genrams/generic/ added wrappers for SystemVerilog
parent
1140a5fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
generic_async_fifo_wrap.sv
modules/genrams/generic/generic_async_fifo_wrap.sv
+98
-0
No files found.
modules/genrams/generic/generic_async_fifo_wrap.sv
0 → 100644
View file @
9d88f217
///////////////////////////////////////////////////////////////////////////////
// Title : Parametrizable asynchronous FIFO SystemVerilog wrapper
// Project : Generics RAMs and FIFOs collection
///////////////////////////////////////////////////////////////////////////////
// File : generic_async_fifo_wrap.sv
// Author : Sebastian Owarzany
// Company : CERN SY/RF/FB
// Created : 2022/12/02
// Last update: 2022/12/02
// Platform :
// Standard : SystemVerilog IEEE 1800
///////////////////////////////////////////////////////////////////////////////
// Description: Dual/clock asynchronous FIFO.
// / configurable data width and size
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2022 CERN
///////////////////////////////////////////////////////////////////////////////
// Revisions :
// Date Version Author Description
// 2022/12/02 1.0 sowarzan Created
///////////////////////////////////////////////////////////////////////////////
module
generic_async_fifo_wrap
#(
parameter
DATA_WIDTH
=
16
,
parameter
SIZE
=
2772
)
(
// Control/Data Signals,
input
wire
rst_i
,
// FPGA Reset
// write port
input
wire
clk_wr_i
,
// Write Clock
input
wire
[
15
:
0
]
d_i
,
// Write data
input
wire
we_i
,
// Wrte enable
// read port
input
wire
clk_rd_i
,
// Read Clock
output
wire
[
15
:
0
]
q_o
,
// Read data
input
wire
rd_i
// Read enable
)
;
reg
r_we_i
,
r_rd_i
;
wire
wr_full_o
,
rd_empty_o
;
always
@
(
wr_full_o
,
we_i
)
begin
if
(
wr_full_o
)
r_we_i
<=
1'b0
;
else
r_we_i
<=
we_i
;
end
always
@
(
rd_empty_o
,
rd_i
)
begin
if
(
rd_empty_o
)
r_rd_i
<=
1'b0
;
else
r_rd_i
<=
rd_i
;
end
generic_async_fifo
#(
.
g_data_width
(
DATA_WIDTH
)
,
.
g_size
(
SIZE
)
,
.
g_show_ahead
()
,
// Read-side flag selection
.
g_with_rd_empty
()
,
// with empty flag
.
g_with_rd_full
()
,
// with full flag
.
g_with_rd_almost_empty
()
,
.
g_with_rd_almost_full
()
,
.
g_with_rd_count
()
,
// with words counter
.
g_with_wr_empty
()
,
.
g_with_wr_full
()
,
.
g_with_wr_almost_empty
()
,
.
g_with_wr_almost_full
()
,
.
g_with_wr_count
()
,
.
g_almost_empty_threshold
(
10
)
,
// threshold for almost empty flag
.
g_almost_full_threshold
(
SIZE
-
10
)
// threshold for almost full flag
)
generic_async_fifo_0
(
.
rst_n_i
(
!
rst_i
)
,
// write port
.
clk_wr_i
(
clk_wr_i
)
,
.
d_i
(
d_i
)
,
.
we_i
(
r_we_i
)
,
.
wr_empty_o
()
,
.
wr_full_o
(
wr_full_o
)
,
.
wr_almost_empty_o
()
,
.
wr_almost_full_o
()
,
.
wr_count_o
()
,
// read port
.
clk_rd_i
(
clk_rd_i
)
,
.
q_o
(
q_o
)
,
.
rd_i
(
r_rd_i
)
,
.
rd_empty_o
(
rd_empty_o
)
,
.
rd_full_o
()
,
.
rd_almost_empty_o
()
,
.
rd_almost_full_o
()
,
.
rd_count_o
()
)
;
endmodule
//
generic_async_fifo_wrap
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment