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
b2bdf7eb
Commit
b2bdf7eb
authored
Sep 11, 2019
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temporary commit
parent
adf76a5f
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
342 additions
and
61 deletions
+342
-61
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-1
executables/nr-gnb.c
executables/nr-gnb.c
+8
-5
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
+10
-4
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
+1
-1
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h
+257
-46
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
+1
-0
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+4
-0
openair2/RRC/NR/nr_rrc_proto.h
openair2/RRC/NR/nr_rrc_proto.h
+32
-1
openair2/RRC/NR/rrc_gNB_nsa.c
openair2/RRC/NR/rrc_gNB_nsa.c
+27
-3
No files found.
cmake_targets/CMakeLists.txt
View file @
b2bdf7eb
...
...
@@ -185,7 +185,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS
}
-g -DMALLOC_CHECK_=3"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
CMAKE_C_FLAGS
}
-g -DMALLOC_CHECK_=3 -O
2
"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
CMAKE_C_FLAGS
}
-g -DMALLOC_CHECK_=3 -O
3
"
)
set
(
GIT_BRANCH
"UNKNOWN"
)
...
...
@@ -1590,6 +1590,7 @@ set(L2_NR_SRC
${
NR_RRC_DIR
}
/L2_nr_interface.c
${
NR_RRC_DIR
}
/nr_rrc_config.c
${
NR_RRC_DIR
}
/rrc_gNB_nsa.c
${
NR_RRC_DIR
}
/rrc_gNB_internode.c
${
NR_RRC_DIR
}
/rrc_gNB_reconfig.c
${
NR_RRC_DIR
}
/rrc_gNB_UE_context.c
)
...
...
executables/nr-gnb.c
View file @
b2bdf7eb
...
...
@@ -886,15 +886,18 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
PHY_VARS_gNB
*
gNB
;
LOG_I
(
PHY
,
"[nr-softmodem.c] gNB (%p) structure about to allocated RC.nb_nr_L1_inst:%d
\n
"
,
RC
.
gNB
,
RC
.
nb_nr_L1_inst
);
if
(
RC
.
gNB
==
NULL
)
RC
.
gNB
=
(
PHY_VARS_gNB
**
)
malloc
((
1
+
RC
.
nb_nr_L1_inst
)
*
sizeof
(
PHY_VARS_gNB
*
));
LOG_I
(
PHY
,
"gNB L1 structure RC.gNB allocated @ %p
\n
"
,
RC
.
gNB
);
if
(
RC
.
gNB
==
NULL
)
{
RC
.
gNB
=
(
PHY_VARS_gNB
**
)
malloc
((
1
+
RC
.
nb_nr_L1_inst
)
*
sizeof
(
PHY_VARS_gNB
*
));
for
(
inst
=
0
;
inst
<
RC
.
nb_nr_L1_inst
;
inst
++
)
{
if
(
RC
.
gNB
[
inst
]
==
NULL
)
{
RC
.
gNB
[
inst
]
=
(
PHY_VARS_gNB
*
)
malloc
(
sizeof
(
PHY_VARS_gNB
));
memset
((
void
*
)
RC
.
gNB
[
inst
],
0
,
sizeof
(
PHY_VARS_gNB
));
}
}
LOG_I
(
PHY
,
"gNB L1 structure RC.gNB allocated @ %p
\n
"
,
RC
.
gNB
);
for
(
inst
=
0
;
inst
<
RC
.
nb_nr_L1_inst
;
inst
++
)
{
LOG_I
(
PHY
,
"[lte-softmodem.c] gNB structure RC.gNB[%d] allocated @ %p
\n
"
,
inst
,
RC
.
gNB
[
inst
]);
gNB
=
RC
.
gNB
[
inst
];
gNB
->
abstraction_flag
=
0
;
...
...
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
View file @
b2bdf7eb
...
...
@@ -87,23 +87,29 @@ static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_pr
// Set of results pointer to correct BN address
p_cnProcBufResBit
=
p_cnProcBufRes
+
(
j
*
bitOffsetInGroup
);
__m256i
*
pj0
=
&
p_cnProcBuf
[
lut_idxCnProcG3
[
j
][
0
]];
__m256i
*
pj1
=
&
p_cnProcBuf
[
lut_idxCnProcG3
[
j
][
1
]];
// Loop over CNs
for
(
i
=
0
;
i
<
M
;
i
++
)
{
// Abs and sign of 32 CNs (first BN)
ymm0
=
p_cnProcBuf
[
lut_idxCnProcG3
[
j
][
0
]
+
i
];
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
ymm0
=
pj0
[
i
];
sgn
=
_mm256_sign_epi8
(
*
p_ones
,
ymm0
);
min
=
_mm256_abs_epi8
(
ymm0
);
// 32 CNs of second BN
ymm0
=
p_cnProcBuf
[
lut_idxCnProcG3
[
j
][
1
]
+
i
];
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
ymm0
=
pj1
[
i
];
min
=
_mm256_min_epu8
(
min
,
_mm256_abs_epi8
(
ymm0
));
sgn
=
_mm256_sign_epi8
(
sgn
,
ymm0
);
// Store result
min
=
_mm256_min_epu8
(
min
,
*
p_maxLLR
);
// 128 in epi8 is -127
*
p_cnProcBufResBit
=
_mm256_sign_epi8
(
min
,
sgn
);
p_cnProcBufResBit
++
;
//*p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
//p_cnProcBufResBit++;
p_cnProcBufResBit
[
i
]
=
_mm256_sign_epi8
(
min
,
sgn
);
}
}
}
...
...
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
View file @
b2bdf7eb
...
...
@@ -39,7 +39,7 @@
#include "nrLDPC_bnProc.h"
#define NR_LDPC_ENABLE_PARITY_CHECK
//
#define NR_LDPC_PROFILER_DETAIL
#define NR_LDPC_PROFILER_DETAIL
#ifdef NR_LDPC_DEBUG_MODE
#include "nrLDPC_tools/nrLDPC_debug.h"
...
...
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h
View file @
b2bdf7eb
...
...
@@ -163,7 +163,7 @@ static inline void nrLDPC_cn2bnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
// =====================================================================
// CN group with 4 BNs
p_lut_cn2bn
+=
(
M
*
3
);
// Number of elements of previous group
//
p_lut_cn2bn += (M*3); // Number of elements of previous group
M
=
lut_numCnInCnGroups
[
1
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG2_R15
[
1
]
*
NR_LDPC_ZMAX
;
...
...
@@ -278,7 +278,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for
(
j
=
0
;
j
<
3
;
j
++
)
{
p_cnProcBufRes
=
&
cnProcBufRes
[
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
];
for
(
i
=
0
;
i
<
M
;
i
++
)
{
bnProcBuf
[
p_lut_cn2bn
[
j
*
M
+
i
]]
=
p_cnProcBufRes
[
i
];
...
...
@@ -422,6 +421,32 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
}
}
static
inline
uint32_t
*
bn2cnmap
(
uint32_t
*
p_lut_cn2bn
,
int8_t
*
p_cnProcBuf
,
int8_t
*
bnProcBufRes
,
int
M2
)
__attribute__
((
always_inline
));
static
inline
uint32_t
*
bn2cnmap
(
uint32_t
*
p_lut_cn2bn
,
int8_t
*
p_cnProcBuf
,
int8_t
*
bnProcBufRes
,
int
M2
)
{
__m128i
tmp
;
for
(
int
i
=
0
;
i
<
M2
;
i
++
)
{
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
0
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
1
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
2
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
3
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
4
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
5
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
6
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
7
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
8
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
9
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
10
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
11
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
12
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
13
);
tmp
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
14
);
((
__m128i
*
)
p_cnProcBuf
)[
i
]
=
_mm_insert_epi8
(
tmp
,
bnProcBufRes
[
*
p_lut_cn2bn
++
],
15
);
}
return
(
p_lut_cn2bn
);
}
/**
\brief Copies the values in the BN processing results buffer to their corresponding place in the CN processing buffer for BG2.
...
...
@@ -457,7 +482,6 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
for
(
j
=
0
;
j
<
2
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
];
for
(
i
=
0
;
i
<
M
;
i
++
)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
...
...
@@ -474,7 +498,6 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
for
(
j
=
0
;
j
<
3
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
1
]
+
j
*
bitOffsetInGroup
];
for
(
i
=
0
;
i
<
M
;
i
++
)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
...
...
@@ -491,7 +514,6 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
for
(
j
=
0
;
j
<
4
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
2
]
+
j
*
bitOffsetInGroup
];
for
(
i
=
0
;
i
<
M
;
i
++
)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
...
...
@@ -508,7 +530,6 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
for
(
j
=
0
;
j
<
5
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
3
]
+
j
*
bitOffsetInGroup
];
for
(
i
=
0
;
i
<
M
;
i
++
)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
...
...
@@ -521,7 +542,6 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
p_lut_cn2bn
+=
(
M
*
6
);
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
4
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG2_R15
[
4
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
4
]
+
j
*
bitOffsetInGroup
];
...
...
@@ -542,7 +562,7 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
for
(
j
=
0
;
j
<
10
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
5
]
+
j
*
bitOffsetInGroup
];
printf
(
"5 BN: cNProcBuf output at %d
\n
"
,
lut_startAddrCnGroups
[
5
]
+
j
*
bitOffsetInGroup
);
for
(
i
=
0
;
i
<
M
;
i
++
)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
...
...
@@ -551,6 +571,7 @@ static inline void nrLDPC_bn2cnProcBuf(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_
}
/**
\brief Copies the values in the BN processing results buffer to their corresponding place in the CN processing buffer for BG1.
\param p_lut Pointer to decoder LUTs
...
...
@@ -566,7 +587,7 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
int8_t
*
bnProcBufRes
=
p_procBuf
->
bnProcBufRes
;
int8_t
*
p_cnProcBuf
;
const
uint32_t
*
p_lut_cn2bn
;
uint32_t
*
p_lut_cn2bn
;
uint32_t
bitOffsetInGroup
;
uint32_t
i
;
uint32_t
j
;
...
...
@@ -582,154 +603,344 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
M
=
lut_numCnInCnGroups
[
0
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
0
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
2
;
j
++
)
for
(
j
=
0
;
j
<
2
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}
*/
}
// =====================================================================
// CN group with 4 BNs
p_lut_cn2bn
+=
(
M
*
3
);
// Number of elements of previous group
// p_lut_cn2bn += (M*3); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
1
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
1
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
3
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
1
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 5 BNs
p_lut_cn2bn
+=
(
M
*
4
);
// Number of elements of previous group
// p_lut_cn2bn += (M*4); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
2
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
2
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
2
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 6 BNs
p_lut_cn2bn
+=
(
M
*
5
);
// Number of elements of previous group
// p_lut_cn2bn += (M*5); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
3
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
3
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
5
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
3
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 7 BNs
p_lut_cn2bn
+=
(
M
*
6
);
// Number of elements of previous group
// p_lut_cn2bn += (M*6); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
4
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
4
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
6
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
4
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 8 BNs
p_lut_cn2bn
+=
(
M
*
7
);
// Number of elements of previous group
// p_lut_cn2bn += (M*7); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
5
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
5
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
7
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
5
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 9 BNs
p_lut_cn2bn
+=
(
M
*
8
);
// Number of elements of previous group
// p_lut_cn2bn += (M*8); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
6
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
6
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
6
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_lut_cn2bn += (M*8); // Number of elements of previous group
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 10 BNs
p_lut_cn2bn
+=
(
M
*
9
);
// Number of elements of previous group
// p_lut_cn2bn += (M*9); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
7
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
7
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
9
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
7
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
}
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
// =====================================================================
// CN group with 19 BNs
p_lut_cn2bn
+=
(
M
*
10
);
// Number of elements of previous group
// p_lut_cn2bn += (M*10); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
8
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
8
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
19
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
8
]
+
j
*
bitOffsetInGroup
];
p_lut_cn2bn
=
bn2cnmap
(
p_lut_cn2bn
,
p_cnProcBuf
,
bnProcBufRes
,
M
>>
4
);
/*
for (i=0; i<M; i++)
{
p_cnProcBuf
[
i
]
=
bnProcBufRes
[
p_lut_cn2bn
[
j
*
M
+
i
]];
// p_cnProcBuf[i] = bnProcBufRes[p_lut_cn2bn[j*M + i]];
p_cnProcBuf[i] = bnProcBufRes[*p_lut_cn2bn++];
}*/
}
}
static
inline
void
memcpy_printer
(
uint32_t
*
p_lut_cn2bn
,
int
dest0
,
int
M
)
{
int
dest
=
0
,
src
=
p_lut_cn2bn
[
0
],
len
=
1
;
for
(
int
i
=
1
;
i
<
M
;
i
++
)
{
if
(
p_lut_cn2bn
[
i
]
!=
(
1
+
p_lut_cn2bn
[
i
-
1
]))
{
printf
(
"memcpy(%d,%d,%d)
\n
"
,
dest0
+
dest
,
src
,
len
);
len
=
1
;
dest
=
i
;
src
=
p_lut_cn2bn
[
i
];
}
else
if
(
i
==
(
M
-
1
))
printf
(
"memcpy(%d,%d,%d)
\n
"
,
dest0
+
dest
,
src
,
len
);
else
len
++
;
// printf("p_lut_cn2bn[%d] : %d\n",i,p_lut_cn2bn[i]);
}
}
static
inline
void
nrLDPC_prep_bn2cnProcBuf_BG1
(
t_nrLDPC_lut
*
p_lut
,
uint16_t
Z
)
{
const
uint32_t
*
lut_cn2bnProcBuf
=
p_lut
->
cn2bnProcBuf
;
const
uint32_t
*
lut_cn2bnProcBuf2
=
p_lut
->
cn2bnProcBuf2
;
const
uint8_t
*
lut_numCnInCnGroups
=
p_lut
->
numCnInCnGroups
;
const
uint32_t
*
lut_startAddrCnGroups
=
p_lut
->
startAddrCnGroups
;
uint32_t
*
p_lut_cn2bn
;
uint32_t
bitOffsetInGroup
;
uint32_t
i
;
uint32_t
j
;
uint32_t
M
;
// For CN groups 3 to 19 no need to send the last BN back since it's single edge
// and BN processing does not change the value already in the CN proc buf
// =====================================================================
// CN group with 3 BNs
p_lut_cn2bn
=
&
lut_cn2bnProcBuf
[
0
];
M
=
lut_numCnInCnGroups
[
0
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
0
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
2
;
j
++
)
{
printf
(
"******3 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
);
memcpy_printer
(
p_lut_cn2bn
,
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
,
M
);
}
// =====================================================================
// CN group with 4 BNs
p_lut_cn2bn
+=
(
M
*
3
);
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
1
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
1
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
3
;
j
++
)
{
printf
(
"******4 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
1
]
+
j
*
bitOffsetInGroup
);
memcpy_printer
(
p_lut_cn2bn
,
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
,
M
);
}
// =====================================================================
// CN group with 5 BNs
// p_lut_cn2bn += (M*4); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
2
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
2
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
printf
(
"******5 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
2
]
+
j
*
bitOffsetInGroup
);
memcpy_printer
(
p_lut_cn2bn
,
lut_startAddrCnGroups
[
0
]
+
j
*
bitOffsetInGroup
,
M
);
}
// =====================================================================
// CN group with 6 BNs
// p_lut_cn2bn += (M*5); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
3
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
3
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
5
;
j
++
)
{
printf
(
"******6 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
3
]
+
j
*
bitOffsetInGroup
);
}
// =====================================================================
// CN group with 7 BNs
// p_lut_cn2bn += (M*6); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
4
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
4
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
6
;
j
++
)
{
printf
(
"******7 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
4
]
+
j
*
bitOffsetInGroup
);
}
// =====================================================================
// CN group with 8 BNs
// p_lut_cn2bn += (M*7); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
5
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
5
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
7
;
j
++
)
{
printf
(
"******8 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
5
]
+
j
*
bitOffsetInGroup
);
}
// =====================================================================
// CN group with 9 BNs
// p_lut_cn2bn += (M*8); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
6
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
6
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"******9 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
6
]
+
j
*
bitOffsetInGroup
);
}
// =====================================================================
// CN group with 10 BNs
// p_lut_cn2bn += (M*9); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
7
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
7
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
9
;
j
++
)
{
p_cnProcBuf
=
&
cnProcBuf
[
lut_startAddrCnGroups
[
7
]
+
j
*
bitOffsetInGroup
];
printf
(
"******10 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
7
]
+
j
*
bitOffsetInGroup
);
}
// =====================================================================
// CN group with 19 BNs
// p_lut_cn2bn += (M*10); // Number of elements of previous group
p_lut_cn2bn
+=
M
;
// Number of elements of previous group
M
=
lut_numCnInCnGroups
[
8
]
*
Z
;
bitOffsetInGroup
=
lut_numCnInCnGroups_BG1_R13
[
8
]
*
NR_LDPC_ZMAX
;
for
(
j
=
0
;
j
<
19
;
j
++
)
{
printf
(
"******19 BN (%d): cNProcBuf output at %d
\n
"
,
j
,
lut_startAddrCnGroups
[
8
]
+
j
*
bitOffsetInGroup
);
}
}
/**
\brief Copies the values in the LLR results buffer to their corresponding place in the output LLR vector.
\param p_lut Pointer to decoder LUTs
...
...
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
View file @
b2bdf7eb
...
...
@@ -48,6 +48,7 @@ typedef struct nrLDPC_lut {
const
uint32_t
*
llr2CnProcBuf
;
/**< LUT for input LLRs to CN processing buffer */
const
uint8_t
*
numEdgesPerBn
;
/**< LUT with number of edges per BN */
const
uint32_t
*
cn2bnProcBuf
;
/**< LUT for transferring CN processing results to BN processing buffer */
const
uint32_t
*
cn2bnProcBuf2
;
/**< LUT for transferring CN processing results to BN processing buffer */
const
uint16_t
*
llr2llrProcBuf
;
/**< LUT for transferring input LLRs to LLR processing buffer */
}
t_nrLDPC_lut
;
...
...
openair2/RRC/NR/nr_rrc_defs.h
View file @
b2bdf7eb
...
...
@@ -377,10 +377,14 @@ typedef struct {
NR_ServingCellConfigCommon_t
*
servingcellconfigcommon
;
NR_RRCReconfiguration_t
*
reconfig
[
MAX_NR_RRC_UE_CONTEXTS
];
NR_RadioBearerConfig_t
*
rb_config
[
MAX_NR_RRC_UE_CONTEXTS
];
NR_CellGroupConfig_t
*
secondaryCellGroup
[
MAX_NR_RRC_UE_CONTEXTS
];
NR_SRB_INFO
SI
;
NR_SRB_INFO
Srb0
;
int
initial_csi_index
[
MAX_NR_RRC_UE_CONTEXTS
];
int
n_physical_antenna_ports
;
}
rrc_gNB_carrier_data_t
;
//---------------------------------------------------
...
...
openair2/RRC/NR/nr_rrc_proto.h
View file @
b2bdf7eb
...
...
@@ -33,6 +33,11 @@
#include "RRC/NR/nr_rrc_defs.h"
#include "flexran_agent_extern.h"
#include "NR_RRCReconfiguration.h"
#include "NR_UE-NR-Capability.h"
#include "NR_UE-CapabilityRAT-ContainerList.h"
#include "NR_CG-Config.h"
#include "NR_CG-ConfigInfo.h"
int
rrc_init_nr_global_param
(
void
);
...
...
@@ -57,6 +62,32 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
rrc_gNB_ue_context_t
*
const
ue_context_pP
);
void
rrc_parse_ue_capabilities
(
gNB_RRC_INST
*
rrc
,
NR_UE_CapabilityRAT_ContainerList_t
*
UE_CapabilityRAT_ContainerList
);
void
rrc_add_nsa_user
(
gNB_RRC_INST
*
rrc
,
struct
rrc_gNB_ue_context_s
*
ue_context_p
);
void
fill_default_secondaryCellGroup
(
NR_ServingCellConfigCommon_t
*
servingcellconfigcommon
,
NR_RRCReconfiguration_IEs_t
*
reconfig
,
NR_CellGroupConfig_t
*
secondaryCellGroup
,
int
scg_id
,
int
servCellIndex
,
int
n_physical_antenna_ports
,
int
initial_csi_index
);
void
fill_default_reconfig
(
NR_ServingCellConfigCommon_t
*
servingcellconfigcommon
,
NR_RRCReconfiguration_IEs_t
*
reconfig
,
NR_CellGroupConfig_t
*
secondaryCellGroup
,
int
n_physical_antenna_ports
,
int
initial_csi_index
);
int
generate_CG_Config
(
gNB_RRC_INST
*
rrc
,
NR_CG_Config_t
*
cg_Config
,
NR_RRCReconfiguration_t
*
reconfig
,
NR_RadioBearerConfig_t
*
rbconfig
);
int
parse_CG_ConfigInfo
(
gNB_RRC_INST
*
rrc
,
NR_CG_ConfigInfo_t
*
CG_ConfigInfo
);
#if defined(ENABLE_ITTI)
/**\brief RRC eNB task.
...
...
openair2/RRC/NR/rrc_gNB_nsa.c
View file @
b2bdf7eb
...
...
@@ -33,11 +33,24 @@
#include "nr_rrc_defs.h"
#include "NR_RRCReconfiguration.h"
#include "NR_UE-NR-Capability.h"
#include "NR_UE-CapabilityRAT-ContainerList.h"
#include "NR_CG-Config.h"
void
rrc_parse_ue_capabilities
(
gNB_RRC_INST
*
rrc
,
BIT_STRING_t
*
ueCapabilityRAT_Container_nr
,
BIT_STRING_t
*
ueCapabilityRAT_Container_MRDC
)
{
void
rrc_parse_ue_capabilities
(
gNB_RRC_INST
*
rrc
,
NR_UE_CapabilityRAT_ContainerList_t
*
UE_CapabilityRAT_ContainerList
)
{
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
NULL
;
int
rnti
=
taus
()
&
65535
;
OCTET_STRING_t
*
ueCapabilityRAT_Container_nr
;
OCTET_STRING_t
*
ueCapabilityRAT_Container_MRDC
;
AssertFatal
(
UE_CapabilityRAT_ContainerList
!=
NULL
,
"UE_CapabilityRAT_ContainerList is null
\n
"
);
AssertFatal
(
UE_CapabilityRAT_ContainerList
->
list
.
size
!=
2
,
"UE_CapabilityRAT_ContainerList->list.size %d != 2
\n
"
,
UE_CapabilityRAT_ContainerList
->
list
.
size
);
if
(
UE_CapabilityRAT_ContainerList
->
list
.
array
[
0
]
->
rat_Type
==
NR_RAT_Type_nr
)
ueCapabilityRAT_Container_nr
=
&
UE_CapabilityRAT_ContainerList
->
list
.
array
[
0
]
->
ue_CapabilityRAT_Container
;
else
if
(
UE_CapabilityRAT_ContainerList
->
list
.
array
[
0
]
->
rat_Type
==
NR_RAT_Type_eutra_nr
)
ueCapabilityRAT_Container_MRDC
=
&
UE_CapabilityRAT_ContainerList
->
list
.
array
[
0
]
->
ue_CapabilityRAT_Container
;
if
(
UE_CapabilityRAT_ContainerList
->
list
.
array
[
1
]
->
rat_Type
==
NR_RAT_Type_nr
)
ueCapabilityRAT_Container_nr
=
&
UE_CapabilityRAT_ContainerList
->
list
.
array
[
1
]
->
ue_CapabilityRAT_Container
;
else
if
(
UE_CapabilityRAT_ContainerList
->
list
.
array
[
1
]
->
rat_Type
==
NR_RAT_Type_eutra_nr
)
ueCapabilityRAT_Container_MRDC
=
&
UE_CapabilityRAT_ContainerList
->
list
.
array
[
1
]
->
ue_CapabilityRAT_Container
;
AssertFatal
(
ueCapabilityRAT_Container_nr
!=
NULL
,
"ueCapabilityRAT_Container_nr is NULL
\n
"
);
AssertFatal
(
ueCapabilityRAT_Container_MRDC
!=
NULL
,
"ueCapabilityRAT_Container_MRDC is NULL
\n
"
);
...
...
@@ -83,9 +96,10 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc,BIT_STRING_t *ueCapabilityRAT_C
xer_fprint
(
stdout
,
&
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
}
rrc_add_nsa_user
(
rrc
,
ue_context_p
);
}
void
rrc_add_nsa_user
(
gNB_RRC_INST
*
rrc
)
{
void
rrc_add_nsa_user
(
gNB_RRC_INST
*
rrc
,
struct
rrc_gNB_ue_context_s
*
ue_context_p
)
{
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
...
...
@@ -104,7 +118,17 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc) {
carrier
->
reconfig
[
rrc
->
Nb_ue
]
->
criticalExtensions
.
present
=
NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
;
NR_RRCReconfiguration_IEs_t
*
reconfig_ies
=
calloc
(
1
,
sizeof
(
NR_RRCReconfiguration_IEs_t
));
carrier
->
reconfig
[
rrc
->
Nb_ue
]
->
criticalExtensions
.
choice
.
rrcReconfiguration
=
reconfig_ies
;
fill_default_reconfig
(
carrier
->
ServingCellConfigCommon
,
reconfig_ies
);
fill_default_reconfig
(
carrier
->
ServingCellConfigCommon
,
reconfig_ies
,
carrier
->
secondaryCellGroup
[
rrc
->
Nb_ue
],
carrier
->
n_physical_antenna_ports
,
carrier
->
initial_csi_index
[
rrc
->
Nb_ue
]);
carrier
->
rb_config
[
rrc
->
Nb_ue
]
=
calloc
(
1
,
sizeof
(
NR_RadioBearerConfig_t
));
fill_default_rbconfig
(
rrc
,
carrier
->
rb_config
[
rrc
->
Nb_ue
]);
NR_CG_Config_t
*
CG_Config
=
calloc
(
1
,
sizeof
(
*
CG_Config
));
memset
((
void
*
)
CG_Config
,
0
,
sizeof
(
*
CG_Config
));
generate_CG_Config
(
rrc
,
CG_Config
,
carrier
->
reconfig
[
rrc
->
Nb_ue
],
carrier
->
rb_config
[
rrc
->
Nb_ue
]);
// Send to X2 entity to transport to MeNB
rrc
->
Nb_ue
++
;
}
...
...
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