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
wangjie
OpenXG-RAN
Commits
6de60def
Commit
6de60def
authored
Oct 25, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L2 interface changes
parent
4ff649ac
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
100 additions
and
132 deletions
+100
-132
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
+8
-10
openair1/PHY/NR_TRANSPORT/nr_dci.h
openair1/PHY/NR_TRANSPORT/nr_dci.h
+2
-1
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+12
-3
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+8
-7
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+7
-8
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+21
-28
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
+7
-11
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
+4
-0
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
+15
-10
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+0
-37
openair1/SCHED_NR/fapi_nr_l1.c
openair1/SCHED_NR/fapi_nr_l1.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+14
-16
No files found.
cmake_targets/CMakeLists.txt
View file @
6de60def
...
...
@@ -1300,6 +1300,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_TRANSPORT/nr_dlsch_tools.c
${
OPENAIR1_DIR
}
/PHY/NR_TRANSPORT/nr_dlsch_coding.c
${
OPENAIR1_DIR
}
/PHY/NR_TRANSPORT/nr_tbs_tools.c
${
OPENAIR1_DIR
}
/PHY/NR_TRANSPORT/nr_sch_dmrs.c
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_gold.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
View file @
6de60def
...
...
@@ -554,26 +554,24 @@ typedef struct {
uint8_t
freq_allocation_type
;
uint8_t
start_prb
;
uint8_t
n_prb
;
uint8_t
S
;
uint8_t
L
;
uint8_t
Imcs
;
uint8_t
start_symbol
;
uint8_t
nb_symbols
;
uint8_t
mcs_idx
;
uint8_t
nb_codewords
;
uint8_t
nb_layers
;
/*uint8_t R;
uint8_t Qm;
uint16_t TBS;
uint8_t nb_layers;*/
uint16_t
coding_rate
;
uint8_t
modulation
;
uint8_t
modulation_order
;
uint16_t
transport_block_size
;
uint8_t
nb_re_dmrs
;
uint8_t
time_alloc_list_flag
;
uint8_t
time_alloc_list
;
uint8_t
rbg_list
;
uint8_t
virtual_resource_block_assignment_flag
;
uint32_t
resource_block_coding
;
uint8_t
modulation
;
uint8_t
redundancy_version
;
uint8_t
transport_blocks
;
//uint8_t transport_block_to_codeword_swap_flag;
uint8_t
transmission_scheme
;
uint8_t
number_of_layers
;
uint8_t
number_of_subbands
;
uint8_t
codebook_index
[
NFAPI_MAX_NUM_SUBBANDS
];
uint8_t
ue_category_capacity
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.h
View file @
6de60def
...
...
@@ -51,7 +51,8 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
int
subframe
,
gNB_rxtx_proc_t
*
proc
,
NR_gNB_DCI_ALLOC_t
*
dci_alloc
,
nfapi_nr_dl_config_request_pdu_t
*
pdu
);
nfapi_nr_dl_config_dci_dl_pdu
*
pdu
,
nfapi_nr_dl_config_dlsch_pdu
*
dlsch_pdu
);
void
nr_fill_cce_list
(
NR_gNB_DCI_ALLOC_t
*
dci_alloc
,
uint16_t
n_shift
,
uint8_t
m
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
View file @
6de60def
...
...
@@ -31,6 +31,7 @@
*/
#include "nr_dci.h"
#include "nr_dlsch.h"
void
nr_fill_cce_list
(
NR_gNB_DCI_ALLOC_t
*
dci_alloc
,
uint16_t
n_shift
,
uint8_t
m
)
{
...
...
@@ -110,14 +111,15 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
int
subframe
,
gNB_rxtx_proc_t
*
proc
,
NR_gNB_DCI_ALLOC_t
*
dci_alloc
,
nfapi_nr_dl_config_request_pdu_t
*
pdu
)
nfapi_nr_dl_config_dci_dl_pdu
*
pdcch_pdu
,
nfapi_nr_dl_config_dlsch_pdu
*
dlsch_pdu
)
{
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
uint8_t
n_shift
;
uint32_t
*
dci_pdu
=
dci_alloc
->
dci_pdu
;
memset
((
void
*
)
dci_pdu
,
0
,
4
*
sizeof
(
uint32_t
));
nfapi_nr_dl_config_dci_dl_pdu_rel15_t
*
pdu_rel15
=
&
pd
u
->
dci_dl_pdu
.
dci_dl_pdu_rel15
;
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
params_rel15
=
&
pd
u
->
dci_dl_pdu
.
pdcch_params_rel15
;
nfapi_nr_dl_config_dci_dl_pdu_rel15_t
*
pdu_rel15
=
&
pd
cch_pdu
->
dci_dl_pdu_rel15
;
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
params_rel15
=
&
pd
cch_pdu
->
pdcch_params_rel15
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
NR_gNB_DLSCH_t
*
dlsch
=
&
gNB
->
dlsch
;
NR_DL_gNB_HARQ_t
**
harq
=
dlsch
->
harq_processes
;
...
...
@@ -532,4 +534,11 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
nr_fill_cce_list
(
dci_alloc
,
n_shift
,
cand_idx
);
LOG_I
(
PHY
,
"DCI type %d payload (size %d) generated on candidate %d
\n
"
,
dci_alloc
->
pdcch_params
.
dci_format
,
dci_alloc
->
size
,
cand_idx
);
/// DLSCH struct
memcpy
((
void
*
)
&
dlsch
->
harq_processes
[
dci_alloc
->
harq_pid
]
->
dlsch_pdu
,
(
void
*
)
dlsch_pdu
,
sizeof
(
nfapi_nr_dl_config_dlsch_pdu
));
nfapi_nr_dl_config_dlsch_pdu_rel15_t
*
dlsch_rel15
=
&
dlsch_pdu
->
dlsch_pdu_rel15
;
nr_get_tbs
(
dlsch
,
*
pdcch_pdu
,
*
cfg
,
dci_alloc
->
harq_pid
);
dlsch_rel15
->
nb_layers
=
1
;
dlsch_rel15
->
nb_codewords
=
1
;
}
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
6de60def
...
...
@@ -32,6 +32,7 @@
#include "nr_dlsch.h"
#include "nr_dci.h"
#include "nr_sch_dmrs.h"
#define DEBUG_DLSCH
...
...
@@ -207,7 +208,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
pdcch_params
.
scrambling_id
:
config
.
sch_config
.
physical_cell_id
.
value
;
for
(
int
q
=
0
;
q
<
rel15
->
nb_codewords
;
q
++
)
nr_pdsch_codeword_scrambling
(
harq
->
f
,
harq
->
TBS
,
rel15
->
transport_block_size
,
q
,
Nid
,
n_RNTI
,
...
...
@@ -216,8 +217,8 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
/// Modulation
for
(
int
q
=
0
;
q
<
rel15
->
nb_codewords
;
q
++
)
nr_pdsch_codeword_modulation
(
scrambled_output
[
q
],
harq
->
Qm
,
harq
->
TBS
,
rel15
->
modulation_order
,
rel15
->
transport_block_size
,
mod_symbs
[
q
]);
/// Layer mapping
...
...
@@ -231,14 +232,14 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
//to be moved to init phase potentially, for now tx_layers 1-8 are mapped on antenna ports 1000-1007
/// DMRS QPSK modulation
uint16_t
n_dmrs
=
rel15
->
n_prb
<<
1
;
uint16_t
n_dmrs
=
rel15
->
n_prb
*
rel15
->
nb_re_dmrs
;
int16_t
mod_dmrs
[
n_dmrs
<<
1
];
uint8_t
dmrs_type
=
config
.
pdsch_config
.
dmrs_type
.
value
;
nr_modulation
(
pdsch_dmrs
,
n_dmrs
,
MOD_QPSK
,
mod_dmrs
);
/// Resource mapping
AssertFatal
(
harq
->
Nl
<=
config
.
rf_config
.
tx_antenna_ports
.
value
,
"Not enough Tx antennas (%d) for %d layers
\n
"
,
\
config
.
rf_config
.
tx_antenna_ports
.
value
,
harq
->
Nl
);
AssertFatal
(
rel15
->
nb_layers
<=
config
.
rf_config
.
tx_antenna_ports
.
value
,
"Not enough Tx antennas (%d) for %d layers
\n
"
,
\
config
.
rf_config
.
tx_antenna_ports
.
value
,
rel15
->
nb_layers
);
// Non interleaved VRB to PRB mapping
uint8_t
start_sc
=
frame_parms
.
first_carrier_offset
+
rel15
->
start_prb
*
NR_NB_SC_PER_RB
+
\
...
...
@@ -255,7 +256,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
uint8_t
k_prime
=
0
,
n
=
0
,
dmrs_idx
=
0
;
uint16_t
m
=
0
;
for
(
int
l
=
rel15
->
S
;
l
<
rel15
->
L
;
l
++
)
for
(
int
l
=
rel15
->
start_symbol
;
l
<
rel15
->
nb_symbols
;
l
++
)
for
(
int
k
=
start_sc
;
k
<
rel15
->
n_prb
*
NR_NB_SC_PER_RB
;
k
++
)
{
if
(
k
>=
frame_parms
.
ofdm_symbol_size
)
k
-=
frame_parms
.
ofdm_symbol_size
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
View file @
6de60def
...
...
@@ -84,12 +84,11 @@ void nr_pdsch_layer_mapping(uint16_t **mod_symbs,
uint32_t
nr_get_G
(
uint16_t
nb_rb
,
uint16_t
nb_symb_sch
,
uint8_t
nb_re_dmrs
,
uint16_t
length_dmrs
,
uint8_t
Qm
,
uint8_t
Nl
);
int
nr_dlsch_encoding
(
PHY_VARS_gNB
*
gNB
,
unsigned
char
*
a
,
uint16_t
nb_symb_sch
,
NR_gNB_DLSCH_t
*
dlsch
,
int
frame
,
uint8_t
subframe
,
time_stats_t
*
rm_stats
,
time_stats_t
*
te_stats
,
time_stats_t
*
i_stats
);
unsigned
char
*
a
,
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
frame
,
uint8_t
subframe
,
time_stats_t
*
rm_stats
,
time_stats_t
*
te_stats
,
time_stats_t
*
i_stats
);
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
6de60def
...
...
@@ -244,53 +244,46 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
}
int
nr_dlsch_encoding
(
PHY_VARS_gNB
*
gNB
,
unsigned
char
*
a
,
uint16_t
nb_symb_sch
,
NR_gNB_DLSCH_t
*
dlsch
,
int
frame
,
uint8_t
subframe
,
time_stats_t
*
rm_stats
,
time_stats_t
*
te_stats
,
time_stats_t
*
i_stats
)
unsigned
char
*
a
,
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
frame
,
uint8_t
subframe
,
time_stats_t
*
rm_stats
,
time_stats_t
*
te_stats
,
time_stats_t
*
i_stats
)
{
unsigned
int
G
;
unsigned
int
crc
=
1
;
NR_DL_FRAME_PARMS
*
frame_parms
=
&
gNB
->
frame_parms
;
u
nsigned
char
harq_pid
=
dlsch
->
harq_ids
[
subframe
];
unsigned
short
nb_rb
=
dlsch
->
harq_processes
[
harq_pid
]
->
nb_rb
;
u
nsigned
int
A
,
Z
;
u
nsigned
*
pz
=
&
Z
;
u
nsigned
char
mod_order
;
u
nsigned
int
Kr
=
0
,
r
,
r_offset
=
0
;
//Kr_bytes
//unsigned short m=dlsch->harq_processes[harq_pid]->mcs
;
//uint8_t beamforming_mode=0;
u
int8_t
harq_pid
=
dlsch
->
harq_ids
[
subframe
];
nfapi_nr_dl_config_dlsch_pdu_rel15_t
rel15
=
dlsch
->
harq_processes
[
harq_pid
]
->
dlsch_pdu
.
dlsch_pdu_rel15
;
u
int16_t
nb_rb
=
rel15
.
n_prb
;
u
int8_t
nb_symb_sch
=
rel15
.
nb_symbols
;
u
int16_t
A
,
Z
;
u
int16_t
*
pz
=
&
Z
;
uint8_t
mod_order
=
rel15
.
modulation_order
;
uint16_t
Kr
=
0
,
r
,
r_offset
=
0
;
//Kr_bytes
uint8_t
*
d_tmp
[
MAX_NUM_DLSCH_SEGMENTS
];
//double rate = 0.33;
uint8_t
kb
,
BG
=
1
;
uint32_t
E
;
uint8_t
Ilbrm
=
0
;
uint32_t
Tbslbrm
=
950984
;
//max tbs
//uint16_t nb_symb_sch =12;
uint8_t
nb_re_dmrs
=
6
;
uint8_t
nb_re_dmrs
=
rel15
.
nb_re_dmrs
;
uint16_t
length_dmrs
=
1
;
uint8_t
*
channel_input
[
MAX_NUM_DLSCH_SEGMENTS
];
//unsigned char
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING
,
VCD_FUNCTION_IN
);
dlsch
->
harq_processes
[
harq_pid
]
->
TBS
=
nr_compute_tbs
(
dlsch
->
harq_processes
[
harq_pid
]
->
mcs
,
nb_rb
,
nb_symb_sch
,
nb_re_dmrs
,
length_dmrs
,
dlsch
->
harq_processes
[
harq_pid
]
->
Nl
);
A
=
dlsch
->
harq_processes
[
harq_pid
]
->
TBS
;
A
=
rel15
.
transport_block_size
;
//printf("Encoder: A: %d frame.subframe %d.%d \n",A, frame,subframe);
mod_order
=
nr_get_Qm
(
dlsch
->
harq_processes
[
harq_pid
]
->
mcs
,
1
);
G
=
nr_get_G
(
nb_rb
,
nb_symb_sch
,
nb_re_dmrs
,
length_dmrs
,
mod_order
,
dlsch
->
harq_processes
[
harq_pid
]
->
Nl
);
G
=
nr_get_G
(
nb_rb
,
nb_symb_sch
,
nb_re_dmrs
,
length_dmrs
,
mod_order
,
rel15
.
nb_layers
);
printf
(
"dlsch coding A %d G %d mod_order %d
\n
"
,
A
,
G
,
mod_order
);
Tbslbrm
=
nr_compute_tbs
(
28
,
nb_rb
,
frame_parms
->
symbols_per_slot
,
0
,
0
,
dlsch
->
harq_processes
[
harq_pid
]
->
Nl
);
Tbslbrm
=
nr_compute_tbs
(
28
,
nb_rb
,
frame_parms
->
symbols_per_slot
,
0
,
0
,
rel15
.
nb_layers
);
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
if
(
dlsch
->
harq_processes
[
harq_pid
]
->
round
==
0
)
{
// this is a new packet
...
...
@@ -400,9 +393,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
],
dlsch
->
harq_processes
[
harq_pid
]
->
e
+
r_offset
,
dlsch
->
harq_processes
[
harq_pid
]
->
C
,
dlsch
->
harq_processes
[
harq_pid
]
->
rvidx
,
rel15
.
redundancy_version
,
mod_order
,
dlsch
->
harq_processes
[
harq_pid
]
->
Nl
,
rel15
.
nb_layers
,
r
);
#ifdef DEBUG_DLSCH_CODING
...
...
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
View file @
6de60def
...
...
@@ -36,7 +36,7 @@
/*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/
int8_t
pdsch_dmrs_1
[
8
][
7
]
=
{{
0
,
0
,
0
,
1
,
1
,
1
,
1
},
{
1
,
0
,
0
,
1
,
-
1
,
1
,
1
},
{
2
,
1
,
1
,
1
,
1
,
,
1
,
1
},
{
2
,
1
,
1
,
1
,
1
,
1
,
1
},
{
3
,
1
,
1
,
1
,
-
1
,
1
,
1
},
{
4
,
0
,
0
,
1
,
1
,
1
,
-
1
},
{
5
,
0
,
0
,
1
,
-
1
,
1
,
-
1
},
...
...
@@ -56,22 +56,18 @@ int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1},
{
10
,
2
,
4
,
1
,
1
,
1
,
-
1
},
{
11
,
2
,
4
,
1
,
-
1
,
1
,
-
1
}};
static
inline
void
*
get_l_prime
(
uint8_t
n_symbs
)
{
uint8_t
*
l_prime
;
for
(
int
i
=
0
;
i
<
nsymbs
;
i
++
)
void
get_l_prime
(
uint8_t
*
l_prime
,
uint8_t
n_symbs
)
{
for
(
int
i
=
0
;
i
<
n_symbs
;
i
++
)
*
(
l_prime
+
i
)
=
i
;
return
l_prime
;
}
static
inline
void
*
get_antenna_ports
(
uint8_t
n_symbs
,
uint8_t
config
)
{
uint8_t
*
ap
;
void
get_antenna_ports
(
uint8_t
*
ap
,
uint8_t
n_symbs
,
uint8_t
config
)
{
if
(
config
==
NFAPI_NR_DMRS_TYPE1
)
for
(
int
i
=
0
;
i
<
(
4
+
4
*
(
n_symbs
-
1
);
i
++
)
for
(
int
i
=
0
;
i
<
(
4
+
((
n_symbs
-
1
)
<<
2
)
);
i
++
)
*
(
ap
+
i
)
=
i
;
else
for
(
int
i
=
0
;
i
<
(
7
+
4
*
(
n_symbs
-
1
);
i
++
)
for
(
int
i
=
0
;
i
<
(
7
+
((
n_symbs
-
1
)
<<
2
)
);
i
++
)
*
(
ap
+
i
)
=
i
;
return
ap
;
}
void
get_Wt
(
int8_t
*
Wt
,
uint8_t
ap
,
uint8_t
config
)
{
...
...
@@ -79,7 +75,7 @@ void get_Wt(int8_t *Wt, uint8_t ap, uint8_t config) {
*
(
Wt
+
i
)
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
3
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
3
+
i
]);
}
void
*
get_Wf
(
int8_t
*
Wf
,
uint8_t
ap
,
uint8_t
config
)
{
void
get_Wf
(
int8_t
*
Wf
,
uint8_t
ap
,
uint8_t
config
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
*
(
Wf
+
i
)
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
5
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
5
+
i
]);
}
...
...
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
View file @
6de60def
...
...
@@ -35,6 +35,10 @@
#define NR_PDSCH_DMRS_ANTENNA_PORT0 1000
#define NR_PDSCH_DMRS_NB_ANTENNA_PORTS 12
void
get_l_prime
(
uint8_t
*
l_prime
,
uint8_t
n_symbs
);
void
get_antenna_ports
(
uint8_t
*
ap
,
uint8_t
n_symbs
,
uint8_t
config
);
void
get_Wt
(
int8_t
*
Wt
,
uint8_t
ap
,
uint8_t
config
);
void
get_Wf
(
int8_t
*
Wf
,
uint8_t
ap
,
uint8_t
config
);
...
...
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
View file @
6de60def
...
...
@@ -118,12 +118,12 @@ void nr_get_tbs(NR_gNB_DLSCH_t *dlsch,
(
config
.
pdsch_config
.
x_overhead
.
value
);
uint8_t
N_PRB_DMRS
=
(
config
.
pdsch_config
.
dmrs_type
.
value
==
NFAPI_NR_DMRS_TYPE1
)
?
4
:
6
;
//This only works for antenna port 1000
uint8_t
mcs_table
=
config
.
pdsch_config
.
mcs_table
.
value
;
uint8_t
N_sh_symb
=
dlsch_rel15
->
L
;
uint8_t
Imcs
=
dlsch_rel15
->
Imcs
;
uint8_t
N_sh_symb
=
dlsch_rel15
->
nb_symbols
;
uint8_t
Imcs
=
dlsch_rel15
->
mcs_idx
;
uint16_t
N_prime_RE
=
NR_NB_SC_PER_RB
*
N_sh_symb
-
N_PRB_DMRS
-
N_PRB_oh
;
LOG_I
(
MAC
,
"N_prime_RE %d for %d symbols %d DMRS per PRB and %d overhead
\n
"
,
N_prime_RE
,
N_sh_symb
,
N_PRB_DMRS
,
N_PRB_oh
);
uint16_t
N_RE
,
Ninfo
,
Ninfo_prime
,
C
;
uint16_t
N_RE
,
Ninfo
,
Ninfo_prime
,
C
,
TBS
;
uint8_t
table_idx
,
R
,
Qm
,
n
,
scale
;
table_idx
=
get_table_idx
(
mcs_table
,
dci_format
,
rnti_type
,
ss_type
);
...
...
@@ -132,14 +132,14 @@ void nr_get_tbs(NR_gNB_DLSCH_t *dlsch,
N_RE
=
min
(
156
,
N_RE
)
*
dlsch_rel15
->
n_prb
;
R
=
nr_get_code_rate
(
Imcs
,
table_idx
);
Qm
=
nr_get_Qm
(
Imcs
,
table_idx
);
Ninfo
=
(
N_RE
*
R
*
Qm
*
harq
->
Nl
)
>>
scale
;
Ninfo
=
(
N_RE
*
R
*
Qm
*
dlsch_rel15
->
nb_layers
)
>>
scale
;
if
(
Ninfo
<=
3824
)
{
n
=
max
(
3
,
(
log2
(
Ninfo
)
-
6
));
Ninfo_prime
=
max
(
24
,
(
Ninfo
>>
n
)
<<
n
);
for
(
int
i
=
0
;
i
<
93
;
i
++
)
if
(
nr_tbs_table
[
i
]
>=
Ninfo_prime
)
{
harq
->
TBS
=
nr_tbs_table
[
i
];
TBS
=
nr_tbs_table
[
i
];
break
;
}
}
...
...
@@ -149,24 +149,29 @@ void nr_get_tbs(NR_gNB_DLSCH_t *dlsch,
if
(
R
<
256
)
{
C
=
CEILIDIV
((
Ninfo_prime
+
24
),
3816
);
harq
->
TBS
=
(
C
*
CEILIDIV
((
Ninfo_prime
+
24
),(
C
<<
3
)))
<<
3
;
TBS
=
(
C
*
CEILIDIV
((
Ninfo_prime
+
24
),(
C
<<
3
)))
<<
3
;
}
else
{
if
(
Ninfo_prime
>
8424
)
{
C
=
CEILIDIV
((
Ninfo_prime
+
24
),
8424
);
harq
->
TBS
=
(
C
*
CEILIDIV
((
Ninfo_prime
+
24
),(
C
<<
3
)))
<<
3
;
TBS
=
(
C
*
CEILIDIV
((
Ninfo_prime
+
24
),(
C
<<
3
)))
<<
3
;
}
else
harq
->
TBS
=
(
CEILIDIV
((
Ninfo_prime
+
24
),
8
)
-
24
)
<<
3
;
TBS
=
(
CEILIDIV
((
Ninfo_prime
+
24
),
8
)
-
24
)
<<
3
;
}
}
LOG_I
(
MAC
,
"TBS %d : N_RE %d N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d Ninfo %d Ninfo_prime %d R %d Qm %d table %d scale %d
\n
"
,
harq
->
TBS
,
N_RE
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
Ninfo
,
Ninfo_prime
,
R
,
Qm
,
table_idx
,
scale
);
TBS
,
N_RE
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
Ninfo
,
Ninfo_prime
,
R
,
Qm
,
table_idx
,
scale
);
dlsch_rel15
->
coding_rate
=
R
;
dlsch_rel15
->
modulation_order
=
Qm
;
dlsch_rel15
->
transport_block_size
=
TBS
;
dlsch_rel15
->
nb_re_dmrs
=
N_PRB_DMRS
;
}
uint32_t
nr_get_G
(
uint16_t
nb_rb
,
uint16_t
nb_symb_sch
,
uint8_t
nb_re_dmrs
,
uint16_t
length_dmrs
,
uint8_t
Qm
,
uint8_t
Nl
)
{
uint32_t
G
;
G
=
((
12
*
nb_symb_sch
)
-
(
nb_re_dmrs
*
length_dmrs
))
*
nb_rb
*
Qm
*
Nl
;
G
=
((
NR_NB_SC_PER_RB
*
nb_symb_sch
)
-
(
nb_re_dmrs
*
length_dmrs
))
*
nb_rb
*
Qm
*
Nl
;
return
(
G
);
}
openair1/PHY/defs_gNB.h
View file @
6de60def
...
...
@@ -70,8 +70,6 @@ typedef struct {
typedef
struct
{
/// Nfapi DLSCH PDU
nfapi_nr_dl_config_dlsch_pdu
dlsch_pdu
;
/// Transport block size
uint32_t
TBS
;
/// pointer to pdu from MAC interface (this is "a" in 36.212)
uint8_t
*
pdu
;
/// The payload + CRC size in bits, "B" from 36-212
...
...
@@ -86,34 +84,8 @@ typedef struct {
uint32_t
subframe
;
/// Index of current HARQ round for this DLSCH
uint8_t
round
;
/// Modulation order
uint8_t
Qm
;
/// MCS
uint8_t
mcs
;
/// Redundancy-version of the current sub-frame
uint8_t
rvidx
;
/// MIMO mode for this DLSCH
MIMO_mode_t
mimo_mode
;
/// Current RB allocation
uint32_t
rb_alloc
[
4
];
/// distributed/localized flag
vrb_t
vrb_type
;
/// Current subband PMI allocation
uint16_t
pmi_alloc
;
/// Current subband RI allocation
uint32_t
ri_alloc
;
/// Current subband CQI1 allocation
uint32_t
cqi_alloc1
;
/// Current subband CQI2 allocation
uint32_t
cqi_alloc2
;
/// Current Number of RBs
uint16_t
nb_rb
;
/// Current NDI
uint8_t
ndi
;
/// downlink power offset field
uint8_t
dl_power_off
;
/// start symbold of pdsch
uint8_t
pdsch_start
;
/// Concatenated sequences
uint8_t
e
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)));
/// LDPC-code outputs
...
...
@@ -126,15 +98,6 @@ typedef struct {
uint32_t
K
;
/// Number of "Filler" bits
uint32_t
F
;
/// Number of MIMO layers (streams)
uint8_t
Nl
;
/// Number of layers for this PDSCH transmission (TM8-10)
uint8_t
Nlayers
;
/// First layer for this PSCH transmission
uint8_t
first_layer
;
/// codeword this transport block is mapped to
uint8_t
codeword
;
/// Number of codewords
}
NR_DL_gNB_HARQ_t
;
...
...
openair1/SCHED_NR/fapi_nr_l1.c
View file @
6de60def
...
...
@@ -65,7 +65,7 @@ void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
LOG_D
(
PHY
,
"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
frame
,
subframe
,
pdcch_vars
->
num_dci
,
proc
->
subframe_tx
,
idx
,
pdcch_vars
->
num_dci
);
// copy dci configuration into gNB structure
nr_fill_dci_and_dlsch
(
gNB
,
frame
,
subframe
,
proc
,
&
pdcch_vars
->
dci_alloc
[
pdcch_vars
->
num_dci
],
dl_config
_pdu
);
nr_fill_dci_and_dlsch
(
gNB
,
frame
,
subframe
,
proc
,
&
pdcch_vars
->
dci_alloc
[
pdcch_vars
->
num_dci
],
&
dl_config_pdu
->
dci_dl_pdu
,
&
dl_config_pdu
->
dlsch
_pdu
);
LOG_D
(
PHY
,
"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
,
pdcch_vars
->
num_dci
,
proc
->
subframe_tx
,
idx
,
pdcch_vars
->
num_dci
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
6de60def
...
...
@@ -49,6 +49,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
nfapi_nr_dl_config_request_pdu_t
*
dl_config_pdu
;
nfapi_tx_request_pdu_t
*
TX_req
;
uint16_t
sfn_sf
=
frameP
<<
4
|
subframeP
;
uint16_t
rnti
=
0x1234
;
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
LOG_I
(
MAC
,
"Scheduling common search space DCI type 1 for CC_id %d
\n
"
,
CC_id
);
...
...
@@ -69,8 +70,9 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
dlsch_pdu_rel15
->
start_prb
=
0
;
dlsch_pdu_rel15
->
n_prb
=
40
;
dlsch_pdu_rel15
->
S
=
8
;
dlsch_pdu_rel15
->
L
=
6
;
dlsch_pdu_rel15
->
start_symbol
=
8
;
dlsch_pdu_rel15
->
nb_symbols
=
6
;
dlsch_pdu_rel15
->
rnti
=
rnti
;
nr_configure_css_dci_from_mib
(
&
gNB
->
pdcch_type0_params
,
kHz30
,
kHz30
,
nr_FR1
,
0
,
0
,
...
...
@@ -79,36 +81,31 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
memcpy
((
void
*
)
params_rel15
,
(
void
*
)
&
gNB
->
pdcch_type0_params
,
sizeof
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
));
pdu_rel15
->
frequency_domain_assignment
=
get_RIV
(
dlsch_pdu_rel15
->
start_prb
,
dlsch_pdu_rel15
->
n_prb
,
cfg
->
rf_config
.
dl_carrier_bandwidth
.
value
);
pdu_rel15
->
time_domain_assignment
=
get_SLIV
(
dlsch_pdu_rel15
->
S
,
dlsch_pdu_rel15
->
L
);
pdu_rel15
->
time_domain_assignment
=
get_SLIV
(
dlsch_pdu_rel15
->
start_symbol
,
dlsch_pdu_rel15
->
nb_symbols
);
pdu_rel15
->
vrb_to_prb_mapping
=
1
;
pdu_rel15
->
mcs
=
12
;
pdu_rel15
->
tb_scaling
=
1
;
pdu_rel15
->
ra_preamble_index
=
25
;
pdu_rel15
->
format_indicator
=
1
;
pdu_rel15
->
ul_sul_indicator
=
1
;
pdu_rel15
->
ss_pbch_index
=
21
;
pdu_rel15
->
prach_mask_index
=
3
;
pdu_rel15
->
ndi
=
1
;
pdu_rel15
->
rv
=
2
;
pdu_rel15
->
harq_pid
=
7
;
pdu_rel15
->
rv
=
0
;
pdu_rel15
->
harq_pid
=
0
;
pdu_rel15
->
dai
=
2
;
pdu_rel15
->
tpc
=
2
;
pdu_rel15
->
pucch_resource_indicator
=
7
;
pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
=
7
;
pdu_rel15
->
tb_scaling
=
1
;
LOG_I
(
MAC
,
"[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d
\n
"
,
LOG_I
(
MAC
,
"[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d
ndi %d rv %d
\n
"
,
pdu_rel15
->
frequency_domain_assignment
,
pdu_rel15
->
time_domain_assignment
,
pdu_rel15
->
vrb_to_prb_mapping
,
pdu_rel15
->
mcs
,
pdu_rel15
->
tb_scaling
);
pdu_rel15
->
tb_scaling
,
pdu_rel15
->
ndi
,
pdu_rel15
->
rv
);
params_rel15
->
rnti
=
0x03
;
params_rel15
->
rnti
=
rnti
;
params_rel15
->
rnti_type
=
NFAPI_NR_RNTI_C
;
params_rel15
->
dci_format
=
NFAPI_NR_DL_DCI_FORMAT_1_0
;
//params_rel15->aggregation_level = 1;
...
...
@@ -129,7 +126,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
params_rel15
->
sfn_mod2
,
params_rel15
->
first_slot
);
dl_req
->
number_dci
++
;
dl_req
->
number_pdu
++
;
dl_req
->
number_pdsch_rnti
++
;
dl_req
->
number_pdu
+=
2
;
TX_req
=
&
nr_mac
->
TX_req
[
CC_id
].
tx_request_body
.
tx_pdu_list
[
nr_mac
->
TX_req
[
CC_id
].
tx_request_body
.
number_of_pdus
];
TX_req
->
pdu_length
=
6
;
...
...
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