Skip to content
GitLab
Explore
Sign in
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
1626fb80
Commit
1626fb80
authored
Oct 13, 2022
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Support g_mm_w < 32bin sim.
parent
096dd312
No related branches found
No related tags found
1 merge request
!285
Resolve L2SDP-840
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/dp/src/vhdl/dp_strobe_total_count.vhd
+13
-8
13 additions, 8 deletions
libraries/base/dp/src/vhdl/dp_strobe_total_count.vhd
with
13 additions
and
8 deletions
libraries/base/dp/src/vhdl/dp_strobe_total_count.vhd
+
13
−
8
View file @
1626fb80
...
@@ -37,6 +37,9 @@
...
@@ -37,6 +37,9 @@
-- . Enable or re-enable count starts at a ref_sync.
-- . Enable or re-enable count starts at a ref_sync.
-- . MM read of a count shows the strobe count that is captured at a ref_sync
-- . MM read of a count shows the strobe count that is captured at a ref_sync
-- (default input ref_sync = '1' when not used)
-- (default input ref_sync = '1' when not used)
-- * g_mm_w = c_word_w
-- Default use g_mm_w = 32b for MM, but support < 32 to ease verification of
-- count values > 2**g_mm_w.
--
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- REGMAP
-- REGMAP
...
@@ -68,6 +71,7 @@ USE common_lib.common_mem_pkg.ALL;
...
@@ -68,6 +71,7 @@ USE common_lib.common_mem_pkg.ALL;
ENTITY
dp_strobe_total_count
IS
ENTITY
dp_strobe_total_count
IS
GENERIC
(
GENERIC
(
g_mm_w
:
NATURAL
:
=
c_word_w
;
g_nof_counts_max
:
NATURAL
:
=
15
;
-- fixed by REGMAP
g_nof_counts_max
:
NATURAL
:
=
15
;
-- fixed by REGMAP
g_nof_counts
:
NATURAL
:
=
1
;
-- actual nof counts, <= g_nof_counts_max
g_nof_counts
:
NATURAL
:
=
1
;
-- actual nof counts, <= g_nof_counts_max
g_count_w
:
NATURAL
:
=
c_longword_w
;
-- actual count width, max is c_longword_w due to two mm word width
g_count_w
:
NATURAL
:
=
c_longword_w
;
-- actual count width, max is c_longword_w due to two mm word width
...
@@ -96,7 +100,7 @@ ARCHITECTURE rtl OF dp_strobe_total_count IS
...
@@ -96,7 +100,7 @@ ARCHITECTURE rtl OF dp_strobe_total_count IS
-- Define the size of the MM slave register
-- Define the size of the MM slave register
CONSTANT
c_mm_reg
:
t_c_mem
:
=
(
latency
=>
1
,
CONSTANT
c_mm_reg
:
t_c_mem
:
=
(
latency
=>
1
,
adr_w
=>
ceil_log2
(
c_nof_words
),
adr_w
=>
ceil_log2
(
c_nof_words
),
dat_w
=>
c_word
_w
,
-- Use MM bus data width = c_word_w = 32 for all MM registers
dat_w
=>
g_mm
_w
,
-- Use MM bus data width = c_word_w = 32 for all MM registers
nof_dat
=>
c_nof_words
,
nof_dat
=>
c_nof_words
,
init_sl
=>
'0'
);
init_sl
=>
'0'
);
...
@@ -116,6 +120,7 @@ ARCHITECTURE rtl OF dp_strobe_total_count IS
...
@@ -116,6 +120,7 @@ ARCHITECTURE rtl OF dp_strobe_total_count IS
BEGIN
BEGIN
ASSERT
g_nof_counts
<=
g_nof_counts_max
REPORT
"Too many counters to fit REGMAP."
SEVERITY
FAILURE
;
ASSERT
g_nof_counts
<=
g_nof_counts_max
REPORT
"Too many counters to fit REGMAP."
SEVERITY
FAILURE
;
ASSERT
g_count_w
<=
g_mm_w
*
2
REPORT
"Too wide counter to fit REGMAP."
SEVERITY
FAILURE
;
mm_cnt_clr
<=
(
reg_mosi
.
rd
OR
reg_mosi
.
wr
)
WHEN
TO_UINT
(
reg_mosi
.
address
(
c_mm_reg
.
adr_w
-1
DOWNTO
0
))
=
c_clear_adr
ELSE
'0'
;
mm_cnt_clr
<=
(
reg_mosi
.
rd
OR
reg_mosi
.
wr
)
WHEN
TO_UINT
(
reg_mosi
.
address
(
c_mm_reg
.
adr_w
-1
DOWNTO
0
))
=
c_clear_adr
ELSE
'0'
;
...
@@ -173,13 +178,13 @@ BEGIN
...
@@ -173,13 +178,13 @@ BEGIN
-- Register mapping
-- Register mapping
gen_cnt
:
FOR
I
IN
0
TO
g_nof_counts
-1
GENERATE
gen_cnt
:
FOR
I
IN
0
TO
g_nof_counts
-1
GENERATE
gen_reg_32b
:
IF
g_count_w
<=
c_word
_w
GENERATE
gen_reg_32b
:
IF
g_count_w
<=
g_mm
_w
GENERATE
rd_reg
((
2
*
I
+
1
)
*
c_word
_w
-
1
DOWNTO
(
2
*
I
+
0
)
*
c_word
_w
)
<=
RESIZE_UVEC
(
hold_cnt_arr
(
I
),
c_word
_w
);
-- low part
rd_reg
((
2
*
I
+
1
)
*
g_mm
_w
-
1
DOWNTO
(
2
*
I
+
0
)
*
g_mm
_w
)
<=
RESIZE_UVEC
(
hold_cnt_arr
(
I
),
g_mm
_w
);
-- low part
rd_reg
((
2
*
I
+
2
)
*
c_word
_w
-
1
DOWNTO
(
2
*
I
+
1
)
*
c_word
_w
)
<=
(
OTHERS
=>
'0'
);
-- high part (not used)
rd_reg
((
2
*
I
+
2
)
*
g_mm
_w
-
1
DOWNTO
(
2
*
I
+
1
)
*
g_mm
_w
)
<=
(
OTHERS
=>
'0'
);
-- high part (not used)
END
GENERATE
;
END
GENERATE
;
gen_reg_64b
:
IF
g_count_w
>
c_word
_w
GENERATE
gen_reg_64b
:
IF
g_count_w
>
g_mm
_w
GENERATE
rd_reg
((
2
*
I
+
1
)
*
c_word
_w
-
1
DOWNTO
(
2
*
I
+
0
)
*
c_word
_w
)
<=
hold_cnt_arr
(
I
)(
c_word
_w
-1
DOWNTO
0
);
-- low part
rd_reg
((
2
*
I
+
1
)
*
g_mm
_w
-
1
DOWNTO
(
2
*
I
+
0
)
*
g_mm
_w
)
<=
hold_cnt_arr
(
I
)(
g_mm
_w
-1
DOWNTO
0
);
-- low part
rd_reg
((
2
*
I
+
2
)
*
c_word
_w
-
1
DOWNTO
(
2
*
I
+
1
)
*
c_word
_w
)
<=
RESIZE_UVEC
(
hold_cnt_arr
(
I
)(
g_count_w
-1
DOWNTO
c_word_w
),
c_word
_w
);
-- high part
rd_reg
((
2
*
I
+
2
)
*
g_mm
_w
-
1
DOWNTO
(
2
*
I
+
1
)
*
g_mm
_w
)
<=
RESIZE_UVEC
(
hold_cnt_arr
(
I
)(
g_count_w
-1
DOWNTO
g_mm_w
),
g_mm
_w
);
-- high part
END
GENERATE
;
END
GENERATE
;
END
GENERATE
;
END
GENERATE
;
...
...
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