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
lizhongxiao
OpenXG-RAN
Commits
b166286a
Commit
b166286a
authored
Jan 25, 2024
by
Jaroslava Fiedlerova
Committed by
Robert Schmidt
Jan 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use clang format
parent
bec8ebc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
29 deletions
+43
-29
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
+1
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+7
-2
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+35
-26
No files found.
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
View file @
b166286a
...
...
@@ -1106,7 +1106,7 @@ int32_t LDPCencoder(unsigned char **input, unsigned char **output, encoder_imple
.
rv
=
impp
->
rv
,
.
F
=
impp
->
F
,
.
Qm
=
impp
->
Qm
,
.
Kr
=
(
impp
->
K
-
impp
->
F
+
7
)
/
8
};
.
Kr
=
(
impp
->
K
-
impp
->
F
+
7
)
/
8
};
struct
rte_bbdev_info
info
;
rte_bbdev_info_get
(
ad
->
dev_id
,
&
info
);
int
socket_id
=
GET_SOCKET
(
info
.
socket_id
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
b166286a
...
...
@@ -368,8 +368,13 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
impp
.
rv
=
rel15
->
rvIndex
[
0
];
int
nb_re_dmrs
=
(
rel15
->
dmrsConfigType
==
NFAPI_NR_DMRS_TYPE1
)
?
(
6
*
rel15
->
numDmrsCdmGrpsNoData
)
:
(
4
*
rel15
->
numDmrsCdmGrpsNoData
);
impp
.
G
=
nr_get_G
(
rel15
->
rbSize
,
rel15
->
NrOfSymbols
,
nb_re_dmrs
,
get_num_dmrs
(
rel15
->
dlDmrsSymbPos
),
harq
->
unav_res
,
rel15
->
qamModOrder
[
0
],
rel15
->
nrOfLayers
);
impp
.
G
=
nr_get_G
(
rel15
->
rbSize
,
rel15
->
NrOfSymbols
,
nb_re_dmrs
,
get_num_dmrs
(
rel15
->
dlDmrsSymbPos
),
harq
->
unav_res
,
rel15
->
qamModOrder
[
0
],
rel15
->
nrOfLayers
);
int
r_offset
=
0
;
for
(
int
r
=
0
;
r
<
impp
.
n_segments
;
r
++
)
{
impp
.
E
=
nr_get_E
(
impp
.
G
,
impp
.
n_segments
,
impp
.
Qm
,
rel15
->
nrOfLayers
,
r
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
View file @
b166286a
...
...
@@ -50,7 +50,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
{
start_meas
(
&
ue
->
ulsch_encoding_stats
);
/////////////////////////parameters and variables initialization/////////////////////////
/////////////////////////parameters and variables initialization/////////////////////////
unsigned
int
crc
=
1
;
NR_UL_UE_HARQ_t
*
harq_process
=
&
ue
->
ul_harq_processes
[
harq_pid
];
...
...
@@ -72,7 +72,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
.
tprep
=
NULL
,
.
tparity
=
NULL
,
.
toutput
=
NULL
};
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING
,
VCD_FUNCTION_IN
);
LOG_D
(
NR_PHY
,
"ulsch coding nb_rb %d, Nl = %d
\n
"
,
nb_rb
,
ulsch
->
pusch_pdu
.
nrOfLayers
);
...
...
@@ -82,7 +82,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_ULSCH_CODING
printf
(
"encoding thinks this is a new packet
\n
"
);
#endif
///////////////////////// a---->| add CRC |---->b /////////////////////////
///////////////////////// a---->| add CRC |---->b /////////////////////////
int
max_payload_bytes
=
MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER
*
ulsch
->
pusch_pdu
.
nrOfLayers
*
1056
;
int
B
;
if
(
A
>
NR_MAX_PDSCH_TBS
)
{
...
...
@@ -90,41 +90,41 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
crc
=
crc24a
(
harq_process
->
a
,
A
)
>>
8
;
harq_process
->
a
[
A
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
2
];
harq_process
->
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
1
];
harq_process
->
a
[
2
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
harq_process
->
a
[
2
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
B
=
A
+
24
;
AssertFatal
((
A
/
8
)
+
4
<=
max_payload_bytes
,
"A %d is too big (A/8+4 = %d > %d)
\n
"
,
A
,(
A
/
8
)
+
4
,
max_payload_bytes
);
AssertFatal
((
A
/
8
)
+
4
<=
max_payload_bytes
,
"A %d is too big (A/8+4 = %d > %d)
\n
"
,
A
,
(
A
/
8
)
+
4
,
max_payload_bytes
);
memcpy
(
harq_process
->
b
,
harq_process
->
a
,(
A
/
8
)
+
4
);
}
else
{
// Add 16-bit crc (polynomial A) to payload
crc
=
crc16
(
harq_process
->
a
,
A
)
>>
16
;
harq_process
->
a
[
A
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
1
];
harq_process
->
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
harq_process
->
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
B
=
A
+
16
;
AssertFatal
((
A
/
8
)
+
3
<=
max_payload_bytes
,
"A %d is too big (A/8+3 = %d > %d)
\n
"
,
A
,(
A
/
8
)
+
3
,
max_payload_bytes
);
AssertFatal
((
A
/
8
)
+
3
<=
max_payload_bytes
,
"A %d is too big (A/8+3 = %d > %d)
\n
"
,
A
,
(
A
/
8
)
+
3
,
max_payload_bytes
);
memcpy
(
harq_process
->
b
,
harq_process
->
a
,(
A
/
8
)
+
3
);
// using 3 bytes to mimic the case of 24 bit crc
}
///////////////////////// b---->| block segmentation |---->c /////////////////////////
///////////////////////// b---->| block segmentation |---->c /////////////////////////
harq_process
->
BG
=
ulsch
->
pusch_pdu
.
ldpcBaseGraph
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION
,
VCD_FUNCTION_IN
);
start_meas
(
&
ue
->
ulsch_segmentation_stats
);
impp
.
Kb
=
nr_segmentation
(
harq_process
->
b
,
harq_process
->
c
,
B
,
&
harq_process
->
C
,
&
harq_process
->
K
,
&
harq_process
->
Z
,
&
harq_process
->
F
,
harq_process
->
BG
);
harq_process
->
c
,
B
,
&
harq_process
->
C
,
&
harq_process
->
K
,
&
harq_process
->
Z
,
&
harq_process
->
F
,
harq_process
->
BG
);
impp
.
n_segments
=
harq_process
->
C
;
impp
.
K
=
harq_process
->
K
;
impp
.
Kr
=
impp
.
K
;
impp
.
Zc
=
harq_process
->
Z
;
impp
.
F
=
harq_process
->
F
;
impp
.
BG
=
harq_process
->
BG
;
if
(
impp
.
n_segments
>
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
ulsch
->
pusch_pdu
.
nrOfLayers
)
{
if
(
impp
.
n_segments
>
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
ulsch
->
pusch_pdu
.
nrOfLayers
)
{
LOG_E
(
PHY
,
"nr_segmentation.c: too many segments %d, B %d
\n
"
,
impp
.
n_segments
,
B
);
return
(
-
1
);
}
...
...
@@ -133,10 +133,10 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_ULSCH_CODING
uint16_t
Kr_bytes
;
Kr_bytes
=
impp
.
Kr
>>
3
;
Kr_bytes
=
impp
.
Kr
>>
3
;
#endif
///////////////////////// c---->| LDCP coding |---->d ////////////////////////////////////
///////////////////////// c---->| LDCP coding |---->d ////////////////////////////////////
for
(
int
r
=
0
;
r
<
impp
.
n_segments
;
r
++
)
{
#ifdef DEBUG_ULSCH_CODING
printf
(
"Encoder: B %d F %d
\n
"
,
B
,
impp
.
F
);
...
...
@@ -169,8 +169,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM
,
VCD_FUNCTION_OUT
);
#ifdef DEBUG_ULSCH_CODING
write_output
(
"ulsch_enc_input0.m"
,
"enc_in0"
,
&
harq_process
->
c
[
0
][
0
],
Kr_bytes
,
1
,
4
);
write_output
(
"ulsch_enc_output0.m"
,
"enc0"
,
&
harq_process
->
d
[
0
][
0
],(
3
*
8
*
Kr_bytes
)
+
12
,
1
,
4
);
write_output
(
"ulsch_enc_input0.m"
,
"enc_in0"
,
&
harq_process
->
c
[
0
][
0
],
Kr_bytes
,
1
,
4
);
write_output
(
"ulsch_enc_output0.m"
,
"enc0"
,
&
harq_process
->
d
[
0
][
0
],
(
3
*
8
*
Kr_bytes
)
+
12
,
1
,
4
);
#endif
}
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -181,9 +181,18 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
}
}
LOG_D
(
PHY
,
"Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d, rvidx %d)...
\n
"
,
r
,
G
,
impp
.
Kr
*
3
,
impp
.
Qm
,
nb_rb
,
ulsch
->
pusch_pdu
.
pusch_data
.
rv_index
);
///////////////////////// d---->| Rate matching bit selection |---->e /////////////////////////
LOG_D
(
PHY
,
"Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb "
"%d, "
"rvidx %d)...
\n
"
,
r
,
G
,
impp
.
Kr
*
3
,
impp
.
Qm
,
nb_rb
,
ulsch
->
pusch_pdu
.
pusch_data
.
rv_index
);
///////////////////////// d---->| Rate matching bit selection |---->e /////////////////////////
impp
.
E
=
nr_get_E
(
G
,
impp
.
n_segments
,
impp
.
Qm
,
ulsch
->
pusch_pdu
.
nrOfLayers
,
r
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC
,
VCD_FUNCTION_IN
);
...
...
@@ -204,8 +213,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC
,
VCD_FUNCTION_OUT
);
#ifdef DEBUG_ULSCH_CODING
for
(
int
i
=
0
;
i
<
16
;
i
++
)
printf
(
"output ratematching e[%d]= %d r_offset %u
\n
"
,
i
,
harq_process
->
e
[
i
+
r_offset
],
r_offset
);
for
(
int
i
=
0
;
i
<
16
;
i
++
)
printf
(
"output ratematching e[%d]= %d r_offset %u
\n
"
,
i
,
harq_process
->
e
[
i
+
r_offset
],
r_offset
);
#endif
///////////////////////// e---->| Rate matching bit interleaving |---->f /////////////////////////
...
...
@@ -227,7 +236,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
r_offset
+=
impp
.
E
;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING
,
VCD_FUNCTION_OUT
);
stop_meas
(
&
ue
->
ulsch_encoding_stats
);
return
(
0
);
...
...
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