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
e8a9cafb
Commit
e8a9cafb
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add sdp_subband_weights.vhd and support co pol and cross pol weigths.
parent
7460dbf6
No related branches found
Branches containing commit
No related tags found
1 merge request
!309
Resolve L2SDP-903
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/lofar2/libraries/sdp/hdllib.cfg
+2
-1
2 additions, 1 deletion
applications/lofar2/libraries/sdp/hdllib.cfg
applications/lofar2/libraries/sdp/src/vhdl/sdp_subband_weights.vhd
+192
-0
192 additions, 0 deletions
...ons/lofar2/libraries/sdp/src/vhdl/sdp_subband_weights.vhd
with
194 additions
and
1 deletion
applications/lofar2/libraries/sdp/hdllib.cfg
+
2
−
1
View file @
e8a9cafb
...
...
@@ -7,7 +7,8 @@ hdl_lib_technology =
synth_files
=
src/vhdl/sdp_pkg.vhd
src/vhdl/sdp_scope.vhd
src/vhdl/sdp_subband_equalizer.vhd
src/vhdl/sdp_subband_weights.vhd
src/vhdl/sdp_subband_equalizer.vhd
src/vhdl/sdp_bf_weights.vhd
src/vhdl/sdp_beamformer_local.vhd
src/vhdl/sdp_beamformer_remote.vhd
...
...
This diff is collapsed.
Click to expand it.
applications/lofar2/libraries/sdp/src/vhdl/sdp_subband_weights.vhd
0 → 100644
+
192
−
0
View file @
e8a9cafb
-------------------------------------------------------------------------------
--
-- Copyright 2020
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
-- Author: R. van der Walle, E. Kooistra (added cross weights)
-- Purpose:
-- . Implements the subband weighting part of the subband equalizer in the
-- subband filterbank (Fsub) of the LOFAR2 SDPFW design.
-- Description:
-- . The sdp_subband_weights.vhd consists of mms_dp_gain_serial_arr.vhd and
-- some address counter logic to select the address of the subband weight
-- and a dp_requantize.vhd component.
-- . There are subband_weights for co-polarization via ram_gains_mosi and
-- for cross polarization via ram_gains_cross_mosi.
-- . Default the co-polarization weights are read from g_gains_file_name and
-- default the cross polarization weights are 0.
-- . Subband widths:
-- - raw_sosi : g_raw_dat_w bits
-- Remark:
--
-------------------------------------------------------------------------------
LIBRARY
IEEE
,
common_lib
,
dp_lib
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
common_lib
.
common_pkg
.
ALL
;
USE
common_lib
.
common_mem_pkg
.
ALL
;
USE
dp_lib
.
dp_stream_pkg
.
ALL
;
USE
work
.
sdp_pkg
.
ALL
;
ENTITY
sdp_subband_weights
IS
GENERIC
(
g_gains_file_name
:
STRING
:
=
"UNUSED"
;
-- for co-polarization
g_nof_streams
:
NATURAL
:
=
c_sdp_P_pfb
;
-- Use no default raw width, to force instance to set it
g_raw_dat_w
:
NATURAL
-- default: c_sdp_W_subband
);
PORT
(
dp_clk
:
IN
STD_LOGIC
;
dp_rst
:
IN
STD_LOGIC
;
in_raw_sosi_arr
:
IN
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
);
in_cross_raw_sosi_arr
:
IN
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
);
weighted_raw_sosi_arr
:
OUT
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
);
weighted_cross_raw_sosi_arr
:
OUT
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
);
mm_rst
:
IN
STD_LOGIC
;
mm_clk
:
IN
STD_LOGIC
;
ram_gains_mosi
:
IN
t_mem_mosi
:
=
c_mem_mosi_rst
;
ram_gains_miso
:
OUT
t_mem_miso
;
ram_gains_cross_mosi
:
IN
t_mem_mosi
:
=
c_mem_mosi_rst
;
ram_gains_cross_miso
:
OUT
t_mem_miso
);
END
sdp_subband_weights
;
ARCHITECTURE
str
OF
sdp_subband_weights
IS
CONSTANT
c_gain_addr_w
:
NATURAL
:
=
ceil_log2
(
c_sdp_Q_fft
*
c_sdp_N_sub
);
-- Product width, do -1 to skip double sign bit in product
CONSTANT
c_gain_out_dat_w
:
NATURAL
:
=
c_sdp_W_sub_weight
+
g_raw_dat_w
-
1
;
SIGNAL
in_sosi
:
t_dp_sosi
;
SIGNAL
cnt
:
NATURAL
RANGE
0
TO
c_sdp_Q_fft
*
c_sdp_N_sub
-1
;
SIGNAL
gains_rd_address
:
STD_LOGIC_VECTOR
(
c_gain_addr_w
-1
DOWNTO
0
);
BEGIN
in_sosi
<=
in_raw_sosi_arr
(
0
);
-- use ctrl from input [0]
-----------------------------------------------------------------------------
-- Counter
-----------------------------------------------------------------------------
-- The subband weigths per PN are stored as
-- (cint16)subband_weights[S_pn/Q_fft]_[Q_fft][N_sub], but have
-- to be applied according the subband data order
-- fsub[S_pn/Q_fft]_[N_sub][Q_fft]. Therefore the counter in
-- sdp_subband_weights.vhd has to account for this difference in order.
p_cnt
:
PROCESS
(
dp_clk
,
dp_rst
)
-- Use short index variables v_Q, v_SUB names in capitals, to ease
-- recognizing them as (loop) indices.
VARIABLE
v_Q
,
v_SUB
:
NATURAL
;
BEGIN
IF
dp_rst
=
'1'
THEN
cnt
<=
0
;
v_Q
:
=
0
;
v_SUB
:
=
0
;
ELSIF
rising_edge
(
dp_clk
)
THEN
IF
in_sosi
.
valid
=
'1'
THEN
IF
in_sosi
.
eop
=
'1'
THEN
v_Q
:
=
0
;
v_SUB
:
=
0
;
ELSE
IF
v_Q
>=
c_sdp_Q_fft
-1
THEN
v_Q
:
=
0
;
IF
v_SUB
>=
c_sdp_N_sub
-1
THEN
v_SUB
:
=
0
;
ELSE
v_SUB
:
=
v_SUB
+
1
;
END
IF
;
ELSE
v_Q
:
=
v_Q
+
1
;
END
IF
;
END
IF
;
cnt
<=
v_Q
*
c_sdp_N_sub
+
v_SUB
;
END
IF
;
END
IF
;
END
PROCESS
;
gains_rd_address
<=
TO_UVEC
(
cnt
,
c_gain_addr_w
);
-----------------------------------------------------------------------------
-- Gain
-----------------------------------------------------------------------------
u_gains_co
:
ENTITY
dp_lib
.
mms_dp_gain_serial_arr
GENERIC
MAP
(
g_nof_streams
=>
g_nof_streams
,
g_nof_gains
=>
c_sdp_Q_fft
*
c_sdp_N_sub
,
g_complex_data
=>
TRUE
,
g_complex_gain
=>
TRUE
,
g_gain_w
=>
c_sdp_W_sub_weight
,
g_in_dat_w
=>
g_raw_dat_w
,
g_out_dat_w
=>
c_gain_out_dat_w
,
g_gains_file_name
=>
g_gains_file_name
)
PORT
MAP
(
-- System
mm_rst
=>
mm_rst
,
mm_clk
=>
mm_clk
,
dp_rst
=>
dp_rst
,
dp_clk
=>
dp_clk
,
-- MM interface
ram_gains_mosi
=>
ram_gains_mosi
,
ram_gains_miso
=>
ram_gains_miso
,
-- ST interface
gains_rd_address
=>
gains_rd_address
,
in_sosi_arr
=>
in_raw_sosi_arr
,
out_sosi_arr
=>
weighted_raw_sosi_arr
);
u_gains_cross
:
ENTITY
dp_lib
.
mms_dp_gain_serial_arr
GENERIC
MAP
(
g_nof_streams
=>
g_nof_streams
,
g_nof_gains
=>
c_sdp_Q_fft
*
c_sdp_N_sub
,
g_complex_data
=>
TRUE
,
g_complex_gain
=>
TRUE
,
g_gain_w
=>
c_sdp_W_sub_weight
,
g_in_dat_w
=>
g_raw_dat_w
,
g_out_dat_w
=>
c_gain_out_dat_w
,
g_gains_file_name
=>
"UNUSED"
)
PORT
MAP
(
-- System
mm_rst
=>
mm_rst
,
mm_clk
=>
mm_clk
,
dp_rst
=>
dp_rst
,
dp_clk
=>
dp_clk
,
-- MM interface
ram_gains_mosi
=>
ram_gains_cross_mosi
,
ram_gains_miso
=>
ram_gains_cross_miso
,
-- ST interface
gains_rd_address
=>
gains_rd_address
,
in_sosi_arr
=>
in_cross_raw_sosi_arr
,
out_sosi_arr
=>
weighted_cross_raw_sosi_arr
);
END
str
;
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