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
promise
OpenXG-RAN
Commits
56448ab7
Commit
56448ab7
authored
Aug 06, 2018
by
yilmazt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addition of polar encoding to scheduler_phytest.
parent
859aa1d2
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
169 additions
and
63 deletions
+169
-63
openair1/PHY/CODING/TESTBENCH/polartest.c
openair1/PHY/CODING/TESTBENCH/polartest.c
+18
-14
openair1/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c
openair1/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c
+22
-10
openair1/PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h
+5
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+15
-2
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+0
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h
+3
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
+3
-0
openair1/PHY/CODING/nr_polar_init.c
openair1/PHY/CODING/nr_polar_init.c
+67
-22
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+5
-1
openair1/PHY/NR_TRANSPORT/nr_dci.c
openair1/PHY/NR_TRANSPORT/nr_dci.c
+16
-3
openair1/PHY/NR_TRANSPORT/nr_dci.h
openair1/PHY/NR_TRANSPORT/nr_dci.h
+1
-0
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+3
-4
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+3
-1
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+3
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+1
-0
targets/RT/USER/nr-gnb.c
targets/RT/USER/nr-gnb.c
+4
-1
No files found.
openair1/PHY/CODING/TESTBENCH/polartest.c
View file @
56448ab7
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <time.h>
#include <time.h>
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/
CODING/nrPolar_tools/nr_polar_pbch_defs
.h"
#include "PHY/
NR_TRANSPORT/nr_dci
.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_gNB.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/TOOLS/sim.h"
...
@@ -20,6 +20,16 @@ int main(int argc, char *argv[]) {
...
@@ -20,6 +20,16 @@ int main(int argc, char *argv[]) {
reset_meas
(
&
timeEncoder
);
reset_meas
(
&
timeEncoder
);
reset_meas
(
&
timeDecoder
);
reset_meas
(
&
timeDecoder
);
//gNB scheduler
/*PHY_VARS_gNB *gNB = RC.gNB[0][0];
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
nfapi_nr_dl_config_request_pdu_t *pdu;
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &pdu->dci_dl_pdu.pdcch_params_rel15;
params_rel15->rnti_type = NFAPI_NR_RNTI_RA;
params_rel15->dci_format = NFAPI_NR_DL_DCI_FORMAT_1_0;*/
randominit
(
0
);
randominit
(
0
);
//Default simulation values (Aim for iterations = 1000000.)
//Default simulation values (Aim for iterations = 1000000.)
int
itr
,
iterations
=
1000
,
arguments
,
polarMessageType
=
0
;
//0=PBCH, 1=DCI, -1=UCI
int
itr
,
iterations
=
1000
,
arguments
,
polarMessageType
=
0
;
//0=PBCH, 1=DCI, -1=UCI
...
@@ -31,7 +41,7 @@ int main(int argc, char *argv[]) {
...
@@ -31,7 +41,7 @@ int main(int argc, char *argv[]) {
uint16_t
testLength
,
coderLength
,
blockErrorCumulative
=
0
,
bitErrorCumulative
=
0
;
uint16_t
testLength
,
coderLength
,
blockErrorCumulative
=
0
,
bitErrorCumulative
=
0
;
double
timeEncoderCumulative
=
0
,
timeDecoderCumulative
=
0
;
double
timeEncoderCumulative
=
0
,
timeDecoderCumulative
=
0
;
uint8_t
decoderListSize
=
8
,
pathMetricAppr
=
0
;
//0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12)
uint8_t
aggregation_level
,
decoderListSize
=
8
,
pathMetricAppr
=
0
;
//0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12)
while
((
arguments
=
getopt
(
argc
,
argv
,
"s:d:f:m:i:l:a:"
))
!=
-
1
)
while
((
arguments
=
getopt
(
argc
,
argv
,
"s:d:f:m:i:l:a:"
))
!=
-
1
)
switch
(
arguments
)
switch
(
arguments
)
...
@@ -73,9 +83,11 @@ int main(int argc, char *argv[]) {
...
@@ -73,9 +83,11 @@ int main(int argc, char *argv[]) {
if
(
polarMessageType
==
0
)
{
//PBCH
if
(
polarMessageType
==
0
)
{
//PBCH
testLength
=
NR_POLAR_PBCH_PAYLOAD_BITS
;
testLength
=
NR_POLAR_PBCH_PAYLOAD_BITS
;
coderLength
=
NR_POLAR_PBCH_E
;
coderLength
=
NR_POLAR_PBCH_E
;
aggregation_level
=
NR_POLAR_PBCH_AGGREGATION_LEVEL
;
}
else
if
(
polarMessageType
==
1
)
{
//DCI
}
else
if
(
polarMessageType
==
1
)
{
//DCI
//testLength = nr_get_dci_size(rel15->dci_format, rel15->rnti_type, &fp->initial_bwp_params_ul ,cfg);
//testLength = nr_get_dci_size(params_rel15->dci_format, params_rel15->rnti_type, &fp->initial_bwp_dl, cfg);
//coderLength = ;
testLength
=
20
;
coderLength
=
108
;
//to be changed by aggregate level function.
}
else
if
(
polarMessageType
==
-
1
)
{
//UCI
}
else
if
(
polarMessageType
==
-
1
)
{
//UCI
//testLength = ;
//testLength = ;
//coderLength = ;
//coderLength = ;
...
@@ -112,16 +124,8 @@ int main(int argc, char *argv[]) {
...
@@ -112,16 +124,8 @@ int main(int argc, char *argv[]) {
uint8_t
*
estimatedOutput
=
malloc
(
sizeof
(
uint8_t
)
*
testLength
);
//decoder output
uint8_t
*
estimatedOutput
=
malloc
(
sizeof
(
uint8_t
)
*
testLength
);
//decoder output
t_nrPolar_paramsPtr
nrPolar_params
=
NULL
;
t_nrPolar_paramsPtr
nrPolar_params
=
NULL
;
nr_polar_init
(
&
nrPolar_params
,
polarMessageType
,
testLength
);
nr_polar_init
(
&
nrPolar_params
,
polarMessageType
,
testLength
,
aggregation_level
);
t_nrPolar_paramsPtr
currentPtr
=
nr_polar_params
(
nrPolar_params
,
polarMessageType
,
testLength
);
t_nrPolar_paramsPtr
currentPtr
=
nrPolar_params
;
while
(
currentPtr
!=
NULL
)
{
if
(
currentPtr
->
idx
==
(
polarMessageType
*
testLength
))
{
break
;
}
else
{
currentPtr
=
currentPtr
->
nextPtr
;
}
}
// We assume no a priori knowledge available about the payload.
// We assume no a priori knowledge available about the payload.
double
aPrioriArray
[
currentPtr
->
payloadBits
];
double
aPrioriArray
[
currentPtr
->
payloadBits
];
...
...
openair1/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c
View file @
56448ab7
...
@@ -21,17 +21,29 @@
...
@@ -21,17 +21,29 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
void
nr_byte2bit
(
uint8_t
*
array
,
uint8_t
arraySize
,
uint8_t
*
bitArray
){
//First 2 parameters are in bytes.
void
nr_byte2bit_uint8
(
uint8_t
*
array
,
uint8_t
arraySize
,
uint8_t
*
bitArray
)
{
//First 2 parameters are in bytes.
for
(
int
i
=
0
;
i
<
arraySize
;
i
++
)
{
for
(
int
i
=
0
;
i
<
arraySize
;
i
++
)
{
bitArray
[(
7
+
(
i
*
8
))]
=
(
array
[
i
]
>>
0
&
0x01
);
bitArray
[(
7
+
(
i
*
8
))]
=
(
array
[
i
]
>>
0
&
0x01
);
bitArray
[(
6
+
(
i
*
8
))]
=
(
array
[
i
]
>>
1
&
0x01
);
bitArray
[(
6
+
(
i
*
8
))]
=
(
array
[
i
]
>>
1
&
0x01
);
bitArray
[(
5
+
(
i
*
8
))]
=
(
array
[
i
]
>>
2
&
0x01
);
bitArray
[(
5
+
(
i
*
8
))]
=
(
array
[
i
]
>>
2
&
0x01
);
bitArray
[(
4
+
(
i
*
8
))]
=
(
array
[
i
]
>>
3
&
0x01
);
bitArray
[(
4
+
(
i
*
8
))]
=
(
array
[
i
]
>>
3
&
0x01
);
bitArray
[(
3
+
(
i
*
8
))]
=
(
array
[
i
]
>>
4
&
0x01
);
bitArray
[(
3
+
(
i
*
8
))]
=
(
array
[
i
]
>>
4
&
0x01
);
bitArray
[(
2
+
(
i
*
8
))]
=
(
array
[
i
]
>>
5
&
0x01
);
bitArray
[(
2
+
(
i
*
8
))]
=
(
array
[
i
]
>>
5
&
0x01
);
bitArray
[(
1
+
(
i
*
8
))]
=
(
array
[
i
]
>>
6
&
0x01
);
bitArray
[(
1
+
(
i
*
8
))]
=
(
array
[
i
]
>>
6
&
0x01
);
bitArray
[
(
i
*
8
)
]
=
(
array
[
i
]
>>
7
&
0x01
);
bitArray
[
(
i
*
8
)]
=
(
array
[
i
]
>>
7
&
0x01
);
}
}
}
void
nr_bit2byte
(
uint32_t
*
in
,
uint16_t
arraySize
,
uint8_t
*
out
)
{
for
(
int
i
=
0
;
i
<
arraySize
;
i
++
)
{
out
[
i
]
=
((
*
in
)
>>
i
)
&
1
;
}
}
void
nr_byte2bit
(
uint8_t
*
in
,
uint16_t
arraySize
,
uint32_t
*
out
)
{
for
(
int
i
=
0
;
i
<
arraySize
;
i
++
)
{
*
out
=
(
*
out
)
<<
i
|
in
[
i
];
}
}
}
openair1/PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h
View file @
56448ab7
...
@@ -33,10 +33,14 @@
...
@@ -33,10 +33,14 @@
#ifndef __NR_POLAR_DCI_DEFS__H__
#ifndef __NR_POLAR_DCI_DEFS__H__
#define __NR_POLAR_DCI_DEFS__H__
#define __NR_POLAR_DCI_DEFS__H__
#define NR_POLAR_DCI_MESSAGE_TYPE 1 //int8_t
#define NR_POLAR_DCI_CRC_PARITY_BITS 24
#define NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS 3
//Sec. 7.3.3: Channel Coding
//Sec. 7.3.3: Channel Coding
#define NR_POLAR_DCI_N_MAX 9 //uint8_t
#define NR_POLAR_DCI_N_MAX 9 //uint8_t
#define NR_POLAR_DCI_I_IL 1 //uint8_t
#define NR_POLAR_DCI_I_IL 1 //uint8_t
//
#define NR_POLAR_DCI_I_SEG 0 //uint8_t
#define NR_POLAR_DCI_I_SEG 0 //uint8_t
#define NR_POLAR_DCI_N_PC 0 //uint8_t
#define NR_POLAR_DCI_N_PC 0 //uint8_t
#define NR_POLAR_DCI_N_PC_WM 0 //uint8_t
#define NR_POLAR_DCI_N_PC_WM 0 //uint8_t
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
56448ab7
...
@@ -28,6 +28,10 @@
...
@@ -28,6 +28,10 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
static
const
uint8_t
nr_polar_subblock_interleaver_pattern
[
32
]
=
{
0
,
1
,
2
,
4
,
3
,
5
,
6
,
7
,
8
,
16
,
9
,
17
,
10
,
18
,
11
,
19
,
12
,
20
,
13
,
21
,
14
,
22
,
15
,
23
,
24
,
25
,
26
,
28
,
27
,
29
,
30
,
31
};
static
const
uint8_t
nr_polar_subblock_interleaver_pattern
[
32
]
=
{
0
,
1
,
2
,
4
,
3
,
5
,
6
,
7
,
8
,
16
,
9
,
17
,
10
,
18
,
11
,
19
,
12
,
20
,
13
,
21
,
14
,
22
,
15
,
23
,
24
,
25
,
26
,
28
,
27
,
29
,
30
,
31
};
struct
nrPolar_params
{
struct
nrPolar_params
{
...
@@ -76,7 +80,14 @@ void polar_encoder(uint8_t *input, uint8_t *output, t_nrPolar_paramsPtr polarPar
...
@@ -76,7 +80,14 @@ void polar_encoder(uint8_t *input, uint8_t *output, t_nrPolar_paramsPtr polarPar
int8_t
polar_decoder
(
double
*
input
,
uint8_t
*
output
,
t_nrPolar_paramsPtr
polarParams
,
int8_t
polar_decoder
(
double
*
input
,
uint8_t
*
output
,
t_nrPolar_paramsPtr
polarParams
,
uint8_t
listSize
,
double
*
aPrioriPayload
,
uint8_t
pathMetricAppr
);
uint8_t
listSize
,
double
*
aPrioriPayload
,
uint8_t
pathMetricAppr
);
void
nr_polar_init
(
t_nrPolar_paramsPtr
*
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
);
void
nr_polar_init
(
t_nrPolar_paramsPtr
*
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
,
uint8_t
aggregation_level
);
void
nr_polar_print_polarParams
(
t_nrPolar_paramsPtr
polarParams
);
t_nrPolar_paramsPtr
nr_polar_params
(
t_nrPolar_paramsPtr
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
);
uint8_t
**
nr_polar_kronecker_power_matrices
(
uint8_t
n
);
uint8_t
**
nr_polar_kronecker_power_matrices
(
uint8_t
n
);
...
@@ -102,7 +113,9 @@ void nr_polar_info_bit_pattern(uint8_t *ibp, int16_t *Q_I_N, int16_t *Q_F_N,
...
@@ -102,7 +113,9 @@ void nr_polar_info_bit_pattern(uint8_t *ibp, int16_t *Q_I_N, int16_t *Q_F_N,
void
nr_polar_info_bit_extraction
(
uint8_t
*
input
,
uint8_t
*
output
,
void
nr_polar_info_bit_extraction
(
uint8_t
*
input
,
uint8_t
*
output
,
uint8_t
*
pattern
,
uint16_t
size
);
uint8_t
*
pattern
,
uint16_t
size
);
void
nr_byte2bit
(
uint8_t
*
array
,
uint8_t
arraySize
,
uint8_t
*
bitArray
);
void
nr_byte2bit
(
uint8_t
*
in
,
uint16_t
arraySize
,
uint32_t
*
out
);
void
nr_byte2bit_uint8
(
uint8_t
*
array
,
uint8_t
arraySize
,
uint8_t
*
bitArray
);
void
nr_bit2byte
(
uint32_t
*
in
,
uint16_t
arraySize
,
uint8_t
*
out
);
void
nr_polar_bit_insertion
(
uint8_t
*
input
,
uint8_t
*
output
,
uint16_t
N
,
void
nr_polar_bit_insertion
(
uint8_t
*
input
,
uint8_t
*
output
,
uint16_t
N
,
uint16_t
K
,
int16_t
*
Q_I_N
,
int16_t
*
Q_PC_N
,
uint8_t
n_PC
);
uint16_t
K
,
int16_t
*
Q_I_N
,
int16_t
*
Q_PC_N
,
uint8_t
n_PC
);
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
56448ab7
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
*/
*/
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
void
polar_encoder
(
void
polar_encoder
(
uint8_t
*
input
,
uint8_t
*
input
,
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h
View file @
56448ab7
...
@@ -33,7 +33,9 @@
...
@@ -33,7 +33,9 @@
#ifndef __NR_POLAR_PBCH_DEFS__H__
#ifndef __NR_POLAR_PBCH_DEFS__H__
#define __NR_POLAR_PBCH_DEFS__H__
#define __NR_POLAR_PBCH_DEFS__H__
#define NR_POLAR_PBCH_PAYLOAD_BITS 32 //uint16_t
#define NR_POLAR_PBCH_AGGREGATION_LEVEL 0 //uint8_t
#define NR_POLAR_PBCH_MESSAGE_TYPE 0 //int8_t
#define NR_POLAR_PBCH_PAYLOAD_BITS 32 //uint16_t
#define NR_POLAR_PBCH_CRC_PARITY_BITS 24
#define NR_POLAR_PBCH_CRC_PARITY_BITS 24
#define NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS 3
#define NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS 3
//Assumed 3 by 3GPP when NR_POLAR_PBCH_L>8 to meet false alarm rate requirements.
//Assumed 3 by 3GPP when NR_POLAR_PBCH_L>8 to meet false alarm rate requirements.
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
View file @
56448ab7
...
@@ -33,4 +33,7 @@
...
@@ -33,4 +33,7 @@
#ifndef __NR_POLAR_UCI_DEFS__H__
#ifndef __NR_POLAR_UCI_DEFS__H__
#define __NR_POLAR_UCI_DEFS__H__
#define __NR_POLAR_UCI_DEFS__H__
#define NR_POLAR_UCI_MESSAGE_TYPE -1 //int8_t
#define NR_POLAR_UCI_CRC_ERROR_CORRECTION_BITS 3
#endif
#endif
openair1/PHY/CODING/nr_polar_init.c
View file @
56448ab7
...
@@ -20,13 +20,16 @@
...
@@ -20,13 +20,16 @@
*/
*/
#include "nrPolar_tools/nr_polar_defs.h"
#include "nrPolar_tools/nr_polar_defs.h"
#include "nrPolar_tools/nr_polar_pbch_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "PHY/NR_TRANSPORT/nr_dci.h"
#include "PHY/NR_TRANSPORT/nr_dci.h"
void
nr_polar_init
(
t_nrPolar_paramsPtr
*
polarParams
,
void
nr_polar_init
(
t_nrPolar_paramsPtr
*
polarParams
,
int8_t
messageType
,
int8_t
messageType
,
uint16_t
messageLength
)
{
uint16_t
messageLength
,
uint8_t
aggregation_level
)
{
t_nrPolar_paramsPtr
currentPtr
=
*
polarParams
;
t_nrPolar_paramsPtr
currentPtr
=
*
polarParams
;
t_nrPolar_paramsPtr
previousPtr
=
NULL
;
t_nrPolar_paramsPtr
previousPtr
=
NULL
;
...
@@ -55,35 +58,45 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
...
@@ -55,35 +58,45 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
newPolarInitNode
->
n_pc
=
NR_POLAR_PBCH_N_PC
;
newPolarInitNode
->
n_pc
=
NR_POLAR_PBCH_N_PC
;
newPolarInitNode
->
n_pc_wm
=
NR_POLAR_PBCH_N_PC_WM
;
newPolarInitNode
->
n_pc_wm
=
NR_POLAR_PBCH_N_PC_WM
;
newPolarInitNode
->
i_bil
=
NR_POLAR_PBCH_I_BIL
;
newPolarInitNode
->
i_bil
=
NR_POLAR_PBCH_I_BIL
;
newPolarInitNode
->
crcParityBits
=
NR_POLAR_PBCH_CRC_PARITY_BITS
;
newPolarInitNode
->
payloadBits
=
NR_POLAR_PBCH_PAYLOAD_BITS
;
newPolarInitNode
->
payloadBits
=
NR_POLAR_PBCH_PAYLOAD_BITS
;
newPolarInitNode
->
encoderLength
=
NR_POLAR_PBCH_E
;
newPolarInitNode
->
encoderLength
=
NR_POLAR_PBCH_E
;
newPolarInitNode
->
crcParityBits
=
NR_POLAR_PBCH_CRC_PARITY_BITS
;
newPolarInitNode
->
crcCorrectionBits
=
NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS
;
newPolarInitNode
->
crcCorrectionBits
=
NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS
;
newPolarInitNode
->
K
=
newPolarInitNode
->
payloadBits
+
newPolarInitNode
->
crcParityBits
;
// Number of bits to encode.
newPolarInitNode
->
N
=
nr_polar_output_length
(
newPolarInitNode
->
K
,
newPolarInitNode
->
encoderLength
,
newPolarInitNode
->
n_max
);
newPolarInitNode
->
n
=
log2
(
newPolarInitNode
->
N
);
newPolarInitNode
->
crc_generator_matrix
=
crc24c_generator_matrix
(
newPolarInitNode
->
payloadBits
);
newPolarInitNode
->
G_N
=
nr_polar_kronecker_power_matrices
(
newPolarInitNode
->
n
);
//polar_encoder vectors:
newPolarInitNode
->
nr_polar_crc
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
crcParityBits
);
newPolarInitNode
->
nr_polar_cPrime
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
newPolarInitNode
->
nr_polar_d
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
N
);
//Polar Coding vectors
newPolarInitNode
->
nr_polar_u
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
N
);
//Decoder: nr_polar_uHat
newPolarInitNode
->
nr_polar_cPrime
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
//Decoder: nr_polar_cHat
newPolarInitNode
->
nr_polar_b
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
//Decoder: nr_polar_bHat
}
else
if
(
messageType
==
1
)
{
//DCI
}
else
if
(
messageType
==
1
)
{
//DCI
newPolarInitNode
->
n_max
=
NR_POLAR_DCI_N_MAX
;
newPolarInitNode
->
i_il
=
NR_POLAR_DCI_I_IL
;
newPolarInitNode
->
i_seg
=
NR_POLAR_DCI_I_SEG
;
newPolarInitNode
->
n_pc
=
NR_POLAR_DCI_N_PC
;
newPolarInitNode
->
n_pc_wm
=
NR_POLAR_DCI_N_PC_WM
;
newPolarInitNode
->
i_bil
=
NR_POLAR_DCI_I_BIL
;
newPolarInitNode
->
crcParityBits
=
NR_POLAR_DCI_CRC_PARITY_BITS
;
newPolarInitNode
->
payloadBits
=
messageLength
;
newPolarInitNode
->
encoderLength
=
aggregation_level
*
108
;
newPolarInitNode
->
crcCorrectionBits
=
NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS
;
}
else
if
(
messageType
==
-
1
)
{
//UCI
}
else
if
(
messageType
==
-
1
)
{
//UCI
}
else
{
}
else
{
AssertFatal
(
1
==
0
,
"[nr_polar_init] Incorrect Message Type(%d)"
,
messageType
);
AssertFatal
(
1
==
0
,
"[nr_polar_init] Incorrect Message Type(%d)"
,
messageType
);
}
}
newPolarInitNode
->
K
=
newPolarInitNode
->
payloadBits
+
newPolarInitNode
->
crcParityBits
;
// Number of bits to encode.
newPolarInitNode
->
N
=
nr_polar_output_length
(
newPolarInitNode
->
K
,
newPolarInitNode
->
encoderLength
,
newPolarInitNode
->
n_max
);
newPolarInitNode
->
n
=
log2
(
newPolarInitNode
->
N
);
newPolarInitNode
->
crc_generator_matrix
=
crc24c_generator_matrix
(
newPolarInitNode
->
payloadBits
);
newPolarInitNode
->
G_N
=
nr_polar_kronecker_power_matrices
(
newPolarInitNode
->
n
);
//polar_encoder vectors:
newPolarInitNode
->
nr_polar_crc
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
crcParityBits
);
newPolarInitNode
->
nr_polar_cPrime
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
newPolarInitNode
->
nr_polar_d
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
N
);
//Polar Coding vectors
newPolarInitNode
->
nr_polar_u
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
N
);
//Decoder: nr_polar_uHat
newPolarInitNode
->
nr_polar_cPrime
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
//Decoder: nr_polar_cHat
newPolarInitNode
->
nr_polar_b
=
malloc
(
sizeof
(
uint8_t
)
*
newPolarInitNode
->
K
);
//Decoder: nr_polar_bHat
newPolarInitNode
->
Q_0_Nminus1
=
nr_polar_sequence_pattern
(
newPolarInitNode
->
n
);
newPolarInitNode
->
Q_0_Nminus1
=
nr_polar_sequence_pattern
(
newPolarInitNode
->
n
);
newPolarInitNode
->
interleaving_pattern
=
malloc
(
sizeof
(
uint16_t
)
*
newPolarInitNode
->
K
);
newPolarInitNode
->
interleaving_pattern
=
malloc
(
sizeof
(
uint16_t
)
*
newPolarInitNode
->
K
);
...
@@ -141,3 +154,35 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
...
@@ -141,3 +154,35 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
currentPtr
->
nextPtr
=
newPolarInitNode
;
currentPtr
->
nextPtr
=
newPolarInitNode
;
return
;
return
;
}
}
void
nr_polar_print_polarParams
(
t_nrPolar_paramsPtr
polarParams
)
{
uint8_t
i
=
0
;
if
(
polarParams
==
NULL
)
{
printf
(
"polarParams is empty.
\n
"
);
}
else
{
while
(
polarParams
!=
NULL
){
printf
(
"polarParams[%d] = %d
\n
"
,
i
,
polarParams
->
idx
);
polarParams
=
polarParams
->
nextPtr
;
i
++
;
}
}
return
;
}
t_nrPolar_paramsPtr
nr_polar_params
(
t_nrPolar_paramsPtr
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
)
{
t_nrPolar_paramsPtr
currentPtr
;
while
(
polarParams
!=
NULL
)
{
if
(
polarParams
->
idx
==
(
messageType
*
messageLength
))
{
currentPtr
=
polarParams
;
break
;
}
else
{
polarParams
=
polarParams
->
nextPtr
;
}
}
return
currentPtr
;
}
openair1/PHY/INIT/nr_init.c
View file @
56448ab7
...
@@ -119,7 +119,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
...
@@ -119,7 +119,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
// PBCH DMRS gold sequences generation
// PBCH DMRS gold sequences generation
nr_init_pbch_dmrs
(
gNB
);
nr_init_pbch_dmrs
(
gNB
);
// Polar encoder init for PBCH
// Polar encoder init for PBCH
nr_polar_init
(
&
fp
->
pbch_polar_params
,
1
,
NR_POLAR_PBCH_PAYLOAD_BITS
);
nr_polar_init
(
&
fp
->
pbch_polar_params
,
NR_POLAR_PBCH_MESSAGE_TYPE
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
NR_POLAR_PBCH_AGGREGATION_LEVEL
);
//PDCCH DMRS init
//PDCCH DMRS init
gNB
->
nr_gold_pdcch_dmrs
=
(
uint32_t
***
)
malloc16
(
fp
->
slots_per_frame
*
sizeof
(
uint32_t
**
));
gNB
->
nr_gold_pdcch_dmrs
=
(
uint32_t
***
)
malloc16
(
fp
->
slots_per_frame
*
sizeof
(
uint32_t
**
));
uint32_t
***
pdcch_dmrs
=
gNB
->
nr_gold_pdcch_dmrs
;
uint32_t
***
pdcch_dmrs
=
gNB
->
nr_gold_pdcch_dmrs
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.c
View file @
56448ab7
...
@@ -148,11 +148,12 @@ void nr_pdcch_scrambling(uint32_t *in,
...
@@ -148,11 +148,12 @@ void nr_pdcch_scrambling(uint32_t *in,
reset
=
0
;
reset
=
0
;
}
}
*
out
^=
(((
*
in
)
>>
i
)
&
1
)
^
((
s
>>
i
)
&
1
);
*
out
^=
(((
*
in
)
>>
i
)
&
1
)
^
((
s
>>
i
)
&
1
);
}
}
}
}
uint8_t
nr_generate_dci_top
(
NR_gNB_PDCCH
pdcch_vars
,
uint8_t
nr_generate_dci_top
(
NR_gNB_PDCCH
pdcch_vars
,
t_nrPolar_paramsPtr
*
nrPolar_params
,
uint32_t
*
gold_pdcch_dmrs
,
uint32_t
*
gold_pdcch_dmrs
,
int32_t
**
txdataF
,
int32_t
**
txdataF
,
int16_t
amp
,
int16_t
amp
,
...
@@ -187,13 +188,25 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
...
@@ -187,13 +188,25 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
}
}
/// DCI payload processing
/// DCI payload processing
//channel coding
//channel coding
uint8_t
*
encoderInput
=
malloc
(
sizeof
(
uint8_t
)
*
dci_alloc
.
size
);
nr_bit2byte
(
dci_alloc
.
dci_pdu
,
dci_alloc
.
size
,
encoderInput
);
nr_polar_init
(
&
nrPolar_params
,
NR_POLAR_DCI_MESSAGE_TYPE
,
dci_alloc
.
size
,
pdcch_params
.
aggregation_level
);
t_nrPolar_paramsPtr
currentPtr
=
nr_polar_params
(
nrPolar_params
,
NR_POLAR_DCI_MESSAGE_TYPE
,
dci_alloc
.
size
);
uint8_t
*
encoderOutput
=
malloc
(
sizeof
(
uint8_t
)
*
currentPtr
->
encoderLength
);
polar_encoder
(
encoderInput
,
encoderOutput
,
currentPtr
);
uint32_t
encoded_payload
[
4
];
nr_byte2bit
(
encoderOutput
,
currentPtr
->
encoderLength
,
encoded_payload
);
// scrambling
// scrambling
uint32_t
scrambled_payload
[
4
];
uint32_t
scrambled_payload
[
4
];
uint32_t
Nid
=
(
pdcch_params
.
search_space_type
==
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
)
?
pdcch_params
.
scrambling_id
:
config
.
sch_config
.
physical_cell_id
.
value
;
uint32_t
Nid
=
(
pdcch_params
.
search_space_type
==
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
)
?
pdcch_params
.
scrambling_id
:
config
.
sch_config
.
physical_cell_id
.
value
;
uint32_t
n_RNTI
=
(
pdcch_params
.
search_space_type
==
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
)
?
pdcch_params
.
rnti
:
0
;
uint32_t
n_RNTI
=
(
pdcch_params
.
search_space_type
==
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
)
?
pdcch_params
.
rnti
:
0
;
nr_pdcch_scrambling
(
dci_alloc
.
dci_pdu
,
dci_alloc
.
size
,
Nid
,
n_RNTI
,
scrambled_payload
);
nr_pdcch_scrambling
(
encoded_payload
,
dci_alloc
.
size
,
Nid
,
n_RNTI
,
scrambled_payload
);
// QPSK modulation
// QPSK modulation
uint32_t
mod_dci
[
NR_MAX_DCI_SIZE
>>
1
];
uint32_t
mod_dci
[
NR_MAX_DCI_SIZE
>>
1
];
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.h
View file @
56448ab7
...
@@ -33,6 +33,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
...
@@ -33,6 +33,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
nfapi_nr_config_request_t
*
config
);
nfapi_nr_config_request_t
*
config
);
uint8_t
nr_generate_dci_top
(
NR_gNB_PDCCH
pdcch_vars
,
uint8_t
nr_generate_dci_top
(
NR_gNB_PDCCH
pdcch_vars
,
t_nrPolar_paramsPtr
*
nrPolar_params
,
uint32_t
*
gold_pdcch_dmrs
,
uint32_t
*
gold_pdcch_dmrs
,
int32_t
**
txdataF
,
int32_t
**
txdataF
,
int16_t
amp
,
int16_t
amp
,
...
...
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
View file @
56448ab7
...
@@ -43,11 +43,11 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
...
@@ -43,11 +43,11 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
uint32_t
*
dci_pdu
=
dci_alloc
->
dci_pdu
;
uint32_t
*
dci_pdu
=
dci_alloc
->
dci_pdu
;
nfapi_nr_dl_config_dci_dl_pdu_rel15_t
*
pdu_rel15
=
&
pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel15
;
nfapi_nr_dl_config_dci_dl_pdu_rel15_t
*
pdu_rel15
=
&
pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel15
;
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
params_rel15
=
&
pdu
->
dci_dl_pdu
.
pdcch_params_rel15
;
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
params_rel15
=
&
pdu
->
dci_dl_pdu
.
pdcch_params_rel15
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
uint16_t
N_RB
=
fp
->
initial_bwp_dl
.
N_RB
;
uint16_t
N_RB
=
fp
->
initial_bwp_dl
.
N_RB
;
uint8_t
fsize
=
0
;
uint8_t
fsize
=
0
;
/// Payload generation
/// Payload generation
switch
(
params_rel15
->
dci_format
)
{
switch
(
params_rel15
->
dci_format
)
{
...
@@ -68,7 +68,6 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
...
@@ -68,7 +68,6 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
// TB scaling
// TB scaling
for
(
int
i
=
0
;
i
<
2
;
i
++
)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
*
dci_pdu
|=
((
pdu_rel15
->
tb_scaling
>>
(
2
-
i
))
&
1
)
<<
i
;
*
dci_pdu
|=
((
pdu_rel15
->
tb_scaling
>>
(
2
-
i
))
&
1
)
<<
i
;
break
;
break
;
}
}
...
...
openair1/PHY/defs_gNB.h
View file @
56448ab7
...
@@ -48,7 +48,7 @@ typedef struct {
...
@@ -48,7 +48,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
/// Length of DCI payload in bits
/// Length of DCI payload in bits
uint
8
_t
size
;
uint
16
_t
size
;
/// Aggregation level
/// Aggregation level
uint8_t
L
;
uint8_t
L
;
/// PDCCH parameters
/// PDCCH parameters
...
@@ -462,6 +462,8 @@ typedef struct PHY_VARS_gNB_s {
...
@@ -462,6 +462,8 @@ typedef struct PHY_VARS_gNB_s {
int32_t
pusch_stats_mcs
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_mcs
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_bsr
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_bsr
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_BO
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_BO
[
NUMBER_OF_UE_MAX
][
10240
];
t_nrPolar_paramsPtr
nrPolar_params
;
}
PHY_VARS_gNB
;
}
PHY_VARS_gNB
;
#endif
#endif
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
56448ab7
...
@@ -151,8 +151,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
...
@@ -151,8 +151,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
}
}
void
phy_procedures_gNB_TX
(
PHY_VARS_gNB
*
gNB
,
void
phy_procedures_gNB_TX
(
PHY_VARS_gNB
*
gNB
,
gNB_rxtx_proc_t
*
proc
,
gNB_rxtx_proc_t
*
proc
,
int
do_meas
)
int
do_meas
)
{
{
int
aa
;
int
aa
;
int
frame
=
proc
->
frame_tx
;
int
frame
=
proc
->
frame_tx
;
...
@@ -188,6 +188,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
...
@@ -188,6 +188,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if
(
nfapi_mode
==
0
||
nfapi_mode
==
1
)
if
(
nfapi_mode
==
0
||
nfapi_mode
==
1
)
nr_generate_dci_top
(
gNB
->
pdcch_vars
,
nr_generate_dci_top
(
gNB
->
pdcch_vars
,
&
gNB
->
nrPolar_params
,
gNB
->
nr_gold_pdcch_dmrs
[
0
][
0
],
gNB
->
nr_gold_pdcch_dmrs
[
0
][
0
],
gNB
->
common_vars
.
txdataF
,
gNB
->
common_vars
.
txdataF
,
AMP
,
*
fp
,
*
cfg
);
AMP
,
*
fp
,
*
cfg
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
56448ab7
...
@@ -81,6 +81,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
...
@@ -81,6 +81,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
params_rel15
->
rnti
=
0x03
;
params_rel15
->
rnti
=
0x03
;
params_rel15
->
rnti_type
=
NFAPI_NR_RNTI_RA
;
params_rel15
->
rnti_type
=
NFAPI_NR_RNTI_RA
;
params_rel15
->
dci_format
=
NFAPI_NR_DL_DCI_FORMAT_1_0
;
params_rel15
->
dci_format
=
NFAPI_NR_DL_DCI_FORMAT_1_0
;
params_rel15
->
aggregation_level
=
1
;
LOG_I
(
MAC
,
"DCI type 1 params: rmsi_pdcch_config %d, rnti %d, rnti_type %d, dci_format %d
\n
\
LOG_I
(
MAC
,
"DCI type 1 params: rmsi_pdcch_config %d, rnti %d, rnti_type %d, dci_format %d
\n
\
coreset params: mux_pattern %d, n_rb %d, n_symb %d, rb_offset %d
\n
\
coreset params: mux_pattern %d, n_rb %d, n_symb %d, rb_offset %d
\n
\
ss params : nb_ss_sets_per_slot %d, first symb %d, nb_slots %d, sfn_mod2 %d, first slot %d
\n
"
,
ss params : nb_ss_sets_per_slot %d, first symb %d, nb_slots %d, sfn_mod2 %d, first slot %d
\n
"
,
...
...
targets/RT/USER/nr-gnb.c
View file @
56448ab7
...
@@ -916,7 +916,10 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
...
@@ -916,7 +916,10 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
gNB
=
RC
.
gNB
[
inst
][
CC_id
];
gNB
=
RC
.
gNB
[
inst
][
CC_id
];
gNB
->
abstraction_flag
=
0
;
gNB
->
abstraction_flag
=
0
;
gNB
->
single_thread_flag
=
single_thread_flag
;
gNB
->
single_thread_flag
=
single_thread_flag
;
nr_polar_init
(
&
gNB
->
nrPolar_params
,
NR_POLAR_PBCH_MESSAGE_TYPE
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
NR_POLAR_PBCH_AGGREGATION_LEVEL
);
LOG_I
(
PHY
,
"Initializing gNB %d CC_id %d single_thread_flag:%d
\n
"
,
inst
,
CC_id
,
single_thread_flag
);
LOG_I
(
PHY
,
"Initializing gNB %d CC_id %d single_thread_flag:%d
\n
"
,
inst
,
CC_id
,
single_thread_flag
);
#ifndef OCP_FRAMEWORK
#ifndef OCP_FRAMEWORK
...
...
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