Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
1f2dfd5d
Commit
1f2dfd5d
authored
Feb 13, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leaks in nr_dlschsim
parent
49fb0d6d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
55 deletions
+56
-55
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+10
-0
openair1/PHY/INIT/phy_init.h
openair1/PHY/INIT/phy_init.h
+1
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+32
-35
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+2
-0
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+11
-20
No files found.
openair1/PHY/INIT/nr_init.c
View file @
1f2dfd5d
...
@@ -553,6 +553,16 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
...
@@ -553,6 +553,16 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
}
}
}
}
void
reset_DLSCH_struct
(
const
PHY_VARS_gNB
*
gNB
,
processingData_L1tx_t
*
msg
)
{
const
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
const
nfapi_nr_config_request_scf_t
*
cfg
=
&
gNB
->
gNB_config
;
const
uint16_t
grid_size
=
cfg
->
carrier_config
.
dl_grid_size
[
fp
->
numerology_index
].
value
;
for
(
int
i
=
0
;
i
<
gNB
->
number_of_nr_dlsch_max
;
i
++
)
for
(
int
j
=
0
;
j
<
2
;
j
++
)
free_gNB_dlsch
(
&
msg
->
dlsch
[
i
][
j
],
grid_size
);
}
void
init_nr_transport
(
PHY_VARS_gNB
*
gNB
)
{
void
init_nr_transport
(
PHY_VARS_gNB
*
gNB
)
{
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
LOG_I
(
PHY
,
"Initialise nr transport
\n
"
);
LOG_I
(
PHY
,
"Initialise nr transport
\n
"
);
...
...
openair1/PHY/INIT/phy_init.h
View file @
1f2dfd5d
...
@@ -410,6 +410,7 @@ void init_dfts(void);
...
@@ -410,6 +410,7 @@ void init_dfts(void);
void
fill_subframe_mask
(
PHY_VARS_eNB
*
eNB
);
void
fill_subframe_mask
(
PHY_VARS_eNB
*
eNB
);
void
init_DLSCH_struct
(
PHY_VARS_gNB
*
gNB
,
processingData_L1tx_t
*
msg
);
void
init_DLSCH_struct
(
PHY_VARS_gNB
*
gNB
,
processingData_L1tx_t
*
msg
);
void
reset_DLSCH_struct
(
const
PHY_VARS_gNB
*
gNB
,
processingData_L1tx_t
*
msg
);
/** @} */
/** @} */
#endif
#endif
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
1f2dfd5d
...
@@ -55,42 +55,39 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
...
@@ -55,42 +55,39 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
NR_gNB_DLSCH_t
*
dlsch
=
*
dlschptr
;
NR_gNB_DLSCH_t
*
dlsch
=
*
dlschptr
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
if
(
dlsch
)
{
if
(
N_RB
!=
273
)
{
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
+
1
;
a_segments
=
a_segments
/
273
+
1
;
}
}
#ifdef DEBUG_DLSCH_FREE
LOG_D
(
PHY
,
"Freeing dlsch %p
\n
"
,
dlsch
);
#endif
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
if
(
harq
->
b
)
{
if
(
harq
->
b
)
{
free16
(
harq
->
b
,
a_segments
*
1056
);
free16
(
harq
->
b
,
a_segments
*
1056
);
harq
->
b
=
NULL
;
harq
->
b
=
NULL
;
#ifdef DEBUG_DLSCH_FREE
LOG_D
(
PHY
,
"Freeing harq->b (%p)
\n
"
,
harq
->
b
);
#endif
}
}
#ifdef DEBUG_DLSCH_FREE
LOG_D
(
PHY
,
"Freeing dlsch process %d c (%p)
\n
"
,
i
,
harq
->
c
);
#endif
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
#ifdef DEBUG_DLSCH_FREE
free
(
harq
->
c
[
r
]);
LOG_D
(
PHY
,
"Freeing dlsch process %d c[%d] (%p)
\n
"
,
i
,
r
,
harq
->
c
[
r
]);
#endif
if
(
harq
->
c
[
r
])
{
free16
(
harq
->
c
[
r
],
1056
);
harq
->
c
[
r
]
=
NULL
;
harq
->
c
[
r
]
=
NULL
;
}
}
free
(
harq
->
pdu
);
for
(
int
aa
=
0
;
aa
<
64
;
aa
++
)
free
(
dlsch
->
calib_dl_ch_estimates
[
aa
]);
free
(
dlsch
->
calib_dl_ch_estimates
);
for
(
int
q
=
0
;
q
<
NR_MAX_NB_CODEWORDS
;
q
++
)
free
(
dlsch
->
mod_symbs
[
q
]);
for
(
int
layer
=
0
;
layer
<
NR_MAX_NB_LAYERS
;
layer
++
)
{
free
(
dlsch
->
txdataF_precoding
[
layer
]);
free
(
dlsch
->
txdataF
[
layer
]);
for
(
int
aa
=
0
;
aa
<
64
;
aa
++
)
free
(
dlsch
->
ue_spec_bf_weights
[
layer
][
aa
]);
free
(
dlsch
->
ue_spec_bf_weights
[
layer
]);
}
}
free16
(
dlsch
,
sizeof
(
NR_gNB_DLSCH_t
));
free
(
dlsch
);
*
dlschptr
=
NULL
;
*
dlschptr
=
NULL
;
}
}
}
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
...
...
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
View file @
1f2dfd5d
...
@@ -106,6 +106,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
...
@@ -106,6 +106,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
uint8_t
abstraction_flag
,
uint8_t
abstraction_flag
,
uint16_t
N_RB
);
uint16_t
N_RB
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
**
dlschptr
,
uint16_t
N_RB
);
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
- RB extraction (signal and channel estimates)
- RB extraction (signal and channel estimates)
- channel compensation (matched filtering)
- channel compensation (matched filtering)
...
...
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
1f2dfd5d
...
@@ -473,16 +473,13 @@ int main(int argc, char **argv)
...
@@ -473,16 +473,13 @@ int main(int argc, char **argv)
rel15
->
dlDmrsSymbPos
=
4
;
rel15
->
dlDmrsSymbPos
=
4
;
rel15
->
mcsIndex
[
0
]
=
Imcs
;
rel15
->
mcsIndex
[
0
]
=
Imcs
;
rel15
->
numDmrsCdmGrpsNoData
=
1
;
rel15
->
numDmrsCdmGrpsNoData
=
1
;
double
*
modulated_input
=
malloc16
(
sizeof
(
double
)
*
16
*
68
*
384
);
// [hna] 16 segments, 68*Zc
double
modulated_input
[
16
*
68
*
384
];
// [hna] 16 segments, 68*Zc
short
*
channel_output_fixed
=
malloc16
(
sizeof
(
short
)
*
16
*
68
*
384
);
short
channel_output_fixed
[
16
*
68
*
384
];
short
*
channel_output_uncoded
=
malloc16
(
sizeof
(
unsigned
short
)
*
16
*
68
*
384
);
//unsigned char *estimated_output;
//unsigned char *estimated_output;
unsigned
char
*
estimated_output_bit
;
unsigned
char
*
test_input_bit
;
unsigned
int
errors_bit
=
0
;
unsigned
int
errors_bit
=
0
;
test_input_bit
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
)
;
unsigned
char
test_input_bit
[
16
*
68
*
384
]
;
//estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
//estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
estimated_output_bit
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
)
;
unsigned
char
estimated_output_bit
[
16
*
68
*
384
]
;
NR_UE_DLSCH_t
*
dlsch0_ue
=
UE
->
dlsch
[
0
][
0
][
0
];
NR_UE_DLSCH_t
*
dlsch0_ue
=
UE
->
dlsch
[
0
][
0
][
0
];
NR_DL_UE_HARQ_t
*
harq_process
=
dlsch0_ue
->
harq_processes
[
harq_pid
];
NR_DL_UE_HARQ_t
*
harq_process
=
dlsch0_ue
->
harq_processes
[
harq_pid
];
harq_process
->
mcs
=
Imcs
;
harq_process
->
mcs
=
Imcs
;
...
@@ -496,9 +493,10 @@ int main(int argc, char **argv)
...
@@ -496,9 +493,10 @@ int main(int argc, char **argv)
harq_process
->
dlDmrsSymbPos
=
4
;
harq_process
->
dlDmrsSymbPos
=
4
;
harq_process
->
n_dmrs_cdm_groups
=
1
;
harq_process
->
n_dmrs_cdm_groups
=
1
;
printf
(
"harq process ue mcs = %d Qm = %d, symb %d
\n
"
,
harq_process
->
mcs
,
harq_process
->
Qm
,
nb_symb_sch
);
printf
(
"harq process ue mcs = %d Qm = %d, symb %d
\n
"
,
harq_process
->
mcs
,
harq_process
->
Qm
,
nb_symb_sch
);
unsigned
char
*
test_input
;
unsigned
char
*
test_input
;
test_input
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
TBS
/
8
);
test_input
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
TBS
/
8
);
//unsigned char test_input[TBS / 8] __attribute__ ((aligned(16)));
for
(
i
=
0
;
i
<
TBS
/
8
;
i
++
)
for
(
i
=
0
;
i
<
TBS
/
8
;
i
++
)
test_input
[
i
]
=
(
unsigned
char
)
rand
();
test_input
[
i
]
=
(
unsigned
char
)
rand
();
...
@@ -555,12 +553,6 @@ int main(int argc, char **argv)
...
@@ -555,12 +553,6 @@ int main(int argc, char **argv)
i,modulated_input[i],
i,modulated_input[i],
i,channel_output_fixed[i]);
i,channel_output_fixed[i]);
*/
*/
//Uncoded BER
if
(
channel_output_fixed
[
i
]
<
0
)
channel_output_uncoded
[
i
]
=
1
;
//QPSK demod
else
channel_output_uncoded
[
i
]
=
0
;
}
}
#ifdef DEBUG_CODER
#ifdef DEBUG_CODER
...
@@ -642,12 +634,11 @@ int main(int argc, char **argv)
...
@@ -642,12 +634,11 @@ int main(int argc, char **argv)
}
}
}*/
}*/
for
(
i
=
0
;
i
<
2
;
i
++
)
{
free
(
test_input
);
printf
(
"gNB %d
\n
"
,
i
);
free_gNB_dlsch
(
&
(
msgDataTx
.
dlsch
[
0
][
i
]),
N_RB_DL
);
free_channel_desc_scm
(
gNB2UE
);
printf
(
"UE %d
\n
"
,
i
);
free_nr_ue_dlsch
(
&
(
UE
->
dlsch
[
0
][
0
][
i
]),
N_RB_DL
);
reset_DLSCH_struct
(
gNB
,
&
msgDataTx
);
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
free
(
s_re
[
i
]);
free
(
s_re
[
i
]);
...
...
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