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
14
Issues
14
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
a259e5c6
Commit
a259e5c6
authored
Oct 10, 2017
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: add missing gc_delay_line.vhd. See also issue #1672
parent
02a5a17b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
gc_delay_line.vhd
modules/common/gc_delay_line.vhd
+83
-0
No files found.
modules/common/gc_delay_line.vhd
0 → 100644
View file @
a259e5c6
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
use
work
.
genram_pkg
.
all
;
entity
gc_delay_line
is
generic
(
g_delay
:
integer
;
g_width
:
integer
);
port
(
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
d_i
:
in
std_logic_vector
(
g_width
-1
downto
0
);
q_o
:
out
std_logic_vector
(
g_width
-1
downto
0
);
ready_o
:
out
std_logic
);
end
gc_delay_line
;
architecture
rtl
of
gc_delay_line
is
constant
c_counter_width
:
integer
:
=
f_log2_size
(
g_delay
+
1
);
signal
rd_ptr
:
unsigned
(
c_counter_width
-1
downto
0
);
signal
wr_ptr
:
unsigned
(
c_counter_width
-1
downto
0
);
signal
init
:
std_logic
;
signal
wr_data
,
rd_data
:
std_logic_vector
(
g_width
-1
downto
0
);
begin
U_DPRAM
:
generic_dpram
generic
map
(
g_data_width
=>
g_width
,
g_size
=>
2
**
c_counter_width
,
g_dual_clock
=>
FALSE
)
port
map
(
rst_n_i
=>
rst_n_i
,
clka_i
=>
clk_i
,
wea_i
=>
'1'
,
aa_i
=>
std_logic_vector
(
wr_ptr
),
da_i
=>
wr_data
,
clkb_i
=>
clk_i
,
web_i
=>
'0'
,
ab_i
=>
std_logic_vector
(
rd_ptr
),
qb_o
=>
rd_data
);
wr_data
<=
(
others
=>
'0'
)
when
init
=
'1'
else
d_i
;
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
if
rst_n_i
=
'0'
then
wr_ptr
<=
(
others
=>
'0'
);
rd_ptr
<=
(
others
=>
'0'
);
init
<=
'1'
;
ready_o
<=
'0'
;
else
if
(
init
=
'1'
)
then
if
(
wr_ptr
=
2
**
c_counter_width
-1
)
then
wr_ptr
<=
to_unsigned
(
g_delay
-1
,
c_counter_width
);
rd_ptr
<=
(
others
=>
'0'
);
init
<=
'0'
;
ready_o
<=
'1'
;
else
wr_ptr
<=
wr_ptr
+
1
;
end
if
;
else
wr_ptr
<=
wr_ptr
+
1
;
rd_ptr
<=
rd_ptr
+
1
;
end
if
;
end
if
;
end
if
;
end
process
;
q_o
<=
rd_data
;
end
rtl
;
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