Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
5ddf6ee6
Commit
5ddf6ee6
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Improve debugging common_reg_r_w.vhd.
parent
2aefd0ba
No related branches found
No related tags found
1 merge request
!279
Improve debugging common_reg_r_w.vhd.
Pipeline
#35926
failed
2 years ago
Stage: simulation
Stage: synthesis
Stage: hardware
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/base/common/src/vhdl/common_reg_r_w.vhd
+16
-5
16 additions, 5 deletions
libraries/base/common/src/vhdl/common_reg_r_w.vhd
libraries/base/common/tb/vhdl/tb_common_pkg.vhd
+6
-0
6 additions, 0 deletions
libraries/base/common/tb/vhdl/tb_common_pkg.vhd
with
22 additions
and
5 deletions
libraries/base/common/src/vhdl/common_reg_r_w.vhd
+
16
−
5
View file @
5ddf6ee6
...
...
@@ -86,6 +86,11 @@ ARCHITECTURE rtl OF common_reg_r_w IS
CONSTANT
c_pipeline
:
NATURAL
:
=
g_reg
.
latency
-
c_rd_latency
;
CONSTANT
c_pipe_dat_w
:
NATURAL
:
=
1
+
g_reg
.
dat_w
;
-- pipeline rd_val & rd_dat together
TYPE
t_reg_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
g_reg
.
dat_w
-1
DOWNTO
0
);
SIGNAL
in_reg_arr
:
t_reg_arr
(
g_reg
.
nof_dat
-1
DOWNTO
0
);
SIGNAL
out_reg_arr
:
t_reg_arr
(
g_reg
.
nof_dat
-1
DOWNTO
0
);
SIGNAL
pipe_dat_in
:
STD_LOGIC_VECTOR
(
c_pipe_dat_w
-1
DOWNTO
0
);
SIGNAL
pipe_dat_out
:
STD_LOGIC_VECTOR
(
c_pipe_dat_w
-1
DOWNTO
0
);
...
...
@@ -104,6 +109,12 @@ BEGIN
out_reg
<=
i_out_reg
;
-- View as reg_arr
gen_reg_arr
:
FOR
I
IN
0
TO
g_reg
.
nof_dat
-1
GENERATE
in_reg_arr
(
I
)
<=
in_reg
((
i
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
i
*
g_reg
.
dat_w
);
out_reg_arr
(
I
)
<=
i_out_reg
((
i
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
i
*
g_reg
.
dat_w
);
END
GENERATE
;
-- Pipeline to support read data latency > 1
u_pipe_rd
:
ENTITY
work
.
common_pipeline
GENERIC
MAP
(
...
...
@@ -153,10 +164,10 @@ BEGIN
nxt_reg_rd_arr
<=
(
OTHERS
=>
'0'
);
nxt_rd_dat
<=
int_rd_dat
;
IF
rd_en
=
'1'
THEN
FOR
i
IN
0
TO
g_reg
.
nof_dat
-1
LOOP
IF
UNSIGNED
(
rd_adr
)
=
i
THEN
FOR
I
IN
0
TO
g_reg
.
nof_dat
-1
LOOP
IF
UNSIGNED
(
rd_adr
)
=
I
THEN
nxt_reg_rd_arr
(
I
)
<=
'1'
;
nxt_rd_dat
<=
in_reg
((
i
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
i
*
g_reg
.
dat_w
);
nxt_rd_dat
<=
in_reg
((
I
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
I
*
g_reg
.
dat_w
);
END
IF
;
END
LOOP
;
END
IF
;
...
...
@@ -165,9 +176,9 @@ BEGIN
nxt_out_reg
<=
i_out_reg
;
IF
wr_en
=
'1'
THEN
FOR
i
IN
0
TO
g_reg
.
nof_dat
-1
LOOP
IF
UNSIGNED
(
wr_adr
)
=
i
THEN
IF
UNSIGNED
(
wr_adr
)
=
I
THEN
nxt_reg_wr_arr
(
I
)
<=
'1'
;
nxt_out_reg
((
i
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
i
*
g_reg
.
dat_w
)
<=
wr_dat
;
nxt_out_reg
((
I
+
1
)
*
g_reg
.
dat_w
-1
DOWNTO
I
*
g_reg
.
dat_w
)
<=
wr_dat
;
END
IF
;
END
LOOP
;
END
IF
;
...
...
This diff is collapsed.
Click to expand it.
libraries/base/common/tb/vhdl/tb_common_pkg.vhd
+
6
−
0
View file @
5ddf6ee6
...
...
@@ -40,6 +40,12 @@ USE work.common_pkg.ALL;
PACKAGE
tb_common_pkg
IS
-- Constants
-- For common_reg_r_w_dc.vhd with c_meta_delay_len = 3 and internal g_readback = TRUE a
-- c_common_cross_clock_domain_latency = 20 is enough. With g_readback = FALSE somewhat
-- more is needed, because the read register value has to cross the clock domain back
-- again, so then use proc_common_wait_cross_clock_domain_latency() with c_nof_cycles
-- = c_common_cross_clock_domain_latency * 2.
CONSTANT
c_common_cross_clock_domain_latency
:
NATURAL
:
=
20
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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