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
57c545d4
Commit
57c545d4
authored
Jul 28, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/use-ubsan' into integration_2022_wk30
parents
c663688f
ab364748
Changes
30
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
298 additions
and
273 deletions
+298
-273
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+6
-0
cmake_targets/build_oai
cmake_targets/build_oai
+11
-1
common/utils/time_meas.h
common/utils/time_meas.h
+2
-2
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+1
-1
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+1
-1
openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
+3
-3
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+2
-2
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
+30
-15
openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
+74
-72
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+1
-1
openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
+0
-8
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
+1
-1
openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c
openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c
+18
-29
openair1/PHY/MODULATION/nr_modulation.c
openair1/PHY/MODULATION/nr_modulation.c
+4
-3
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+1
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+3
-2
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+71
-72
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+1
-1
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+1
-2
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+10
-6
openair1/SIMULATION/LTE_PHY/ulsim.c
openair1/SIMULATION/LTE_PHY/ulsim.c
+7
-7
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+1
-1
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+2
-2
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+0
-7
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+14
-8
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+25
-19
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+2
-0
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+2
-2
openair3/SCTP/sctp_eNB_task.c
openair3/SCTP/sctp_eNB_task.c
+3
-3
No files found.
cmake_targets/CMakeLists.txt
View file @
57c545d4
...
...
@@ -271,6 +271,12 @@ if (SANITIZE_ADDRESS)
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
endif
()
add_boolean_option
(
SANITIZE_UNDEFINED False
"enable the undefined behavior sanitizer (UBSan)"
)
if
(
SANITIZE_UNDEFINED
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=undefined -fno-sanitize-recover=all"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=undefined -fno-sanitize-recover=all"
)
endif
()
add_definitions
(
"-DASN_DISABLE_OER_SUPPORT"
)
#########################
...
...
cmake_targets/build_oai
View file @
57c545d4
...
...
@@ -171,8 +171,12 @@ Options:
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
--ninja
Tell cmake to use the Ninja build system. Without, will generate make files
--sanitize
Shortcut for usage of --sanitize-address --sanitize-undefined
--sanitize-address | -fsanitize=address
Enable the address sanitizer on all targets
--sanitize-undefined | -fsanitize=undefined
Enable the undefined behavior sanitizer on all targets
--ittiSIM
Makes the itti simulator
-h | --help
...
...
@@ -451,10 +455,16 @@ function main() {
CMAKE_CMD
=
"
$CMAKE_CMD
-GNinja"
MAKE_CMD
=
ninja
shift
;;
--sanitize
)
CMAKE_CMD
=
"
$CMAKE_CMD
-DSANITIZE_ADDRESS=True -DSANITIZE_UNDEFINED=True"
shift
;;
--sanitize-address
|
-fsanitize
=
address
)
grep
-sq
"Ubuntu 18.04"
/etc/os-release
&&
echo_error
"Bug in OS with this option, see CMakeLists.txt"
CMAKE_CMD
=
"
$CMAKE_CMD
-DSANITIZE_ADDRESS=True"
shift
;;
--sanitize-undefined
|
-fundefined
=
address
)
CMAKE_CMD
=
"
$CMAKE_CMD
-DSANITIZE_UNDEFINED=True"
shift
;;
--ittiSIM
)
ittiSIM
=
1
CMAKE_CMD
=
"
$CMAKE_CMD
-DITTI_SIM=True"
...
...
common/utils/time_meas.h
View file @
57c545d4
...
...
@@ -62,7 +62,7 @@ typedef struct time_stats {
oai_cputime_t
in
;
/*!< \brief time at measure starting point */
oai_cputime_t
diff
;
/*!< \brief average difference between time at starting point and time at endpoint*/
oai_cputime_t
p_time
;
/*!< \brief absolute process duration */
oai_cputime_t
diff_square
;
/*!< \brief process duration square */
double
diff_square
;
/*!< \brief process duration square */
oai_cputime_t
max
;
/*!< \brief maximum difference between time at starting point and time at endpoint*/
int
trials
;
/*!< \brief number of start point - end point iterations */
int
meas_flag
;
/*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */
...
...
@@ -156,7 +156,7 @@ static inline void stop_meas(time_stats_t *ts) {
ts
->
diff
+=
(
out
-
ts
->
in
);
/// process duration is the difference between two clock points
ts
->
p_time
=
(
out
-
ts
->
in
);
ts
->
diff_square
+=
(
out
-
ts
->
in
)
*
(
out
-
ts
->
in
);
ts
->
diff_square
+=
(
(
double
)
out
-
ts
->
in
)
*
((
double
)
out
-
ts
->
in
);
if
((
out
-
ts
->
in
)
>
ts
->
max
)
ts
->
max
=
out
-
ts
->
in
;
...
...
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
View file @
57c545d4
...
...
@@ -87,7 +87,7 @@ typedef struct {
// N_CCE is L, or number of CCEs for DCI
int
N_CCE
;
uint8_t
payloadSize
;
uint8_t
payloadBits
[
16
]
;
uint8_t
payloadBits
[
16
]
__attribute__
((
aligned
(
16
)));
// will be cast as uint64
//fapi_nr_dci_pdu_rel15_t dci;
}
fapi_nr_dci_indication_pdu_t
;
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
57c545d4
...
...
@@ -738,7 +738,7 @@ typedef struct {
// The total DCI length (in bits) including padding bits [TS38.212 sec 7.3.1] Range 0->DCI_PAYLOAD_BYTE_LEN*8
uint16_t
PayloadSizeBits
;
// DCI payload, where the actual size is defined by PayloadSizeBits. The bit order is as following bit0-bit7 are mapped to first byte of MSB - LSB
uint8_t
Payload
[
DCI_PAYLOAD_BYTE_LEN
];
uint8_t
Payload
[
DCI_PAYLOAD_BYTE_LEN
]
__attribute__
((
aligned
(
32
)))
;
}
nfapi_nr_dl_dci_pdu_t
;
...
...
openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
View file @
57c545d4
...
...
@@ -814,7 +814,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
llr_t
*
s1
,
*
s2
,
*
yp1
,
*
yp2
,
*
yp
;
unsigned
int
i
,
j
,
iind
;
//,pi;
unsigned
char
iteration_cnt
=
0
;
unsigned
int
crc
,
oldcrc
,
crc_len
;
unsigned
int
crc
,
crc_len
;
uint8_t
temp
;
#if defined(__x86_64__) || defined(__i386__)
__m128i
*
yp128
;
...
...
@@ -1233,8 +1233,8 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
}
// check the CRC
oldcrc
=
*
((
unsigned
int
*
)(
&
decoded_bytes
[(
n
>>
3
)
-
crc_len
]))
;
uint32_t
oldcrc
;
memcpy
(
&
oldcrc
,
&
decoded_bytes
[(
n
>>
3
)
-
crc_len
],
crc_len
);
switch
(
crc_type
)
{
case
CRC24_A
:
oldcrc
&=
0x00ffffff
;
...
...
openair1/PHY/CODING/crc_byte.c
View file @
57c545d4
...
...
@@ -244,11 +244,11 @@ crc16 (unsigned char * inptr, int bitlen)
while
(
octetlen
--
>
0
)
{
crc
=
(
crc
<<
8
)
^
(
crc16Table
[(
*
inptr
++
)
^
(
crc
>>
24
)]
<<
16
);
crc
=
(
crc
<<
8
)
^
(
((
uint32_t
)
crc16Table
[(
*
inptr
++
)
^
(
crc
>>
24
)])
<<
16
);
}
if
(
resbit
>
0
)
crc
=
(
crc
<<
resbit
)
^
(
crc16Table
[((
*
inptr
)
>>
(
8
-
resbit
))
^
(
crc
>>
(
32
-
resbit
))]
<<
16
);
crc
=
(
crc
<<
resbit
)
^
(
((
uint32_t
)
crc16Table
[(
*
inptr
)
>>
(
8
-
resbit
)
^
(
crc
>>
(
32
-
resbit
))])
<<
16
);
return
crc
;
}
...
...
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
View file @
57c545d4
...
...
@@ -961,6 +961,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1028,6 +1029,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1096,6 +1098,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1163,6 +1166,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1230,6 +1234,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1297,6 +1302,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1364,6 +1370,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1431,6 +1438,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1498,6 +1506,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1593,6 +1602,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1660,6 +1670,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1727,6 +1738,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1794,6 +1806,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1861,6 +1874,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
@@ -1928,6 +1942,7 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
// If no error pcRes should be 0
// Only use valid CNs
if
(
Mrem
)
pcResSum
|=
(
pcRes
&
(
0xFFFFFFFF
>>
(
32
-
Mrem
)));
// If PC failed we can stop here
...
...
openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
View file @
57c545d4
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
View file @
57c545d4
...
...
@@ -288,7 +288,7 @@ static void TPencode(void * arg) {
LTE_DL_eNB_HARQ_t
*
hadlsch
=
rdata
->
dlsch
->
harq_processes
[
harq_pid
];
if
(
rdata
->
round
==
0
)
{
uint8_t
tmp
[
96
+
12
+
3
+
3
*
6144
];
uint8_t
tmp
[
96
+
12
+
3
+
3
*
6144
]
__attribute__
((
aligned
(
32
)))
;
memset
(
tmp
,
LTE_NULL
,
TURBO_SIMD_SOFTBITS
);
start_meas
(
rdata
->
te_stats
);
encoder
(
rdata
->
input
,
...
...
openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
View file @
57c545d4
...
...
@@ -1272,14 +1272,6 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
@return Transport block size */
uint32_t
get_TBS_UL
(
uint8_t
mcs
,
uint16_t
nb_rb
);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@param N_RB_DL number of PRB on DL
@param indicator for even/odd slot
@param vrb vrb index
@param Ngap Gap indicator
*/
uint32_t
get_prb
(
int
N_RB_DL
,
int
odd_slot
,
int
vrb
,
int
Ngap
);
/* \brief Return prb for a given vrb index
@param vrb_type VRB type (0=localized,1=distributed)
@param rb_alloc_dci rballoc field from DCI
...
...
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
View file @
57c545d4
...
...
@@ -90,7 +90,7 @@ typedef struct {
/// Redundancy-version of the current sub-frame
uint8_t
rvidx
;
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12
uint8_t
d
[
MAX_NUM_ULSCH_SEGMENTS
][(
96
+
3
+
(
3
*
6144
))
];
uint8_t
*
d
[
MAX_NUM_ULSCH_SEGMENTS
];
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
uint8_t
w
[
MAX_NUM_ULSCH_SEGMENTS
][
3
*
6144
];
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
...
...
openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c
View file @
57c545d4
...
...
@@ -71,6 +71,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) {
for
(
r
=
0
;
r
<
MAX_NUM_ULSCH_SEGMENTS
;
r
++
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
])
{
free16
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
free16
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
],
0
);
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
}
}
...
...
@@ -86,7 +87,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) {
LTE_UE_ULSCH_t
*
new_ue_ulsch
(
unsigned
char
N_RB_UL
,
uint8_t
abstraction_flag
)
{
LTE_UE_ULSCH_t
*
ulsch
;
unsigned
char
exit_flag
=
0
,
i
,
j
,
r
;
unsigned
char
exit_flag
=
0
;
unsigned
char
bw_scaling
=
1
;
switch
(
N_RB_UL
)
{
...
...
@@ -113,7 +114,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
memset
(
ulsch
,
0
,
sizeof
(
LTE_UE_ULSCH_t
));
ulsch
->
Mlimit
=
4
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
8
;
i
++
)
{
ulsch
->
harq_processes
[
i
]
=
(
LTE_UL_UE_HARQ_t
*
)
malloc16
(
sizeof
(
LTE_UL_UE_HARQ_t
));
// printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
...
...
@@ -129,15 +130,11 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
}
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
MAX_NUM_ULSCH_SEGMENTS
;
r
++
)
{
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
unsigned
char
*
)
malloc16
(((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
// account for filler in first segment and CRCs for multiple segment case
if
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
])
memset
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],
0
,((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
else
{
LOG_E
(
PHY
,
"Can't get c
\n
"
);
exit_flag
=
2
;
}
for
(
int
r
=
0
;
r
<
MAX_NUM_ULSCH_SEGMENTS
;
r
++
)
{
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
malloc16_clear
(((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
// account for filler in first segment and CRCs for multiple segment case
AssertFatal
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],
""
);
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
malloc16_clear
(
96
+
3
+
(
3
*
6144
));
AssertFatal
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
],
""
);
}
}
...
...
@@ -148,15 +145,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
exit_flag
=
3
;
}
}
if
((
abstraction_flag
==
0
)
&&
(
exit_flag
==
0
))
{
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
j
=
0
;
j
<
96
;
j
++
)
for
(
r
=
0
;
r
<
MAX_NUM_ULSCH_SEGMENTS
;
r
++
)
ulsch
->
harq_processes
[
i
]
->
d
[
r
][
j
]
=
LTE_NULL
;
return
(
ulsch
);
}
else
if
(
abstraction_flag
==
1
)
if
(
!
exit_flag
)
return
(
ulsch
);
}
...
...
@@ -191,7 +180,7 @@ uint32_t ulsch_encoding(uint8_t *a,
uint32_t
Qprime_ACK
=
0
,
Qprime_CQI
=
0
,
Qprime_RI
=
0
,
len_ACK
=
0
,
len_RI
=
0
;
// uint32_t E;
uint8_t
ack_parity
;
uint32_t
i
,
q
,
j
,
iprime
,
j2
;
uint32_t
q
,
j
,
iprime
,
j2
;
uint16_t
o_RCC
;
uint8_t
o_flip
[
8
];
uint32_t
wACK_idx
;
...
...
@@ -327,6 +316,8 @@ uint32_t ulsch_encoding(uint8_t *a,
#endif
// offset=0;
start_meas
(
te_stats
);
for
(
int
z
=
0
;
z
<
96
;
z
++
)
ulsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
z
]
=
LTE_NULL
;
encoder
(
ulsch
->
harq_processes
[
harq_pid
]
->
c
[
r
],
Kr
>>
3
,
&
ulsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
96
],
...
...
@@ -539,8 +530,6 @@ uint32_t ulsch_encoding(uint8_t *a,
ulsch
->
q
);
}
i
=
0
;
// Do RI coding
if
(
ulsch
->
O_RI
==
1
)
{
switch
(
Q_m
)
{
...
...
@@ -691,7 +680,7 @@ uint32_t ulsch_encoding(uint8_t *a,
j
=
0
;
for
(
i
=
0
;
i
<
Qprime_RI
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
Qprime_RI
;
i
++
)
{
r
=
Rmux_prime
-
1
-
(
i
>>
2
);
for
(
q
=
0
;
q
<
Q_m
;
q
++
)
{
...
...
@@ -725,7 +714,7 @@ uint32_t ulsch_encoding(uint8_t *a,
}
*/
for
(
i
=
0
;
i
<
Qprime_CQI
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
Qprime_CQI
;
i
++
)
{
while
(
y
[
Q_m
*
j
]
!=
LTE_NULL
)
j
++
;
for
(
q
=
0
;
q
<
Q_m
;
q
++
)
{
...
...
@@ -788,7 +777,7 @@ uint32_t ulsch_encoding(uint8_t *a,
j
=
0
;
for
(
i
=
0
;
i
<
Qprime_ACK
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
Qprime_ACK
;
i
++
)
{
r
=
Rmux_prime
-
1
-
(
i
>>
2
);
for
(
q
=
0
;
q
<
Q_m
;
q
++
)
{
...
...
@@ -808,7 +797,7 @@ uint32_t ulsch_encoding(uint8_t *a,
switch
(
Q_m
)
{
case
2
:
for
(
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
r
=
0
;
r
<
Rmux_prime
;
r
++
)
{
yptr
=&
y
[((
r
*
Cmux
)
+
i
)
<<
1
];
ulsch
->
h
[
j
++
]
=
*
yptr
++
;
...
...
@@ -818,7 +807,7 @@ uint32_t ulsch_encoding(uint8_t *a,
break
;
case
4
:
for
(
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
r
=
0
;
r
<
Rmux_prime
;
r
++
)
{
yptr
=
&
y
[((
r
*
Cmux
)
+
i
)
<<
2
];
ulsch
->
h
[
j
++
]
=
*
yptr
++
;
...
...
@@ -830,7 +819,7 @@ uint32_t ulsch_encoding(uint8_t *a,
break
;
case
6
:
for
(
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
Cmux
;
i
++
)
for
(
r
=
0
;
r
<
Rmux_prime
;
r
++
)
{
yptr
=
&
y
[((
r
*
Cmux
)
+
i
)
*
6
];
ulsch
->
h
[
j
++
]
=
*
yptr
++
;
...
...
openair1/PHY/MODULATION/nr_modulation.c
View file @
57c545d4
...
...
@@ -226,10 +226,11 @@ void nr_modulation(uint32_t *in,
i
*=
24
;
bit_cnt
=
i
*
8
;
while
(
bit_cnt
<
length
)
{
x
=
*
((
uint32_t
*
)(
in_bytes
+
i
));
x1
=
x
&
4095
;
uint32_t
xx
;
memcpy
(
&
xx
,
in_bytes
+
i
,
sizeof
(
xx
));
x1
=
xx
&
4095
;
out64
[
j
++
]
=
nr_64qam_mod_table
[
x1
];
x1
=
(
x
>>
12
)
&
4095
;
x1
=
(
x
x
>>
12
)
&
4095
;
out64
[
j
++
]
=
nr_64qam_mod_table
[
x1
];
i
+=
3
;
bit_cnt
+=
24
;
...
...
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
57c545d4
...
...
@@ -162,7 +162,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
measurements
->
n0_subband_power
[
aarx
][
rb
]
=
0
;
}
int
offset0
=
(
slot
&
3
)
*
(
frame_parms
->
symbols_per_slot
*
frame_parms
->
ofdm_symbol_size
)
+
(
frame_parms
->
first_carrier_offset
+
(
rb
*
12
))
%
frame_parms
->
ofdm_symbol_size
;
if
((
gNB
->
rb_mask_ul
[
s
][
rb
>>
5
]
&
(
1
<<
(
rb
&
31
)))
==
0
)
{
// check that rb was not used in this subframe
if
((
gNB
->
rb_mask_ul
[
s
][
rb
>>
5
]
&
(
1U
<<
(
rb
&
31
)))
==
0
)
{
// check that rb was not used in this subframe
nb_symb
[
rb
]
++
;
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
int
offset
=
offset0
+
(
s
*
frame_parms
->
ofdm_symbol_size
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
57c545d4
...
...
@@ -123,7 +123,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
rel15
->
dlDmrsSymbPos
);
n_ptrs
=
(
rel15
->
rbSize
+
rel15
->
PTRSFreqDensity
-
1
)
/
rel15
->
PTRSFreqDensity
;
}
int16_t
mod_ptrs
[
n_ptrs
<<
1
]
__attribute__
((
aligned
(
16
)));
/// CRC, coding, interleaving and rate matching
AssertFatal
(
harq
->
pdu
!=
NULL
,
"harq->pdu is null
\n
"
);
...
...
@@ -302,12 +301,14 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
/* calculate if current symbol is PTRS symbols */
ptrs_idx
=
0
;
int16_t
*
mod_ptrs
=
NULL
;
if
(
rel15
->
pduBitmap
&
0x1
)
{
ptrs_symbol
=
is_ptrs_symbol
(
l
,
dlPtrsSymPos
);
if
(
ptrs_symbol
)
{
/* PTRS QPSK Modulation for each OFDM symbol in a slot */
LOG_D
(
PHY
,
"Doing ptrs modulation for symbol %d, n_ptrs %d
\n
"
,
l
,
n_ptrs
);
int16_t
mod_ptrsBuf
[
n_ptrs
<<
1
]
__attribute__
((
aligned
(
16
)));
mod_ptrs
=
mod_ptrsBuf
;
nr_modulation
(
pdsch_dmrs
[
l
][
rel15
->
SCID
],
(
n_ptrs
<<
1
),
DMRS_MOD_ORDER
,
mod_ptrs
);
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
View file @
57c545d4
...
...
@@ -540,14 +540,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
codeword_TB0
,
codeword_TB1
,
pdsch_vars
[
gNB_id
]
->
layer_llr
);
}
stop_meas
(
&
ue
->
generic_stat_bis
[
proc
->
thread_id
][
slot
]);
if
(
cpumeas
(
CPUMEAS_GETSTATE
))
LOG_D
(
PHY
,
"[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f
\n
"
,
frame
,
nr_slot_rx
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
proc
->
thread_id
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
// Please keep it: useful for debugging
// Please keep it: useful for debugging
#ifdef DEBUG_PDSCH_RX
char
filename
[
50
];
uint8_t
aa
=
0
;
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
57c545d4
...
...
@@ -573,7 +573,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
LOG_D
(
PHY
,
"symbol %d Filling rb_mask_ul rb_size %d
\n
"
,
symbol
,
ulsch_harq
->
ulsch_pdu
.
rb_size
);
for
(
rb
=
0
;
rb
<
ulsch_harq
->
ulsch_pdu
.
rb_size
;
rb
++
)
{
rb2
=
rb
+
ulsch_harq
->
ulsch_pdu
.
rb_start
+
ulsch_harq
->
ulsch_pdu
.
bwp_start
;
gNB
->
rb_mask_ul
[
symbol
][
rb2
>>
5
]
|=
(
1
<<
(
rb2
&
31
)
);
gNB
->
rb_mask_ul
[
symbol
][
rb2
>>
5
]
|=
1U
<<
(
rb2
&
31
);
}
}
}
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
57c545d4
...
...
@@ -1321,8 +1321,7 @@ int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_
//uint8_t half_frame_index = fp->half_frame_bit;
//uint8_t i_ssb = fp->ssb_index;
uint8_t
Lmax
=
fp
->
Lmax
;
if
(
!
(
frame
%
(
1
<<
(
config
->
ssb_table
.
ssb_period
-
1
)))){
if
((
config
->
ssb_table
.
ssb_period
>
0
)
&&
!
(
frame
%
(
1
<<
(
config
->
ssb_table
.
ssb_period
-
1
))))
{
if
(
Lmax
<=
8
)
{
if
(
slot
<=
3
&&
(((
config
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
<<
2
*
slot
)
&
0x80000000
)
==
0x80000000
||
((
config
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
<<
(
2
*
slot
+
1
))
&
0x80000000
)
==
0x80000000
))
...
...
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
57c545d4
...
...
@@ -512,12 +512,16 @@ int main(int argc, char **argv) {
int
re
;
int
s
,
Kr
,
Kr_bytes
;
LTE_DL_FRAME_PARMS
*
frame_parms
;
double
s_re0
[
30720
*
2
],
s_im0
[
30720
*
2
],
r_re0
[
30720
*
2
],
r_im0
[
30720
*
2
];
double
s_re1
[
30720
*
2
],
s_im1
[
30720
*
2
],
r_re1
[
30720
*
2
],
r_im1
[
30720
*
2
];
double
*
s_re
[
NB_ANTENNAS_TX
]
=
{
s_re0
,
s_re1
};
double
*
s_im
[
NB_ANTENNAS_TX
]
=
{
s_im0
,
s_im1
};
double
*
r_re
[
NB_ANTENNAS_RX
]
=
{
r_re0
,
r_re1
};
double
*
r_im
[
NB_ANTENNAS_RX
]
=
{
r_im0
,
r_im1
};
double
*
tmpTX
[
4
],
*
tmpRX
[
4
]
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
tmpTX
[
i
]
=
malloc
(
30720
*
NB_ANTENNAS_TX
*
sizeof
(
*
tmpTX
));
tmpRX
[
i
]
=
malloc
(
30720
*
NB_ANTENNAS_RX
*
sizeof
(
*
tmpRX
));
}
double
*
s_re
[
NB_ANTENNAS_TX
]
=
{
tmpTX
[
0
],
tmpTX
[
1
]};
double
*
s_im
[
NB_ANTENNAS_TX
]
=
{
tmpTX
[
2
],
tmpTX
[
3
]};
double
*
r_re
[
NB_ANTENNAS_RX
]
=
{
tmpRX
[
0
],
tmpRX
[
1
]};
double
*
r_im
[
NB_ANTENNAS_RX
]
=
{
tmpRX
[
2
],
tmpRX
[
3
]};
uint8_t
transmission_mode
=
1
,
n_tx_port
=
1
,
n_tx_phy
=
1
,
n_rx
=
2
;
int
eNB_id
=
0
;
unsigned
char
round
;
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
57c545d4
...
...
@@ -358,7 +358,7 @@ int main(int argc, char **argv) {
unsigned
short
input_buffer_length
;
unsigned
int
ret
;
unsigned
int
coded_bits_per_codeword
,
nsymb
;
unsigned
int
tx_lev
=
0
,
tx_lev_dB
=
0
,
trials
,
errs
[
5
]
=
{
0
,
0
,
0
,
0
,
0
},
round_trials
[
4
]
=
{
0
,
0
,
0
,
0
};
unsigned
int
tx_lev
=
0
,
tx_lev_dB
=
0
,
trials
,
errs
[
6
]
=
{
0
},
round_trials
[
4
]
=
{
0
};
FILE
*
bler_fd
=
NULL
;
char
bler_fname
[
512
];
FILE
*
time_meas_fd
=
NULL
;
...
...
@@ -387,7 +387,6 @@ int main(int argc, char **argv) {
double
cpu_freq_GHz
;
int
iter_trials
;
uint32_t
UL_alloc_pdu
;
int
s
,
Kr
,
Kr_bytes
;
int
dump_perf
=
0
;
static
int
dump_table
=
0
;
double
effective_rate
=
0
.
0
;
...
...
@@ -1233,20 +1232,21 @@ int main(int argc, char **argv) {
if
(
n_frames
==
1
)
{
printf
(
"ULSCH errors found o_ACK[0]= %d
\n
"
,
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
o_ACK
[
0
]);
#ifdef DUMP_EACH_VALUE
int
Kr_bytes
;
for
(
s
=
0
;
s
<
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
C
;
s
++
)
{
if
(
s
<
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
Cminus
)
Kr
=
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
Kminus
;
Kr
_bytes
=
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
Kminus
;
else
Kr
=
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
Kplus
;
Kr_bytes
=
Kr
>>
3
;
Kr_bytes
=
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
Kplus
;
Kr_bytes
=
Kr_bytes
>>
3
;
printf
(
"Decoded_output (Segment %d):
\n
"
,
s
);
for
(
i
=
0
;
i
<
Kr_bytes
;
i
++
)
printf
(
"%d : %x (%x)
\n
"
,
i
,
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
c
[
s
][
i
],
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
c
[
s
][
i
]
^
UE
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
c
[
s
][
i
]);
}
#endif
dump_ulsch
(
eNB
,
eNB
->
proc
.
frame_rx
,
subframe
,
0
,
round
);
round
=
5
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
57c545d4
...
...
@@ -1142,7 +1142,7 @@ int main(int argc, char **argv)
Sched_INFO
.
frame
=
frame
;
Sched_INFO
.
slot
=
slot
;
Sched_INFO
.
DL_req
=
&
gNB_mac
->
DL_req
[
0
];
Sched_INFO
.
UL_tti_req
=
gNB_mac
->
UL_tti_req_ahead
[
slot
];
Sched_INFO
.
UL_tti_req
=
gNB_mac
->
UL_tti_req_ahead
[
0
];
Sched_INFO
.
UL_dci_req
=
NULL
;
Sched_INFO
.
TX_req
=
&
gNB_mac
->
TX_req
[
0
];
pushNotifiedFIFO
(
gNB
->
L1_tx_free
,
msgL1Tx
);
...
...
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
57c545d4
...
...
@@ -190,7 +190,7 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
cfg
->
ssb_table
.
ssb_subcarrier_offset
=
mac
->
ssb_subcarrier_offset
;
if
(
mac
->
frequency_range
==
FR1
){
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
=
scc
->
ssb_PositionsInBurst
.
inOneGroup
.
buf
[
0
]
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
=
((
uint32_t
)
scc
->
ssb_PositionsInBurst
.
inOneGroup
.
buf
[
0
])
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
=
0
;
}
else
{
...
...
@@ -353,7 +353,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
cfg
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
=
0
;
break
;
case
2
:
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
=
scc
->
ssb_PositionsInBurst
->
choice
.
mediumBitmap
.
buf
[
0
]
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
=
((
uint32_t
)
scc
->
ssb_PositionsInBurst
->
choice
.
mediumBitmap
.
buf
[
0
])
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
=
0
;
break
;
case
3
:
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
57c545d4
...
...
@@ -257,13 +257,6 @@ void get_bwp_info(NR_UE_MAC_INST_t *mac,
NR_BWP_DownlinkCommon_t
*
get_bwp_downlink_common
(
NR_UE_MAC_INST_t
*
mac
,
NR_BWP_Id_t
dl_bwp_id
);
uint8_t
nr_extract_dci_info
(
NR_UE_MAC_INST_t
*
mac
,
uint8_t
dci_format
,
uint8_t
dci_length
,
uint16_t
rnti
,
uint64_t
*
dci_pdu
,
dci_pdu_rel15_t
*
nr_pdci_info_extracted
);
NR_PUSCH_TimeDomainResourceAllocationList_t
*
choose_ul_tda_list
(
const
NR_PUSCH_Config_t
*
pusch_Config
,
NR_PUSCH_ConfigCommon_t
*
pusch_ConfigCommon
);
NR_PDSCH_TimeDomainResourceAllocationList_t
*
choose_dl_tda_list
(
NR_PDSCH_Config_t
*
pdsch_Config
,
NR_PDSCH_ConfigCommon_t
*
pdsch_ConfigCommon
);
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
57c545d4
...
...
@@ -134,6 +134,13 @@ const initial_pucch_resource_t initial_pucch_resource[16] = {
};
static
uint8_t
nr_extract_dci_info
(
NR_UE_MAC_INST_t
*
mac
,
uint8_t
dci_format
,
uint8_t
dci_length
,
uint16_t
rnti
,
uint64_t
*
dci_pdu
,
dci_pdu_rel15_t
*
nr_pdci_info_extracted
);
void
nr_ue_init_mac
(
module_id_t
module_idP
)
{
int
i
;
...
...
@@ -985,7 +992,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
if
(
dci
->
tpc
==
3
)
dlsch_config_pdu_1_0
->
accumulated_delta_PUCCH
=
3
;
// Sanity check for pucch_resource_indicator value received to check for false DCI.
valid
=
0
;
if
(
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
if
(
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pucch_Config
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pucch_Config
->
choice
.
setup
&&
...
...
@@ -1512,13 +1520,12 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
NR_BWP_UplinkCommon_t
*
initialUplinkBWP
;
if
(
mac
->
scc
)
initialUplinkBWP
=
mac
->
scc
->
uplinkConfigCommon
->
initialUplinkBWP
;
else
initialUplinkBWP
=
&
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
;
NR_BWP_Uplink_t
*
ubwp
=
mac
->
ULbwp
[
bwp_id
-
1
];
if
(
mac
->
cg
&&
ubwp
&&
if
(
mac
->
cg
&&
bwp_id
>
1
&&
mac
->
ULbwp
[
bwp_id
-
1
]
&&
mac
->
cg
->
spCellConfig
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
initialUplinkBWP
)
{
scs
=
ubwp
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
scs
=
mac
->
ULbwp
[
bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
}
else
scs
=
initialUplinkBWP
->
genericParameters
.
subcarrierSpacing
;
...
...
@@ -2340,17 +2347,16 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
NR_BWP_Id_t
bwp_id
=
mac
->
UL_BWP_Id
;
NR_PUCCH_Config_t
*
pucch_Config
=
NULL
;
int
scs
;
NR_BWP_Uplink_t
*
ubwp
=
mac
->
ULbwp
[
bwp_id
-
1
];
NR_BWP_UplinkCommon_t
*
initialUplinkBWP
;
if
(
mac
->
scc
)
initialUplinkBWP
=
mac
->
scc
->
uplinkConfigCommon
->
initialUplinkBWP
;
else
initialUplinkBWP
=
&
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
;
if
(
mac
->
cg
&&
ubwp
&&
if
(
mac
->
cg
&&
bwp_id
&&
mac
->
ULbwp
[
bwp_id
-
1
]
&&
mac
->
cg
->
spCellConfig
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
&&
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
initialUplinkBWP
)
{
scs
=
ubwp
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
scs
=
mac
->
ULbwp
[
bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
}
else
scs
=
initialUplinkBWP
->
genericParameters
.
subcarrierSpacing
;
...
...
@@ -2732,7 +2738,7 @@ int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){
}
uint8_t
nr_extract_dci_info
(
NR_UE_MAC_INST_t
*
mac
,
static
uint8_t
nr_extract_dci_info
(
NR_UE_MAC_INST_t
*
mac
,
uint8_t
dci_format
,
uint8_t
dci_size
,
uint16_t
rnti
,
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
57c545d4
...
...
@@ -118,12 +118,13 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) {
NR_BWP_Id_t
ul_bwp_id
=
mac
->
UL_BWP_Id
;
// Get K2 from RRC configuration
NR_PUSCH_Config_t
*
pusch_config
=
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
:
NULL
;
NR_PUSCH_Config_t
*
pusch_config
=
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
:
NULL
;
NR_PUSCH_TimeDomainResourceAllocationList_t
*
pusch_TimeDomainAllocationList
=
NULL
;
if
(
pusch_config
&&
pusch_config
->
pusch_TimeDomainAllocationList
)
{
pusch_TimeDomainAllocationList
=
pusch_config
->
pusch_TimeDomainAllocationList
->
choice
.
setup
;
}
else
if
(
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
else
if
(
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
->
pusch_ConfigCommon
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
->
pusch_ConfigCommon
->
choice
.
setup
&&
...
...
@@ -169,7 +170,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
// Calculate the index of the UL slot in mac->ul_config_request list. This is
// based on the TDD pattern (slot configuration period) and number of UL+mixed
// slots in the period. TS 38.213 Sec 11.1
int
mu
=
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
int
mu
=
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
.
genericParameters
.
subcarrierSpacing
;
const
int
n
=
nr_slots_per_frame
[
mu
];
...
...
@@ -205,7 +206,7 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
srs_config
=
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
initialUplinkBWP
->
srs_Config
->
choice
.
setup
;
}
NR_PUSCH_Config_t
*
pusch_Config
=
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
NR_PUSCH_Config_t
*
pusch_Config
=
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
:
(
ubwpd
?
ubwpd
->
pusch_Config
->
choice
.
setup
:
...
...
@@ -361,7 +362,7 @@ void ul_ports_config(NR_UE_MAC_INST_t *mac, int *n_front_load_symb, nfapi_nr_ue_
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
initialUplinkBWP
)
ubwpd
=
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
initialUplinkBWP
;
NR_PUSCH_Config_t
*
pusch_Config
=
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
:
(
ubwpd
?
ubwpd
->
pusch_Config
->
choice
.
setup
:
NULL
);
NR_PUSCH_Config_t
*
pusch_Config
=
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
:
(
ubwpd
?
ubwpd
->
pusch_Config
->
choice
.
setup
:
NULL
);
AssertFatal
(
pusch_Config
!=
NULL
,
"pusch_Config shouldn't be null
\n
"
);
long
transformPrecoder
;
...
...
@@ -581,7 +582,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
if
(
rar_grant
)
{
// Note: for Msg3 or MsgA PUSCH transmission the N_PRB_oh is always set to 0
NR_BWP_Uplink_t
*
ubwp
=
mac
->
ULbwp
[
ul_bwp_id
-
1
]
;
NR_BWP_Uplink_t
*
ubwp
=
ul_bwp_id
>
0
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
:
NULL
;
NR_BWP_UplinkDedicated_t
*
ibwp
;
int
scs
,
abwp_start
,
abwp_size
,
startSymbolAndLength
,
mappingtype
;
NR_PUSCH_Config_t
*
pusch_Config
=
NULL
;
...
...
@@ -839,11 +840,15 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
mappingtype
,
add_pos
,
dmrslength
,
pusch_config_pdu
->
start_symbol_index
,
mac
->
scc
?
mac
->
scc
->
dmrs_TypeA_Position
:
mac
->
mib
->
dmrs_TypeA_Position
);
if
(
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
pusch_config_pdu
->
transform_precoding
==
NR_PUSCH_Config__transformPrecoder_disabled
)
{
if
(
*
dci_format
!=
NR_UL_DCI_FORMAT_0_1
)
{
if
(
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
pusch_config_pdu
->
transform_precoding
==
NR_PUSCH_Config__transformPrecoder_disabled
&&
*
dci_format
!=
NR_UL_DCI_FORMAT_0_1
)
{
pusch_config_pdu
->
num_dmrs_cdm_grps_no_data
=
1
;
}
}
else
if
(
*
dci_format
==
NR_UL_DCI_FORMAT_0_0
||
(
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
pusch_config_pdu
->
transform_precoding
==
NR_PUSCH_Config__transformPrecoder_enabled
))
{
}
else
if
(
*
dci_format
==
NR_UL_DCI_FORMAT_0_0
||
(
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
pusch_config_pdu
->
transform_precoding
==
NR_PUSCH_Config__transformPrecoder_enabled
))
{
pusch_config_pdu
->
num_dmrs_cdm_grps_no_data
=
2
;
}
...
...
@@ -859,7 +864,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
else
N_PRB_oh
=
0
;
/* PTRS */
if
(
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
if
(
ul_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Dedicated
->
pusch_Config
->
choice
.
setup
&&
...
...
@@ -1093,10 +1099,11 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
dcireq
.
dl_config_req
=
mac
->
dl_config_request
;
fill_scheduled_response
(
&
scheduled_response
,
&
dcireq
.
dl_config_req
,
NULL
,
NULL
,
mod_id
,
cc_id
,
rx_frame
,
rx_slot
,
dl_info
->
thread_id
,
dl_info
->
phy_data
);
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
{
LOG_D
(
NR_MAC
,
"1# scheduled_response transmitted, %d, %d
\n
"
,
rx_frame
,
rx_slot
);
mac
->
if_module
->
scheduled_response
(
&
scheduled_response
);
}
}
else
{
// this is for Msg2/Msg4
if
(
mac
->
ra
.
ra_state
>=
WAIT_RAR
)
{
...
...
@@ -1564,15 +1571,14 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac,
int
delta
=
0
;
NR_BWP_Id_t
ul_bwp_id
=
mac
->
UL_BWP_Id
;
NR_BWP_Uplink_t
*
ubwp
=
mac
->
ULbwp
[
ul_bwp_id
-
1
];
// Get the numerology to calculate the Tx frame and slot
int
mu
=
u
bwp
?
ubwp
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
int
mu
=
u
l_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
.
genericParameters
.
subcarrierSpacing
;
NR_PUSCH_TimeDomainResourceAllocationList_t
*
pusch_TimeDomainAllocationList
=
u
bwp
?
ubwp
->
bwp_Common
->
pusch_ConfigCommon
->
choice
.
setup
->
pusch_TimeDomainAllocationList
:
NR_PUSCH_TimeDomainResourceAllocationList_t
*
pusch_TimeDomainAllocationList
=
u
l_bwp_id
>
0
&&
mac
->
ULbwp
[
ul_bwp_id
-
1
]
?
mac
->
ULbwp
[
ul_bwp_id
-
1
]
->
bwp_Common
->
pusch_ConfigCommon
->
choice
.
setup
->
pusch_TimeDomainAllocationList
:
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
.
pusch_ConfigCommon
->
choice
.
setup
->
pusch_TimeDomainAllocationList
;
// k2 as per 3GPP TS 38.214 version 15.9.0 Release 15 ch 6.1.2.1.1
// PUSCH time domain resource allocation is higher layer configured from uschTimeDomainAllocationList in either pusch-ConfigCommon
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
57c545d4
...
...
@@ -360,7 +360,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
cfg
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
.
value
=
0
;
break
;
case
2
:
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
.
value
=
scc
->
ssb_PositionsInBurst
->
choice
.
mediumBitmap
.
buf
[
0
]
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
.
value
=
((
uint32_t
)
scc
->
ssb_PositionsInBurst
->
choice
.
mediumBitmap
.
buf
[
0
])
<<
24
;
cfg
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
.
value
=
0
;
break
;
case
3
:
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
57c545d4
...
...
@@ -1349,6 +1349,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
header
->
L
=
htons
(
bufEnd
-
buf
);
dlsch_total_bytes
+=
bufEnd
-
buf
;
for
(;
((
intptr_t
)
buf
)
%
4
;
buf
++
)
*
buf
=
lrand48
()
&
0xff
;
for
(;
buf
<
bufEnd
-
3
;
buf
+=
4
)
{
uint32_t
*
buf32
=
(
uint32_t
*
)
buf
;
*
buf32
=
lrand48
();
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
57c545d4
...
...
@@ -1320,11 +1320,11 @@ nr_rrc_ue_process_masterCellGroup(
//TODO (perform SCell addition/modification as specified in 5.3.5.5.9)
}
if
(
cellGroupConfig
->
ext2
->
bh_RLC_ChannelToReleaseList_r16
!=
NULL
){
if
(
cellGroupConfig
->
ext2
!=
NULL
&&
cellGroupConfig
->
ext2
->
bh_RLC_ChannelToReleaseList_r16
!=
NULL
){
//TODO (perform the BH RLC channel addition/modification as specified in 5.3.5.5.11)
}
if
(
cellGroupConfig
->
ext2
->
bh_RLC_ChannelToAddModList_r16
!=
NULL
){
if
(
cellGroupConfig
->
ext2
!=
NULL
&&
cellGroupConfig
->
ext2
->
bh_RLC_ChannelToAddModList_r16
!=
NULL
){
//TODO (perform the BH RLC channel addition/modification as specified in 5.3.5.5.11)
}
}
...
...
openair3/SCTP/sctp_eNB_task.c
View file @
57c545d4
...
...
@@ -859,7 +859,7 @@ sctp_eNB_accept_associations(
struct
sctp_cnx_list_elm_s
*
sctp_cnx
)
{
int
client_sd
;
struct
sockaddr
saddr
;
struct
sockaddr
_in6
saddr
;
socklen_t
saddr_size
;
DevAssert
(
sctp_cnx
!=
NULL
);
...
...
@@ -868,14 +868,14 @@ sctp_eNB_accept_associations(
/* There is a new client connecting. Accept it...
*/
if
((
client_sd
=
accept
(
sctp_cnx
->
sd
,
&
saddr
,
&
saddr_size
))
<
0
)
{
if
((
client_sd
=
accept
(
sctp_cnx
->
sd
,
(
struct
sockaddr
*
)
&
saddr
,
&
saddr_size
))
<
0
)
{
SCTP_ERROR
(
"[%d] accept failed: %s:%d
\n
"
,
sctp_cnx
->
sd
,
strerror
(
errno
),
errno
);
}
else
{
struct
sctp_cnx_list_elm_s
*
new_cnx
;
uint16_t
port
;
/* This is an ipv6 socket */
port
=
((
struct
sockaddr_in6
*
)
&
saddr
)
->
sin6_port
;
port
=
saddr
.
sin6_port
;
/* Contrary to BSD, client socket does not inherit O_NONBLOCK option */
if
(
fcntl
(
client_sd
,
F_SETFL
,
O_NONBLOCK
)
<
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