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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Merge requests
!51
inital commit of sdp_bf_weights.vhd
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
inital commit of sdp_bf_weights.vhd
L2SDP-167
into
master
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
inital commit of sdp_bf_weights.vhd
Reinier van der Walle
requested to merge
L2SDP-167
into
master
Oct 8, 2020
Overview
0
Commits
1
Pipelines
0
Changes
3
Closes
L2SDP-167
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
ad4d9a91
1 commit,
Oct 8, 2020
3 files
+
146
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
applications/lofar2/libraries/sdp/src/vhdl/sdp_bf_weights.vhd
0 → 100644
+
140
−
0
View file @ ad4d9a91
Edit in single-file editor
Open in Web IDE
-------------------------------------------------------------------------------
--
-- 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
-- Purpose:
-- . Implements the functionality of sdp_bf_weights in the beamformer (BF) of
-- the LOFAR2 SDPFW design.
-- Description:
-- The sdp_bf_weights.vhd consists of mms_dp_gain_serial_arr.vhd and
-- some address counter logic to select the address of the subband weight.
-- Remark:
-- . sdp_bf_weights.vhd is similar to sdp_subband_equalizer.vhd. The
-- difference is that they have a different purpose and that the
-- sdp_subband_equalizer requantizes the output.
-------------------------------------------------------------------------------
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_bf_weights
IS
GENERIC
(
g_gains_file_name
:
STRING
:
=
"UNUSED"
);
PORT
(
dp_clk
:
IN
STD_LOGIC
;
dp_rst
:
IN
STD_LOGIC
;
in_sosi_arr
:
IN
t_dp_sosi_arr
(
c_sdp_N_pol
*
c_sdp_P_pfb
-1
DOWNTO
0
);
out_sosi_arr
:
OUT
t_dp_sosi_arr
(
c_sdp_N_pol
*
c_sdp_P_pfb
-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
);
END
sdp_bf_weights
;
ARCHITECTURE
str
OF
sdp_bf_weights
IS
CONSTANT
c_gain_addr_w
:
NATURAL
:
=
ceil_log2
(
c_sdp_Q_fft
*
c_sdp_S_sub_bf
);
CONSTANT
c_gain_out_dat_w
:
NATURAL
:
=
c_sdp_W_bf_weight
+
c_sdp_W_subband
-1
;
SIGNAL
cnt
:
NATURAL
RANGE
0
TO
c_sdp_Q_fft
*
c_sdp_S_sub_bf
-1
;
SIGNAL
gains_rd_address
:
STD_LOGIC_VECTOR
(
c_gain_addr_w
-1
DOWNTO
0
);
SIGNAL
dp_gain_serial_out_sosi_arr
:
t_dp_sosi_arr
(
c_sdp_P_pfb
-1
DOWNTO
0
);
BEGIN
---------------------------------------------------------------
-- Counter
---------------------------------------------------------------
-- The BF weigths per PN are stored as
-- (cint16)subband_weights[N_pol][S_pn/Q_fft]_[Q_fft][S_sub_bf], but have
-- to be applied according the subband data order
-- [N_pol][S_pn/Q_fft]_[S_sub_bf][Q_fft]. Therefore this counter
-- has to account for this difference in order.
p_cnt
:
PROCESS
(
dp_clk
,
dp_rst
)
VARIABLE
v_Q_fft
,
v_S_sub_bf
:
NATURAL
;
BEGIN
IF
dp_rst
=
'1'
THEN
cnt
<=
0
;
v_Q_fft
:
=
0
;
v_S_sub_bf
:
=
0
;
ELSIF
rising_edge
(
dp_clk
)
THEN
IF
in_sosi_arr
(
0
)
.
eop
=
'1'
THEN
v_Q_fft
:
=
0
;
v_S_sub_bf
:
=
0
;
ELSE
IF
v_Q_fft
>=
c_sdp_Q_fft
-1
THEN
v_Q_fft
:
=
0
;
IF
v_S_sub_bf
>=
c_sdp_S_sub_bf
-1
THEN
v_S_sub_bf
:
=
0
;
ELSE
v_S_sub_bf
:
=
v_S_sub_bf
+
1
;
END
IF
;
ELSE
v_Q_fft
:
=
v_Q_fft
+
1
;
END
IF
;
END
IF
;
cnt
<=
v_Q_fft
*
c_sdp_S_sub_bf
+
v_S_sub_bf
;
END
IF
;
END
PROCESS
;
gains_rd_address
<=
TO_UVEC
(
cnt
,
c_gain_addr_w
);
---------------------------------------------------------------
-- Gain
---------------------------------------------------------------
u_mms_dp_gain_serial_arr
:
ENTITY
dp_lib
.
mms_dp_gain_serial_arr
GENERIC
MAP
(
g_nof_streams
=>
c_sdp_N_pol
*
c_sdp_P_pfb
,
g_nof_gains
=>
c_sdp_Q_fft
*
c_sdp_S_sub_bf
,
g_complex_data
=>
TRUE
,
g_complex_gain
=>
TRUE
,
g_gain_w
=>
c_sdp_W_bf_weight
,
g_in_dat_w
=>
c_sdp_W_subband
,
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_sosi_arr
,
out_sosi_arr
=>
out_sosi_arr
);
END
str
;
Loading