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
ffa27fed
Commit
ffa27fed
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add functions to map arr to one.
parent
146546d0
No related branches found
No related tags found
1 merge request
!293
Rename eth_stream into eth_stream_udp. Create new eth_stream.vhd that contains...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/dp/src/vhdl/dp_stream_pkg.vhd
+32
-0
32 additions, 0 deletions
libraries/base/dp/src/vhdl/dp_stream_pkg.vhd
with
32 additions
and
0 deletions
libraries/base/dp/src/vhdl/dp_stream_pkg.vhd
+
32
−
0
View file @
ffa27fed
...
...
@@ -272,6 +272,12 @@ PACKAGE dp_stream_pkg Is
FUNCTION
TO_DP_SOSI_UNSIGNED
(
sync
,
valid
,
sop
,
eop
:
STD_LOGIC
;
bsn
,
data
,
re
,
im
,
empty
,
channel
,
err
:
UNSIGNED
)
RETURN
t_dp_sosi_unsigned
;
-- Map between array and single element
FUNCTION
TO_DP_ARR
(
sosi
:
t_dp_sosi
)
RETURN
t_dp_sosi_arr
;
FUNCTION
TO_DP_ARR
(
siso
:
t_dp_siso
)
RETURN
t_dp_siso_arr
;
FUNCTION
TO_DP_ONE
(
sosi_arr
:
t_dp_sosi_arr
)
RETURN
t_dp_sosi
;
FUNCTION
TO_DP_ONE
(
siso_arr
:
t_dp_siso_arr
)
RETURN
t_dp_siso
;
-- Keep part of head data and combine part of tail data, use the other sosi from head_sosi
FUNCTION
func_dp_data_shift_first
(
head_sosi
,
tail_sosi
:
t_dp_sosi
;
symbol_w
,
nof_symbols_per_data
,
nof_symbols_from_tail
:
NATURAL
)
RETURN
t_dp_sosi
;
-- Shift and combine part of previous data and this data, use the other sosi from prev_sosi
...
...
@@ -638,6 +644,32 @@ PACKAGE BODY dp_stream_pkg IS
RETURN
v_sosi_unsigned
;
END
TO_DP_SOSI_UNSIGNED
;
-- Map between array and single element
FUNCTION
TO_DP_ARR
(
sosi
:
t_dp_sosi
)
RETURN
t_dp_sosi_arr
IS
VARIABLE
v_sosi_arr
:
t_dp_sosi_arr
(
0
DOWNTO
0
)
:
=
(
OTHERS
=>
sosi
);
BEGIN
RETURN
v_sosi_arr
;
END
TO_DP_ARR
;
FUNCTION
TO_DP_ARR
(
siso
:
t_dp_siso
)
RETURN
t_dp_siso_arr
IS
VARIABLE
v_siso_arr
:
t_dp_siso_arr
(
0
DOWNTO
0
)
:
=
(
OTHERS
=>
siso
);
BEGIN
RETURN
v_siso_arr
;
END
TO_DP_ARR
;
FUNCTION
TO_DP_ONE
(
sosi_arr
:
t_dp_sosi_arr
)
RETURN
t_dp_sosi
IS
VARIABLE
v_sosi
:
t_dp_sosi
:
=
sosi_arr
(
0
);
BEGIN
RETURN
v_sosi
;
END
TO_DP_ONE
;
FUNCTION
TO_DP_ONE
(
siso_arr
:
t_dp_siso_arr
)
RETURN
t_dp_siso
IS
VARIABLE
v_siso
:
t_dp_siso
:
=
siso_arr
(
0
);
BEGIN
RETURN
v_siso
;
END
TO_DP_ONE
;
-- Keep part of head data and combine part of tail data
FUNCTION
func_dp_data_shift_first
(
head_sosi
,
tail_sosi
:
t_dp_sosi
;
symbol_w
,
nof_symbols_per_data
,
nof_symbols_from_tail
:
NATURAL
)
RETURN
t_dp_sosi
IS
VARIABLE
vN
:
NATURAL
:
=
nof_symbols_per_data
;
...
...
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