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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
1bf539b1
Commit
1bf539b1
authored
8 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Removed sum_sop, only need to use sum_sync. Added purpose and description description.
parent
0a6099d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/io/aduh/src/vhdl/aduh_mean_sum.vhd
+24
-33
24 additions, 33 deletions
libraries/io/aduh/src/vhdl/aduh_mean_sum.vhd
libraries/io/aduh/src/vhdl/aduh_power_sum.vhd
+10
-4
10 additions, 4 deletions
libraries/io/aduh/src/vhdl/aduh_power_sum.vhd
with
34 additions
and
37 deletions
libraries/io/aduh/src/vhdl/aduh_mean_sum.vhd
+
24
−
33
View file @
1bf539b1
...
@@ -19,6 +19,14 @@
...
@@ -19,6 +19,14 @@
--
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Purpose : Calculate the signed 'voltage' sum of input symbols during a sync
-- interval
-- Description :
-- The in_data can have g_nof_symbols_per_data >= 1 per in_data word.
-- The sync interval starts with the in_data that is valid at the in_sync.
-- The output 'voltage' sum of the previous sync interval is valid at the
-- sum_sync and held until the next sum_sync.
LIBRARY
IEEE
,
common_lib
;
LIBRARY
IEEE
,
common_lib
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
common_lib
.
common_pkg
.
ALL
;
USE
common_lib
.
common_pkg
.
ALL
;
...
@@ -43,8 +51,7 @@ ENTITY aduh_mean_sum IS
...
@@ -43,8 +51,7 @@ ENTITY aduh_mean_sum IS
-- Accumulation outputs
-- Accumulation outputs
sum
:
OUT
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
sum
:
OUT
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
sum_sync
:
OUT
STD_LOGIC
;
-- after sync there is a new sum
sum_sync
:
OUT
STD_LOGIC
-- at sum_sync there is a new sum
sum_sop
:
OUT
STD_LOGIC
-- at sop there is a new sum
);
);
END
aduh_mean_sum
;
END
aduh_mean_sum
;
...
@@ -59,41 +66,29 @@ ARCHITECTURE rtl OF aduh_mean_sum IS
...
@@ -59,41 +66,29 @@ ARCHITECTURE rtl OF aduh_mean_sum IS
TYPE
t_symbol_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
g_symbol_w
-1
DOWNTO
0
);
TYPE
t_symbol_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
g_symbol_w
-1
DOWNTO
0
);
TYPE
t_acc_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
c_acc_w
-1
DOWNTO
0
);
TYPE
t_acc_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
c_acc_w
-1
DOWNTO
0
);
SIGNAL
acc_load
:
STD_LOGIC
;
SIGNAL
in_sync_p
:
STD_LOGIC
;
SIGNAL
nxt_acc_load
:
STD_LOGIC
;
SIGNAL
acc_load_p
:
STD_LOGIC
;
SIGNAL
symbol_arr
:
t_symbol_arr
(
0
TO
g_nof_symbols_per_data
-1
);
SIGNAL
symbol_arr
:
t_symbol_arr
(
0
TO
g_nof_symbols_per_data
-1
);
SIGNAL
acc_arr
:
t_acc_arr
(
0
TO
g_nof_symbols_per_data
-1
);
SIGNAL
acc_arr
:
t_acc_arr
(
0
TO
g_nof_symbols_per_data
-1
);
SIGNAL
acc_vec
:
STD_LOGIC_VECTOR
(
g_nof_symbols_per_data
*
c_acc_w
-1
DOWNTO
0
);
SIGNAL
acc_vec
:
STD_LOGIC_VECTOR
(
g_nof_symbols_per_data
*
c_acc_w
-1
DOWNTO
0
);
SIGNAL
acc_sum
:
STD_LOGIC_VECTOR
(
c_acc_sum_w
-1
DOWNTO
0
);
SIGNAL
acc_sum
:
STD_LOGIC_VECTOR
(
c_acc_sum_w
-1
DOWNTO
0
);
SIGNAL
i_sum
:
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
SIGNAL
i_sum
:
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
SIGNAL
nxt_sum
:
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
SIGNAL
nxt_sum
:
STD_LOGIC_VECTOR
(
g_sum_w
-1
DOWNTO
0
);
SIGNAL
nxt_sum_sync
:
STD_LOGIC
;
SIGNAL
i_sum_sync
:
STD_LOGIC
;
BEGIN
BEGIN
sum
<=
i_sum
;
sum
<=
i_sum
;
sum_sync
<=
i_sum_sync
;
regs
:
PROCESS
(
rst
,
clk
)
regs
:
PROCESS
(
rst
,
clk
)
BEGIN
BEGIN
IF
rst
=
'1'
THEN
IF
rst
=
'1'
THEN
acc_load
<=
'0'
;
i_sum
<=
(
OTHERS
=>
'0'
);
i_sum
<=
(
OTHERS
=>
'0'
);
sum_s
op
<=
'0'
;
sum_s
ync
<=
'0'
;
ELSIF
rising_edge
(
clk
)
THEN
ELSIF
rising_edge
(
clk
)
THEN
acc_load
<=
nxt_acc_load
;
i_sum
<=
nxt_sum
;
i_sum
<=
nxt_sum
;
sum_s
op
<=
i
_sum_sync
;
sum_s
ync
<=
nxt
_sum_sync
;
END
IF
;
END
IF
;
END
PROCESS
;
END
PROCESS
;
-- Reload the accumlators with 0 or with the valid sample after the sync
nxt_acc_load
<=
in_sync
;
-- Accumulate per symbol stream in the in_data
-- Accumulate per symbol stream in the in_data
gen_acc
:
FOR
I
IN
0
TO
g_nof_symbols_per_data
-1
GENERATE
gen_acc
:
FOR
I
IN
0
TO
g_nof_symbols_per_data
-1
GENERATE
...
@@ -106,7 +101,7 @@ BEGIN
...
@@ -106,7 +101,7 @@ BEGIN
PORT
MAP
(
PORT
MAP
(
rst
=>
rst
,
rst
=>
rst
,
clk
=>
clk
,
clk
=>
clk
,
sload
=>
acc_load
,
sload
=>
in_sync
,
-- Reload the accumlators with 0 at the sync or with the valid sample after the sync
in_val
=>
in_val
,
in_val
=>
in_val
,
in_dat
=>
symbol_arr
(
I
),
in_dat
=>
symbol_arr
(
I
),
out_dat
=>
acc_arr
(
I
)
out_dat
=>
acc_arr
(
I
)
...
@@ -117,10 +112,8 @@ BEGIN
...
@@ -117,10 +112,8 @@ BEGIN
no_tree
:
IF
g_nof_symbols_per_data
=
1
GENERATE
no_tree
:
IF
g_nof_symbols_per_data
=
1
GENERATE
-- Capture the current accumulator values at the reload
-- Capture the current accumulator values at the reload
nxt_sum
<=
truncate_or_resize_svec
(
acc_vec
,
g_sum_truncate
,
g_sum_w
)
WHEN
acc_load_p
=
'1'
ELSE
i_sum
;
nxt_sum
<=
truncate_or_resize_svec
(
acc_vec
,
g_sum_truncate
,
g_sum_w
)
WHEN
in_sync
=
'1'
ELSE
i_sum
;
nxt_sum_sync
<=
in_sync
;
-- The accumulator has a latency of 1 clk cycle
i_sum_sync
<=
acc_load
;
END
GENERATE
;
END
GENERATE
;
gen_tree
:
IF
g_nof_symbols_per_data
>
1
GENERATE
gen_tree
:
IF
g_nof_symbols_per_data
>
1
GENERATE
...
@@ -138,23 +131,21 @@ BEGIN
...
@@ -138,23 +131,21 @@ BEGIN
sum
=>
acc_sum
sum
=>
acc_sum
);
);
u_
load
_p
:
ENTITY
common_lib
.
common_pipeline_sl
u_
in_sync
_p
:
ENTITY
common_lib
.
common_pipeline_sl
GENERIC
MAP
(
GENERIC
MAP
(
g_pipeline
=>
c_acc_sum_nof_stages
*
c_acc_sum_pipeline
,
g_pipeline
=>
c_acc_sum_nof_stages
*
c_acc_sum_pipeline
,
-- latency of common_adder_tree
g_reset_value
=>
0
g_reset_value
=>
0
)
)
PORT
MAP
(
PORT
MAP
(
rst
=>
rst
,
rst
=>
rst
,
clk
=>
clk
,
clk
=>
clk
,
in_dat
=>
acc_load
,
in_dat
=>
in_sync
,
out_dat
=>
acc_load
_p
out_dat
=>
in_sync
_p
);
);
-- Capture the current accumulator values at the reload
-- Capture the current accumulator values at the reload (taking account of the latency of common_adder_tree)
nxt_sum
<=
truncate_or_resize_svec
(
acc_sum
,
g_sum_truncate
,
g_sum_w
)
WHEN
acc_load_p
=
'1'
ELSE
i_sum
;
nxt_sum
<=
truncate_or_resize_svec
(
acc_sum
,
g_sum_truncate
,
g_sum_w
)
WHEN
in_sync_p
=
'1'
ELSE
i_sum
;
nxt_sum_sync
<=
in_sync_p
;
-- The accumulators have a latency of 1 clk cycle
i_sum_sync
<=
acc_load_p
;
END
GENERATE
;
END
GENERATE
;
END
rtl
;
END
rtl
;
This diff is collapsed.
Click to expand it.
libraries/io/aduh/src/vhdl/aduh_power_sum.vhd
+
10
−
4
View file @
1bf539b1
...
@@ -19,6 +19,14 @@
...
@@ -19,6 +19,14 @@
--
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Purpose : Calculate the 'power' sum of input symbols during a sync interval
-- Description :
-- The in_data can have g_nof_symbols_per_data >= 1 per in_data word.
-- The sync interval starts with the in_data that is valid at the in_sync.
-- The in_data is multiplied by itself to get the power value.
-- The output 'power' sum of the previous sync interval is valid at the
-- sum_sync and held until the next sum_sync.
LIBRARY
IEEE
,
technology_lib
,
common_lib
,
common_mult_lib
;
LIBRARY
IEEE
,
technology_lib
,
common_lib
,
common_mult_lib
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
technology_lib
.
technology_select_pkg
.
ALL
;
USE
technology_lib
.
technology_select_pkg
.
ALL
;
...
@@ -46,8 +54,7 @@ ENTITY aduh_power_sum IS
...
@@ -46,8 +54,7 @@ ENTITY aduh_power_sum IS
-- Accumulation outputs
-- Accumulation outputs
pwr_sum
:
OUT
STD_LOGIC_VECTOR
(
g_pwr_sum_w
-1
DOWNTO
0
);
pwr_sum
:
OUT
STD_LOGIC_VECTOR
(
g_pwr_sum_w
-1
DOWNTO
0
);
pwr_sum_sync
:
OUT
STD_LOGIC
;
-- after sync there is a new sum
pwr_sum_sync
:
OUT
STD_LOGIC
-- af sum_sync there is a new sum
pwr_sum_sop
:
OUT
STD_LOGIC
-- at sop there is a new sum
);
);
END
aduh_power_sum
;
END
aduh_power_sum
;
...
@@ -134,8 +141,7 @@ BEGIN
...
@@ -134,8 +141,7 @@ BEGIN
-- Accumulation outputs
-- Accumulation outputs
sum
=>
pwr_sum
,
sum
=>
pwr_sum
,
sum_sync
=>
pwr_sum_sync
,
sum_sync
=>
pwr_sum_sync
sum_sop
=>
pwr_sum_sop
);
);
-- Debug wire signal arrays for easier data interpretation in the Wave window
-- Debug wire signal arrays for easier data interpretation in the Wave window
...
...
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