Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Gateware
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Gateware
Commits
057eba7d
Commit
057eba7d
authored
13 years ago
by
Tomasz Wlostowski
Browse files
Options
Downloads
Patches
Plain Diff
async MPM: swc_async_fifo_ctrl.vhd: last commit with async set/clear controller
parent
55d9ed75
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/wrsw_swcore/async/swc_async_fifo_ctrl.vhd
+51
-7
51 additions, 7 deletions
modules/wrsw_swcore/async/swc_async_fifo_ctrl.vhd
top/scb_test/scb_top_synthesis.ucf
+0
-0
0 additions, 0 deletions
top/scb_test/scb_top_synthesis.ucf
with
51 additions
and
7 deletions
modules/wrsw_swcore/async/swc_async_fifo_ctrl.vhd
+
51
−
7
View file @
057eba7d
-------------------------------------------------------------------------------
-- Title : Dual clock (asynchronous) FIFO controller
-- Project : White Rabbit Switch
-------------------------------------------------------------------------------
-- File : swc_async_fifo_ctrl.vhd
-- Author : Tomasz Włostowski
-- Company : CERN BE-CO-HT
-- Created : 2012-01-30
-- Last update : 2012-01-30
-- Platform : FPGA-generic
-- Standard : VHDL'93
-- Dependencies : genram_pkg
-------------------------------------------------------------------------------
-- Description: Gray-encoded dual clock FIFO controller and address generator.
-- Based on Xilinx Application Note "Asynchronous FIFO in Virtex-II FPGAs" by
-- P. Alfke & example code from http://www.asic-world.com.
-------------------------------------------------------------------------------
--
-- Copyright (c) 2012 CERN
--
-- This source file is free software; you can redistribute it
-- and/or modify it under the terms of the GNU Lesser General
-- Public License as published by the Free Software Foundation;
-- either version 2.1 of the License, or (at your option) any
-- later version.
--
-- This source is distributed in the hope that it will be
-- useful, but WITHOUT ANY WARRANTY; without even the implied
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-- PURPOSE. See the GNU Lesser General Public License for more
-- details.
--
-- You should have received a copy of the GNU Lesser General
-- Public License along with this source; if not, download it
-- from http://www.gnu.org/licenses/lgpl-2.1.html
--
-------------------------------------------------------------------------------
-- Revisions :
-- Date Version Author Description
-- 2012-01-30 1.0 twlostow Created
-------------------------------------------------------------------------------
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
...
...
@@ -10,7 +52,7 @@ entity swc_async_fifo_ctrl is
g_size
:
integer
);
port
(
rst_n_i
:
in
std_logic
;
rst_n_
a_
i
:
in
std_logic
;
clk_wr_i
:
in
std_logic
;
clk_rd_i
:
in
std_logic
;
...
...
@@ -27,6 +69,8 @@ end swc_async_fifo_ctrl;
architecture
rtl
of
swc_async_fifo_ctrl
is
-- Gray-encoded increase-by-1 function. Takes a gray-encoded integer x and returns
-- gray-encoded value of (x+1).
function
f_gray_inc
(
x
:
unsigned
)
return
unsigned
is
variable
bin
,
tmp
:
unsigned
(
x
'left
downto
0
);
begin
...
...
@@ -51,9 +95,9 @@ architecture rtl of swc_async_fifo_ctrl is
signal
stat
:
std_logic
;
begin
-- rtl
p_write_ptr
:
process
(
clk_wr_i
,
rst_n_i
)
p_write_ptr
:
process
(
clk_wr_i
,
rst_n_
a_
i
)
begin
if
rst_n_i
=
'0'
then
if
rst_n_
a_
i
=
'0'
then
wr_ptr
<=
(
others
=>
'0'
);
elsif
rising_edge
(
clk_wr_i
)
then
if
(
wr_i
=
'1'
and
full_int
=
'0'
)
then
...
...
@@ -63,9 +107,9 @@ begin -- rtl
end
process
;
p_read_ptr
:
process
(
clk_rd_i
,
rst_n_i
)
p_read_ptr
:
process
(
clk_rd_i
,
rst_n_
a_
i
)
begin
if
rst_n_i
=
'0'
then
if
rst_n_
a_
i
=
'0'
then
rd_ptr
<=
(
others
=>
'0'
);
elsif
rising_edge
(
clk_rd_i
)
then
if
(
rd_i
=
'1'
and
empty_int
=
'0'
)
then
...
...
@@ -82,9 +126,9 @@ begin -- rtl
and
(
wr_ptr
(
wr_ptr
'left
)
xnor
rd_ptr
(
rd_ptr
'left
-1
));
end
process
;
process
(
set_stat
,
rst_stat
,
rst_n_i
)
process
(
set_stat
,
rst_stat
,
rst_n_
a_
i
)
begin
if
(
rst_stat
=
'1'
or
rst_n_i
=
'0'
)
then
if
(
rst_stat
=
'1'
or
rst_n_
a_
i
=
'0'
)
then
stat
<=
'0'
;
elsif
(
set_stat
=
'1'
)
then
stat
<=
'1'
;
...
...
This diff is collapsed.
Click to expand it.
top/scb_test/
test_scb
.ucf
→
top/scb_test/
scb_top_synthesis
.ucf
+
0
−
0
View file @
057eba7d
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment