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
spbro
OpenXG-RAN
Commits
60f99e51
Commit
60f99e51
authored
Sep 08, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/HeapAllocIssue' into integration_2023_w36
parents
bb717499
1b2a64fe
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
125 deletions
+59
-125
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+3
-27
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+3
-3
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+15
-33
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+23
-31
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+6
-16
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+3
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+6
-9
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
60f99e51
...
...
@@ -778,23 +778,9 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
break
;
case
NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE
:
{
nfapi_nr_uci_pucch_pdu_format_0_1_t
*
uci_ind_pdu
=
&
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
;
nfapi_nr_uci_pucch_pdu_format_0_1_t
*
ind_pdu
=
&
ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
;
if
(
ind_pdu
->
sr
)
{
uci_ind_pdu
->
sr
=
CALLOC
(
1
,
sizeof
(
*
uci_ind_pdu
->
sr
));
AssertFatal
(
uci_ind_pdu
->
sr
!=
NULL
,
"Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."
);
*
uci_ind_pdu
->
sr
=
*
ind_pdu
->
sr
;
}
if
(
ind_pdu
->
harq
)
{
uci_ind_pdu
->
harq
=
CALLOC
(
1
,
sizeof
(
*
uci_ind_pdu
->
harq
));
AssertFatal
(
uci_ind_pdu
->
harq
!=
NULL
,
"Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."
);
*
uci_ind_pdu
->
harq
=
*
ind_pdu
->
harq
;
uci_ind_pdu
->
harq
->
harq_list
=
CALLOC
(
uci_ind_pdu
->
harq
->
num_harq
,
sizeof
(
*
uci_ind_pdu
->
harq
->
harq_list
));
AssertFatal
(
uci_ind_pdu
->
harq
->
harq_list
!=
NULL
,
"Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."
);
for
(
int
j
=
0
;
j
<
uci_ind_pdu
->
harq
->
num_harq
;
j
++
)
uci_ind_pdu
->
harq
->
harq_list
[
j
].
harq_value
=
ind_pdu
->
harq
->
harq_list
[
j
].
harq_value
;
}
//nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_0_1;
//nfapi_nr_uci_pucch_pdu_format_0_1_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_0_1;
//Unused
break
;
}
...
...
@@ -834,16 +820,6 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
{
if
(
uci_ind
->
uci_list
[
i
].
pdu_type
==
NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE
)
{
if
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
)
{
free
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
->
harq_list
);
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
->
harq_list
=
NULL
;
free
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
);
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
=
NULL
;
}
if
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
sr
)
{
free
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
sr
);
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
sr
=
NULL
;
}
}
if
(
uci_ind
->
uci_list
[
i
].
pdu_type
==
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE
)
{
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
60f99e51
...
...
@@ -1580,7 +1580,7 @@ typedef struct
{
uint8_t
num_harq
;
uint8_t
harq_confidence_level
;
nfapi_nr_harq_t
*
harq_list
;
nfapi_nr_harq_t
harq_list
[
2
]
;
}
nfapi_nr_harq_pdu_0_1_t
;
...
...
@@ -1628,8 +1628,8 @@ typedef struct
uint8_t
ul_cqi
;
uint16_t
timing_advance
;
uint16_t
rssi
;
nfapi_nr_sr_pdu_0_1_t
*
sr
;
//67
nfapi_nr_harq_pdu_0_1_t
*
harq
;
//68
nfapi_nr_sr_pdu_0_1_t
sr
;
//67
nfapi_nr_harq_pdu_0_1_t
harq
;
//68
}
nfapi_nr_uci_pucch_pdu_format_0_1_t
;
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
60f99e51
...
...
@@ -3292,20 +3292,20 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint
if
(
!
push16
(
value
->
rssi
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
value
->
pduBitmap
&
0x01
)
{
//SR
if
(
!
push8
(
value
->
sr
->
sr_indication
,
ppWritePackedMsg
,
end
))
if
(
!
push8
(
value
->
sr
.
sr_indication
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push8
(
value
->
sr
->
sr_confidence_level
,
ppWritePackedMsg
,
end
))
if
(
!
push8
(
value
->
sr
.
sr_confidence_level
,
ppWritePackedMsg
,
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
1
)
&
0x01
))
{
//HARQ
if
(
!
push8
(
value
->
harq
->
num_harq
,
ppWritePackedMsg
,
end
))
if
(
!
push8
(
value
->
harq
.
num_harq
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push8
(
value
->
harq
->
harq_confidence_level
,
ppWritePackedMsg
,
end
))
if
(
!
push8
(
value
->
harq
.
harq_confidence_level
,
ppWritePackedMsg
,
end
))
return
0
;
for
(
int
i
=
0
;
i
<
value
->
harq
->
num_harq
;
i
++
)
for
(
int
i
=
0
;
i
<
value
->
harq
.
num_harq
;
i
++
)
{
if
(
!
push8
(
value
->
harq
->
harq_list
[
i
].
harq_value
,
ppWritePackedMsg
,
end
))
if
(
!
push8
(
value
->
harq
.
harq_list
[
i
].
harq_value
,
ppWritePackedMsg
,
end
))
return
0
;
}
}
...
...
@@ -6075,41 +6075,23 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
))
return
0
;
if
(
value
->
pduBitmap
&
0x01
)
{
//SR
value
->
sr
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
sr
),
config
);
if
(
value
->
sr
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate sr pdu
\n
"
,
__FUNCTION__
);
return
0
;
}
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
sr
->
sr_indication
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
sr
->
sr_confidence_level
,
end
)
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
sr
.
sr_indication
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
sr
.
sr_confidence_level
,
end
)
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
1
)
&
0x01
))
{
//HARQ
value
->
harq
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
harq
),
config
);
if
(
value
->
harq
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate nr_harq pdu
\n
"
,
__FUNCTION__
);
return
0
;
}
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
harq
->
num_harq
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
harq
->
harq_confidence_level
,
end
)
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
harq
.
num_harq
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_confidence_level
,
end
)
))
return
0
;
value
->
harq
->
harq_list
=
NULL
;
if
(
value
->
harq
->
num_harq
>
0
)
{
value
->
harq
->
harq_list
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
harq
->
harq_list
)
*
value
->
harq
->
num_harq
,
config
);
if
(
value
->
harq
->
harq_list
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate harq ind pdu list (count:%d)
\n
"
,
__FUNCTION__
,
value
->
harq
->
num_harq
);
return
0
;
}
for
(
int
i
=
0
;
i
<
value
->
harq
->
num_harq
;
i
++
)
{
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
harq
->
harq_list
[
i
].
harq_value
,
end
))
{
if
(
value
->
harq
.
num_harq
>
0
)
{
for
(
int
i
=
0
;
i
<
value
->
harq
.
num_harq
;
i
++
)
{
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_list
[
i
].
harq_value
,
end
))
{
return
0
;
}
}
...
...
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
60f99e51
...
...
@@ -146,7 +146,7 @@ static const int16_t idft12_im[12][12] = {
{
0
,
-
20066
,
-
20066
,
0
,
20066
,
20066
,
0
,
-
20066
,
-
20066
,
0
,
20066
,
20066
},
{
0
,
-
11585
,
-
20066
,
-
23170
,
-
20066
,
-
11585
,
0
,
11585
,
20066
,
23170
,
20066
,
11585
}
};
//************************************************************************//
void
nr_decode_pucch0
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
...
...
@@ -406,31 +406,27 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu
->
rssi
=
1280
-
(
10
*
dB_fixed
(
32767
*
32767
))
-
dB_fixed_times10
(
sigenergy
);
if
(
pucch_pdu
->
bit_len_harq
==
0
)
{
uci_pdu
->
harq
=
NULL
;
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
uci_pdu
->
sr
->
sr_confidence_level
=
SNRtimes10
<
uci_stats
->
pucch0_thres
;
uci_pdu
->
sr
.
sr_confidence_level
=
SNRtimes10
<
uci_stats
->
pucch0_thres
;
uci_stats
->
pucch0_sr_trials
++
;
if
(
xrtmag_dBtimes10
>
(
10
*
max_n0
+
100
))
{
uci_pdu
->
sr
->
sr_indication
=
1
;
uci_pdu
->
sr
.
sr_indication
=
1
;
uci_stats
->
pucch0_positive_SR
++
;
LOG_D
(
PHY
,
"PUCCH0 got positive SR. Cumulative number of positive SR %d
\n
"
,
uci_stats
->
pucch0_positive_SR
);
}
else
{
uci_pdu
->
sr
->
sr_indication
=
0
;
uci_pdu
->
sr
.
sr_indication
=
0
;
}
}
else
if
(
pucch_pdu
->
bit_len_harq
==
1
)
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
uci_pdu
->
harq
->
num_harq
=
1
;
uci_pdu
->
harq
->
harq_confidence_level
=
no_conf
;
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
sizeof
*
uci_pdu
->
harq
->
harq_list
);
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
=
!
(
index
&
0x01
);
uci_pdu
->
harq
.
num_harq
=
1
;
uci_pdu
->
harq
.
harq_confidence_level
=
no_conf
;
uci_pdu
->
harq
.
harq_list
[
0
].
harq_value
=
!
(
index
&
0x01
);
LOG_D
(
PHY
,
"[DLSCH/PDSCH/PUCCH] %d.%d HARQ %s with confidence level %s xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, "
"cqi %d, SNRtimes10 %d, energy %f
\n
"
,
frame
,
slot
,
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
->
harq_confidence_level
==
0
?
"good"
:
"bad"
,
uci_pdu
->
harq
.
harq_list
[
0
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
.
harq_confidence_level
==
0
?
"good"
:
"bad"
,
xrtmag_dBtimes10
,
xrtmag_next_dBtimes10
,
max_n0
,
...
...
@@ -442,10 +438,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
10
*
log10
((
double
)
sigenergy
));
if
(
pucch_pdu
->
sr_flag
==
1
)
{
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
uci_pdu
->
sr
->
sr_indication
=
(
index
>
1
);
uci_pdu
->
sr
->
sr_confidence_level
=
no_conf
;
if
(
uci_pdu
->
sr
->
sr_indication
==
1
&&
uci_pdu
->
sr
->
sr_confidence_level
==
0
)
{
uci_pdu
->
sr
.
sr_indication
=
(
index
>
1
);
uci_pdu
->
sr
.
sr_confidence_level
=
no_conf
;
if
(
uci_pdu
->
sr
.
sr_indication
==
1
&&
uci_pdu
->
sr
.
sr_confidence_level
==
0
)
{
uci_stats
->
pucch0_positive_SR
++
;
LOG_D
(
PHY
,
"PUCCH0 got positive SR. Cumulative number of positive SR %d
\n
"
,
uci_stats
->
pucch0_positive_SR
);
}
...
...
@@ -453,21 +448,19 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats
->
pucch01_trials
++
;
}
else
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
uci_pdu
->
harq
->
num_harq
=
2
;
uci_pdu
->
harq
->
harq_confidence_level
=
no_conf
;
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
2
*
sizeof
(
*
uci_pdu
->
harq
->
harq_list
));
uci_pdu
->
harq
.
num_harq
=
2
;
uci_pdu
->
harq
.
harq_confidence_level
=
no_conf
;
uci_pdu
->
harq
->
harq_list
[
1
].
harq_value
=
!
(
index
&
0x01
);
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
=
!
((
index
>>
1
)
&
0x01
);
uci_pdu
->
harq
.
harq_list
[
1
].
harq_value
=
!
(
index
&
0x01
);
uci_pdu
->
harq
.
harq_list
[
0
].
harq_value
=
!
((
index
>>
1
)
&
0x01
);
LOG_D
(
PHY
,
"[DLSCH/PDSCH/PUCCH] %d.%d HARQ values (%s, %s) with confidence level %s, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) "
"pucch0_thres %d, cqi %d, SNRtimes10 %d
\n
"
,
frame
,
slot
,
uci_pdu
->
harq
->
harq_list
[
1
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
->
harq_confidence_level
==
0
?
"good"
:
"bad"
,
uci_pdu
->
harq
.
harq_list
[
1
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
.
harq_list
[
0
].
harq_value
==
0
?
"ACK"
:
"NACK"
,
uci_pdu
->
harq
.
harq_confidence_level
==
0
?
"good"
:
"bad"
,
xrtmag_dBtimes10
,
xrtmag_next_dBtimes10
,
max_n0
,
...
...
@@ -477,17 +470,16 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
cqi
,
SNRtimes10
);
if
(
pucch_pdu
->
sr_flag
==
1
)
{
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
uci_pdu
->
sr
->
sr_indication
=
(
index
>
3
)
?
1
:
0
;
uci_pdu
->
sr
->
sr_confidence_level
=
no_conf
;
if
(
uci_pdu
->
sr
->
sr_indication
==
1
&&
uci_pdu
->
sr
->
sr_confidence_level
==
0
)
{
uci_pdu
->
sr
.
sr_indication
=
(
index
>
3
)
?
1
:
0
;
uci_pdu
->
sr
.
sr_confidence_level
=
no_conf
;
if
(
uci_pdu
->
sr
.
sr_indication
==
1
&&
uci_pdu
->
sr
.
sr_confidence_level
==
0
)
{
uci_stats
->
pucch0_positive_SR
++
;
LOG_D
(
PHY
,
"PUCCH0 got positive SR. Cumulative number of positive SR %d
\n
"
,
uci_stats
->
pucch0_positive_SR
);
}
}
}
}
//*****************************************************************//
void
nr_decode_pucch1
(
c16_t
**
rxdataF
,
pucch_GroupHopping_t
pucch_GroupHopping
,
uint32_t
n_id
,
// hoppingID higher layer parameter
...
...
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
View file @
60f99e51
...
...
@@ -82,16 +82,8 @@ static void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind)
{
if
(
uci_ind
->
uci_list
[
k
].
pdu_type
==
NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE
)
{
nfapi_nr_uci_pucch_pdu_format_0_1_t
*
pdu_0_1
=
&
uci_ind
->
uci_list
[
k
].
pucch_pdu_format_0_1
;
free
(
pdu_0_1
->
sr
);
pdu_0_1
->
sr
=
NULL
;
if
(
pdu_0_1
->
harq
)
{
free
(
pdu_0_1
->
harq
->
harq_list
);
pdu_0_1
->
harq
->
harq_list
=
NULL
;
}
free
(
pdu_0_1
->
harq
);
pdu_0_1
->
harq
=
NULL
;
//nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1;
// Warning: pdu_0_1 is unused
}
if
(
uci_ind
->
uci_list
[
k
].
pdu_type
==
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE
)
{
...
...
@@ -259,10 +251,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
if
(
mac
->
nr_ue_emul_l1
.
num_harqs
>
0
)
{
int
harq_index
=
0
;
pdu_0_1
->
pduBitmap
=
2
;
// (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR
pdu_0_1
->
harq
=
CALLOC
(
1
,
sizeof
(
*
pdu_0_1
->
harq
));
pdu_0_1
->
harq
->
num_harq
=
mac
->
nr_ue_emul_l1
.
num_harqs
;
pdu_0_1
->
harq
->
harq_confidence_level
=
0
;
pdu_0_1
->
harq
->
harq_list
=
CALLOC
(
pdu_0_1
->
harq
->
num_harq
,
sizeof
(
*
pdu_0_1
->
harq
->
harq_list
));
pdu_0_1
->
harq
.
num_harq
=
mac
->
nr_ue_emul_l1
.
num_harqs
;
pdu_0_1
->
harq
.
harq_confidence_level
=
0
;
int
harq_pid
=
-
1
;
for
(
int
k
=
0
;
k
<
NR_MAX_HARQ_PROCESSES
;
k
++
)
{
if
(
mac
->
nr_ue_emul_l1
.
harq
[
k
].
active
&&
...
...
@@ -270,8 +260,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
mac
->
nr_ue_emul_l1
.
harq
[
k
].
active_dl_harq_slot
==
uci_ind
->
slot
)
{
mac
->
nr_ue_emul_l1
.
harq
[
k
].
active
=
false
;
harq_pid
=
k
;
AssertFatal
(
harq_index
<
pdu_0_1
->
harq
->
num_harq
,
"Invalid harq_index %d
\n
"
,
harq_index
);
pdu_0_1
->
harq
->
harq_list
[
harq_index
].
harq_value
=
!
mac
->
dl_harq_info
[
k
].
ack
;
AssertFatal
(
harq_index
<
pdu_0_1
->
harq
.
num_harq
,
"Invalid harq_index %d
\n
"
,
harq_index
);
pdu_0_1
->
harq
.
harq_list
[
harq_index
].
harq_value
=
!
mac
->
dl_harq_info
[
k
].
ack
;
harq_index
++
;
}
}
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
60f99e51
...
...
@@ -663,14 +663,13 @@ int main(int argc, char **argv)
nr_decode_pucch0
(
gNB
,
nr_frame_tx
,
nr_slot_tx
,
&
uci_pdu
,
&
pucch_pdu
);
if
(
sr_flag
==
1
){
if
(
uci_pdu
.
sr
->
sr_indication
==
0
||
uci_pdu
.
sr
->
sr_confidence_level
==
1
)
if
(
uci_pdu
.
sr
.
sr_indication
==
0
||
uci_pdu
.
sr
.
sr_confidence_level
==
1
)
sr_errors
+=
1
;
free
(
uci_pdu
.
sr
);
}
// harq value 0 -> pass
nfapi_nr_harq_t
*
harq_list
=
uci_pdu
.
harq
->
harq_list
;
nfapi_nr_harq_t
*
harq_list
=
uci_pdu
.
harq
.
harq_list
;
// confidence value 0 -> good confidence
const
int
confidence_lvl
=
uci_pdu
.
harq
->
harq_confidence_level
;
const
int
confidence_lvl
=
uci_pdu
.
harq
.
harq_confidence_level
;
if
(
nr_bit
>
0
){
if
(
nr_bit
==
1
&&
do_DTX
==
0
)
ack_nack_errors
+=
(
actual_payload
^
(
!
harq_list
[
0
].
harq_value
));
...
...
@@ -679,9 +678,7 @@ int main(int argc, char **argv)
else
if
((
!
confidence_lvl
&&
!
harq_list
[
0
].
harq_value
)
||
(
!
confidence_lvl
&&
nr_bit
==
2
&&
!
harq_list
[
1
].
harq_value
))
ack_nack_errors
++
;
free
(
uci_pdu
.
harq
->
harq_list
);
}
free
(
uci_pdu
.
harq
);
}
else
if
(
format
==
1
)
{
nr_decode_pucch1
((
c16_t
**
)
rxdataF
,
PUCCH_GroupHopping
,
hopping_id
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
60f99e51
...
...
@@ -998,9 +998,9 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
if
(((
uci_01
->
pduBitmap
>>
1
)
&
0x01
))
{
// iterate over received harq bits
for
(
int
harq_bit
=
0
;
harq_bit
<
uci_01
->
harq
->
num_harq
;
harq_bit
++
)
{
const
uint8_t
harq_value
=
uci_01
->
harq
->
harq_list
[
harq_bit
].
harq_value
;
const
uint8_t
harq_confidence
=
uci_01
->
harq
->
harq_confidence_level
;
for
(
int
harq_bit
=
0
;
harq_bit
<
uci_01
->
harq
.
num_harq
;
harq_bit
++
)
{
const
uint8_t
harq_value
=
uci_01
->
harq
.
harq_list
[
harq_bit
].
harq_value
;
const
uint8_t
harq_confidence
=
uci_01
->
harq
.
harq_confidence_level
;
NR_UE_harq_t
*
harq
=
find_harq
(
frame
,
slot
,
UE
,
nrmac
->
dl_bler
.
harq_round_max
);
if
(
!
harq
)
{
LOG_E
(
NR_MAC
,
"UE %04x: Could not find a HARQ process at %4d.%2d!
\n
"
,
UE
->
rnti
,
frame
,
slot
);
...
...
@@ -1015,24 +1015,21 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
}
// tpc (power control) only if we received AckNack
if
(
uci_01
->
harq
->
harq_confidence_level
==
0
)
if
(
uci_01
->
harq
.
harq_confidence_level
==
0
)
sched_ctrl
->
tpc1
=
nr_get_tpc
(
nrmac
->
pucch_target_snrx10
,
uci_01
->
ul_cqi
,
30
);
else
sched_ctrl
->
tpc1
=
3
;
sched_ctrl
->
pucch_snrx10
=
uci_01
->
ul_cqi
*
5
-
640
;
free
(
uci_01
->
harq
->
harq_list
);
free
(
uci_01
->
harq
);
}
// check scheduling request result, confidence_level == 0 is good
if
(
uci_01
->
pduBitmap
&
0x1
)
{
if
(
uci_01
->
sr
->
sr_indication
&&
uci_01
->
sr
->
sr_confidence_level
==
0
&&
uci_01
->
ul_cqi
>=
148
)
{
if
(
uci_01
->
sr
.
sr_indication
&&
uci_01
->
sr
.
sr_confidence_level
==
0
&&
uci_01
->
ul_cqi
>=
148
)
{
// SR detected with SNR >= 10dB
sched_ctrl
->
SR
|=
true
;
LOG_D
(
NR_MAC
,
"SR UE %04x ul_cqi %d
\n
"
,
uci_01
->
rnti
,
uci_01
->
ul_cqi
);
}
free
(
uci_01
->
sr
);
}
NR_SCHED_UNLOCK
(
&
nrmac
->
sched_lock
);
}
...
...
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