Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
d104ef73
Commit
d104ef73
authored
Dec 13, 2021
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gNB: fix memory allocations for PUSCH in phy_init_nr_gNB()
parent
9e90b8f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+18
-15
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+0
-4
No files found.
openair1/PHY/INIT/nr_init.c
View file @
d104ef73
...
...
@@ -252,10 +252,16 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
int
N_RB_UL
=
cfg
->
carrier_config
.
ul_grid_size
[
cfg
->
ssb_config
.
scs_common
.
value
].
value
;
int
n_buf
=
Prx
*
max_ul_mimo_layers
;
int
nb_re_pusch
=
N_RB_UL
*
NR_NB_SC_PER_RB
;
#ifdef __AVX2__
int
nb_re_pusch2
=
nb_re_pusch
+
(
nb_re_pusch
&
7
);
#else
int
nb_re_pusch2
=
nb_re_pusch
;
#endif
for
(
int
ULSCH_id
=
0
;
ULSCH_id
<
gNB
->
number_of_nr_ulsch_max
;
ULSCH_id
++
)
{
pusch_vars
[
ULSCH_id
]
=
(
NR_gNB_PUSCH
*
)
malloc16_clear
(
sizeof
(
NR_gNB_PUSCH
)
);
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext2
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_ext
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
ptrs_phase_per_slot
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
...
...
@@ -265,23 +271,22 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb0
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_mag
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
rho
=
(
int32_t
**
)
malloc16
_clear
(
n_buf
*
sizeof
(
int32_t
*
)
);
pusch_vars
[
ULSCH_id
]
->
rho
=
(
int32_t
**
)
malloc16
(
n_buf
*
sizeof
(
int32_t
*
)
);
for
(
i
=
0
;
i
<
Prx
;
i
++
)
{
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
N_RB_UL
*
12
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext2
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
N_RB_UL
*
12
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
}
for
(
i
=
0
;
i
<
n_buf
;
i
++
)
{
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
*
2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
N_RB_UL
*
1
2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch
2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
);
pusch_vars
[
ULSCH_id
]
->
ptrs_phase_per_slot
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
symbols_per_slot
);
// symbols per slot
pusch_vars
[
ULSCH_id
]
->
rxdataF_comp
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
N_RB_UL
*
1
2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_mag0
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_slot
*
sizeof
(
int32_t
)
*
N_RB_UL
*
12
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb0
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_slot
*
sizeof
(
int32_t
)
*
N_RB_UL
*
12
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_mag
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_slot
*
sizeof
(
int32_t
)
*
N_RB_UL
*
12
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_slot
*
sizeof
(
int32_t
)
*
N_RB_UL
*
12
);
pusch_vars
[
ULSCH_id
]
->
rho
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
(
fp
->
N_RB_UL
*
12
*
7
*
2
)
);
pusch_vars
[
ULSCH_id
]
->
rxdataF_comp
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch
2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_mag0
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb0
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_mag
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
ul_ch_magb
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
pusch_vars
[
ULSCH_id
]
->
rho
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
nb_re_pusch2
*
fp
->
symbols_per_slot
);
}
pusch_vars
[
ULSCH_id
]
->
llr
=
(
int16_t
*
)
malloc16_clear
(
(
8
*
((
3
*
8
*
6144
)
+
12
))
*
sizeof
(
int16_t
)
);
// [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
pusch_vars
[
ULSCH_id
]
->
ul_valid_re_per_slot
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int16_t
)
*
fp
->
symbols_per_slot
);
...
...
@@ -389,7 +394,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
for
(
int
ULSCH_id
=
0
;
ULSCH_id
<
gNB
->
number_of_nr_ulsch_max
;
ULSCH_id
++
)
{
for
(
int
i
=
0
;
i
<
Prx
;
i
++
)
{
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext
[
i
]);
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext2
[
i
]);
}
for
(
int
i
=
0
;
i
<
n_buf
;
i
++
)
{
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates
[
i
]);
...
...
@@ -404,7 +408,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
rho
[
i
]);
}
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext
);
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
rxdataF_ext2
);
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates
);
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
ul_ch_estimates_ext
);
free_and_zero
(
pusch_vars
[
ULSCH_id
]
->
ptrs_phase_per_slot
);
...
...
openair1/PHY/defs_gNB.h
View file @
d104ef73
...
...
@@ -436,10 +436,6 @@ typedef struct {
/// - first index: rx antenna id [0..nb_antennas_rx[
/// - second index: ? [0..2*ofdm_symbol_size[
int32_t
**
rxdataF_ext
;
/// \brief Holds the received data in the frequency domain for the allocated RBs in normal format.
/// - first index: rx antenna id [0..nb_antennas_rx[
/// - second index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
rxdataF_ext2
;
/// \brief Hold the channel estimates in time domain based on DRS.
/// - first index: rx antenna id [0..nb_antennas_rx[
/// - second index: ? [0..4*ofdm_symbol_size[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment