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
Michael Black
OpenXG-RAN
Commits
07a3634e
Commit
07a3634e
authored
Jun 23, 2022
by
Roberto Louro Magueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some heap allocations to stack allocations
parent
1a4686b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
31 deletions
+11
-31
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+0
-14
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+0
-6
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+7
-7
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+4
-4
No files found.
openair1/PHY/INIT/nr_init.c
View file @
07a3634e
...
...
@@ -613,13 +613,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for
(
int
id
=
0
;
id
<
NUMBER_OF_NR_SRS_MAX
;
id
++
)
{
gNB
->
nr_srs_info
[
id
]
=
(
nr_srs_info_t
*
)
malloc16_clear
(
sizeof
(
nr_srs_info_t
));
gNB
->
nr_srs_info
[
id
]
->
sc_list
=
(
uint16_t
*
)
malloc16_clear
(
6
*
fp
->
N_RB_UL
*
sizeof
(
uint16_t
));
gNB
->
nr_srs_info
[
id
]
->
srs_generated_signal
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
MAX_NUM_NR_SRS_SYMBOLS
*
sizeof
(
int32_t
));
gNB
->
nr_srs_info
[
id
]
->
signal_power
=
(
uint32_t
*
)
malloc16_clear
(
sizeof
(
uint32_t
));
gNB
->
nr_srs_info
[
id
]
->
noise_power_per_rb
=
(
uint32_t
*
)
malloc16_clear
(
fp
->
N_RB_UL
*
sizeof
(
uint32_t
));
gNB
->
nr_srs_info
[
id
]
->
noise_power
=
(
uint32_t
*
)
malloc16_clear
(
sizeof
(
uint32_t
));
gNB
->
nr_srs_info
[
id
]
->
snr_per_rb
=
(
int8_t
*
)
malloc16_clear
(
fp
->
N_RB_UL
*
sizeof
(
int8_t
));
gNB
->
nr_srs_info
[
id
]
->
snr
=
(
int8_t
*
)
malloc16_clear
(
sizeof
(
int8_t
));
gNB
->
nr_srs_info
[
id
]
->
srs_received_signal
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
));
gNB
->
nr_srs_info
[
id
]
->
srs_ls_estimated_channel
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
));
gNB
->
nr_srs_info
[
id
]
->
srs_estimated_channel_freq
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
));
...
...
@@ -796,13 +789,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_estimated_channel_time
[
i
]);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_estimated_channel_time_shifted
[
i
]);
}
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
sc_list
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_generated_signal
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
signal_power
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
noise_power_per_rb
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
noise_power
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
snr_per_rb
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
snr
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_received_signal
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_ls_estimated_channel
);
free_and_zero
(
gNB
->
nr_srs_info
[
id
]
->
srs_estimated_channel_freq
);
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
07a3634e
...
...
@@ -377,9 +377,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
ue
->
nr_srs_info
=
(
nr_srs_info_t
*
)
malloc16_clear
(
sizeof
(
nr_srs_info_t
));
ue
->
nr_srs_info
->
sc_list
=
(
uint16_t
*
)
malloc16_clear
(
6
*
fp
->
N_RB_UL
*
sizeof
(
uint16_t
));
ue
->
nr_srs_info
->
srs_generated_signal
=
(
int32_t
*
)
malloc16_clear
(
(
2
*
(
fp
->
samples_per_frame
)
+
2048
)
*
sizeof
(
int32_t
)
);
ue
->
nr_srs_info
->
noise_power
=
(
uint32_t
*
)
malloc16_clear
(
sizeof
(
uint32_t
));
ue
->
nr_srs_info
->
srs_received_signal
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
ue
->
nr_srs_info
->
srs_ls_estimated_channel
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
ue
->
nr_srs_info
->
srs_estimated_channel_freq
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
...
...
@@ -527,9 +524,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero
(
ue
->
nr_srs_info
->
srs_estimated_channel_time
[
i
]);
free_and_zero
(
ue
->
nr_srs_info
->
srs_estimated_channel_time_shifted
[
i
]);
}
free_and_zero
(
ue
->
nr_srs_info
->
sc_list
);
free_and_zero
(
ue
->
nr_srs_info
->
srs_generated_signal
);
free_and_zero
(
ue
->
nr_srs_info
->
noise_power
);
free_and_zero
(
ue
->
nr_srs_info
->
srs_received_signal
);
free_and_zero
(
ue
->
nr_srs_info
->
srs_ls_estimated_channel
);
free_and_zero
(
ue
->
nr_srs_info
->
srs_estimated_channel_freq
);
...
...
openair1/PHY/defs_nr_common.h
View file @
07a3634e
...
...
@@ -241,19 +241,19 @@ typedef struct {
typedef
struct
{
uint16_t
sc_list_length
;
uint16_t
*
sc_list
;
uint16_t
sc_list
[
6
*
273
]
;
uint8_t
srs_generated_signal_bits
;
int32_t
*
srs_generated_signal
;
int32_t
srs_generated_signal
[
OFDM_SYMBOL_SIZE_SAMPLES_MAX
*
MAX_NUM_NR_SRS_SYMBOLS
]
;
int32_t
**
srs_received_signal
;
int32_t
**
srs_ls_estimated_channel
;
int32_t
**
srs_estimated_channel_freq
;
int32_t
**
srs_estimated_channel_time
;
int32_t
**
srs_estimated_channel_time_shifted
;
uint32_t
*
signal_power
;
uint32_t
*
noise_power_per_rb
;
uint32_t
*
noise_power
;
int8_t
*
snr_per_rb
;
int8_t
*
snr
;
uint32_t
signal_power
;
uint32_t
noise_power_per_rb
[
273
]
;
uint32_t
noise_power
;
int8_t
snr_per_rb
[
273
]
;
int8_t
snr
;
}
nr_srs_info_t
;
typedef
struct
{
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
07a3634e
...
...
@@ -878,11 +878,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB
->
nr_srs_info
[
i
]
->
srs_estimated_channel_freq
,
gNB
->
nr_srs_info
[
i
]
->
srs_estimated_channel_time
,
gNB
->
nr_srs_info
[
i
]
->
srs_estimated_channel_time_shifted
,
gNB
->
nr_srs_info
[
i
]
->
signal_power
,
&
gNB
->
nr_srs_info
[
i
]
->
signal_power
,
gNB
->
nr_srs_info
[
i
]
->
noise_power_per_rb
,
gNB
->
nr_srs_info
[
i
]
->
noise_power
,
&
gNB
->
nr_srs_info
[
i
]
->
noise_power
,
gNB
->
nr_srs_info
[
i
]
->
snr_per_rb
,
gNB
->
nr_srs_info
[
i
]
->
snr
);
&
gNB
->
nr_srs_info
[
i
]
->
snr
);
}
T
(
T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE
,
T_INT
(
0
),
T_INT
(
srs_pdu
->
rnti
),
T_INT
(
frame_rx
),
T_INT
(
0
),
T_INT
(
0
),
...
...
@@ -900,7 +900,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB
->
srs_pdu_list
[
num_srs
].
timing_advance
=
srs_est
>=
0
?
nr_est_timing_advance_srs
(
&
gNB
->
frame_parms
,
(
const
int32_t
**
)
gNB
->
nr_srs_info
[
i
]
->
srs_estimated_channel_time
)
:
0xFFFF
;
gNB
->
srs_pdu_list
[
num_srs
].
num_symbols
=
1
<<
srs_pdu
->
num_symbols
;
gNB
->
srs_pdu_list
[
num_srs
].
wide_band_snr
=
srs_est
>=
0
?
(
*
gNB
->
nr_srs_info
[
i
]
->
snr
+
64
)
<<
1
:
0xFF
;
// 0xFF will be set if this field is invalid
gNB
->
srs_pdu_list
[
num_srs
].
wide_band_snr
=
srs_est
>=
0
?
(
gNB
->
nr_srs_info
[
i
]
->
snr
+
64
)
<<
1
:
0xFF
;
// 0xFF will be set if this field is invalid
gNB
->
srs_pdu_list
[
num_srs
].
num_reported_symbols
=
1
<<
srs_pdu
->
num_symbols
;
if
(
!
gNB
->
srs_pdu_list
[
num_srs
].
reported_symbol_list
)
{
gNB
->
srs_pdu_list
[
num_srs
].
reported_symbol_list
=
(
nfapi_nr_srs_indication_reported_symbol_t
*
)
calloc
(
1
,
gNB
->
srs_pdu_list
[
num_srs
].
num_reported_symbols
*
sizeof
(
nfapi_nr_srs_indication_reported_symbol_t
));
...
...
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