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
fc9baef9
Commit
fc9baef9
authored
Oct 27, 2021
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial optimization of PDSCH resource element mappping.
parent
a7229937
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
63 deletions
+114
-63
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+108
-63
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+3
-0
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+3
-0
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
fc9baef9
...
...
@@ -247,7 +247,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
#endif
start_meas
(
&
gNB
->
dlsch_layer_mapping_stats
);
/// Layer mapping
nr_layer_mapping
(
mod_symbs
,
rel15
->
nrOfLayers
,
...
...
@@ -265,6 +265,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
#endif
stop_meas
(
&
gNB
->
dlsch_layer_mapping_stats
);
/// Resource mapping
// Non interleaved VRB to PRB mapping
...
...
@@ -278,7 +279,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf
(
"PDSCH resource mapping started (start SC %d
\t
start symbol %d
\t
N_PRB %d
\t
nb_re %d,nb_layers %d)
\n
"
,
start_sc
,
rel15
->
StartSymbolIndex
,
rel15
->
rbSize
,
nb_re
,
rel15
->
nrOfLayers
);
#endif
start_meas
(
&
gNB
->
dlsch_resource_mapping_stats
);
for
(
int
ap
=
0
;
ap
<
rel15
->
nrOfLayers
;
ap
++
)
{
// DMRS params for this ap
...
...
@@ -320,20 +321,13 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
dmrs_idx
=
(
rel15
->
rbStart
+
rel15
->
BWPStart
)
*
4
;
}
}
}
// Update l_prime in the case of double DMRS config
if
((
dmrs_symbol_map
&
(
1
<<
l
))){
//DMRS time occasion
if
(
l
==
(
l_overline
+
1
))
//take into account the double DMRS symbols
l_prime
=
1
;
else
if
(
l
>
(
l_overline
+
1
))
{
//new DMRS pair
l_overline
=
l
;
l_prime
=
0
;
}
}
/// DMRS QPSK modulation
if
(
rel15
->
dlDmrsSymbPos
&
(
1
<<
l
))
{
/// DMRS QPSK modulation
nr_modulation
(
pdsch_dmrs
[
l
][
0
],
n_dmrs
*
2
,
DMRS_MOD_ORDER
,
mod_dmrs
);
// currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
#ifdef DEBUG_DLSCH
...
...
@@ -358,69 +352,117 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
}
uint16_t
k
=
start_sc
;
// Loop Over SCs:
for
(
int
i
=
0
;
i
<
rel15
->
rbSize
*
NR_NB_SC_PER_RB
;
i
++
)
{
/
* check if cuurent RE is PTRS RE*/
is_ptrs_re
=
0
;
/* check for PTRS symbol and set flag for PTRS RE
*/
if
(
ptrs_symbol
){
i
s_ptrs_re
=
is_ptrs_subcarrier
(
k
,
rel15
->
rnti
,
ap
,
rel15
->
dmrsConfigType
,
rel15
->
PTRSFreqDensity
,
rel15
->
rbSize
,
rel15
->
PTRSReOffset
,
start_sc
,
frame_parms
->
ofdm_symbol_size
);
}
/* Map DMRS Symbol */
if
(
(
dmrs_symbol_map
&
(
1
<<
l
)
)
&&
(
k
==
((
start_sc
+
get_dmrs_freq_idx
(
n
,
k_prime
,
delta
,
dmrs_Type
))
%
(
frame_parms
->
ofdm_symbol_size
))))
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
Wt
[
l_prime
]
*
Wf
[
k_prime
]
*
amp
*
mod_dmrs
[
dmrs_idx
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
Wt
[
l_prime
]
*
Wf
[
k_prime
]
*
amp
*
mod_dmrs
[(
dmrs_idx
<<
1
)
+
1
])
>>
15
;
if
(
ptrs_symbol
||
dmrs_symbol_map
&
(
1
<<
l
))
{
/
/ Loop Over SCs:
for
(
int
i
=
0
;
i
<
rel15
->
rbSize
*
NR_NB_SC_PER_RB
;
i
++
)
{
/* check if cuurent RE is PTRS RE
*/
is_ptrs_re
=
0
;
i
f
(
ptrs_symbol
)
is_ptrs_re
=
is_ptrs_subcarrier
(
k
,
rel15
->
rnti
,
ap
,
rel15
->
dmrsConfigType
,
rel15
->
PTRSFreqDensity
,
rel15
->
rbSize
,
rel15
->
PTRSReOffset
,
start_sc
,
frame_parms
->
ofdm_symbol_size
);
/* Map DMRS Symbol */
if
(
(
dmrs_symbol_map
&
(
1
<<
l
))
&&
(
k
==
((
start_sc
+
get_dmrs_freq_idx
(
n
,
k_prime
,
delta
,
dmrs_Type
))
%
(
frame_parms
->
ofdm_symbol_size
))))
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
Wt
[
l_prime
]
*
Wf
[
k_prime
]
*
amp
*
mod_dmrs
[
dmrs_idx
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
Wt
[
l_prime
]
*
Wf
[
k_prime
]
*
amp
*
mod_dmrs
[(
dmrs_idx
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_DLSCH_MAPPING
printf
(
"dmrs_idx %d
\t
l %d
\t
k %d
\t
k_prime %d
\t
n %d
\t
txdataF: %d %d
\n
"
,
dmrs_idx
,
l
,
k
,
k_prime
,
n
,
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
printf
(
"dmrs_idx %d
\t
l %d
\t
k %d
\t
k_prime %d
\t
n %d
\t
txdataF: %d %d
\n
"
,
dmrs_idx
,
l
,
k
,
k_prime
,
n
,
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
#endif
dmrs_idx
++
;
k_prime
++
;
k_prime
&=
1
;
n
+=
(
k_prime
)
?
0
:
1
;
}
/* Map PTRS Symbol */
else
if
(
is_ptrs_re
){
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
beta_ptrs
*
amp
*
mod_ptrs
[
ptrs_idx
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
beta_ptrs
*
amp
*
mod_ptrs
[(
ptrs_idx
<<
1
)
+
1
])
>>
15
;
dmrs_idx
++
;
k_prime
++
;
k_prime
&=
1
;
n
+=
(
k_prime
)
?
0
:
1
;
}
else
if
(
is_ptrs_re
){
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
beta_ptrs
*
amp
*
mod_ptrs
[
ptrs_idx
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
beta_ptrs
*
amp
*
mod_ptrs
[(
ptrs_idx
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_DLSCH_MAPPING
printf
(
"ptrs_idx %d
\t
l %d
\t
k %d
\t
k_prime %d
\t
n %d
\t
txdataF: %d %d
\n
"
,
ptrs_idx
,
l
,
k
,
k_prime
,
n
,
((
int16_t
*
)
txdataF
[
ap
])[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
((
int16_t
*
)
txdataF
[
ap
])[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
printf
(
"ptrs_idx %d
\t
l %d
\t
k %d
\t
k_prime %d
\t
n %d
\t
txdataF: %d %d
\n
"
,
ptrs_idx
,
l
,
k
,
k_prime
,
n
,
((
int16_t
*
)
txdataF
[
ap
])[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
((
int16_t
*
)
txdataF
[
ap
])[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
#endif
ptrs_idx
++
;
}
ptrs_idx
++
;
}
/* Map DATA Symbol */
else
if
(
(
!
(
dmrs_symbol_map
&
(
1
<<
l
)))
||
allowed_xlsch_re_in_dmrs_symbol
(
k
,
start_sc
,
frame_parms
->
ofdm_symbol_size
,
rel15
->
numDmrsCdmGrpsNoData
,
dmrs_Type
))
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
amp
*
tx_layers
[
ap
][
m
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
amp
*
tx_layers
[
ap
][(
m
<<
1
)
+
1
])
>>
15
;
else
if
(
allowed_xlsch_re_in_dmrs_symbol
(
k
,
start_sc
,
frame_parms
->
ofdm_symbol_size
,
rel15
->
numDmrsCdmGrpsNoData
,
dmrs_Type
))
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
(
amp
*
tx_layers
[
ap
][
m
<<
1
])
>>
15
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
(
amp
*
tx_layers
[
ap
][(
m
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_DLSCH_MAPPING
printf
(
"m %d
\t
l %d
\t
k %d
\t
txdataF: %d %d
\n
"
,
m
,
l
,
k
,
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
printf
(
"m %d
\t
l %d
\t
k %d
\t
txdataF: %d %d
\n
"
,
m
,
l
,
k
,
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
#endif
m
++
;
m
++
;
}
/* mute RE */
else
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
0
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
0
;
}
if
(
++
k
>=
frame_parms
->
ofdm_symbol_size
)
k
-=
frame_parms
->
ofdm_symbol_size
;
}
//RE loop
}
else
{
// no PTRS or DMRS in this symbol
// Loop Over SCs:
int16_t
*
txF
=&
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
start_sc
+
txdataF_offset
)
<<
1
)];
int
upper_limit
=
rel15
->
rbSize
*
NR_NB_SC_PER_RB
;
int
remaining_re
=
0
;
if
(
start_sc
+
upper_limit
>
frame_parms
->
ofdm_symbol_size
)
{
remaining_re
=
upper_limit
+
start_sc
-
frame_parms
->
ofdm_symbol_size
;
upper_limit
=
frame_parms
->
ofdm_symbol_size
-
start_sc
;
}
/* mute RE */
else
{
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
(
2
*
txdataF_offset
)]
=
0
;
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]
=
0
;
int16_t
*
txl
=
&
tx_layers
[
ap
][
m
<<
1
];
for
(
int
i
=
0
;
i
<
(
upper_limit
<<
1
);
i
++
)
{
txF
[
i
]
=
(
amp
*
txl
[
i
])
>>
15
;
#ifdef DEBUG_DLSCH_MAPPING
if
((
i
&
1
)
>
0
)
printf
(
"m %d
\t
l %d
\t
k %d
\t
txdataF: %d %d
\n
"
,
m
,
l
,
start_sc
+
(
i
>>
1
),
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
start_sc
+
(
i
>>
1
))
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
start_sc
+
(
i
>>
1
))
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
#endif
/* handle this, mute RE */
/*else {
txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
}*/
}
//RE loop, first part
m
+=
upper_limit
;
if
(
remaining_re
>
0
)
{
txF
=
&
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
txdataF_offset
)
<<
1
)];
txl
=
&
tx_layers
[
ap
][
m
<<
1
];
for
(
int
i
=
0
;
i
<
(
remaining_re
<<
1
);
i
++
)
{
txF
[
i
]
=
(
amp
*
txl
[
i
])
>>
15
;
#ifdef DEBUG_DLSCH_MAPPING
if
((
i
&
1
)
>
0
)
printf
(
"m %d
\t
l %d
\t
k %d
\t
txdataF: %d %d
\n
"
,
m
,
l
,
i
>>
1
,
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
(
i
>>
1
))
<<
1
)
+
(
2
*
txdataF_offset
)],
txdataF_precoding
[
ap
][((
l
*
frame_parms
->
ofdm_symbol_size
+
(
i
>>
1
))
<<
1
)
+
1
+
(
2
*
txdataF_offset
)]);
#endif
/* handle this, mute RE */
/*else {
txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
}*/
}
//RE loop, second part
}
if
(
++
k
>=
frame_parms
->
ofdm_symbol_size
)
k
-=
frame_parms
->
ofdm_symbol_size
;
}
//RE loop
m
+=
remaining_re
;
}
}
// symbol loop
}
// layer loop
stop_meas
(
&
gNB
->
dlsch_resource_mapping_stats
);
///Layer Precoding and Antenna port mapping
// tx_layers 1-8 are mapped on antenna ports 1000-1007
...
...
@@ -429,7 +471,9 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
// pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1
// The Precoding matrix:
// The Codebook Type I and Type II are not supported yet.
// We adopt the precoding matrices of PUSCH for 4 layers.
// We`adopt the precoding matrices of PUSCH for 4 layers.
start_meas
(
&
gNB
->
dlsch_precoding_stats
);
for
(
int
ap
=
0
;
ap
<
frame_parms
->
nb_antennas_tx
;
ap
++
)
{
for
(
int
l
=
rel15
->
StartSymbolIndex
;
l
<
rel15
->
StartSymbolIndex
+
rel15
->
NrOfSymbols
;
l
++
)
{
...
...
@@ -504,6 +548,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
// symbol loop
}
// port loop
stop_meas
(
&
gNB
->
dlsch_precoding_stats
);
dlsch
->
slot_tx
[
slot
]
=
0
;
// TODO: handle precoding
...
...
openair1/PHY/defs_gNB.h
View file @
fc9baef9
...
...
@@ -868,6 +868,9 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t
dlsch_encoding_stats
;
time_stats_t
dlsch_modulation_stats
;
time_stats_t
dlsch_scrambling_stats
;
time_stats_t
dlsch_resource_mapping_stats
;
time_stats_t
dlsch_layer_mapping_stats
;
time_stats_t
dlsch_precoding_stats
;
time_stats_t
tinput
;
time_stats_t
tprep
;
time_stats_t
tparity
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
fc9baef9
...
...
@@ -1302,6 +1302,9 @@ int main(int argc, char **argv)
printStatIndent3
(
&
gNB
->
dlsch_interleaving_stats
,
"DLSCH Interleaving time"
);
printStatIndent2
(
&
gNB
->
dlsch_modulation_stats
,
"DLSCH modulation time"
);
printStatIndent2
(
&
gNB
->
dlsch_scrambling_stats
,
"DLSCH scrambling time"
);
printStatIndent2
(
&
gNB
->
dlsch_layer_mapping_stats
,
"DLSCH Layer Mapping time"
);
printStatIndent2
(
&
gNB
->
dlsch_resource_mapping_stats
,
"DLSCH Resource Mapping time"
);
printStatIndent2
(
&
gNB
->
dlsch_precoding_stats
,
"DLSCH Layer Precoding time"
);
printf
(
"
\n
UE RX function statistics (per %d us slot)
\n
"
,
1000
>>*
scc
->
ssbSubcarrierSpacing
);
...
...
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