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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
9af7987e
Commit
9af7987e
authored
May 07, 2022
by
Sagar Parsawar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OAI UE: Cleaned up PRS buffer handling
parent
4e869190
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
38 deletions
+34
-38
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+3
-3
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+21
-21
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+1
-5
targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf
targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf
+9
-9
No files found.
openair1/PHY/INIT/nr_init_ue.c
View file @
9af7987e
...
...
@@ -338,10 +338,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
AssertFatal
((
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
!=
NULL
),
"NR UE init: PRS measurements malloc failed for gNB_id %d
\n
"
,
idx
);
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
NR_SYMBOLS_PER_SLOT
*
sizeof
(
int32_t
));
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
NR_SYMBOLS_PER_SLOT
*
sizeof
(
int32_t
));
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
AssertFatal
(((
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates
[
i
]
!=
NULL
)
||
(
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_ch_estimates_time
[
i
]
!=
NULL
)),
"NR UE init: PRS channel estimates malloc failed for rx_ant %d
\n
"
,
i
);
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
[
i
]
=
(
prs_meas_t
*
)
malloc16_clear
(
NR_SYMBOLS_PER_SLOT
*
sizeof
(
prs_meas_t
)
);
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
[
i
]
=
(
prs_meas_t
*
)
malloc16_clear
(
sizeof
(
prs_meas_t
)
);
AssertFatal
((
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
[
i
]
!=
NULL
),
"NR UE init: PRS measurements malloc failed for rx_ant %d
\n
"
,
i
);
}
}
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
9af7987e
...
...
@@ -240,7 +240,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
#endif
// average out the SNR computed
snr
=
snr
/
num_pilots
;
prs_meas
[
rxAnt
]
[
l
].
snr
=
snr
;
prs_meas
[
rxAnt
]
->
snr
=
snr
;
}
else
if
(
prs_cfg
->
CombSize
==
4
)
{
...
...
@@ -384,7 +384,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
#endif
// average out the SNR computed
snr
=
snr
/
num_pilots
;
prs_meas
[
rxAnt
]
[
l
].
snr
=
snr
;
prs_meas
[
rxAnt
]
->
snr
=
snr
;
}
else
{
...
...
@@ -396,7 +396,6 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
}
// for rxAnt
}
//for l
int16_t
l
=
0
;
//symbIdx
for
(
rxAnt
=
0
;
rxAnt
<
frame_params
->
nb_antennas_rx
;
rxAnt
++
)
{
// scale by averaging factor 1/NumPrsSymbols
...
...
@@ -423,9 +422,9 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
first_half
=
frame_params
->
ofdm_symbol_size
-
re_offset
;
second_half
=
(
prs_cfg
->
NumRB
*
12
)
-
first_half
;
if
(
first_half
>
0
)
memcpy
((
int16_t
*
)
&
prs_chestF
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
+
re_offset
],
&
ch_tmp
[
0
],
first_half
*
sizeof
(
int32_t
));
memcpy
((
int16_t
*
)
&
prs_chestF
[
rxAnt
][
re_offset
],
&
ch_tmp
[
0
],
first_half
*
sizeof
(
int32_t
));
if
(
second_half
>
0
)
memcpy
((
int16_t
*
)
&
prs_chestF
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
&
ch_tmp
[(
frame_params
->
ofdm_symbol_size
-
re_offset
)
<<
1
],
second_half
*
sizeof
(
int32_t
));
memcpy
((
int16_t
*
)
&
prs_chestF
[
rxAnt
][
0
],
&
ch_tmp
[(
first_half
<<
1
)
],
second_half
*
sizeof
(
int32_t
));
// Time domain IMPULSE response
idft_size_idx_t
idftsizeidx
;
...
...
@@ -472,39 +471,40 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
}
idft
(
idftsizeidx
,
(
int16_t
*
)
&
prs_chestF
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
(
int16_t
*
)
&
prs_chestF
[
rxAnt
][
0
],
(
int16_t
*
)
&
ch_tmp
[
0
],
1
);
// rearrange impulse response
memcpy
((
int16_t
*
)
&
prs_chestT
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
&
ch_tmp
[
frame_params
->
ofdm_symbol_size
],
(
frame_params
->
ofdm_symbol_size
>>
1
)
*
sizeof
(
int32_t
));
memcpy
((
int16_t
*
)
&
prs_chestT
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
+
(
frame_params
->
ofdm_symbol_size
>>
1
)],
&
ch_tmp
[
0
],
(
frame_params
->
ofdm_symbol_size
>>
1
)
*
sizeof
(
int32_t
));
memcpy
((
int16_t
*
)
&
prs_chestT
[
rxAnt
][
0
],
&
ch_tmp
[
frame_params
->
ofdm_symbol_size
],
(
frame_params
->
ofdm_symbol_size
>>
1
)
*
sizeof
(
int32_t
));
memcpy
((
int16_t
*
)
&
prs_chestT
[
rxAnt
][(
frame_params
->
ofdm_symbol_size
>>
1
)],
&
ch_tmp
[
0
],
(
frame_params
->
ofdm_symbol_size
>>
1
)
*
sizeof
(
int32_t
));
// peak estimator
peak_estimator
(
&
prs_chestT
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
peak_estimator
(
&
prs_chestT
[
rxAnt
][
0
],
frame_params
->
ofdm_symbol_size
,
&
prs_meas
[
rxAnt
]
[
l
].
dl_toa
,
&
prs_meas
[
rxAnt
]
->
dl_toa
,
&
ch_pwr
);
LOG_I
(
PHY
,
"[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] ToA for PRS symbol %2d ==> %d / %d samples, peak channel power %.1f dB
\n
"
,
gNB_id
,
rsc_id
,
rxAnt
,
proc
->
frame_rx
,
proc
->
nr_slot_rx
,
l
,
prs_meas
[
rxAnt
][
l
].
dl_toa
-
(
frame_params
->
ofdm_symbol_size
>>
1
),
frame_params
->
ofdm_symbol_size
,
10
*
log10
(
ch_pwr
));
//prs measurements
prs_meas
[
rxAnt
][
l
].
gNB_id
=
gNB_id
;
prs_meas
[
rxAnt
][
l
].
sfn
=
proc
->
frame_rx
;
prs_meas
[
rxAnt
][
l
].
slot
=
proc
->
nr_slot_rx
;
prs_meas
[
rxAnt
][
l
].
rxAnt_idx
=
rxAnt
;
prs_meas
[
rxAnt
][
l
].
dl_aoa
=
0
;
prs_meas
[
rxAnt
]
->
dl_toa
-=
(
frame_params
->
ofdm_symbol_size
>>
1
);
prs_meas
[
rxAnt
]
->
gNB_id
=
gNB_id
;
prs_meas
[
rxAnt
]
->
sfn
=
proc
->
frame_rx
;
prs_meas
[
rxAnt
]
->
slot
=
proc
->
nr_slot_rx
;
prs_meas
[
rxAnt
]
->
rxAnt_idx
=
rxAnt
;
prs_meas
[
rxAnt
]
->
dl_aoa
=
0
;
LOG_I
(
PHY
,
"[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %d / %d samples, peak channel power %.1f dB, SNR %+2d dB
\n
"
,
gNB_id
,
rsc_id
,
rxAnt
,
proc
->
frame_rx
,
proc
->
nr_slot_rx
,
prs_meas
[
rxAnt
]
->
dl_toa
,
frame_params
->
ofdm_symbol_size
,
10
*
log10
(
ch_pwr
),
prs_meas
[
rxAnt
]
->
snr
);
#ifdef DEBUG_PRS_CHEST
sprintf
(
filename
,
"%s%i%s"
,
"PRSpilot_"
,
rxAnt
,
".m"
);
LOG_M
(
filename
,
"prs_loc"
,
&
mod_prs
[
0
],
prs_cfg
->
NumRB
*
(
12
/
prs_cfg
->
CombSize
),
1
,
1
);
sprintf
(
filename
,
"%s%i%s"
,
"rxSigF_"
,
rxAnt
,
".m"
);
sprintf
(
varname
,
"%s%i"
,
"rxF_"
,
rxAnt
);
LOG_M
(
filename
,
varname
,
&
rxdataF
[
rxAnt
][
prs_cfg
->
SymbolStart
*
frame_params
->
ofdm_symbol_size
],
prs_cfg
->
NumPRSSymbols
*
frame_params
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
filename
,
varname
,
&
rxdataF
[
rxAnt
][
0
],
prs_cfg
->
NumPRSSymbols
*
frame_params
->
ofdm_symbol_size
,
1
,
1
);
sprintf
(
filename
,
"%s%i%s"
,
"prsChestF_"
,
rxAnt
,
".m"
);
sprintf
(
varname
,
"%s%i"
,
"prsChF_"
,
rxAnt
);
LOG_M
(
filename
,
varname
,
&
prs_chestF
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
frame_params
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
filename
,
varname
,
&
prs_chestF
[
rxAnt
][
0
],
frame_params
->
ofdm_symbol_size
,
1
,
1
);
sprintf
(
filename
,
"%s%i%s"
,
"prsChestT_"
,
rxAnt
,
".m"
);
sprintf
(
varname
,
"%s%i"
,
"prsChT_"
,
rxAnt
);
LOG_M
(
filename
,
varname
,
&
prs_chestT
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
frame_params
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
filename
,
varname
,
&
prs_chestT
[
rxAnt
][
0
],
frame_params
->
ofdm_symbol_size
,
1
,
1
);
#endif
// T tracer dump
...
...
@@ -514,11 +514,11 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
T
(
T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ
,
T_INT
(
gNB_id
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
nr_slot_rx
),
T_INT
(
rxAnt
),
T_BUFFER
(
&
prs_chestF
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
prs_cfg
->
NumPRSSymbols
*
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
)));
T_INT
(
rxAnt
),
T_BUFFER
(
&
prs_chestF
[
rxAnt
][
0
],
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
)));
T
(
T_UE_PHY_DL_CHANNEL_ESTIMATE
,
T_INT
(
gNB_id
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
nr_slot_rx
),
T_INT
(
rxAnt
),
T_BUFFER
(
&
prs_chestT
[
rxAnt
][
l
*
frame_params
->
ofdm_symbol_size
],
prs_cfg
->
NumPRSSymbols
*
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
)));
T_INT
(
rxAnt
),
T_BUFFER
(
&
prs_chestT
[
rxAnt
][
0
],
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
)));
}
free
(
ch_tmp
);
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
9af7987e
...
...
@@ -1692,11 +1692,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
nr_slot_rx
);
}
//PRS channel estimation
//for(int gIdx = 0; gIdx < ue->prs_active_gNBs; gIdx++)
{
nr_prs_channel_estimation
(
prs_gNB_id
,
rsc_id
,
ue
,
proc
,
fp
);
}
nr_prs_channel_estimation
(
prs_gNB_id
,
rsc_id
,
ue
,
proc
,
fp
);
}
if
((
frame_rx
%
64
==
0
)
&&
(
nr_slot_rx
==
0
))
{
...
...
targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf
View file @
9af7987e
...
...
@@ -26,20 +26,20 @@ PRSs =
prs_config1
= (
{
gNB_id
=
1
;
PRSResourceSetPeriod0
=
40
;
PRSResourceSetPeriod
1
=
0
;
SymbolStart
=
7
;
NumPRSSymbols
=
4
;
NumPRSResources
=
1
;
PRSResourceSetPeriod
= [
20
,
5
]
;
SymbolStart
=
[
8
]
;
NumPRSSymbols
=
[
5
]
;
NumRB
=
106
;
RBOffset
=
0
;
CombSize
=
4
;
REOffset
=
1
;
PRSResourceOffset
=
0
;
REOffset
=
[
1
]
;
PRSResourceOffset
=
[
1
]
;
PRSResourceRepetition
=
1
;
PRSResourceTimeGap
=
1
;
NPRS_ID
=
0
;
MutingPattern1
= [
0
];
MutingPattern2
= [
0
];
NPRS_ID
=
[
5
]
;
MutingPattern1
= [];
MutingPattern2
= [];
MutingBitRepetition
=
1
;
}
);
...
...
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