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
8623bc66
Commit
8623bc66
authored
Apr 07, 2022
by
Laurent Thomas
Committed by
Robert Schmidt
Apr 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a small out of buffer access, likely only santize addr detection
parent
1a2be8fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
40 deletions
+37
-40
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+37
-40
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
8623bc66
...
...
@@ -98,7 +98,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint16_t
nb_re
=
((
12
*
rel15
->
NrOfSymbols
)
-
nb_re_dmrs
*
dmrs_len
-
xOverhead
)
*
rel15
->
rbSize
*
rel15
->
nrOfLayers
;
uint8_t
Qm
=
rel15
->
qamModOrder
[
0
];
uint32_t
encoded_length
=
nb_re
*
Qm
;
uint32_t
scrambled_output
[
rel15
->
NrOfCodewords
][(
encoded_length
>>
5
)
+
1
];
int16_t
mod_dmrs
[
n_dmrs
<<
1
]
__attribute__
((
aligned
(
16
)));
/* PTRS */
...
...
@@ -147,63 +146,61 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf
(
"
\n
"
);
#endif
/// scrambling
start_meas
(
dlsch_scrambling_stats
);
for
(
int
q
=
0
;
q
<
rel15
->
NrOfCodewords
;
q
++
)
{
memset
((
void
*
)
scrambled_output
[
q
],
0
,
((
encoded_length
>>
5
)
+
1
)
*
sizeof
(
uint32_t
));
/// scrambling
start_meas
(
dlsch_scrambling_stats
);
uint32_t
scrambled_output
[(
encoded_length
>>
5
)
+
4
];
// modulator acces by 4 bytes in some cases
memset
(
scrambled_output
,
0
,
sizeof
(
scrambled_output
));
if
(
encoded_length
>
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
)
abort
();
nr_pdsch_codeword_scrambling
(
output
,
encoded_length
,
q
,
rel15
->
dataScramblingId
,
rel15
->
rnti
,
scrambled_output
[
q
]);
}
stop_meas
(
dlsch_scrambling_stats
);
scrambled_output
);
#ifdef DEBUG_DLSCH
printf
(
"PDSCH scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
encoded_length
>>
8
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
printf
(
"0x%08x
\t
"
,
scrambled_output
[
0
]
[(
i
<<
3
)
+
j
]);
printf
(
"
\n
"
);
}
printf
(
"PDSCH scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
encoded_length
>>
8
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
printf
(
"0x%08x
\t
"
,
scrambled_output
[(
i
<<
3
)
+
j
]);
printf
(
"
\n
"
);
}
#endif
/// Modulation
start_meas
(
dlsch_modulation_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
1
);
for
(
int
q
=
0
;
q
<
rel15
->
NrOfCodewords
;
q
++
)
nr_modulation
(
scrambled_output
[
q
],
encoded_length
,
Qm
,
mod_symbs
[
q
]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
0
);
stop_meas
(
dlsch_modulation_stats
);
stop_meas
(
dlsch_scrambling_stats
);
/// Modulation
start_meas
(
dlsch_modulation_stats
);
nr_modulation
(
scrambled_output
,
encoded_length
,
Qm
,
mod_symbs
[
q
]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
0
);
stop_meas
(
dlsch_modulation_stats
);
#ifdef DEBUG_DLSCH
printf
(
"PDSCH Modulation: Qm %d(%d)
\n
"
,
Qm
,
nb_re
);
for
(
int
i
=
0
;
i
<
nb_re
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"%d %d
\t
"
,
mod_symbs
[
0
][((
i
<<
3
)
+
j
)
<<
1
],
mod_symbs
[
0
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
printf
(
"PDSCH Modulation: Qm %d(%d)
\n
"
,
Qm
,
nb_re
);
for
(
int
i
=
0
;
i
<
nb_re
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"%d %d
\t
"
,
mod_symbs
[
0
][((
i
<<
3
)
+
j
)
<<
1
],
mod_symbs
[
0
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
}
#endif
}
start_meas
(
&
gNB
->
dlsch_layer_mapping_stats
);
/// Layer mapping
nr_layer_mapping
(
mod_symbs
,
rel15
->
nrOfLayers
,
nb_re
,
tx_layers
);
rel15
->
nrOfLayers
,
nb_re
,
tx_layers
);
#ifdef DEBUG_DLSCH
printf
(
"Layer mapping (%d layers):
\n
"
,
rel15
->
nrOfLayers
);
for
(
int
l
=
0
;
l
<
rel15
->
nrOfLayers
;
l
++
)
for
(
int
i
=
0
;
i
<
(
nb_re
/
rel15
->
nrOfLayers
)
>>
3
;
i
++
)
{
printf
(
"layer %d, Re %d..%d : "
,
l
,
i
<<
3
,(
i
<<
3
)
+
7
);
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"l%d %d
\t
"
,
tx_layers
[
l
][((
i
<<
3
)
+
j
)
<<
1
],
tx_layers
[
l
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
printf
(
"
\n
"
);
printf
(
"layer %d, Re %d..%d : "
,
l
,
i
<<
3
,(
i
<<
3
)
+
7
);
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"l%d %d
\t
"
,
tx_layers
[
l
][((
i
<<
3
)
+
j
)
<<
1
],
tx_layers
[
l
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
printf
(
"
\n
"
);
}
#endif
...
...
@@ -222,7 +219,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
#ifdef DEBUG_DLSCH_MAPPING
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
);
start_sc
,
rel15
->
StartSymbolIndex
,
rel15
->
rbSize
,
nb_re
,
rel15
->
nrOfLayers
);
#endif
start_meas
(
&
gNB
->
dlsch_resource_mapping_stats
);
...
...
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