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
ac0f83dc
Commit
ac0f83dc
authored
3 years ago
by
Job van Wee
Browse files
Options
Downloads
Patches
Plain Diff
test commit
parent
2c60dd71
No related branches found
No related tags found
1 merge request
!215
Resolve L2SDP-660
Pipeline
#25617
passed
3 years ago
Stage: simulation
Stage: synthesis
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/lofar2/libraries/ddrctrl/src/vhdl/repack.vhd
+10
-11
10 additions, 11 deletions
applications/lofar2/libraries/ddrctrl/src/vhdl/repack.vhd
with
10 additions
and
11 deletions
applications/lofar2/libraries/ddrctrl/src/vhdl/repack.vhd
+
10
−
11
View file @
ac0f83dc
LIBRARY
IEEE
;
LIBRARY
IEEE
,
dp_lib
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
dp_lib
.
dp_stream_pkg
.
ALL
;
ENTITY
repack
IS
ENTITY
repack
IS
GENERIC
(
GENERIC
(
...
@@ -11,8 +11,7 @@ ENTITY repack IS
...
@@ -11,8 +11,7 @@ ENTITY repack IS
clk
:
IN
STD_LOGIC
;
clk
:
IN
STD_LOGIC
;
out_o_f
:
OUT
NATURAL
;
out_o_f
:
OUT
NATURAL
;
in_data
:
IN
STD_LOGIC_VECTOR
(
g_in_data_w
-1
DOWNTO
0
);
in_data
:
IN
STD_LOGIC_VECTOR
(
g_in_data_w
-1
DOWNTO
0
);
out_data
:
OUT
STD_LOGIC_VECTOR
(
g_out_data_w
-1
DOWNTO
0
);
out_sosi
:
OUT
t_dp_sosi
data_enable
:
OUT
STD_LOGIC
);
);
END
repack
;
END
repack
;
...
@@ -36,28 +35,28 @@ BEGIN
...
@@ -36,28 +35,28 @@ BEGIN
IF
(
g_in_data_w
*
(
c_v_count
+
1
)
>=
g_out_data_w
*
(
out_data_count
+
1
))
THEN
-- if the input data exceeds the output data vector width
IF
(
g_in_data_w
*
(
c_v_count
+
1
)
>=
g_out_data_w
*
(
out_data_count
+
1
))
THEN
-- if the input data exceeds the output data vector width
IF
(
out_data_count
=
1
)
THEN
-- if the input data exceeds c_v vector widt
IF
(
out_data_count
=
1
)
THEN
-- if the input data exceeds c_v vector widt
out_o_f
<=
a_o_f
;
-- set the output overflow to the overflow that maches the out_data vector
out_o_f
<=
a_o_f
;
-- set the output overflow to the overflow that maches the out_
sosi.
data vector
a_o_f
<=
a_o_f
+
g_in_data_w
*
c_v_count
-
g_out_data_w
*
(
out_data_count
+
1
);
-- check how much overflow there is and safe it in a_o_f
a_o_f
<=
a_o_f
+
g_in_data_w
*
c_v_count
-
g_out_data_w
*
(
out_data_count
+
1
);
-- check how much overflow there is and safe it in a_o_f
c_v
(
k_c_v_w
-
1
DOWNTO
k_c_v_w
-
(
g_in_data_w
-
a_o_f
))
<=
in_data
(
g_in_data_w
-
a_o_f
-
1
DOWNTO
0
);
-- fill the rest of c_v untill the end
c_v
(
k_c_v_w
-
1
DOWNTO
k_c_v_w
-
(
g_in_data_w
-
a_o_f
))
<=
in_data
(
g_in_data_w
-
a_o_f
-
1
DOWNTO
0
);
-- fill the rest of c_v untill the end
c_v
(
a_o_f
-
1
DOWNTO
0
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
g_in_data_w
-
a_o_f
);
-- fill the start of c_v untill the a_o_f
c_v
(
a_o_f
-
1
DOWNTO
0
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
g_in_data_w
-
a_o_f
);
-- fill the start of c_v untill the a_o_f
out_data
(
g_out_data_w
-
1
DOWNTO
0
)
<=
c_v
(
k_c_v_w
-
1
DOWNTO
g_out_data_w
);
-- fill out_data with 2nd part of c_v
out_
sosi
.
data
(
g_out_data_w
-
1
DOWNTO
0
)
<=
c_v
(
k_c_v_w
-
1
DOWNTO
g_out_data_w
);
-- fill out_
sosi.
data with 2nd part of c_v
data_enable
<=
'1'
;
-- data_enable
1
out_sosi
.
valid
<=
'1'
;
-- out_sosi.valid
1
c_v_count
<=
0
;
-- reset counter
c_v_count
<=
0
;
-- reset counter
out_data_count
<=
0
;
-- reset counter
out_data_count
<=
0
;
-- reset counter
Else
-- if the input data exceeds output data vector width but not the c_v vector widt
Else
-- if the input data exceeds output data vector width but not the c_v vector widt
c_v
(
g_in_data_w
*
(
c_v_count
+
1
)
+
a_o_f
-
1
DOWNTO
g_in_data_w
*
c_v_count
+
a_o_f
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
0
);
-- fill c_v
c_v
(
g_in_data_w
*
(
c_v_count
+
1
)
+
a_o_f
-
1
DOWNTO
g_in_data_w
*
c_v_count
+
a_o_f
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
0
);
-- fill c_v
c_v_count
<=
c_v_count
+
1
;
-- increase the counter of c_v with 1
c_v_count
<=
c_v_count
+
1
;
-- increase the counter of c_v with 1
out_data
(
g_out_data_w
-
1
DOWNTO
0
)
<=
c_v
(
g_out_data_w
-
1
DOWNTO
0
);
-- fill out_data with 1st part of c_v
out_
sosi
.
data
(
g_out_data_w
-
1
DOWNTO
0
)
<=
c_v
(
g_out_data_w
-
1
DOWNTO
0
);
-- fill out_
sosi.
data with 1st part of c_v
out_data_count
<=
out_data_count
+
1
;
-- increase the counter of out_data with 1
out_data_count
<=
out_data_count
+
1
;
-- increase the counter of out_
sosi.
data with 1
data_enable
<=
'1'
;
-- data_enable
1
out_sosi
.
valid
<=
'1'
;
-- out_sosi.valid
1
END
IF
;
END
IF
;
ELSE
-- if the input data doesn't exceeds the output data vector width
ELSE
-- if the input data doesn't exceeds the output data vector width
c_v
(
g_in_data_w
*
(
c_v_count
+
1
)
+
a_o_f
-
1
DOWNTO
g_in_data_w
*
c_v_count
+
a_o_f
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
0
);
-- fill c_v
c_v
(
g_in_data_w
*
(
c_v_count
+
1
)
+
a_o_f
-
1
DOWNTO
g_in_data_w
*
c_v_count
+
a_o_f
)
<=
in_data
(
g_in_data_w
-
1
DOWNTO
0
);
-- fill c_v
c_v_count
<=
c_v_count
+
1
;
-- increase the counter of c_v with 1
c_v_count
<=
c_v_count
+
1
;
-- increase the counter of c_v with 1
data_enable
<=
'0'
;
-- data_enable
0
out_sosi
.
valid
<=
'0'
;
-- out_sosi.valid
0
END
IF
;
END
IF
;
...
...
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