Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
8e891f7b
Commit
8e891f7b
authored
Feb 15, 2019
by
yilmazt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warning removals and first update of small block coding
parent
9f8a9df3
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
263 additions
and
178 deletions
+263
-178
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
+1
-1
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
+1
-1
openair1/PHY/CODING/TESTBENCH/polartest.c
openair1/PHY/CODING/TESTBENCH/polartest.c
+111
-13
openair1/PHY/CODING/coding_defs.h
openair1/PHY/CODING/coding_defs.h
+2
-0
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+1
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+1
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+76
-63
openair1/PHY/CODING/nrSmallBlock/encodeSmall.c
openair1/PHY/CODING/nrSmallBlock/encodeSmall.c
+0
-0
openair1/PHY/CODING/nr_rate_matching.c
openair1/PHY/CODING/nr_rate_matching.c
+1
-0
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+1
-1
openair1/SCHED_NR_UE/pucch_power_control_ue_nr.c
openair1/SCHED_NR_UE/pucch_power_control_ue_nr.c
+2
-0
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
+6
-53
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+7
-11
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+23
-26
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+7
-6
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+22
-0
No files found.
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
View file @
8e891f7b
...
...
@@ -583,7 +583,7 @@ typedef struct {
}
nfapi_pnf_phy_rf_config_t
;
#define NFAPI_PNF_PHY_RF_TAG 0x1003
// Generic struc
ut
re for single tlv value.
// Generic struc
tu
re for single tlv value.
typedef
struct
{
nfapi_tl_t
tl
;
uint16_t
value
;
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
View file @
8e891f7b
...
...
@@ -72,7 +72,7 @@ typedef struct
// These TLVs are used by the VNF to configure the RF in the PNF
// nfapi_uint16_tlv_t max_transmit_power;
nfapi_uint
16
_tlv_t
nrarfcn
;
nfapi_uint
32
_tlv_t
nrarfcn
;
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
...
...
openair1/PHY/CODING/TESTBENCH/polartest.c
View file @
8e891f7b
...
...
@@ -11,10 +11,36 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/coding_defs.h"
#include "SIMULATION/TOOLS/sim.h"
//#include "PHY/NR_TRANSPORT/nr_transport.h"
//#include "common/utils/LOG/log.h"
//#define DEBUG_DCI_POLAR_PARAMS
//#define DEBUG_POLAR_TIMING
//#define DEBUG_CRC
//#define DEBUG_POLARTEST
uint8_t
nr_pbch_payload_interleaving_pattern
[
32
]
=
{
16
,
23
,
18
,
17
,
8
,
30
,
10
,
6
,
24
,
7
,
0
,
5
,
3
,
2
,
1
,
4
,
9
,
11
,
12
,
13
,
14
,
15
,
19
,
20
,
21
,
22
,
25
,
26
,
27
,
28
,
29
,
31
};
void
nr_init_pbch_interleaver
(
uint8_t
*
interleaver
)
{
uint8_t
j_sfn
=
0
,
j_hrf
=
10
,
j_ssb
=
11
,
j_other
=
14
;
memset
((
void
*
)
interleaver
,
0
,
NR_POLAR_PBCH_PAYLOAD_BITS
);
for
(
uint8_t
i
=
0
;
i
<
NR_POLAR_PBCH_PAYLOAD_BITS
;
i
++
)
if
(
!
i
)
// choice bit:1
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_other
++
);
else
if
(
i
<
7
)
//Sfn bits:6
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_sfn
++
);
else
if
(
i
<
24
)
// other:17
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_other
++
);
else
if
(
i
<
28
)
// Sfn:4
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_sfn
++
);
else
if
(
i
==
28
)
// Hrf bit:1
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_hrf
);
else
// Ssb bits:3
*
(
interleaver
+
i
)
=
*
(
nr_pbch_payload_interleaving_pattern
+
j_ssb
++
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -37,9 +63,9 @@ int main(int argc, char *argv[]) {
uint32_t
decoderState
=
0
,
blockErrorState
=
0
;
//0 = Success, -1 = Decoding failed, 1 = Block Error.
uint16_t
testLength
=
0
,
coderLength
=
0
,
blockErrorCumulative
=
0
,
bitErrorCumulative
=
0
;
double
timeEncoderCumulative
=
0
,
timeDecoderCumulative
=
0
;
uint8_t
aggregation_level
=
8
,
decoderListSize
=
8
,
pathMetricAppr
=
0
;
uint8_t
aggregation_level
=
8
,
decoderListSize
=
8
,
pathMetricAppr
=
0
,
matlabDebug
=
0
;
while
((
arguments
=
getopt
(
argc
,
argv
,
"s:d:f:
m:i:l:a:hqg
"
))
!=
-
1
)
while
((
arguments
=
getopt
(
argc
,
argv
,
"s:d:f:
c:i:l:a:hqgm
"
))
!=
-
1
)
switch
(
arguments
)
{
case
's'
:
...
...
@@ -54,7 +80,7 @@ int main(int argc, char *argv[]) {
SNRstop
=
atof
(
optarg
);
break
;
case
'
m
'
:
case
'
c
'
:
polarMessageType
=
atoi
(
optarg
);
break
;
...
...
@@ -74,6 +100,11 @@ int main(int argc, char *argv[]) {
decoder_int16
=
1
;
break
;
case
'm'
:
matlabDebug
=
1
;
//#define DEBUG_POLAR_MATLAB
break
;
case
'g'
:
iterations
=
1
;
SNRstart
=
-
6
.
0
;
...
...
@@ -82,7 +113,7 @@ int main(int argc, char *argv[]) {
break
;
case
'h'
:
printf
(
"./polartest -s SNRstart -d SNRinc -f SNRstop -
m [0=PBCH|1=DCI|2=UCI] -i iterations -l decoderListSize -a pathMetricAppr
\n
"
);
printf
(
"./polartest -s SNRstart -d SNRinc -f SNRstop -
c [0=PBCH|1=DCI|2=UCI] -i iterations -l decoderListSize -a pathMetricAppr -m Matlab Debug
\n
"
);
exit
(
-
1
);
default:
...
...
@@ -91,7 +122,7 @@ int main(int argc, char *argv[]) {
}
if
(
polarMessageType
==
0
)
{
//PBCH
testLength
=
64
;
//
NR_POLAR_PBCH_PAYLOAD_BITS;
testLength
=
NR_POLAR_PBCH_PAYLOAD_BITS
;
coderLength
=
NR_POLAR_PBCH_E
;
aggregation_level
=
NR_POLAR_PBCH_AGGREGATION_LEVEL
;
}
else
if
(
polarMessageType
==
1
)
{
//DCI
...
...
@@ -320,20 +351,87 @@ int main(int argc, char *argv[]) {
testInput
[
i
]
|=
(
((
uint32_t
)
(
rand
()
%
2
))
&
1
);
}
/*printf("testInput: [0]->0x%08x\n", testInput[0]);
for (int i=0; i<32; i++)
printf("%d\n",(testInput[0]>>i)&1);*/
#ifdef DEBUG_POLARTEST
printf
(
"testInput: "
);
for
(
int
i
=
0
;
i
<
testArrayLength
;
i
++
)
printf
(
"[%d]->0x%08x
\t
"
,
i
,
testInput
[
i
]);
printf
(
"
\n
"
);
printf
(
"testInput[0]: "
);
for
(
int
i
=
0
;
i
<
32
;
i
++
)
printf
(
"[%d]=%d-"
,
i
,(
testInput
[
0
]
>>
i
)
&
1
);
printf
(
"
\n
"
);
printf
(
"testInput[1]: "
);
for
(
int
i
=
0
;
i
<
32
;
i
++
)
printf
(
"[%d]=%d-"
,
i
,(
testInput
[
1
]
>>
i
)
&
1
);
printf
(
"
\n
"
);
#endif
int
len_mod64
=
currentPtr
->
payloadBits
&
63
;
((
uint64_t
*
)
testInput
)[
currentPtr
->
payloadBits
/
64
]
&=
((((
uint64_t
)
1
)
<<
len_mod64
)
-
1
);
#ifdef DEBUG_POLARTEST
printf
(
"testInput: "
);
for
(
int
i
=
0
;
i
<
testArrayLength
;
i
++
)
printf
(
"[%d]->0x%08x
\t
"
,
i
,
testInput
[
i
]);
printf
(
"
\n
"
);
printf
(
"testInput[0]: "
);
for
(
int
i
=
0
;
i
<
32
;
i
++
)
printf
(
"[%d]=%d-"
,
i
,(
testInput
[
0
]
>>
i
)
&
1
);
printf
(
"
\n
"
);
printf
(
"testInput[1]: "
);
for
(
int
i
=
0
;
i
<
32
;
i
++
)
printf
(
"[%d]=%d-"
,
i
,(
testInput
[
1
]
>>
i
)
&
1
);
printf
(
"
\n
"
);
#endif
if
(
matlabDebug
==
1
){
memset
(
testInput
,
0
,
sizeof
(
uint32_t
)
*
testArrayLength
);
/*testInput[0] |= ((uint32_t)1 << 31); testInput[0] |= ((uint32_t)1 << 28); testInput[0] |= ((uint32_t)1 << 26);
testInput[0] |= ((uint32_t)1 << 25); testInput[0] |= ((uint32_t)1 << 22); testInput[0] |= ((uint32_t)1 << 21);
testInput[0] |= ((uint32_t)1 << 19); testInput[0] |= ((uint32_t)1 << 17); testInput[0] |= ((uint32_t)1 << 15);
testInput[0] |= ((uint32_t)1 << 14); testInput[0] |= ((uint32_t)1 << 12); testInput[0] |= ((uint32_t)1 << 10);
testInput[0] |= ((uint32_t)1 << 8); testInput[0] |= ((uint32_t)1 << 5); testInput[0] |= ((uint32_t)1 << 3);
testInput[0] |= ((uint32_t)1 << 2); testInput[0] |= ((uint32_t)1 << 1);*/
testInput
[
0
]
|=
((
uint32_t
)
1
<<
30
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
29
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
28
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
26
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
23
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
21
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
19
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
17
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
16
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
14
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
12
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
10
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
9
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
6
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
5
);
testInput
[
0
]
|=
((
uint32_t
)
1
<<
3
);
testInput
[
0
]
|=
((
uint32_t
)
1
);
/*printf("testInput (a_31,..., a_0): ");
for (int i=31; i>=0; i--) printf("%d-",(testInput[0]>>i)&1); //a_31, a_30, ..., a_0
printf("testInput = 0x%llx\n", testInput[0]);
printf("\n");*/
/*for (int i=0;i<32;i++){
memset(testInput,0,sizeof(uint32_t) * testArrayLength);
testInput[0] |= ((uint32_t)1 << i);
int crc = crc24c(testInput,32);
printf("[i=%d]testInput = 0x%08lx, crc = 0x%lx\n", i,testInput[0], crc);
}
memset(testInput,0,sizeof(uint32_t) * testArrayLength);
int crc = crc24c(testInput,32);
printf("testInput = 0x%08lx, crc = 0x%lx\n", testInput[0], crc);*/
}
uint8_t
nr_pbch_interleaver
[
NR_POLAR_PBCH_PAYLOAD_BITS
];
memset
((
void
*
)
nr_pbch_interleaver
,
0
,
NR_POLAR_PBCH_PAYLOAD_BITS
);
nr_init_pbch_interleaver
(
nr_pbch_interleaver
);
for
(
int
i
=
0
;
i
<=
31
;
i
++
)
printf
(
"nr_pbch_interleaver[%d]=%d
\n
"
,
i
,
nr_pbch_interleaver
[
i
]);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_PAYLOAD_BITS
;
i
++
)
printf
(
"nr_pbch_interleaver_operation[%d]=%d
\n
"
,
i
,(
*
(
nr_pbch_interleaver
+
i
)));
start_meas
(
&
timeEncoder
);
if
(
decoder_int16
==
0
)
polar_encoder
(
testInput
,
encoderOutput
,
currentPtr
);
if
(
decoder_int16
==
1
)
polar_encoder_fast
((
uint64_t
*
)
testInput
,
encoderOutput
,
0
,
currentPtr
);
else
polar_encoder
_fast
((
uint64_t
*
)
testInput
,
encoderOutput
,
0
,
currentPtr
);
polar_encoder
(
testInput
,
encoderOutput
,
currentPtr
);
//polar_encoder_fast((uint64_t*)testInput, (uint64_t*)encoderOutput,0, currentPtr);
stop_meas
(
&
timeEncoder
);
/*printf("encoderOutput: [0]->0x%08x\n", encoderOutput[0]);
...
...
openair1/PHY/CODING/coding_defs.h
View file @
8e891f7b
...
...
@@ -30,6 +30,8 @@
#include <stdint.h>
#include <PHY/defs_common.h>
typedef
unsigned
__int128
uint128_t
;
#define CRC24_A 0
#define CRC24_B 1
#define CRC16 2
...
...
openair1/PHY/CODING/crc_byte.c
View file @
8e891f7b
...
...
@@ -258,7 +258,7 @@ unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table
int
check_crc
(
uint8_t
*
decoded_bytes
,
uint32_t
n
,
uint32_t
F
,
uint8_t
crc_type
)
{
uint32_t
crc
=
0
,
oldcrc
=
0
;
uint8_t
crc_len
,
temp
;
uint8_t
crc_len
;
switch
(
crc_type
)
{
case
CRC24_A
:
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
8e891f7b
...
...
@@ -147,7 +147,7 @@ void polar_encoder_dci(uint32_t *in,
t_nrPolar_paramsPtr
polarParams
,
uint16_t
n_RNTI
);
void
polar_encoder_fast
(
uint64_t
*
A
,
void
polar_encoder_fast
(
uint64_t
*
A
prime
,
uint32_t
*
out
,
int32_t
crcmask
,
t_nrPolar_paramsPtr
polarParams
);
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
8e891f7b
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrSmallBlock/encodeSmall.c
0 → 100644
View file @
8e891f7b
openair1/PHY/CODING/nr_rate_matching.c
View file @
8e891f7b
...
...
@@ -26,6 +26,7 @@
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/CODING/coding_defs.h"
//#define RM_DEBUG 1
...
...
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
View file @
8e891f7b
...
...
@@ -703,7 +703,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
int
dlsch_encoding
(
PHY_VARS_eNB
*
eNB
,
unsigned
char
*
a
,
unsigned
char
*
a
,
uint8_t
num_pdcch_symbols
,
LTE_eNB_DLSCH_t
*
dlsch
,
int
frame
,
...
...
openair1/SCHED_NR_UE/pucch_power_control_ue_nr.c
View file @
8e891f7b
...
...
@@ -33,6 +33,8 @@
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#include "SCHED_NR_UE/pucch_power_control_ue_nr.h"
int16_t
get_PL
(
module_id_t
Mod_id
,
uint8_t
CC_id
,
uint8_t
eNB_index
);
/**************** defines **************************************/
/**************** variables **************************************/
...
...
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
View file @
8e891f7b
...
...
@@ -36,6 +36,7 @@
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/NR_UE_TRANSPORT/pucch_nr.h"
#ifndef NO_RAT_NR
...
...
@@ -51,57 +52,7 @@
int8_t
nr_ue_get_SR
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
uint8_t
eNB_id
,
uint16_t
rnti
,
sub_frame_t
subframe
);
uint8_t
is_cqi_TXOp
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
);
uint8_t
is_ri_TXOp
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
);
/*
void nr_generate_pucch0(int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
int16_t amp,
int nr_tti_tx,
uint8_t mcs,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB);
void nr_generate_pucch1(int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint64_t payload,
int16_t amp,
int nr_tti_tx,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB,
uint16_t startingPRB_intraSlotHopping,
uint8_t timeDomainOCC,
uint8_t nr_bit);
void nr_generate_pucch2(int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint64_t payload,
int16_t amp,
int nr_tti_tx,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint8_t nrofPRB,
uint16_t startingPRB,
uint8_t nr_bit);
void nr_generate_pucch3_4(int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
pucch_format_nr_t fmt,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint64_t payload,
int16_t amp,
int nr_tti_tx,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint8_t nrofPRB,
uint16_t startingPRB,
uint8_t nr_bit,
uint8_t occ_length_format4,
uint8_t occ_index_format4);
*/
/**************** variables **************************************/
...
...
@@ -556,7 +507,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
switch
(
format
)
{
case
pucch_format0_nr
:
{
nr_generate_pucch0
(
ue
,
ue
->
common_vars
.
txdataF
,
nr_generate_pucch0
(
ue
,
ue
->
common_vars
.
txdataF
,
&
ue
->
frame_parms
,
&
ue
->
pucch_config_dedicated_nr
[
gNB_id
],
tx_amp
,
...
...
@@ -570,7 +522,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
}
case
pucch_format1_nr
:
{
nr_generate_pucch1
(
ue
,
ue
->
common_vars
.
txdataF
,
nr_generate_pucch1
(
ue
,
ue
->
common_vars
.
txdataF
,
&
ue
->
frame_parms
,
&
ue
->
pucch_config_dedicated_nr
[
gNB_id
],
pucch_payload
,
...
...
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
8e891f7b
...
...
@@ -145,8 +145,7 @@ int main(int argc, char **argv) {
//uint16_t NB_RB=25;
SCM_t
channel_model
=
AWGN
;
//Rayleigh1_anticorr;
uint8_t
N_RB_DL
=
106
,
mu
=
1
;
unsigned
char
frame_type
=
0
;
unsigned
char
pbch_phase
=
0
;
unsigned
char
frame_type
=
0
,
pbch_phase
=
0
;
int
frame
=
0
,
subframe
=
0
;
int
frame_length_complex_samples
;
//int frame_length_complex_samples_no_prefix;
...
...
@@ -341,8 +340,8 @@ int main(int argc, char **argv) {
printf
(
"-x Transmission mode (1,2,6 for the moment)
\n
"
);
printf
(
"-y Number of TX antennas used in eNB
\n
"
);
printf
(
"-z Number of RX antennas used in UE
\n
"
);
printf
(
"-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1
\n
"
);
printf
(
"-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2
\n
"
);
printf
(
"-i Relative strength of first inte
r
fering eNB (in dB) - cell_id mod 3 = 1
\n
"
);
printf
(
"-j Relative strength of second inte
r
fering eNB (in dB) - cell_id mod 3 = 2
\n
"
);
printf
(
"-N Nid_cell
\n
"
);
printf
(
"-R N_RB_DL
\n
"
);
printf
(
"-O oversampling factor (1,2,4,8,16)
\n
"
);
...
...
@@ -482,13 +481,10 @@ int main(int argc, char **argv) {
short
*
channel_output_fixed
=
malloc16
(
sizeof
(
short
)
*
16
*
68
*
384
);
short
*
channel_output_uncoded
=
malloc16
(
sizeof
(
unsigned
short
)
*
16
*
68
*
384
);
double
errors_bit_uncoded
=
0
;
unsigned
char
*
estimated_output
;
unsigned
char
*
estimated_output_bit
;
unsigned
char
*
test_input_bit
;
//unsigned char *estimated_output = malloc16(sizeof(unsigned char) * 16 * 68 * 384)
;
unsigned
char
*
estimated_output_bit
=
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
)
;
unsigned
char
*
test_input_bit
=
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
)
;
unsigned
int
errors_bit
=
0
;
test_input_bit
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
);
estimated_output
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
);
estimated_output_bit
=
(
unsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
16
*
68
*
384
);
NR_UE_DLSCH_t
*
dlsch0_ue
=
UE
->
dlsch
[
UE
->
current_thread_id
[
subframe
]][
0
][
0
];
NR_DL_UE_HARQ_t
*
harq_process
=
dlsch0_ue
->
harq_processes
[
harq_pid
];
harq_process
->
mcs
=
Imcs
;
...
...
@@ -503,7 +499,7 @@ int main(int argc, char **argv) {
for
(
i
=
0
;
i
<
TBS
/
8
;
i
++
)
test_input
[
i
]
=
(
unsigned
char
)
rand
();
estimated_output
=
harq_process
->
b
;
//
estimated_output = harq_process->b;
#ifdef DEBUG_DLSCHSIM
for
(
i
=
0
;
i
<
TBS
/
8
;
i
++
)
printf
(
"test_input[i]=%d
\n
"
,
test_input
[
i
]);
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
8e891f7b
...
...
@@ -42,10 +42,11 @@
#include "PHY/MODULATION/modulation_UE.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
//
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "SCHED_NR/sched_nr.h"
#include "SCHED_NR_UE/fapi_nr_ue_l1.h"
#include "SCHED_NR/fapi_nr_l1.h"
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_UE/mac_defs.h"
...
...
@@ -54,6 +55,10 @@
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
#include "NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "RRC/NR/MESSAGES/asn1_msg.h"
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
...
...
@@ -78,7 +83,7 @@ int32_t get_uldl_offset(int nr_bandP) {return(0);}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
){
return
(
NULL
);}
int8_t
dummy_nr_ue_dl_indication
(
nr_downlink_indication_t
*
dl_info
){
return
(
0
);}
int
8_t
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
){
return
(
0
);}
int
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
){
return
(
0
);}
lte_subframe_t
subframe_select
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
subframe
)
{
return
(
SF_DL
);}
...
...
@@ -99,13 +104,6 @@ int rlc_module_init (void) {return(0);}
void
pdcp_layer_init
(
void
)
{}
int
rrc_init_nr_global_param
(
void
){
return
(
0
);}
void
config_common
(
int
Mod_idP
,
int
CC_idP
,
int
nr_bandP
,
uint64_t
dl_CarrierFreqP
,
uint32_t
dl_BandwidthP
);
// needed for some functions
PHY_VARS_NR_UE
***
PHY_vars_UE_g
;
...
...
@@ -115,40 +113,39 @@ int main(int argc, char **argv)
{
char
c
;
int
i
,
l
,
aa
;
int
i
,
aa
;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
snr0
=-
2
.
0
,
snr1
=
2
.
0
;
uint8_t
snr1set
=
0
;
int
**
txdata
;
double
**
s_re
,
**
s_im
,
**
r_re
,
**
r_im
;
double
iqim
=
0
.
0
;
unsigned
char
pbch_pdu
[
6
];
//
double iqim = 0.0;
//
unsigned char pbch_pdu[6];
// int sync_pos, sync_pos_slot;
// FILE *rx_frame_file;
FILE
*
output_fd
=
NULL
;
uint8_t
write_output_file
=
0
;
//int result;
int
freq_offset
;
// int subframe_offset;
// int freq_offset, subframe_offset;
// char fname[40], vname[40];
int
trial
,
n_trials
=
1
,
n_errors
,
n_errors2
,
n_alamouti
;
int
trial
,
n_trials
=
1
,
n_errors
=
0
;
//int n_errors2=0,n_alamouti=0;
uint8_t
transmission_mode
=
1
,
n_tx
=
1
,
n_rx
=
1
;
uint16_t
Nid_cell
=
0
;
channel_desc_t
*
gNB2UE
;
uint32_t
nsymb
,
tx_lev
,
tx_lev1
=
0
,
tx_lev2
=
0
;
//
uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
uint8_t
extended_prefix_flag
=
0
;
int8_t
interf1
=-
21
,
interf2
=-
21
;
FILE
*
input_fd
=
NULL
,
*
pbch_file_fd
=
NULL
;
char
input_val_str
[
50
],
input_val_str2
[
50
];
//
char input_val_str[50],input_val_str2[50];
uint8_t
frame_mod4
,
num_pdcch_symbols
=
0
;
//uint8_t frame_mod4,
num_pdcch_symbols = 0;
SCM_t
channel_model
=
AWGN
;
//Rayleigh1_anticorr;
double
pbch_sinr
;
int
pbch_tx_ant
;
//
double pbch_sinr;
//
int pbch_tx_ant;
int
N_RB_DL
=
273
,
mu
=
1
;
unsigned
char
frame_type
=
0
;
...
...
@@ -358,8 +355,8 @@ int main(int argc, char **argv)
printf
(
"-x Transmission mode (1,2,6 for the moment)
\n
"
);
printf
(
"-y Number of TX antennas used in eNB
\n
"
);
printf
(
"-z Number of RX antennas used in UE
\n
"
);
printf
(
"-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1
\n
"
);
printf
(
"-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2
\n
"
);
printf
(
"-i Relative strength of first inte
r
fering eNB (in dB) - cell_id mod 3 = 1
\n
"
);
printf
(
"-j Relative strength of second inte
r
fering eNB (in dB) - cell_id mod 3 = 2
\n
"
);
printf
(
"-N Nid_cell
\n
"
);
printf
(
"-R N_RB_DL
\n
"
);
printf
(
"-O oversampling factor (1,2,4,8,16)
\n
"
);
...
...
@@ -497,7 +494,7 @@ int main(int argc, char **argv)
gNB_mac
=
RC
.
nrmac
[
0
];
config_common
(
0
,
0
,
78
,(
uint64_t
)
3640000000L
,
N_RB_DL
);
config_nr_mib
(
0
,
0
,
1
,
kHz30
,
0
,
0
,
0
,
0
);
config_nr_mib
(
0
,
0
,
1
,
kHz30
,
0
,
0
,
0
,
0
,
0
);
nr_l2_init_ue
();
UE_mac
=
get_mac_inst
(
0
);
...
...
@@ -640,8 +637,8 @@ int main(int argc, char **argv)
for
(
SNR
=
snr0
;
SNR
<
snr1
;
SNR
+=
.
2
)
{
n_errors
=
0
;
n_errors2
=
0
;
n_alamouti
=
0
;
//
n_errors2 = 0;
//
n_alamouti = 0;
for
(
trial
=
0
;
trial
<
n_trials
;
trial
++
)
{
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
8e891f7b
...
...
@@ -68,7 +68,7 @@ int8_t nr_ue_process_dlsch(module_id_t module_id, int cc_id, uint8_t gNB_index,
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
fapi_nr_ul_config_request_t
*
ul_config
=
&
mac
->
ul_config_request
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
//
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
nr_phy_config_t
*
phy_config
=
&
mac
->
phy_config
;
//ul_config->ul_config_list[ul_config->number_pdus].ulsch_config_pdu.rnti = rnti;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
View file @
8e891f7b
...
...
@@ -36,6 +36,7 @@
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
...
...
@@ -324,7 +325,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
rnti
=
UE_RNTI
(
module_idP
,
i
);
CC_id
=
UE_PCCID
(
module_idP
,
i
);
int
spf
=
get_spf
(
cfg
);
//
int spf = get_spf(cfg);
if
(((
frameP
&
127
)
==
0
)
&&
(
slotP
==
0
))
{
LOG_I
(
MAC
,
...
...
@@ -382,11 +383,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
}
for
(
int
ii
=
0
;
ii
<
MAX_MOBILES_PER_GNB
;
ii
++
)
{
LTE_e
NB_DLSCH_t
*
dlsch
=
RC
.
gNB
[
module_idP
][
CC_id
]
->
dlsch
[
ii
][
0
];
if
((
dlsch
!=
NULL
)
&&
(
dlsch
->
rnti
==
rnti
)){
LOG_I
(
MAC
,
"clean_eNb_dlsch UE %x
\n
"
,
rnti
);
clean_eNb_dlsch
(
dlsch
);
}
NR_g
NB_DLSCH_t
*
dlsch
=
RC
.
gNB
[
module_idP
][
CC_id
]
->
dlsch
[
ii
][
0
];
if
((
dlsch
!=
NULL
)
&&
(
dlsch
->
rnti
==
rnti
)){
LOG_I
(
MAC
,
"clean_eNb_dlsch UE %x
\n
"
,
rnti
);
clean_eNb_dlsch
(
dlsch
);
}
}
for
(
int
j
=
0
;
j
<
10
;
j
++
){
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
8e891f7b
...
...
@@ -36,6 +36,28 @@
void
mac_top_init_gNB
(
void
);
uint32_t
to_nrarfcn
(
int
nr_bandP
,
uint64_t
dl_CarrierFreq
,
uint32_t
bw
);
uint64_t
from_nrarfcn
(
int
nr_bandP
,
uint32_t
dl_nrarfcn
);
void
config_nr_mib
(
int
Mod_idP
,
int
CC_idP
,
int
p_gNBP
,
int
subCarrierSpacingCommon
,
uint32_t
ssb_SubcarrierOffset
,
int
dmrs_TypeA_Position
,
uint32_t
pdcch_ConfigSIB1
,
int
cellBarred
,
int
intraFreqReselection
);
void
config_common
(
int
Mod_idP
,
int
CC_idP
,
int
nr_bandP
,
uint64_t
dl_CarrierFreqP
,
uint32_t
dl_BandwidthP
);
int
rrc_mac_config_req_gNB
(
module_id_t
Mod_idP
,
int
CC_id
,
int
p_gNB
,
...
...
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