Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openairinterface5G
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
23
Merge Requests
23
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
oai
openairinterface5G
Commits
5d30379b
Commit
5d30379b
authored
Aug 28, 2018
by
Jacques
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nr ue : add tdd slot config
parent
d77732b3
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
250 additions
and
231 deletions
+250
-231
openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
+25
-50
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+15
-2
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
+4
-2
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+15
-39
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+2
-1
openair1/PHY/impl_defs_nr.h
openair1/PHY/impl_defs_nr.h
+1
-3
openair1/PHY/impl_defs_top.h
openair1/PHY/impl_defs_top.h
+1
-1
openair1/SCHED_NR_UE/harq_nr.c
openair1/SCHED_NR_UE/harq_nr.c
+78
-34
openair1/SCHED_NR_UE/harq_nr.h
openair1/SCHED_NR_UE/harq_nr.h
+20
-17
openair1/SCHED_NR_UE/phy_frame_config_nr.c
openair1/SCHED_NR_UE/phy_frame_config_nr.c
+1
-1
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+16
-7
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
+3
-3
openair1/SIMULATION/NR_UE_PHY/unit_tests/build/run_tests.sh
openair1/SIMULATION/NR_UE_PHY/unit_tests/build/run_tests.sh
+32
-23
openair1/SIMULATION/NR_UE_PHY/unit_tests/readme.txt
openair1/SIMULATION/NR_UE_PHY/unit_tests/readme.txt
+33
-18
openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c
openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c
+2
-2
targets/RT/USER/nr-ue.c
targets/RT/USER/nr-ue.c
+2
-28
No files found.
openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
View file @
5d30379b
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#endif
#endif
#include "assertions.h"
#include "assertions.h"
#include "SCHED_NR_UE/harq_nr.h"
//#define DEBUG_HARQ
//#define DEBUG_HARQ
...
@@ -4180,6 +4181,22 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4180,6 +4181,22 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
#endif
#endif
}
}
/* store rnti type */
for
(
int
k
=
0
;
k
<
TOTAL_NBR_SCRAMBLED_VALUES
;
k
++
)
{
if
(
rnti
==
crc_scrambled_values
[
k
])
{
if
((
dci_format
==
format1_0
)
||
(
dci_format
==
format1_1
))
{
pdlsch0
->
rnti_type
=
k
;
}
else
{
ulsch0
->
rnti_type
=
k
;
}
}
}
if
(
j
==
TOTAL_NBR_SCRAMBLED_VALUES
)
{
LOG_E
(
PHY
,
"Fatal error in DCI due to unknown RNTI type at line %d in function %s of file %s
\n
"
,
__LINE__
,
__func__
,
__FILE__
);
}
if
((
dci_format
==
format1_0
)
||
(
dci_format
==
format1_1
))
{
if
((
dci_format
==
format1_0
)
||
(
dci_format
==
format1_1
))
{
if
(
rnti
==
crc_scrambled_values
[
_SI_RNTI_
])
{
if
(
rnti
==
crc_scrambled_values
[
_SI_RNTI_
])
{
ue
->
dlsch_SI
[
eNB_id
]
->
active
=
1
;
ue
->
dlsch_SI
[
eNB_id
]
->
active
=
1
;
...
@@ -4335,9 +4352,6 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4335,9 +4352,6 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
start_RB
=
n_RB_DLBWP
-
start_RB
-
1
;
start_RB
=
n_RB_DLBWP
-
start_RB
-
1
;
}
}
pdlsch0_harq
->
nb_rb
=
l_RB
;
pdlsch0_harq
->
nb_rb
=
l_RB
;
pdlsch0
->
current_harq_pid
=
nr_pdci_info_extracted
->
harq_process_number
;
pdlsch0
->
active
=
1
;
pdlsch0
->
rnti
=
rnti
;
}
}
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->freq_dom_resource_assignment_DL=%x, RIV = %d
\n
"
,
nr_pdci_info_extracted
->
freq_dom_resource_assignment_DL
,
nr_pdci_info_extracted
->
freq_dom_resource_assignment_DL
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->freq_dom_resource_assignment_DL=%x, RIV = %d
\n
"
,
nr_pdci_info_extracted
->
freq_dom_resource_assignment_DL
,
nr_pdci_info_extracted
->
freq_dom_resource_assignment_DL
);
...
@@ -4534,30 +4548,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4534,30 +4548,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
case
NDI
:
// 25 NDI: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-)
case
NDI
:
// 25 NDI: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-)
nr_pdci_info_extracted
->
ndi
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
nr_pdci_info_extracted
->
ndi
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
if
(
dci_format
==
format0_0
||
dci_format
==
format0_1
)
{
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
DCINdi
=
nr_pdci_info_extracted
->
ndi
;
if
(
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
first_tx
==
1
)
{
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
first_tx
=
0
;
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
DCINdi
=
nr_pdci_info_extracted
->
ndi
;
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
round
=
0
;
}
else
{
if
(
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
DCINdi
!=
nr_pdci_info_extracted
->
ndi
)
{
// new SDU opportunity
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
DCINdi
=
nr_pdci_info_extracted
->
ndi
;
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
round
=
0
;
}
}
}
else
{
if
(
rnti
==
crc_scrambled_values
[
_TC_RNTI_
])
{
//fix for standalone Contention Resolution Id
pdlsch0_harq
->
DCINdi
=
(
uint8_t
)
-
1
;
}
else
{
if
((
prev_ndi
!=
nr_pdci_info_extracted
->
ndi
)
||
(
pdlsch0_harq
->
first_tx
==
1
))
{
pdlsch0_harq
->
round
=
0
;
pdlsch0_harq
->
first_tx
=
0
;
pdlsch0_harq
->
status
=
ACTIVE
;
}
pdlsch0_harq
->
DCINdi
=
nr_pdci_info_extracted
->
ndi
;
}
}
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->ndi=%x
\n
"
,
nr_pdci_info_extracted
->
ndi
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->ndi=%x
\n
"
,
nr_pdci_info_extracted
->
ndi
);
#endif
#endif
...
@@ -4565,29 +4556,12 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4565,29 +4556,12 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
case
RV
:
// 26 RV: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-)
case
RV
:
// 26 RV: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-)
nr_pdci_info_extracted
->
rv
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
nr_pdci_info_extracted
->
rv
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
if
(
dci_format
==
format0_0
||
dci_format
==
format0_1
)
if
(
dci_format
==
format0_0
||
dci_format
==
format0_1
)
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
rvidx
=
nr_pdci_info_extracted
->
rv
;
ulsch0
->
harq_processes
[
nr_pdci_info_extracted
->
harq_process_number
]
->
rvidx
=
nr_pdci_info_extracted
->
rv
;
else
else
pdlsch0_harq
->
rvidx
=
nr_pdci_info_extracted
->
rv
;
pdlsch0_harq
->
rvidx
=
nr_pdci_info_extracted
->
rv
;
if
((
prev_ndi
==
nr_pdci_info_extracted
->
ndi
)
&&
(
pdlsch0_harq
->
rvidx
!=
0
))
{
// NDI has not been toggled but rv was increased by eNB: retransmission
if
(
pdlsch0_harq
->
status
==
SCH_IDLE
)
{
// packet was actually decoded in previous transmission (ACK was missed by eNB)
// however, the round is not a good check as it might have been decoded in a retransmission prior to this one.
// skip pdsch decoding and report ack
pdlsch0
->
harq_processes
[
pdlsch0
->
current_harq_pid
]
->
harq_ack
.
ack
=
1
;
pdlsch0
->
harq_processes
[
pdlsch0
->
current_harq_pid
]
->
harq_ack
.
send_harq_status
;
#if 0
pdlsch0->active = 0;
pdlsch0->harq_ack[nr_tti_rx].ack = 1;
pdlsch0->harq_ack[nr_tti_rx].harq_id = nr_pdci_info_extracted->harq_process_number;
pdlsch0->harq_ack[nr_tti_rx].send_harq_status = 1;
#endif
}
else
{
// normal retransmission, nothing special to do
}
}
else
{
pdlsch0_harq
->
status
=
ACTIVE
;
}
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->rv=%x
\n
"
,
nr_pdci_info_extracted
->
rv
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->rv=%x
\n
"
,
nr_pdci_info_extracted
->
rv
);
#endif
#endif
...
@@ -4595,7 +4569,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4595,7 +4569,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
case
HARQ_PROCESS_NUMBER
:
// 27 HARQ_PROCESS_NUMBER: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-)
case
HARQ_PROCESS_NUMBER
:
// 27 HARQ_PROCESS_NUMBER: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-)
nr_pdci_info_extracted
->
harq_process_number
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
nr_pdci_info_extracted
->
harq_process_number
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
pdlsch0
->
current_harq_pid
=
nr_pdci_info_extracted
->
harq_process_number
;
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->harq_process_number=%x
\n
"
,
nr_pdci_info_extracted
->
harq_process_number
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->harq_process_number=%x
\n
"
,
nr_pdci_info_extracted
->
harq_process_number
);
#endif
#endif
...
@@ -4607,8 +4581,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4607,8 +4581,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
// 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI
// 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI
// 0 otherwise
// 0 otherwise
nr_pdci_info_extracted
->
dai
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
nr_pdci_info_extracted
->
dai
=
(
uint8_t
)(((((
*
(
uint64_t
*
)
dci_pdu
)
<<
(
left_shift
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
])))
&
pdu_bitmap
)
>>
(
dci_length
-
dci_fields_sizes
[
dci_field
][
dci_format
-
15
]));
pdlsch0
->
harq_processes
[
pdlsch0
->
current_harq_pid
]
->
harq_ack
.
vDAI_DL
=
nr_pdci_info_extracted
->
dai
+
1
;
//pdlsch0->harq_ack[nr_tti_rx].vDAI_DL = nr_pdci_info_extracted->dai+1;
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dai=%x
\n
"
,
nr_pdci_info_extracted
->
dai
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dai=%x
\n
"
,
nr_pdci_info_extracted
->
dai
);
#endif
#endif
...
@@ -4811,11 +4784,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
...
@@ -4811,11 +4784,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->reserved_nr_dci=%x
\n
"
,
nr_pdci_info_extracted
->
reserved_nr_dci
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->reserved_nr_dci=%x
\n
"
,
nr_pdci_info_extracted
->
reserved_nr_dci
);
#endif
#endif
break
;
break
;
}
}
}
}
}
}
/* process harq -> set dlsch[0]->harq_processes[dlsch[0]->current_harq_pid].rx_status give NEW TRANSMISSION or RETRANSMISSION */
get_dci_info_for_harq
(
ue
,
nr_pdci_info_extracted
,
pdlsch0
,
ulsch0
,
nr_tti_rx
,
k_offset
);
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> Ending function nr_extract_dci_info()
\n
"
);
printf
(
"
\t\t
<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> Ending function nr_extract_dci_info()
\n
"
);
#endif
#endif
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
View file @
5d30379b
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#define __NR_TRANSPORT_UE__H__
#define __NR_TRANSPORT_UE__H__
#include <limits.h>
#include <limits.h>
#include "PHY/impl_defs_top.h"
#include "PHY/impl_defs_top.h"
//#include "PHY/defs_nr_UE.h"
//#include "PHY/defs_nr_UE.h"
//#include "../LTE_TRANSPORT/dci.h"
//#include "../LTE_TRANSPORT/dci.h"
//#include "../LTE_TRANSPORT/mdci.h"
//#include "../LTE_TRANSPORT/mdci.h"
...
@@ -50,11 +51,18 @@
...
@@ -50,11 +51,18 @@
* @{
* @{
*/
*/
typedef
enum
{
NEW_TRANSMISSION_HARQ
,
RETRANSMISSION_HARQ
}
harq_result_t
;
//#if defined(UPGRADE_RAT_NR)
//#if defined(UPGRADE_RAT_NR)
#if 1
#if 1
typedef
struct
{
typedef
struct
{
/// HARQ process id
/// HARQ process id
uint8_t
harq_id
;
uint8_t
harq_id
;
/// HARQ rx status
harq_result_t
rx_status
;
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
uint8_t
ack
;
uint8_t
ack
;
/// send status (for PUCCH)
/// send status (for PUCCH)
...
@@ -81,6 +89,8 @@ typedef struct {
...
@@ -81,6 +89,8 @@ typedef struct {
uint8_t
first_tx
;
uint8_t
first_tx
;
/// Last Ndi received for this process on DCI (used for C-RNTI only)
/// Last Ndi received for this process on DCI (used for C-RNTI only)
uint8_t
DCINdi
;
uint8_t
DCINdi
;
/// HARQ tx status
harq_result_t
tx_status
;
/// Flag indicating that this ULSCH has a new packet (start of new round)
/// Flag indicating that this ULSCH has a new packet (start of new round)
// uint8_t Ndi;
// uint8_t Ndi;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
/// Status Flag indicating for this ULSCH (idle,active,disabled)
...
@@ -145,7 +155,6 @@ typedef struct {
...
@@ -145,7 +155,6 @@ typedef struct {
// int calibration_flag;
// int calibration_flag;
/// Number of soft channel bits
/// Number of soft channel bits
uint32_t
G
;
uint32_t
G
;
// decode phich
// decode phich
uint8_t
decode_phich
;
uint8_t
decode_phich
;
}
NR_UL_UE_HARQ_t
;
}
NR_UL_UE_HARQ_t
;
...
@@ -159,7 +168,7 @@ typedef struct {
...
@@ -159,7 +168,7 @@ typedef struct {
#if 1
#if 1
// Pointers to HARQ processes for the ULSCH
// Pointers to HARQ processes for the ULSCH
NR_UL_UE_HARQ_t
*
harq_processes
[
NR_MAX_ULSCH_HARQ_PROCESSES
];
NR_UL_UE_HARQ_t
*
harq_processes
[
NR_MAX_ULSCH_HARQ_PROCESSES
];
int
harq_process_id
[
NR_MAX_SLOTS_P
A
R_FRAME
];
int
harq_process_id
[
NR_MAX_SLOTS_P
E
R_FRAME
];
// UL number of harq processes
// UL number of harq processes
uint8_t
number_harq_processes_for_pusch
;
uint8_t
number_harq_processes_for_pusch
;
#endif
#endif
...
@@ -211,6 +220,8 @@ typedef struct {
...
@@ -211,6 +220,8 @@ typedef struct {
uint8_t
cooperation_flag
;
uint8_t
cooperation_flag
;
/// RNTI attributed to this ULSCH
/// RNTI attributed to this ULSCH
uint16_t
rnti
;
uint16_t
rnti
;
/// RNTI type
uint8_t
rnti_type
;
/// f_PUSCH parameter for PUSCH power control
/// f_PUSCH parameter for PUSCH power control
int16_t
f_pusch
;
int16_t
f_pusch
;
/// Po_PUSCH - target output power for PUSCH
/// Po_PUSCH - target output power for PUSCH
...
@@ -311,6 +322,8 @@ typedef struct {
...
@@ -311,6 +322,8 @@ typedef struct {
typedef
struct
{
typedef
struct
{
/// RNTI
/// RNTI
uint16_t
rnti
;
uint16_t
rnti
;
/// RNTI type
uint8_t
rnti_type
;
/// Active flag for DLSCH demodulation
/// Active flag for DLSCH demodulation
uint8_t
active
;
uint8_t
active
;
/// Transmission mode
/// Transmission mode
...
...
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
View file @
5d30379b
...
@@ -453,7 +453,9 @@ void nr_generate_pucch0(int32_t **txdataF,
...
@@ -453,7 +453,9 @@ void nr_generate_pucch0(int32_t **txdataF,
PUCCH_GroupHopping
=
0
;
PUCCH_GroupHopping
=
0
;
n_id
=
10
;
n_id
=
10
;
PUCCH_Frequency_Hopping
=
0
;
PUCCH_Frequency_Hopping
=
0
;
#ifdef DEBUG_NR_PUCCH_TX
printf
(
"
\t
[nr_generate_pucch0] sequence generation: variable initialization for test
\n
"
);
printf
(
"
\t
[nr_generate_pucch0] sequence generation: variable initialization for test
\n
"
);
#endif
/////////////////////////////////////////////////////// ending variables initialization for test
/////////////////////////////////////////////////////// ending variables initialization for test
// x_n contains the sequence r_u_v_alpha_delta(n)
// x_n contains the sequence r_u_v_alpha_delta(n)
...
@@ -862,7 +864,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
...
@@ -862,7 +864,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
for
(
i
=
0
;
i
<
M_bit
;
i
++
)
{
for
(
i
=
0
;
i
<
M_bit
;
i
++
)
{
c
=
(
uint8_t
)((
s
>>
i
)
&
1
);
c
=
(
uint8_t
)((
s
>>
i
)
&
1
);
btilde
[
i
]
=
(((
B
>>
i
)
&
1
)
^
c
);
btilde
[
i
]
=
(((
B
>>
i
)
&
1
)
^
c
);
#if
n
def DEBUG_NR_PUCCH_TX
#ifdef DEBUG_NR_PUCCH_TX
printf
(
"
\t\t\t
btilde[%d]=%lx from scrambled bit %d
\n
"
,
i
,
btilde
[
i
],((
B
>>
i
)
&
1
));
printf
(
"
\t\t\t
btilde[%d]=%lx from scrambled bit %d
\n
"
,
i
,
btilde
[
i
],((
B
>>
i
)
&
1
));
#endif
#endif
}
}
...
@@ -1303,7 +1305,7 @@ void nr_generate_pucch3_4(int32_t **txdataF,
...
@@ -1303,7 +1305,7 @@ void nr_generate_pucch3_4(int32_t **txdataF,
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]
=
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]
=
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]
+
(
int16_t
)(((
int32_t
)
round
(
32767
/
sqrt
(
12
*
nrofPRB
))
*
(
int16_t
)((((
int32_t
)
y_n_im
[
l
*
(
12
*
nrofPRB
)
+
m
]
*
(
int16_t
)
round
(
32767
*
cos
(
2
*
M_PI
*
m
*
k
/
(
12
*
nrofPRB
))))
>>
15
)
+
(
int16_t
)(((
int32_t
)
round
(
32767
/
sqrt
(
12
*
nrofPRB
))
*
(
int16_t
)((((
int32_t
)
y_n_im
[
l
*
(
12
*
nrofPRB
)
+
m
]
*
(
int16_t
)
round
(
32767
*
cos
(
2
*
M_PI
*
m
*
k
/
(
12
*
nrofPRB
))))
>>
15
)
-
(((
int32_t
)
y_n_re
[
l
*
(
12
*
nrofPRB
)
+
m
]
*
(
int16_t
)
round
(
32767
*
sin
(
2
*
M_PI
*
m
*
k
/
(
12
*
nrofPRB
))))
>>
15
)))
>>
15
);
-
(((
int32_t
)
y_n_re
[
l
*
(
12
*
nrofPRB
)
+
m
]
*
(
int16_t
)
round
(
32767
*
sin
(
2
*
M_PI
*
m
*
k
/
(
12
*
nrofPRB
))))
>>
15
)))
>>
15
);
#if
n
def DEBUG_NR_PUCCH_TX
#ifdef DEBUG_NR_PUCCH_TX
printf
(
"
\t
[nr_generate_pucch3_4] transform precoding for formats 3 and 4: (l,k,m)=(%d,%d,%d)
\t
z(%d) =
\t
(%d, %d)
\n
"
,
printf
(
"
\t
[nr_generate_pucch3_4] transform precoding for formats 3 and 4: (l,k,m)=(%d,%d,%d)
\t
z(%d) =
\t
(%d, %d)
\n
"
,
l
,
k
,
m
,
l
*
(
12
*
nrofPRB
)
+
k
,
z_re
[
l
*
(
12
*
nrofPRB
)
+
k
],
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]);
l
,
k
,
m
,
l
*
(
12
*
nrofPRB
)
+
k
,
z_re
[
l
*
(
12
*
nrofPRB
)
+
k
],
z_im
[
l
*
(
12
*
nrofPRB
)
+
k
]);
#endif
#endif
...
...
openair1/PHY/defs_nr_UE.h
View file @
5d30379b
...
@@ -160,27 +160,6 @@
...
@@ -160,27 +160,6 @@
#include "NR_IF_Module.h"
#include "NR_IF_Module.h"
//#if defined(UPGRADE_RAT_NR)
#if 1
/* see 38.321 Table 7.1-2 RNTI usage */
typedef
enum
{
/* Type for Radio Network Temporary Identifier */
C_RNTI_NR
=
0
,
/* Cell RNTI */
Temporary_C_RNTI_NR
,
/* Temporary C-RNTI */
CS_RNTI_NR
,
/* Configured Scheduling RNTI */
P_RNTI_NR
,
/* Paging RNTI */
SI_RNTI_NR
,
/* System information RNTI */
RA_RNTI_NR
,
/* Random Access RNTI */
TPC_CS_RNTI_NR
,
/* configured scheduling uplink power control */
TPC_PUCCH_RNTI_NR
,
/* PUCCH power control */
TPC_PUSCH_RNTI_NR
,
/* PUSCH power control */
TPC_SRS_RNTI_NR
,
/* SRS trigger and power control */
INT_RNTI_NR
,
/* Indication pre-emption in DL */
SFI_RNTI_NR
,
/* Slot Format Indication on the given cell */
SP_CSI_RNTI_NR
/* Semipersistent CSI reporting on PUSCH */
}
nr_rnti_type_t
;
#endif
/// Context data structure for RX/TX portion of subframe processing
/// Context data structure for RX/TX portion of subframe processing
typedef
struct
{
typedef
struct
{
/// index of the current UE RX/TX proc
/// index of the current UE RX/TX proc
...
@@ -700,24 +679,21 @@ typedef enum {
...
@@ -700,24 +679,21 @@ typedef enum {
#define _TPC_PUSCH_RNTI_ 10
#define _TPC_PUSCH_RNTI_ 10
#define _TPC_PUCCH_RNTI_ 11
#define _TPC_PUCCH_RNTI_ 11
#define _TPC_SRS_RNTI_ 12
#define _TPC_SRS_RNTI_ 12
typedef
enum
{
typedef
enum
{
/* see 38.321 Table 7.1-2 RNTI usage */
_c_rnti
=
_C_RNTI_
,
_c_rnti
=
_C_RNTI_
,
/* Cell RNTI */
_cs_rnti
=
_CS_RNTI_
,
_cs_rnti
=
_CS_RNTI_
,
/* Configured Scheduling RNTI */
_new_rnti
=
_NEW_RNTI_
,
_new_rnti
=
_NEW_RNTI_
,
/* ? */
_tc_rnti
=
_TC_RNTI_
,
_tc_rnti
=
_TC_RNTI_
,
/* Temporary C-RNTI */
_p_rnti
=
_P_RNTI_
,
_p_rnti
=
_P_RNTI_
,
/* Paging RNTI */
_si_rnti
=
_SI_RNTI_
,
_si_rnti
=
_SI_RNTI_
,
/* System information RNTI */
_ra_rnti
=
_RA_RNTI_
,
_ra_rnti
=
_RA_RNTI_
,
/* Random Access RNTI */
_sp_csi_rnti
=
_SP_CSI_RNTI_
,
_sp_csi_rnti
=
_SP_CSI_RNTI_
,
/* Semipersistent CSI reporting on PUSCH */
_sfi_rnti
=
_SFI_RNTI_
,
_sfi_rnti
=
_SFI_RNTI_
,
/* Slot Format Indication on the given cell */
_int_rnti
=
_INT_RNTI_
,
_int_rnti
=
_INT_RNTI_
,
/* Indication pre-emption in DL */
_tpc_pusch_rnti
=
_TPC_PUSCH_RNTI_
,
_tpc_pusch_rnti
=
_TPC_PUSCH_RNTI_
,
/* PUSCH power control */
_tpc_pucch_rnti
=
_TPC_PUCCH_RNTI_
,
_tpc_pucch_rnti
=
_TPC_PUCCH_RNTI_
,
/* PUCCH power control */
_tpc_srs_rnti
=
_TPC_SRS_RNTI_
}
crc_scrambled_t
;
_tpc_srs_rnti
=
_TPC_SRS_RNTI_
}
crc_scrambled_t
;
typedef
enum
{
bundle_n2
=
2
,
bundle_n3
=
3
,
bundle_n6
=
6
}
NR_UE_CORESET_REG_bundlesize_t
;
typedef
enum
{
bundle_n2
=
2
,
bundle_n3
=
3
,
bundle_n6
=
6
}
NR_UE_CORESET_REG_bundlesize_t
;
typedef
enum
{
interleave_n2
=
2
,
interleave_n3
=
3
,
interleave_n6
=
6
}
NR_UE_CORESET_interleaversize_t
;
typedef
enum
{
interleave_n2
=
2
,
interleave_n3
=
3
,
interleave_n6
=
6
}
NR_UE_CORESET_interleaversize_t
;
...
@@ -1020,9 +996,9 @@ typedef struct {
...
@@ -1020,9 +996,9 @@ typedef struct {
/// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime)
/// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime)
uint32_t
rx_gain_byp
[
4
];
uint32_t
rx_gain_byp
[
4
];
/// \brief Current transmit power
/// \brief Current transmit power
int16_t
tx_power_dBm
[
MAX_NR_OF_SLOTS
];
int16_t
tx_power_dBm
[
NR_MAX_SLOTS_PER_FRAME
];
/// \brief Total number of REs in current transmission
/// \brief Total number of REs in current transmission
int
tx_total_RE
[
MAX_NR_OF_SLOTS
];
int
tx_total_RE
[
NR_MAX_SLOTS_PER_FRAME
];
/// \brief Maximum transmit power
/// \brief Maximum transmit power
int8_t
tx_power_max_dBm
;
int8_t
tx_power_max_dBm
;
/// \brief Number of eNB seen by UE
/// \brief Number of eNB seen by UE
...
...
openair1/PHY/defs_nr_common.h
View file @
5d30379b
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#ifndef __PHY_DEFS_NR_COMMON__H__
#ifndef __PHY_DEFS_NR_COMMON__H__
#define __PHY_DEFS_NR_COMMON__H__
#define __PHY_DEFS_NR_COMMON__H__
#include "PHY/impl_defs_top.h"
#include "defs_common.h"
#include "defs_common.h"
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface.h"
#include "impl_defs_nr.h"
#include "impl_defs_nr.h"
...
@@ -176,7 +177,7 @@ typedef struct NR_DL_FRAME_PARMS {
...
@@ -176,7 +177,7 @@ typedef struct NR_DL_FRAME_PARMS {
TDD_UL_DL_SlotConfig_t
*
p_TDD_UL_DL_ConfigDedicated
;
TDD_UL_DL_SlotConfig_t
*
p_TDD_UL_DL_ConfigDedicated
;
/// TDD configuration
/// TDD configuration
uint16_t
tdd_uplink_nr
[
MAX_NR_OF_SLOTS
];
/* this is a bitmap of symbol of each slot given for 2 frames */
uint16_t
tdd_uplink_nr
[
2
*
NR_MAX_SLOTS_PER_FRAME
];
/* this is a bitmap of symbol of each slot given for 2 frames */
//SSB related params
//SSB related params
/// Start in Subcarrier index of the SSB block
/// Start in Subcarrier index of the SSB block
...
...
openair1/PHY/impl_defs_nr.h
View file @
5d30379b
...
@@ -114,8 +114,6 @@ SystemInformationBlockType1_nr_t;
...
@@ -114,8 +114,6 @@ SystemInformationBlockType1_nr_t;
*
*
************************************************************************/
************************************************************************/
#define MAX_NR_OF_SLOTS (320)
/* maximum number of slots */
#define NR_TDD_DOWNLINK_SLOT (0x0000)
#define NR_TDD_DOWNLINK_SLOT (0x0000)
#define NR_TDD_UPLINK_SLOT (0x3FFF)
/* uplink bitmap for each symbol, there are 14 symbols per slots */
#define NR_TDD_UPLINK_SLOT (0x3FFF)
/* uplink bitmap for each symbol, there are 14 symbols per slots */
#define NR_TDD_SET_ALL_SYMBOLS (0x3FFF)
#define NR_TDD_SET_ALL_SYMBOLS (0x3FFF)
...
@@ -544,7 +542,7 @@ typedef struct {
...
@@ -544,7 +542,7 @@ typedef struct {
const
initial_pucch_resource_t
initial_pucch_resource
[
NB_INITIAL_PUCCH_RESOURCE
];
/* TS 36.213 Table 9.2.1-1: PUCCH resource sets before dedicated PUCCH resource configuration */
const
initial_pucch_resource_t
initial_pucch_resource
[
NB_INITIAL_PUCCH_RESOURCE
];
/* TS 36.213 Table 9.2.1-1: PUCCH resource sets before dedicated PUCCH resource configuration */
/* structure with all possible field for pucch format from 0 to 4 */
/* structure with all possible field
s
for pucch format from 0 to 4 */
typedef
struct
{
typedef
struct
{
pucch_format_nr_t
format
;
/* format 0 1 2 3 4 */
pucch_format_nr_t
format
;
/* format 0 1 2 3 4 */
uint8_t
initialCyclicShift
;
/* x x */
uint8_t
initialCyclicShift
;
/* x x */
...
...
openair1/PHY/impl_defs_top.h
View file @
5d30379b
...
@@ -261,7 +261,7 @@
...
@@ -261,7 +261,7 @@
#define NB_NUMEROLOGIES_NR (5)
#define NB_NUMEROLOGIES_NR (5)
#define TDD_CONFIG_NB_FRAMES (2)
#define TDD_CONFIG_NB_FRAMES (2)
#define NR_MAX_SLOTS_P
A
R_FRAME (160)
/* number of slots per frame */
#define NR_MAX_SLOTS_P
E
R_FRAME (160)
/* number of slots per frame */
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (4)
/* FFS_NR_TODO it defines ue capability which is the number of slots */
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (4)
/* FFS_NR_TODO it defines ue capability which is the number of slots */
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of un uplink grant and its related transmission */
/* - between reception of un uplink grant and its related transmission */
...
...
openair1/SCHED_NR_UE/harq_nr.c
View file @
5d30379b
...
@@ -89,9 +89,53 @@
...
@@ -89,9 +89,53 @@
************************************************************************/
************************************************************************/
#include "PHY/defs_nr_UE.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "SCHED_NR_UE/harq_nr.h"
#include "SCHED_NR_UE/harq_nr.h"
/********************* define **************************************/
#define DL_DCI (1)
#define UL_DCI (0)
/*******************************************************************
*
* NAME : get_dci_info_for_harq
*
* PARAMETERS : pointer to ue context
* id of current gNB
* number of uplink processes
* maximum number of uplink retransmissions
* RETURN : none
*
* DESCRIPTION : update HARQ entity with information from DCI
* TS 38.212 7.3.1.2 DCI formats for scheduling PDSCH
*
*********************************************************************/
void
get_dci_info_for_harq
(
PHY_VARS_NR_UE
*
ue
,
NR_DCI_INFO_EXTRACTED_t
*
nr_dci_info_extracted
,
NR_UE_DLSCH_t
**
dlsch
,
NR_UE_ULSCH_t
*
ulsch
,
uint8_t
nr_tti_rx
,
uint8_t
tx_offset
)
{
if
(
nr_dci_info_extracted
->
identifier_dci_formats
==
DL_DCI
)
{
dlsch
[
0
]
->
current_harq_pid
=
nr_dci_info_extracted
->
harq_process_number
;
NR_DL_UE_HARQ_t
*
dl_harq
=
dlsch
[
0
]
->
harq_processes
[
dlsch
[
0
]
->
current_harq_pid
];
dl_harq
->
harq_ack
.
vDAI_DL
=
nr_dci_info_extracted
->
dai
+
1
;
dl_harq
->
harq_ack
.
pucch_resource_indicator
=
nr_dci_info_extracted
->
pucch_resource_ind
;
dl_harq
->
harq_ack
.
slot_for_feedback_ack
=
(
nr_tti_rx
+
nr_dci_info_extracted
->
pdsch_to_harq_feedback_time_ind
)
%
ue
->
frame_parms
.
ttis_per_subframe
;
dl_harq
->
harq_ack
.
harq_id
=
nr_dci_info_extracted
->
harq_process_number
;
dl_harq
->
harq_ack
.
rx_status
=
downlink_harq_process
(
dl_harq
,
dlsch
[
0
]
->
current_harq_pid
,
nr_dci_info_extracted
->
ndi
,
dlsch
[
0
]
->
rnti_type
);
}
else
if
(
nr_dci_info_extracted
->
identifier_dci_formats
==
UL_DCI
)
{
/* store harq id for which pusch should be transmitted at rx_slot + tx_offset */
set_tx_harq_id
(
ulsch
,
nr_dci_info_extracted
->
harq_process_number
,
(
nr_tti_rx
+
tx_offset
)
%
ue
->
frame_parms
.
ttis_per_subframe
);
ulsch
->
harq_processes
[
nr_dci_info_extracted
->
harq_process_number
]
->
tx_status
=
uplink_harq_process
(
ulsch
,
nr_dci_info_extracted
->
harq_process_number
,
nr_dci_info_extracted
->
ndi
,
ulsch
->
rnti_type
);
}
}
/*******************************************************************
/*******************************************************************
*
*
* NAME : config_uplink_harq_process
* NAME : config_uplink_harq_process
...
@@ -139,6 +183,10 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, uint8_t number_h
...
@@ -139,6 +183,10 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, uint8_t number_h
ulsch
->
harq_processes
[
harq_pid
]
->
first_tx
=
1
;
ulsch
->
harq_processes
[
harq_pid
]
->
first_tx
=
1
;
ulsch
->
harq_processes
[
harq_pid
]
->
round
=
0
;
ulsch
->
harq_processes
[
harq_pid
]
->
round
=
0
;
}
}
for
(
int
slot_tx
=
0
;
slot_tx
<
NR_MAX_SLOTS_PER_FRAME
;
slot_tx
++
)
{
ue
->
ulsch
[
gNB_id
]
->
harq_process_id
[
slot_tx
]
=
NR_MAX_HARQ_PROCESSES
;
}
}
}
/*******************************************************************
/*******************************************************************
...
@@ -184,9 +232,9 @@ void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id)
...
@@ -184,9 +232,9 @@ void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id)
*
*
*********************************************************************/
*********************************************************************/
void
set_tx_harq_id
(
PHY_VARS_NR_UE
*
ue
,
int
gNB_id
,
int
harq_pid
,
int
slot_tx
)
void
set_tx_harq_id
(
NR_UE_ULSCH_t
*
ulsch
,
int
harq_pid
,
int
slot_tx
)
{
{
u
e
->
ulsch
[
gNB_id
]
->
harq_process_id
[
slot_tx
]
=
harq_pid
;
u
lsch
->
harq_process_id
[
slot_tx
]
=
harq_pid
;
}
}
/*******************************************************************
/*******************************************************************
...
@@ -199,30 +247,14 @@ void set_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int harq_pid, int slot_tx)
...
@@ -199,30 +247,14 @@ void set_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int harq_pid, int slot_tx)
*
*
* RETURN : harq process identifier
* RETURN : harq process identifier
*
*
* DESCRIPTION : return tx harq process identifier for given
transmission slot
* DESCRIPTION : return tx harq process identifier for given
slot transmission
*
*
*********************************************************************/
*********************************************************************/
int
get_tx_harq_id
(
PHY_VARS_NR_UE
*
ue
,
int
gNB_id
,
int
slot_tx
)
int
get_tx_harq_id
(
NR_UE_ULSCH_t
*
ulsch
,
int
slot_tx
)
{
{
return
(
ue
->
ulsch
[
gNB_id
]
->
harq_process_id
[
slot_tx
]);
}
/*******************************************************************
return
(
ulsch
->
harq_process_id
[
slot_tx
]);
*
* NAME : get_dci_slot_rx_to_tx
*
* PARAMETERS : dci index
*
* RETURN : number of slots
*
* DESCRIPTION : extract from DCI number of slots between current reception and its related transmission
*
*********************************************************************/
int
get_dci_slot_rx_to_tx
(
int
dci_index
)
{
return
(
4
);
}
}
/*******************************************************************
/*******************************************************************
...
@@ -244,13 +276,17 @@ int get_dci_slot_rx_to_tx(int dci_index)
...
@@ -244,13 +276,17 @@ int get_dci_slot_rx_to_tx(int dci_index)
*
*