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
ace07914
Commit
ace07914
authored
May 23, 2024
by
Romain Beurdouche
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ldpc-decoding-module-interface-rework): Add slot encoding to the interface and interface demo
parent
a88d4e95
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
423 additions
and
22 deletions
+423
-22
CMakeLists.txt
CMakeLists.txt
+1
-2
openair1/PHY/CODING/nr_dlsch_encoding_interface_demo.c
openair1/PHY/CODING/nr_dlsch_encoding_interface_demo.c
+333
-0
openair1/PHY/CODING/nr_ulsch_decoding_interface.h
openair1/PHY/CODING/nr_ulsch_decoding_interface.h
+16
-0
openair1/PHY/CODING/nr_ulsch_decoding_interface_demo.c
openair1/PHY/CODING/nr_ulsch_decoding_interface_demo.c
+9
-9
openair1/PHY/CODING/nr_ulsch_decoding_interface_load.c
openair1/PHY/CODING/nr_ulsch_decoding_interface_load.c
+3
-1
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+5
-3
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+52
-7
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+4
-0
No files found.
CMakeLists.txt
View file @
ace07914
...
...
@@ -881,7 +881,7 @@ add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
set
(
PHY_NR_ULSCH_DECODING_DEMO_SRC
${
OPENAIR1_DIR
}
/PHY/CODING/nr_ulsch_decoding_interface_demo.c
${
PHY_LDPC_OPTIM8SEGMULTI_SRC
}
${
OPENAIR1_DIR
}
/PHY/CODING/nr_dlsch_encoding_interface_demo.c
)
set
(
PHY_NR_CODINGIF
...
...
@@ -913,7 +913,6 @@ add_library(coding MODULE ${PHY_TURBOSRC} )
add_library
(
dfts MODULE
${
OPENAIR1_DIR
}
/PHY/TOOLS/oai_dfts.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/oai_dfts_neon.c
)
add_library
(
ldpc_slot_demo MODULE
${
PHY_NR_ULSCH_DECODING_DEMO_SRC
}
)
target_link_libraries
(
ldpc_slot_demo PRIVATE ldpc_gen_HEADERS
)
set
(
PHY_SRC_COMMON
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/dci_tools_common.c
...
...
openair1/PHY/CODING/nr_dlsch_encoding_interface_demo.c
0 → 100644
View file @
ace07914
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nr_ulsch_decoding_interface.h
View file @
ace07914
...
...
@@ -36,10 +36,26 @@ typedef int32_t(nr_ulsch_decoding_shutdown_t)(void);
*/
typedef
int32_t
(
nr_ulsch_decoding_decoder_t
)(
PHY_VARS_gNB
*
gNB
,
NR_DL_FRAME_PARMS
*
frame_parms
,
int
frame_rx
,
int
slot_rx
,
uint32_t
*
G
);
typedef
int32_t
(
nr_ulsch_decoding_encoder_t
)
(
PHY_VARS_gNB
*
gNB
,
processingData_L1tx_t
*
msgTx
,
int
frame_tx
,
uint8_t
slot_tx
,
NR_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
**
output
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
,
time_stats_t
*
dlsch_rate_matching_stats
,
time_stats_t
*
dlsch_interleaving_stats
,
time_stats_t
*
dlsch_segmentation_stats
);
typedef
struct
nr_ulsch_decoding_interface_s
{
nr_ulsch_decoding_init_t
*
nr_ulsch_decoding_init
;
nr_ulsch_decoding_shutdown_t
*
nr_ulsch_decoding_shutdown
;
nr_ulsch_decoding_decoder_t
*
nr_ulsch_decoding_decoder
;
nr_ulsch_decoding_encoder_t
*
nr_ulsch_decoding_encoder
;
}
nr_ulsch_decoding_interface_t
;
int
load_nr_ulsch_decoding_interface
(
char
*
version
,
nr_ulsch_decoding_interface_t
*
interface
);
...
...
openair1/PHY/CODING/nr_ulsch_decoding_interface_demo.c
View file @
ace07914
...
...
@@ -63,14 +63,10 @@
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
int32_t
LDPCdecoder
(
t_nrLDPC_dec_params
*
p_decParams
,
uint8_t
harq_pid
,
uint8_t
ulsch_id
,
uint8_t
C
,
int8_t
*
p_llr
,
int8_t
*
p_out
,
t_nrLDPC_time_stats
*
p_profiler
,
decode_abort_t
*
ab
);
#define DEMO_LDPCLIB_SUFFIX ""
// Global var to limit the rework of the dirty legacy code
ldpc_interface_t
ldpc_interface_demo
;
static
void
nr_processULSegment_demo
(
void
*
arg
)
{
...
...
@@ -169,7 +165,7 @@ static void nr_processULSegment_demo(void *arg)
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
rdata
->
decodeIterations
=
LDPCdecoder
(
p_decoderParms
,
0
,
0
,
0
,
l
,
llrProcBuf
,
p_procTime
,
&
ulsch_harq
->
abort_decode
);
ldpc_interface_demo
.
LDPCdecoder
(
p_decoderParms
,
0
,
0
,
0
,
l
,
llrProcBuf
,
p_procTime
,
&
ulsch_harq
->
abort_decode
);
if
(
rdata
->
decodeIterations
<=
p_decoderParms
->
numMaxIter
)
memcpy
(
ulsch_harq
->
c
[
r
],
llrProcBuf
,
Kr
>>
3
);
...
...
@@ -326,12 +322,16 @@ int nr_ulsch_decoding_demo(PHY_VARS_gNB *phy_vars_gNB,
int32_t
nr_ulsch_decoding_init
(
void
){
load_LDPClib
(
DEMO_LDPCLIB_SUFFIX
,
&
ldpc_interface_demo
);
return
0
;
}
int32_t
nr_ulsch_decoding_shutdown
(
void
){
free_LDPClib
(
&
ldpc_interface_demo
);
return
0
;
}
...
...
openair1/PHY/CODING/nr_ulsch_decoding_interface_load.c
View file @
ace07914
...
...
@@ -56,7 +56,8 @@ int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_
/* function description array, to be used when loading the encoding/decoding shared lib */
loader_shlibfunc_t
shlib_fdesc
[]
=
{{.
fname
=
"nr_ulsch_decoding_init"
},
{.
fname
=
"nr_ulsch_decoding_shutdown"
},
{.
fname
=
"nr_ulsch_decoding_decoder"
}};
{.
fname
=
"nr_ulsch_decoding_decoder"
},
{.
fname
=
"nr_ulsch_decoding_encoder"
}};
int
ret
;
ret
=
load_module_version_shlib
(
libname
,
version
,
shlib_fdesc
,
sizeofArray
(
shlib_fdesc
),
NULL
);
if
(
ret
<
0
){
...
...
@@ -66,6 +67,7 @@ int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_
itf
->
nr_ulsch_decoding_init
=
(
nr_ulsch_decoding_init_t
*
)
shlib_fdesc
[
0
].
fptr
;
itf
->
nr_ulsch_decoding_shutdown
=
(
nr_ulsch_decoding_shutdown_t
*
)
shlib_fdesc
[
1
].
fptr
;
itf
->
nr_ulsch_decoding_decoder
=
(
nr_ulsch_decoding_decoder_t
*
)
shlib_fdesc
[
2
].
fptr
;
itf
->
nr_ulsch_decoding_encoder
=
(
nr_ulsch_decoding_encoder_t
*
)
shlib_fdesc
[
3
].
fptr
;
AssertFatal
(
itf
->
nr_ulsch_decoding_init
()
==
0
,
"error starting LDPC library %s %s
\n
"
,
libname
,
version
);
...
...
openair1/PHY/INIT/nr_init.c
View file @
ace07914
...
...
@@ -136,10 +136,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
gNB
->
nr_ulsch_decoding_interface_flag
=
0
;
int
ret_loader
=
load_nr_ulsch_decoding_interface
(
NULL
,
&
nr_ulsch_decoding_interface
);
if
(
ret_loader
>=
0
)
if
(
ret_loader
>=
0
)
{
gNB
->
nr_ulsch_decoding_interface_flag
=
1
;
load_LDPClib
(
NULL
,
&
ldpc_interface
);
load_LDPClib
(
""
,
&
ldpc_interface
);
}
else
{
load_LDPClib
(
NULL
,
&
ldpc_interface
);
}
pthread_mutex_init
(
&
gNB
->
UL_INFO
.
crc_rx_mutex
,
NULL
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
ace07914
...
...
@@ -33,6 +33,7 @@
#include "nr_dlsch.h"
#include "nr_dci.h"
#include "nr_sch_dmrs.h"
#include "PHY/CODING/nr_ulsch_decoding_interface.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/ptrs_nr.h"
...
...
@@ -64,6 +65,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
time_stats_t
*
dlsch_interleaving_stats
=&
gNB
->
dlsch_interleaving_stats
;
time_stats_t
*
dlsch_segmentation_stats
=&
gNB
->
dlsch_segmentation_stats
;
unsigned
char
**
output
=
calloc
(
msgTx
->
num_pdsch_slot
,
sizeof
(
unsigned
char
*
));
int
slot_encoding_done
=
0
;
for
(
int
dlsch_id
=
0
;
dlsch_id
<
msgTx
->
num_pdsch_slot
;
dlsch_id
++
)
{
NR_gNB_DLSCH_t
*
dlsch
=
msgTx
->
dlsch
[
dlsch_id
];
...
...
@@ -104,18 +108,52 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
}
harq
->
unav_res
=
ptrsSymbPerSlot
*
n_ptrs
;
if
(
slot_encoding_done
)
goto
after_encoding
;
/// CRC, coding, interleaving and rate matching
AssertFatal
(
harq
->
pdu
!=
NULL
,
"harq->pdu is null
\n
"
);
unsigned
char
output
[
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
]
__attribute__
((
aligned
(
64
)));
bzero
(
output
,
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
);
start_meas
(
dlsch_encoding_stats
);
int
ret_memalign
=
posix_memalign
((
void
**
)
&
output
[
dlsch_id
],
64
,
sizeof
(
unsigned
char
)
*
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
);
if
(
ret_memalign
){
if
(
gNB
->
nr_ulsch_decoding_interface_flag
)
for
(
int
i
=
0
;
i
<
dlsch_id
;
i
++
)
free
(
output
[
i
]);
return
;
}
bzero
(
output
[
dlsch_id
],
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
);
if
(
gNB
->
nr_ulsch_decoding_interface_flag
){
if
(
dlsch_id
==
msgTx
->
num_pdsch_slot
-
1
){
start_meas
(
dlsch_encoding_stats
);
if
(
nr_ulsch_decoding_interface
.
nr_ulsch_decoding_encoder
(
gNB
,
msgTx
,
frame
,
slot
,
frame_parms
,
output
,
tinput
,
tprep
,
tparity
,
toutput
,
dlsch_rate_matching_stats
,
dlsch_interleaving_stats
,
dlsch_segmentation_stats
)
==
-
1
)
{
return
;
}
stop_meas
(
dlsch_encoding_stats
);
dlsch_id
=
-
1
;
slot_encoding_done
=
1
;
}
continue
;
}
start_meas
(
dlsch_encoding_stats
);
if
(
nr_dlsch_encoding
(
gNB
,
frame
,
slot
,
harq
,
frame_parms
,
output
,
output
[
dlsch_id
]
,
tinput
,
tprep
,
tparity
,
...
...
@@ -125,6 +163,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
dlsch_segmentation_stats
)
==
-
1
)
return
;
stop_meas
(
dlsch_encoding_stats
);
after_encoding:
#ifdef DEBUG_DLSCH
printf
(
"PDSCH encoding:
\n
Payload:
\n
"
);
for
(
int
i
=
0
;
i
<
harq
->
B
>>
7
;
i
++
)
{
...
...
@@ -135,14 +175,14 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
printf
(
"
\n
Encoded payload:
\n
"
);
for
(
int
i
=
0
;
i
<
encoded_length
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
printf
(
"%d"
,
output
[(
i
<<
3
)
+
j
]);
printf
(
"%d"
,
output
[
dlsch_id
][
(
i
<<
3
)
+
j
]);
printf
(
"
\t
"
);
}
printf
(
"
\n
"
);
#endif
if
(
IS_SOFTMODEM_DLSIM
)
memcpy
(
harq
->
f
,
output
,
encoded_length
);
memcpy
(
harq
->
f
,
output
[
dlsch_id
]
,
encoded_length
);
c16_t
mod_symbs
[
rel15
->
NrOfCodewords
][
encoded_length
];
for
(
int
codeWord
=
0
;
codeWord
<
rel15
->
NrOfCodewords
;
codeWord
++
)
{
...
...
@@ -151,7 +191,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
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
,
codeWord
,
rel15
->
dataScramblingId
,
rel15
->
rnti
,
scrambled_output
);
nr_pdsch_codeword_scrambling
(
output
[
dlsch_id
],
encoded_length
,
codeWord
,
rel15
->
dataScramblingId
,
rel15
->
rnti
,
scrambled_output
);
free
(
output
[
dlsch_id
]);
#ifdef DEBUG_DLSCH
printf
(
"PDSCH scrambling:
\n
"
);
...
...
@@ -589,6 +631,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
LOG_D
(
PHY
,
"beam index for PDSCH allocation already taken
\n
"
);
}
}
// dlsch loop
free
(
output
);
}
void
dump_pdsch_stats
(
FILE
*
fd
,
PHY_VARS_gNB
*
gNB
)
{
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
ace07914
...
...
@@ -38,6 +38,7 @@
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_vars_nr_ue.h"
#include "PHY/types.h"
#include "PHY/CODING/nr_ulsch_decoding_interface.h"
#include "PHY/INIT/nr_phy_init.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/MODULATION/nr_modulation.h"
...
...
@@ -1327,6 +1328,9 @@ int main(int argc, char **argv)
if
(
gNB
->
ldpc_offload_flag
)
free_LDPClib
(
&
ldpc_interface_offload
);
if
(
gNB
->
nr_ulsch_decoding_interface_flag
)
free_nr_ulsch_decoding_interface
(
&
nr_ulsch_decoding_interface
);
if
(
output_fd
)
fclose
(
output_fd
);
...
...
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