Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
0d664103
Commit
0d664103
authored
Mar 17, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another round of review
parent
12ccca72
Changes
26
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
904 additions
and
775 deletions
+904
-775
common/openairinterface5g_limits.h
common/openairinterface5g_limits.h
+1
-1
executables/nr-gnb.c
executables/nr-gnb.c
+1
-2
nfapi/oai_integration/nfapi_pnf.c
nfapi/oai_integration/nfapi_pnf.c
+4
-2
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+93
-109
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+23
-19
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+28
-22
openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
+8
-2
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+3
-3
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+21
-28
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+4
-8
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+2
-9
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+44
-39
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
+2
-3
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+115
-130
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+73
-72
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+137
-75
openair1/PHY/NR_TRANSPORT/srs_rx.c
openair1/PHY/NR_TRANSPORT/srs_rx.c
+4
-20
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+6
-6
openair1/SCHED_NR/fapi_nr_l1.c
openair1/SCHED_NR/fapi_nr_l1.c
+5
-8
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+229
-172
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+2
-2
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+5
-3
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+1
-1
openair1/SIMULATION/NR_PHY/ulschsim.c
openair1/SIMULATION/NR_PHY/ulschsim.c
+2
-2
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+91
-36
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+0
-1
No files found.
common/openairinterface5g_limits.h
View file @
0d664103
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
# define NUMBER_OF_SRS_MAX 16
# define NUMBER_OF_SRS_MAX 16
# define NUMBER_OF_SCH_STATS_MAX 16
# define NUMBER_OF_SCH_STATS_MAX 16
#
define NUMBER_FRAMES_PHY_UE_INACTIVE 10
#define NUMBER_FRAMES_PHY_UE_INACTIVE 10
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2
...
...
executables/nr-gnb.c
View file @
0d664103
...
@@ -130,7 +130,6 @@ void tx_func(void *param) {
...
@@ -130,7 +130,6 @@ void tx_func(void *param) {
void
rx_func
(
void
*
param
)
void
rx_func
(
void
*
param
)
{
{
processingData_L1_t
*
info
=
(
processingData_L1_t
*
)
param
;
processingData_L1_t
*
info
=
(
processingData_L1_t
*
)
param
;
PHY_VARS_gNB
*
gNB
=
info
->
gNB
;
PHY_VARS_gNB
*
gNB
=
info
->
gNB
;
int
frame_rx
=
info
->
frame_rx
;
int
frame_rx
=
info
->
frame_rx
;
...
@@ -179,7 +178,7 @@ void rx_func(void *param)
...
@@ -179,7 +178,7 @@ void rx_func(void *param)
reset_active_ulsch
(
gNB
,
frame_tx
);
reset_active_ulsch
(
gNB
,
frame_tx
);
// RX processing
// RX processing
int
rx_slot_type
=
nr_slot_select
(
cfg
,
frame_rx
,
slot_rx
);
int
rx_slot_type
=
nr_slot_select
(
cfg
,
frame_rx
,
slot_rx
);
if
(
rx_slot_type
==
NR_UPLINK_SLOT
||
rx_slot_type
==
NR_MIXED_SLOT
)
{
if
(
rx_slot_type
==
NR_UPLINK_SLOT
||
rx_slot_type
==
NR_MIXED_SLOT
)
{
// UE-specific RX processing for subframe n
// UE-specific RX processing for subframe n
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
...
...
nfapi/oai_integration/nfapi_pnf.c
View file @
0d664103
...
@@ -1220,8 +1220,10 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
...
@@ -1220,8 +1220,10 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
if
(
tx_data
!=
NULL
)
{
if
(
tx_data
!=
NULL
)
{
uint8_t
*
dlsch_sdu
=
(
uint8_t
*
)
tx_data
->
TLVs
[
0
].
value
.
direct
;
uint8_t
*
dlsch_sdu
=
(
uint8_t
*
)
tx_data
->
TLVs
[
0
].
value
.
direct
;
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
AssertFatal
(
msgTx
->
num_pdsch_slot
<
gNB
->
max_nb_pdsch
,
"Number of PDSCH PDUs %d exceeded the limit %d
\n
"
,
AssertFatal
(
msgTx
->
num_pdsch_slot
<
gNB
->
max_nb_pdsch
,
msgTx
->
num_pdsch_slot
,
gNB
->
max_nb_pdsch
);
"Number of PDSCH PDUs %d exceeded the limit %d
\n
"
,
msgTx
->
num_pdsch_slot
,
gNB
->
max_nb_pdsch
);
handle_nr_nfapi_pdsch_pdu
(
msgTx
,
pdsch_pdu
,
dlsch_sdu
);
handle_nr_nfapi_pdsch_pdu
(
msgTx
,
pdsch_pdu
,
dlsch_sdu
);
}
}
else
{
else
{
...
...
openair1/PHY/INIT/nr_init.c
View file @
0d664103
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
0d664103
...
@@ -208,9 +208,12 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
...
@@ -208,9 +208,12 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
//
//
// Todo:
// Todo:
// - averaging IIR filter for RX power and noise
// - averaging IIR filter for RX power and noise
void
nr_gnb_measurements
(
PHY_VARS_gNB
*
gNB
,
NR_gNB_ULSCH_t
*
ulsch
,
NR_gNB_PUSCH
*
pusch_vars
,
unsigned
char
symbol
,
uint8_t
nrOfLayers
)
void
nr_gnb_measurements
(
PHY_VARS_gNB
*
gNB
,
NR_gNB_ULSCH_t
*
ulsch
,
NR_gNB_PUSCH
*
pusch_vars
,
unsigned
char
symbol
,
uint8_t
nrOfLayers
)
{
{
int
rx_power_tot
=
0
;
int
rx_power_tot
=
0
;
unsigned
short
rx_power_avg_dB
;
unsigned
short
rx_power_avg_dB
;
unsigned
short
rx_power_tot_dB
;
unsigned
short
rx_power_tot_dB
;
...
@@ -225,34 +228,35 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, NR_gNB_ULSCH_t *ulsch, NR_gNB_PUSCH
...
@@ -225,34 +228,35 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, NR_gNB_ULSCH_t *ulsch, NR_gNB_PUSCH
int
rx_power
[
fp
->
nb_antennas_rx
];
int
rx_power
[
fp
->
nb_antennas_rx
];
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
){
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
){
rx_power
[
aarx
]
=
0
;
rx_power
[
aarx
]
=
0
;
for
(
int
aatx
=
0
;
aatx
<
nrOfLayers
;
aatx
++
){
for
(
int
aatx
=
0
;
aatx
<
nrOfLayers
;
aatx
++
){
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
pusch_vars
->
ul_ch_estimates
[
aatx
*
fp
->
nb_antennas_rx
+
aarx
][
ch_offset
],
N_RB_UL
*
NR_NB_SC_PER_RB
));
(
signal_energy_nodc
(
&
pusch_vars
->
ul_ch_estimates
[
aatx
*
fp
->
nb_antennas_rx
+
aarx
][
ch_offset
],
N_RB_UL
*
NR_NB_SC_PER_RB
));
if
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
<
0
)
{
if
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
<
0
)
{
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
0
;
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
0
;
}
}
ulsch_measurements
->
rx_spatial_power_dB
[
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]);
ulsch_measurements
->
rx_spatial_power_dB
[
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]);
rx_power
[
aarx
]
+=
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
];
rx_power
[
aarx
]
+=
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
];
}
}
LOG_D
(
PHY
,
"[RNTI %04x] RX power in antenna %d = %d
\n
"
,
ulsch
->
rnti
,
aarx
,
rx_power
[
aarx
]);
LOG_D
(
PHY
,
"[RNTI %04x] RX power in antenna %d = %d
\n
"
,
ulsch
->
rnti
,
aarx
,
rx_power
[
aarx
]);
rx_power_tot
+=
rx_power
[
aarx
];
rx_power_tot
+=
rx_power
[
aarx
];
}
}
rx_power_tot_dB
=
(
unsigned
short
)
dB_fixed
(
rx_power_tot
);
rx_power_tot_dB
=
(
unsigned
short
)
dB_fixed
(
rx_power_tot
);
rx_power_avg_dB
=
rx_power_tot_dB
;
rx_power_avg_dB
=
rx_power_tot_dB
;
ulsch_measurements
->
wideband_cqi_tot
=
dB_fixed2
(
rx_power_tot
,
meas
->
n0_power_tot
);
ulsch_measurements
->
wideband_cqi_tot
=
dB_fixed2
(
rx_power_tot
,
meas
->
n0_power_tot
);
ulsch_measurements
->
rx_rssi_dBm
=
rx_power_avg_dB
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
(
rx_gain
-
rx_gain_offset
)
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
ulsch_measurements
->
rx_rssi_dBm
=
rx_power_avg_dB
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
(
rx_gain
-
rx_gain_offset
)
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
LOG_D
(
PHY
,
"[RNTI %04x] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d
\n
"
,
LOG_D
(
PHY
,
"[RNTI %04x] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d
\n
"
,
ulsch
->
rnti
,
ulsch
->
rnti
,
ulsch_measurements
->
rx_rssi_dBm
,
ulsch_measurements
->
rx_rssi_dBm
,
rx_power_avg_dB
,
rx_power_avg_dB
,
...
...
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
View file @
0d664103
...
@@ -130,7 +130,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
...
@@ -130,7 +130,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
debug_ch_est
=
fopen
(
"debug_ch_est.txt"
,
"w"
);
debug_ch_est
=
fopen
(
"debug_ch_est.txt"
,
"w"
);
#endif
#endif
//uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
//uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
c16_t
**
ul_ch_estimates
=
(
c16_t
**
)
gNB
->
pusch_vars
[
ul_id
]
->
ul_ch_estimates
;
NR_gNB_PUSCH
*
pusch_vars
=
&
gNB
->
pusch_vars
[
ul_id
];
c16_t
**
ul_ch_estimates
=
(
c16_t
**
)
pusch_vars
->
ul_ch_estimates
;
const
int
symbolSize
=
gNB
->
frame_parms
.
ofdm_symbol_size
;
const
int
symbolSize
=
gNB
->
frame_parms
.
ofdm_symbol_size
;
const
int
soffset
=
(
Ns
&
3
)
*
gNB
->
frame_parms
.
symbols_per_slot
*
symbolSize
;
const
int
soffset
=
(
Ns
&
3
)
*
gNB
->
frame_parms
.
symbols_per_slot
*
symbolSize
;
const
int
nushift
=
(
p
>>
1
)
&
1
;
const
int
nushift
=
(
p
>>
1
)
&
1
;
...
@@ -187,8 +188,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
...
@@ -187,8 +188,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
c16_t
ul_ls_est
[
symbolSize
]
__attribute__
((
aligned
(
32
)));
c16_t
ul_ls_est
[
symbolSize
]
__attribute__
((
aligned
(
32
)));
memset
(
ul_ls_est
,
0
,
sizeof
(
c16_t
)
*
symbolSize
);
memset
(
ul_ls_est
,
0
,
sizeof
(
c16_t
)
*
symbolSize
);
NR_ULSCH_delay_t
*
delay
=
&
gNB
->
ulsch
[
ul_id
]
->
delay
;
NR_ULSCH_delay_t
*
delay
=
&
gNB
->
ulsch
[
ul_id
]
.
delay
;
memset
(
&
delay
,
0
,
sizeof
(
delay
));
memset
(
delay
,
0
,
sizeof
(
*
delay
));
for
(
int
aarx
=
0
;
aarx
<
gNB
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
for
(
int
aarx
=
0
;
aarx
<
gNB
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
c16_t
*
rxdataF
=
(
c16_t
*
)
&
gNB
->
common_vars
.
rxdataF
[
aarx
][
symbol_offset
];
c16_t
*
rxdataF
=
(
c16_t
*
)
&
gNB
->
common_vars
.
rxdataF
[
aarx
][
symbol_offset
];
...
@@ -229,11 +230,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
...
@@ -229,11 +230,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pilot_cnt
+=
2
;
pilot_cnt
+=
2
;
}
}
freq2time
(
symbolSize
,
freq2time
(
symbolSize
,
(
int16_t
*
)
ul_ls_est
,
(
int16_t
*
)
pusch_vars
->
ul_ch_estimates_time
[
aarx
]);
(
int16_t
*
)
ul_ls_est
,
(
int16_t
*
)
gNB
->
pusch_vars
[
ul_id
]
->
ul_ch_estimates_time
[
aarx
]);
nr_est_timing_advance_pusch
(
&
gNB
->
frame_parms
,
gNB
->
pusch_vars
[
ul_id
]
->
ul_ch_estimates_time
[
aarx
],
delay
);
nr_est_timing_advance_pusch
(
&
gNB
->
frame_parms
,
pusch_vars
->
ul_ch_estimates_time
[
aarx
],
delay
);
int
pusch_delay
=
delay
->
pusch_est_delay
;
int
pusch_delay
=
delay
->
pusch_est_delay
;
int
delay_idx
=
get_delay_idx
(
pusch_delay
);
int
delay_idx
=
get_delay_idx
(
pusch_delay
);
c16_t
*
ul_delay_table
=
gNB
->
frame_parms
.
ul_delay_table
[
delay_idx
];
c16_t
*
ul_delay_table
=
gNB
->
frame_parms
.
ul_delay_table
[
delay_idx
];
...
@@ -311,8 +310,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
...
@@ -311,8 +310,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
}
}
// Delay compensation
// Delay compensation
freq2time
(
symbolSize
,
(
int16_t
*
)
ul_ls_est
,
(
int16_t
*
)
gNB
->
pusch_vars
[
ul_id
]
->
ul_ch_estimates_time
[
aarx
]);
freq2time
(
symbolSize
,
(
int16_t
*
)
ul_ls_est
,
(
int16_t
*
)
pusch_vars
->
ul_ch_estimates_time
[
aarx
]);
nr_est_timing_advance_pusch
(
&
gNB
->
frame_parms
,
gNB
->
pusch_vars
[
ul_id
]
->
ul_ch_estimates_time
[
aarx
],
delay
);
nr_est_timing_advance_pusch
(
&
gNB
->
frame_parms
,
pusch_vars
->
ul_ch_estimates_time
[
aarx
],
delay
);
int
pusch_delay
=
delay
->
pusch_est_delay
;
int
pusch_delay
=
delay
->
pusch_est_delay
;
int
delay_idx
=
get_delay_idx
(
-
pusch_delay
);
int
delay_idx
=
get_delay_idx
(
-
pusch_delay
);
c16_t
*
ul_delay_table
=
gNB
->
frame_parms
.
ul_delay_table
[
delay_idx
];
c16_t
*
ul_delay_table
=
gNB
->
frame_parms
.
ul_delay_table
[
delay_idx
];
...
@@ -533,7 +532,9 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
...
@@ -533,7 +532,9 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint8_t
ulsch_id
,
uint8_t
ulsch_id
,
uint8_t
nr_tti_rx
,
uint8_t
nr_tti_rx
,
unsigned
char
symbol
,
unsigned
char
symbol
,
uint32_t
nb_re_pusch
)
{
uint32_t
nb_re_pusch
)
{
NR_gNB_PUSCH
*
pusch_vars
=
&
gNB
->
pusch_vars
[
ulsch_id
];
//#define DEBUG_UL_PTRS 1
//#define DEBUG_UL_PTRS 1
int32_t
*
ptrs_re_symbol
=
NULL
;
int32_t
*
ptrs_re_symbol
=
NULL
;
int8_t
ret
=
0
;
int8_t
ret
=
0
;
...
@@ -543,16 +544,16 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
...
@@ -543,16 +544,16 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint8_t
*
L_ptrs
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_time_density
;
uint8_t
*
L_ptrs
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_time_density
;
uint8_t
*
K_ptrs
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_freq_density
;
uint8_t
*
K_ptrs
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_freq_density
;
uint16_t
*
dmrsSymbPos
=
&
rel15_ul
->
ul_dmrs_symb_pos
;
uint16_t
*
dmrsSymbPos
=
&
rel15_ul
->
ul_dmrs_symb_pos
;
uint16_t
*
ptrsSymbPos
=
&
gNB
->
pusch_vars
[
ulsch_id
]
->
ptrs_symbols
;
uint16_t
*
ptrsSymbPos
=
&
pusch_vars
->
ptrs_symbols
;
uint8_t
*
ptrsSymbIdx
=
&
gNB
->
pusch_vars
[
ulsch_id
]
->
ptrs_symbol_index
;
uint8_t
*
ptrsSymbIdx
=
&
pusch_vars
->
ptrs_symbol_index
;
uint8_t
*
dmrsConfigType
=
&
rel15_ul
->
dmrs_config_type
;
uint8_t
*
dmrsConfigType
=
&
rel15_ul
->
dmrs_config_type
;
uint16_t
*
nb_rb
=
&
rel15_ul
->
rb_size
;
uint16_t
*
nb_rb
=
&
rel15_ul
->
rb_size
;
uint8_t
*
ptrsReOffset
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_ports_list
[
0
].
ptrs_re_offset
;
uint8_t
*
ptrsReOffset
=
&
rel15_ul
->
pusch_ptrs
.
ptrs_ports_list
[
0
].
ptrs_re_offset
;
/* loop over antennas */
/* loop over antennas */
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
c16_t
*
phase_per_symbol
=
(
c16_t
*
)
gNB
->
pusch_vars
[
ulsch_id
]
->
ptrs_phase_per_slot
[
aarx
];
c16_t
*
phase_per_symbol
=
(
c16_t
*
)
pusch_vars
->
ptrs_phase_per_slot
[
aarx
];
ptrs_re_symbol
=
&
gNB
->
pusch_vars
[
ulsch_id
]
->
ptrs_re_per_slot
;
ptrs_re_symbol
=
&
pusch_vars
->
ptrs_re_per_slot
;
*
ptrs_re_symbol
=
0
;
*
ptrs_re_symbol
=
0
;
phase_per_symbol
[
symbol
].
i
=
0
;
phase_per_symbol
[
symbol
].
i
=
0
;
/* set DMRS estimates to 0 angle with magnitude 1 */
/* set DMRS estimates to 0 angle with magnitude 1 */
...
@@ -585,13 +586,17 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
...
@@ -585,13 +586,17 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
/*------------------------------------------------------------------------------------------------------- */
/*------------------------------------------------------------------------------------------------------- */
/* 1) Estimate common phase error per PTRS symbol */
/* 1) Estimate common phase error per PTRS symbol */
/*------------------------------------------------------------------------------------------------------- */
/*------------------------------------------------------------------------------------------------------- */
nr_ptrs_cpe_estimation
(
*
K_ptrs
,
*
ptrsReOffset
,
*
dmrsConfigType
,
*
nb_rb
,
nr_ptrs_cpe_estimation
(
*
K_ptrs
,
*
ptrsReOffset
,
*
dmrsConfigType
,
*
nb_rb
,
rel15_ul
->
rnti
,
rel15_ul
->
rnti
,
nr_tti_rx
,
nr_tti_rx
,
symbol
,
frame_parms
->
ofdm_symbol_size
,
symbol
,
(
int16_t
*
)
&
gNB
->
pusch_vars
[
ulsch_id
]
->
rxdataF_comp
[
aarx
][(
symbol
*
nb_re_pusch
)],
frame_parms
->
ofdm_symbol_size
,
(
int16_t
*
)
&
pusch_vars
->
rxdataF_comp
[
aarx
][(
symbol
*
nb_re_pusch
)],
gNB
->
nr_gold_pusch_dmrs
[
rel15_ul
->
scid
][
nr_tti_rx
][
symbol
],
gNB
->
nr_gold_pusch_dmrs
[
rel15_ul
->
scid
][
nr_tti_rx
][
symbol
],
(
int16_t
*
)
&
phase_per_symbol
[
symbol
],
(
int16_t
*
)
&
phase_per_symbol
[
symbol
],
ptrs_re_symbol
);
ptrs_re_symbol
);
}
}
...
@@ -609,7 +614,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
...
@@ -609,7 +614,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
}
}
#ifdef DEBUG_UL_PTRS
#ifdef DEBUG_UL_PTRS
LOG_M
(
"ptrsEstUl.m"
,
"est"
,
gNB
->
pusch_vars
[
ulsch_id
]
->
ptrs_phase_per_slot
[
aarx
],
frame_parms
->
symbols_per_slot
,
1
,
1
);
LOG_M
(
"ptrsEstUl.m"
,
"est"
,
pusch_vars
->
ptrs_phase_per_slot
[
aarx
],
frame_parms
->
symbols_per_slot
,
1
,
1
);
LOG_M
(
"rxdataF_bf_ptrs_comp_ul.m"
,
"bf_ptrs_cmp"
,
LOG_M
(
"rxdataF_bf_ptrs_comp_ul.m"
,
"bf_ptrs_cmp"
,
&
gNB
->
pusch_vars
[
0
]
->
rxdataF_comp
[
aarx
][
rel15_ul
->
start_symbol_index
*
NR_NB_SC_PER_RB
*
rel15_ul
->
rb_size
],
&
gNB
->
pusch_vars
[
0
]
->
rxdataF_comp
[
aarx
][
rel15_ul
->
start_symbol_index
*
NR_NB_SC_PER_RB
*
rel15_ul
->
rb_size
],
rel15_ul
->
nr_of_symbols
*
NR_NB_SC_PER_RB
*
rel15_ul
->
rb_size
,
1
,
1
);
rel15_ul
->
nr_of_symbols
*
NR_NB_SC_PER_RB
*
rel15_ul
->
rb_size
,
1
,
1
);
...
@@ -625,10 +630,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
...
@@ -625,10 +630,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
#ifdef DEBUG_UL_PTRS
#ifdef DEBUG_UL_PTRS
printf
(
"[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d
\n
"
,
i
,
phase_per_symbol
[
i
].
r
,
phase_per_symbol
[
i
].
i
);
printf
(
"[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d
\n
"
,
i
,
phase_per_symbol
[
i
].
r
,
phase_per_symbol
[
i
].
i
);
#endif
#endif
rotate_cpx_vector
((
c16_t
*
)
&
gNB
->
pusch_vars
[
ulsch_id
]
->
rxdataF_comp
[
aarx
][(
i
*
rel15_ul
->
rb_size
*
NR_NB_SC_PER_RB
)],
rotate_cpx_vector
((
c16_t
*
)
&
pusch_vars
->
rxdataF_comp
[
aarx
][(
i
*
rel15_ul
->
rb_size
*
NR_NB_SC_PER_RB
)],
&
phase_per_symbol
[
i
],
&
phase_per_symbol
[
i
],
(
c16_t
*
)
&
gNB
->
pusch_vars
[
ulsch_id
]
->
rxdataF_comp
[
aarx
][(
i
*
rel15_ul
->
rb_size
*
NR_NB_SC_PER_RB
)],
(
c16_t
*
)
&
pusch_vars
->
rxdataF_comp
[
aarx
][(
i
*
rel15_ul
->
rb_size
*
NR_NB_SC_PER_RB
)],
((
*
nb_rb
)
*
NR_NB_SC_PER_RB
),
15
);
((
*
nb_rb
)
*
NR_NB_SC_PER_RB
),
15
);
}
// if not DMRS Symbol
}
// if not DMRS Symbol
}
// symbol loop
}
// symbol loop
}
// last symbol check
}
// last symbol check
...
...
openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
View file @
0d664103
...
@@ -53,9 +53,15 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
...
@@ -53,9 +53,15 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
void
gNB_I0_measurements
(
PHY_VARS_gNB
*
gNB
,
int
slot
,
int
first_symb
,
int
num_symb
);
void
gNB_I0_measurements
(
PHY_VARS_gNB
*
gNB
,
int
slot
,
int
first_symb
,
int
num_symb
);
void
nr_gnb_measurements
(
PHY_VARS_gNB
*
gNB
,
NR_gNB_ULSCH_t
*
ulsch
,
NR_gNB_PUSCH
*
pusch_vars
,
unsigned
char
symbol
,
uint8_t
nrOfLayers
);
void
nr_gnb_measurements
(
PHY_VARS_gNB
*
gNB
,
NR_gNB_ULSCH_t
*
ulsch
,
NR_gNB_PUSCH
*
pusch_vars
,
unsigned
char
symbol
,
uint8_t
nrOfLayers
);
void
nr_est_timing_advance_pusch
(
const
NR_DL_FRAME_PARMS
*
frame_parms
,
const
int32_t
*
ul_ch_estimates_time
,
NR_ULSCH_delay_t
*
delay
);
void
nr_est_timing_advance_pusch
(
const
NR_DL_FRAME_PARMS
*
frame_parms
,
const
int32_t
*
ul_ch_estimates_time
,
NR_ULSCH_delay_t
*
delay
);
int
nr_est_timing_advance_srs
(
const
NR_DL_FRAME_PARMS
*
frame_parms
,
int
nr_est_timing_advance_srs
(
const
NR_DL_FRAME_PARMS
*
frame_parms
,
const
int32_t
srs_estimated_channel_time
[][
frame_parms
->
ofdm_symbol_size
]);
const
int32_t
srs_estimated_channel_time
[][
frame_parms
->
ofdm_symbol_size
]);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
0d664103
...
@@ -75,7 +75,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
...
@@ -75,7 +75,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
time_stats_t
*
dlsch_segmentation_stats
=&
gNB
->
dlsch_segmentation_stats
;
time_stats_t
*
dlsch_segmentation_stats
=&
gNB
->
dlsch_segmentation_stats
;
for
(
int
dlsch_id
=
0
;
dlsch_id
<
msgTx
->
num_pdsch_slot
;
dlsch_id
++
)
{
for
(
int
dlsch_id
=
0
;
dlsch_id
<
msgTx
->
num_pdsch_slot
;
dlsch_id
++
)
{
dlsch
=
msgTx
->
dlsch
[
dlsch_id
][
0
];
dlsch
=
&
msgTx
->
dlsch
[
dlsch_id
][
0
];
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
harq
->
pdsch_pdu
.
pdsch_pdu_rel15
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
harq
->
pdsch_pdu
.
pdsch_pdu_rel15
;
...
@@ -567,12 +567,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
...
@@ -567,12 +567,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
}
void
dump_pdsch_stats
(
FILE
*
fd
,
PHY_VARS_gNB
*
gNB
)
{
void
dump_pdsch_stats
(
FILE
*
fd
,
PHY_VARS_gNB
*
gNB
)
{
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
{
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
{
NR_gNB_PHY_STATS_t
*
stats
=
&
gNB
->
phy_stats
[
i
];
NR_gNB_PHY_STATS_t
*
stats
=
&
gNB
->
phy_stats
[
i
];
if
(
stats
->
active
&&
stats
->
frame
!=
stats
->
dlsch_stats
.
dump_frame
)
{
if
(
stats
->
active
&&
stats
->
frame
!=
stats
->
dlsch_stats
.
dump_frame
)
{
stats
->
dlsch_stats
.
dump_frame
=
stats
->
frame
;
stats
->
dlsch_stats
.
dump_frame
=
stats
->
frame
;
fprintf
(
fd
,
"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d
\n
"
,
fprintf
(
fd
,
"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d
\n
"
,
stats
->
rnti
,
stats
->
rnti
,
stats
->
dlsch_stats
.
current_Qm
,
stats
->
dlsch_stats
.
current_Qm
,
stats
->
dlsch_stats
.
current_RI
,
stats
->
dlsch_stats
.
current_RI
,
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
0d664103
...
@@ -48,13 +48,8 @@
...
@@ -48,13 +48,8 @@
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_FREE 1
//#define DEBUG_DLSCH_FREE 1
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
N_RB
,
const
NR_DL_FRAME_PARMS
*
frame_parms
)
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
**
dlschptr
,
{
uint16_t
N_RB
,
const
NR_DL_FRAME_PARMS
*
frame_parms
)
{
NR_gNB_DLSCH_t
*
dlsch
=
*
dlschptr
;
int
max_layers
=
(
frame_parms
->
nb_antennas_tx
<
NR_MAX_NB_LAYERS
)
?
frame_parms
->
nb_antennas_tx
:
NR_MAX_NB_LAYERS
;
int
max_layers
=
(
frame_parms
->
nb_antennas_tx
<
NR_MAX_NB_LAYERS
)
?
frame_parms
->
nb_antennas_tx
:
NR_MAX_NB_LAYERS
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
max_layers
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
max_layers
;
...
@@ -92,14 +87,10 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,
...
@@ -92,14 +87,10 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,
}
}
free
(
dlsch
->
txdataF
);
free
(
dlsch
->
txdataF
);
free
(
dlsch
->
ue_spec_bf_weights
);
free
(
dlsch
->
ue_spec_bf_weights
);
free
(
dlsch
);
*
dlschptr
=
NULL
;
}
}
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
NR_gNB_DLSCH_t
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
uint16_t
N_RB
)
uint16_t
N_RB
)
{
{
int
max_layers
=
(
frame_parms
->
nb_antennas_tx
<
NR_MAX_NB_LAYERS
)
?
frame_parms
->
nb_antennas_tx
:
NR_MAX_NB_LAYERS
;
int
max_layers
=
(
frame_parms
->
nb_antennas_tx
<
NR_MAX_NB_LAYERS
)
?
frame_parms
->
nb_antennas_tx
:
NR_MAX_NB_LAYERS
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
max_layers
;
//number of segments to be allocated
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
max_layers
;
//number of segments to be allocated
...
@@ -110,34 +101,32 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
...
@@ -110,34 +101,32 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
LOG_D
(
PHY
,
"Allocating %d segments (MAX %d, N_PRB %d)
\n
"
,
a_segments
,
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
,
N_RB
);
LOG_D
(
PHY
,
"Allocating %d segments (MAX %d, N_PRB %d)
\n
"
,
a_segments
,
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
,
N_RB
);
uint32_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
uint32_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
NR_gNB_DLSCH_t
*
dlsch
=
malloc16
(
sizeof
(
NR_gNB_DLSCH_t
));
NR_gNB_DLSCH_t
dlsch
;
AssertFatal
(
dlsch
,
"cannot allocate dlsch
\n
"
);
bzero
(
dlsch
,
sizeof
(
NR_gNB_DLSCH_t
));
int
txdataf_size
=
frame_parms
->
N_RB_DL
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
8
;
// max pdsch encoded length for each layer
int
txdataf_size
=
frame_parms
->
N_RB_DL
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
8
;
// max pdsch encoded length for each layer
dlsch
->
txdataF
=
(
int32_t
**
)
malloc16
(
max_layers
*
sizeof
(
int32_t
*
));
dlsch
.
txdataF
=
(
int32_t
**
)
malloc16
(
max_layers
*
sizeof
(
int32_t
*
));
dlsch
->
ue_spec_bf_weights
=
(
int32_t
***
)
malloc16
(
max_layers
*
sizeof
(
int32_t
**
));
dlsch
.
ue_spec_bf_weights
=
(
int32_t
***
)
malloc16
(
max_layers
*
sizeof
(
int32_t
**
));
for
(
int
layer
=
0
;
layer
<
max_layers
;
layer
++
)
{
for
(
int
layer
=
0
;
layer
<
max_layers
;
layer
++
)
{
dlsch
->
ue_spec_bf_weights
[
layer
]
=
(
int32_t
**
)
malloc16
(
64
*
sizeof
(
int32_t
*
));
dlsch
.
ue_spec_bf_weights
[
layer
]
=
(
int32_t
**
)
malloc16
(
64
*
sizeof
(
int32_t
*
));
for
(
int
aa
=
0
;
aa
<
64
;
aa
++
)
{
for
(
int
aa
=
0
;
aa
<
64
;
aa
++
)
{
dlsch
->
ue_spec_bf_weights
[
layer
][
aa
]
=
(
int32_t
*
)
malloc16
(
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
*
sizeof
(
int32_t
));
dlsch
.
ue_spec_bf_weights
[
layer
][
aa
]
=
(
int32_t
*
)
malloc16
(
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
*
sizeof
(
int32_t
));
for
(
int
re
=
0
;
re
<
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
re
++
)
{
for
(
int
re
=
0
;
re
<
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
re
++
)
{
dlsch
->
ue_spec_bf_weights
[
layer
][
aa
][
re
]
=
0x00007fff
;
dlsch
.
ue_spec_bf_weights
[
layer
][
aa
][
re
]
=
0x00007fff
;
}
}
}
}
dlsch
->
txdataF
[
layer
]
=
(
int32_t
*
)
malloc16
((
txdataf_size
)
*
sizeof
(
int32_t
));
dlsch
.
txdataF
[
layer
]
=
(
int32_t
*
)
malloc16
((
txdataf_size
)
*
sizeof
(
int32_t
));
}
}
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
dlsch
->
mod_symbs
=
(
int32_t
**
)
malloc16
(
nb_codewords
*
sizeof
(
int32_t
*
));
dlsch
.
mod_symbs
=
(
int32_t
**
)
malloc16
(
nb_codewords
*
sizeof
(
int32_t
*
));
for
(
int
q
=
0
;
q
<
nb_codewords
;
q
++
)
for
(
int
q
=
0
;
q
<
nb_codewords
;
q
++
)
dlsch
->
mod_symbs
[
q
]
=
(
int32_t
*
)
malloc16
(
txdataf_size
*
max_layers
*
sizeof
(
int32_t
));
dlsch
.
mod_symbs
[
q
]
=
(
int32_t
*
)
malloc16
(
txdataf_size
*
max_layers
*
sizeof
(
int32_t
));
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
.
harq_process
;
bzero
(
harq
,
sizeof
(
NR_DL_gNB_HARQ_t
));
bzero
(
harq
,
sizeof
(
NR_DL_gNB_HARQ_t
));
harq
->
b
=
malloc16
(
dlsch_bytes
);
harq
->
b
=
malloc16
(
dlsch_bytes
);
AssertFatal
(
harq
->
b
,
"cannot allocate memory for harq->b
\n
"
);
AssertFatal
(
harq
->
b
,
"cannot allocate memory for harq->b
\n
"
);
...
@@ -276,9 +265,13 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
...
@@ -276,9 +265,13 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t
slot
,
uint8_t
slot
,
NR_DL_gNB_HARQ_t
*
harq
,
NR_DL_gNB_HARQ_t
*
harq
,
NR_DL_FRAME_PARMS
*
frame_parms
,
NR_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
*
output
,
unsigned
char
*
output
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
,
time_stats_t
*
tinput
,
time_stats_t
*
dlsch_rate_matching_stats
,
time_stats_t
*
dlsch_interleaving_stats
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
,
time_stats_t
*
dlsch_rate_matching_stats
,
time_stats_t
*
dlsch_interleaving_stats
,
time_stats_t
*
dlsch_segmentation_stats
)
time_stats_t
*
dlsch_segmentation_stats
)
{
{
encoder_implemparams_t
impp
;
encoder_implemparams_t
impp
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
View file @
0d664103
...
@@ -44,17 +44,13 @@ void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) {
...
@@ -44,17 +44,13 @@ void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) {
*
(
pdu
+
i
)
=
(
uint8_t
)
rand
();
*
(
pdu
+
i
)
=
(
uint8_t
)
rand
();
}
}
void
nr_fill_dlsch
(
processingData_L1tx_t
*
msgTx
,
void
nr_fill_dlsch
(
processingData_L1tx_t
*
msgTx
,
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
uint8_t
*
sdu
)
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
uint8_t
*
sdu
)
{
{
NR_gNB_DLSCH_t
*
dlsch
=
&
msgTx
->
dlsch
[
msgTx
->
num_pdsch_slot
][
0
];
NR_gNB_DLSCH_t
*
dlsch
=
msgTx
->
dlsch
[
msgTx
->
num_pdsch_slot
][
0
];
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
->
harq_process
;
/// DLSCH struct
/// DLSCH struct
memcpy
((
void
*
)
&
harq
->
pdsch_pdu
,
(
void
*
)
pdsch_pdu
,
sizeof
(
nfapi_nr_dl_tti_pdsch_pdu
));
memcpy
((
void
*
)
&
harq
->
pdsch_pdu
,
(
void
*
)
pdsch_pdu
,
sizeof
(
nfapi_nr_dl_tti_pdsch_pdu
));
msgTx
->
num_pdsch_slot
++
;
msgTx
->
num_pdsch_slot
++
;
AssertFatal
(
sdu
!=
NULL
,
"sdu is null
\n
"
);
AssertFatal
(
sdu
!=
NULL
,
"sdu is null
\n
"
);
harq
->
pdu
=
sdu
;
harq
->
pdu
=
sdu
;
}
}
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
View file @
0d664103
...
@@ -108,10 +108,9 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
...
@@ -108,10 +108,9 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
*/
*/
void
nr_init_pbch_interleaver
(
uint8_t
*
interleaver
);
void
nr_init_pbch_interleaver
(
uint8_t
*
interleaver
);
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
NR_gNB_DLSCH_t
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
uint16_t
N_RB
);
uint16_t
N_RB
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
*
dlschptr
,
uint16_t
N_RB
,
const
NR_DL_FRAME_PARMS
*
frame_parms
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
N_RB
,
const
NR_DL_FRAME_PARMS
*
frame_parms
);
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
- RB extraction (signal and channel estimates)
- RB extraction (signal and channel estimates)
...
@@ -308,17 +307,11 @@ void nr_fill_prach_ru(RU_t *ru,
...
@@ -308,17 +307,11 @@ void nr_fill_prach_ru(RU_t *ru,
int16_t
find_nr_prach
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
find_type_t
type
);
int16_t
find_nr_prach
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
find_type_t
type
);
int16_t
find_nr_prach_ru
(
RU_t
*
ru
,
int
frame
,
int
slot
,
find_type_t
type
);
int16_t
find_nr_prach_ru
(
RU_t
*
ru
,
int
frame
,
int
slot
,
find_type_t
type
);
NR_gNB_PUCCH_t
*
new_gNB_pucch
(
void
);
void
free_gNB_pucch
(
NR_gNB_PUCCH_t
*
pucch
);
void
nr_fill_pucch
(
PHY_VARS_gNB
*
gNB
,
void
nr_fill_pucch
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
frame
,
int
slot
,
int
slot
,
nfapi_nr_pucch_pdu_t
*
pucch_pdu
);
nfapi_nr_pucch_pdu_t
*
pucch_pdu
);
NR_gNB_SRS_t
*
new_gNB_srs
(
void
);
void
free_gNB_srs
(
NR_gNB_SRS_t
*
srs
);
void
nr_fill_srs
(
PHY_VARS_gNB
*
gNB
,
void
nr_fill_srs
(
PHY_VARS_gNB
*
gNB
,
frame_t
frame
,
frame_t
frame
,
slot_t
slot
,
slot_t
slot
,
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
View file @
0d664103
...
@@ -36,36 +36,30 @@
...
@@ -36,36 +36,30 @@
NR_gNB_ULSCH_t
*
find_nr_ulsch
(
PHY_VARS_gNB
*
gNB
,
uint16_t
rnti
,
int
pid
)
NR_gNB_ULSCH_t
*
find_nr_ulsch
(
PHY_VARS_gNB
*
gNB
,
uint16_t
rnti
,
int
pid
)
{
{
int16_t
first_free_index
=
-
1
;
int16_t
first_free_index
=
-
1
;
AssertFatal
(
gNB
!=
NULL
,
"gNB is null
\n
"
);
AssertFatal
(
gNB
!=
NULL
,
"gNB is null
\n
"
);
NR_gNB_ULSCH_t
*
ulsch
=
NULL
;
NR_gNB_ULSCH_t
*
ulsch
=
NULL
;
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
{
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
{
ulsch
=
gNB
->
ulsch
[
i
];
ulsch
=
&
gNB
->
ulsch
[
i
];
AssertFatal
(
ulsch
!=
NULL
,
"gNB->ulsch[%d] is null
\n
"
,
i
);
AssertFatal
(
ulsch
!=
NULL
,
"gNB->ulsch[%d] is null
\n
"
,
i
);
if
(
!
ulsch
->
active
)
{
if
(
!
ulsch
->
active
)
{
if
(
first_free_index
==
-
1
)
if
(
first_free_index
==
-
1
)
first_free_index
=
i
;
first_free_index
=
i
;
}
}
else
{
else
{
// if there is already an active ULSCH for this RNTI and HARQ_PID
// if there is already an active ULSCH for this RNTI and HARQ_PID
if
((
ulsch
->
harq_pid
==
pid
)
&&
(
ulsch
->
rnti
==
rnti
))
if
((
ulsch
->
harq_pid
==
pid
)
&&
(
ulsch
->
rnti
==
rnti
))
return
ulsch
;
return
ulsch
;
}
}
}
}
if
(
first_free_index
!=
-
1
)
if
(
first_free_index
!=
-
1
)
ulsch
=
gNB
->
ulsch
[
first_free_index
];
ulsch
=
&
gNB
->
ulsch
[
first_free_index
];
return
ulsch
;
return
ulsch
;
}
}
void
nr_fill_ulsch
(
PHY_VARS_gNB
*
gNB
,
void
nr_fill_ulsch
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
nfapi_nr_pusch_pdu_t
*
ulsch_pdu
)
int
frame
,
int
slot
,
nfapi_nr_pusch_pdu_t
*
ulsch_pdu
)
{
{
int
harq_pid
=
ulsch_pdu
->
pusch_data
.
harq_process_id
;
int
harq_pid
=
ulsch_pdu
->
pusch_data
.
harq_process_id
;
NR_gNB_ULSCH_t
*
ulsch
=
find_nr_ulsch
(
gNB
,
ulsch_pdu
->
rnti
,
harq_pid
);
NR_gNB_ULSCH_t
*
ulsch
=
find_nr_ulsch
(
gNB
,
ulsch_pdu
->
rnti
,
harq_pid
);
AssertFatal
(
ulsch
,
"No ulsch_id found for rnti %04x
\n
"
,
ulsch_pdu
->
rnti
);
AssertFatal
(
ulsch
,
"No ulsch_id found for rnti %04x
\n
"
,
ulsch_pdu
->
rnti
);
...
@@ -79,8 +73,13 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
...
@@ -79,8 +73,13 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
NR_UL_gNB_HARQ_t
*
harq
=
ulsch
->
harq_process
;
NR_UL_gNB_HARQ_t
*
harq
=
ulsch
->
harq_process
;
harq
->
new_rx
=
ulsch_pdu
->
pusch_data
.
new_data_indicator
;
harq
->
new_rx
=
ulsch_pdu
->
pusch_data
.
new_data_indicator
;
LOG_D
(
PHY
,
"%d.%d RNTI %x HARQ PID %d new data indicator %d
\n
"
,
LOG_D
(
PHY
,
frame
,
slot
,
ulsch_pdu
->
rnti
,
harq_pid
,
ulsch_pdu
->
pusch_data
.
new_data_indicator
);
"%d.%d RNTI %x HARQ PID %d new data indicator %d
\n
"
,
frame
,
slot
,
ulsch_pdu
->
rnti
,
harq_pid
,
ulsch_pdu
->
pusch_data
.
new_data_indicator
);
if
(
harq
->
new_rx
)
if
(
harq
->
new_rx
)
harq
->
round
=
0
;
harq
->
round
=
0
;
else
else
...
@@ -88,16 +87,16 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
...
@@ -88,16 +87,16 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
memcpy
(
&
ulsch
->
harq_process
->
ulsch_pdu
,
ulsch_pdu
,
sizeof
(
ulsch
->
harq_process
->
ulsch_pdu
));
memcpy
(
&
ulsch
->
harq_process
->
ulsch_pdu
,
ulsch_pdu
,
sizeof
(
ulsch
->
harq_process
->
ulsch_pdu
));
LOG_D
(
PHY
,
"Initializing nFAPI for ULSCH, harq_pid %d
\n
"
,
harq_pid
);
LOG_D
(
PHY
,
"Initializing nFAPI for ULSCH, harq_pid %d
\n
"
,
harq_pid
);
}
}
void
reset_active_ulsch
(
PHY_VARS_gNB
*
gNB
,
int
frame
)
void
reset_active_ulsch
(
PHY_VARS_gNB
*
gNB
,
int
frame
)
{
{
// d
is
activate ULSCH structure after a given number of frames
// d
e
activate ULSCH structure after a given number of frames
// no activity on this structure for NUMBER_FRAMES_PHY_UE_INACTIVE
// no activity on this structure for NUMBER_FRAMES_PHY_UE_INACTIVE
// assuming UE disconnected or some other error occurred
// assuming UE disconnected or some other error occurred
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
{
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
{
NR_gNB_ULSCH_t
*
ulsch
=
gNB
->
ulsch
[
i
];
NR_gNB_ULSCH_t
*
ulsch
=
&
gNB
->
ulsch
[
i
];
if
(
ulsch
->
active
&&
(((
frame
-
ulsch
->
frame
+
1024
)
%
1024
)
>
NUMBER_FRAMES_PHY_UE_INACTIVE
))
if
(
ulsch
->
active
&&
(((
frame
-
ulsch
->
frame
+
1024
)
%
1024
)
>
NUMBER_FRAMES_PHY_UE_INACTIVE
))
ulsch
->
active
=
false
;
ulsch
->
active
=
false
;
}
}
...
@@ -108,11 +107,7 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n
...
@@ -108,11 +107,7 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n
nr_codeword_unscrambling
(
llr
,
size
,
0
,
Nid
,
n_RNTI
);
nr_codeword_unscrambling
(
llr
,
size
,
0
,
Nid
,
n_RNTI
);
}
}
void
nr_ulsch_layer_demapping
(
int16_t
*
llr_cw
,
void
nr_ulsch_layer_demapping
(
int16_t
*
llr_cw
,
uint8_t
Nl
,
uint8_t
mod_order
,
uint32_t
length
,
int16_t
**
llr_layers
)
uint8_t
Nl
,
uint8_t
mod_order
,
uint32_t
length
,
int16_t
**
llr_layers
)
{
{
switch
(
Nl
)
{
switch
(
Nl
)
{
...
@@ -137,31 +132,43 @@ void nr_ulsch_layer_demapping(int16_t *llr_cw,
...
@@ -137,31 +132,43 @@ void nr_ulsch_layer_demapping(int16_t *llr_cw,
void
dump_pusch_stats
(
FILE
*
fd
,
PHY_VARS_gNB
*
gNB
)
void
dump_pusch_stats
(
FILE
*
fd
,
PHY_VARS_gNB
*
gNB
)
{
{
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
{
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
{
NR_gNB_PHY_STATS_t
*
stats
=
&
gNB
->
phy_stats
[
i
];
NR_gNB_PHY_STATS_t
*
stats
=
&
gNB
->
phy_stats
[
i
];
if
(
stats
->
active
&&
stats
->
frame
!=
stats
->
ulsch_stats
.
dump_frame
)
{
if
(
stats
->
active
&&
stats
->
frame
!=
stats
->
ulsch_stats
.
dump_frame
)
{
stats
->
ulsch_stats
.
dump_frame
=
stats
->
frame
;
stats
->
ulsch_stats
.
dump_frame
=
stats
->
frame
;
for
(
int
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_rx
;
aa
++
)
for
(
int
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_rx
;
aa
++
)
if
(
aa
==
0
)
if
(
aa
==
0
)
fprintf
(
fd
,
"ULSCH RNTI %4x, %d: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d, sync_pos %d
\n
"
,
fprintf
(
fd
,
stats
->
rnti
,
stats
->
frame
,
"ULSCH RNTI %4x, %d: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d, sync_pos %d
\n
"
,
aa
,
stats
->
ulsch_stats
.
power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
power
[
aa
]
%
10
,
stats
->
rnti
,
aa
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
%
10
,
stats
->
frame
,
aa
,
stats
->
ulsch_stats
.
power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
power
[
aa
]
%
10
,
aa
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
%
10
,
stats
->
ulsch_stats
.
sync_pos
);
stats
->
ulsch_stats
.
sync_pos
);
else
else
fprintf
(
fd
,
" ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d
\n
"
,
fprintf
(
fd
,
aa
,
stats
->
ulsch_stats
.
power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
power
[
aa
]
%
10
,
" ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d
\n
"
,
aa
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
%
10
);
aa
,
stats
->
ulsch_stats
.
power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
power
[
aa
]
%
10
,
aa
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
%
10
);
int
*
rt
=
stats
->
ulsch_stats
.
round_trials
;
int
*
rt
=
stats
->
ulsch_stats
.
round_trials
;
fprintf
(
fd
,
" round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d
\n
"
,
fprintf
(
fd
,
" round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes "
"RX/SCHED %d/%d
\n
"
,
rt
[
0
],
rt
[
0
],
(
double
)
rt
[
1
]
/
rt
[
0
],
(
double
)
rt
[
1
]
/
rt
[
0
],
rt
[
1
],
rt
[
1
],
(
double
)
rt
[
2
]
/
rt
[
0
],
(
double
)
rt
[
2
]
/
rt
[
0
],
rt
[
2
],
rt
[
2
],
(
double
)
rt
[
3
]
/
rt
[
0
],
(
double
)
rt
[
3
]
/
rt
[
0
],
rt
[
3
],
rt
[
3
],
stats
->
ulsch_stats
.
DTX
,
stats
->
ulsch_stats
.
DTX
,
stats
->
ulsch_stats
.
current_Qm
,
stats
->
ulsch_stats
.
current_Qm
,
...
@@ -171,5 +178,3 @@ void dump_pusch_stats(FILE *fd, PHY_VARS_gNB *gNB)
...
@@ -171,5 +178,3 @@ void dump_pusch_stats(FILE *fd, PHY_VARS_gNB *gNB)
}
}
}
}
}
}
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
View file @
0d664103
...
@@ -33,10 +33,9 @@
...
@@ -33,10 +33,9 @@
#include "PHY/defs_gNB.h"
#include "PHY/defs_gNB.h"
#include "common/utils/threadPool/thread-pool.h"
#include "common/utils/threadPool/thread-pool.h"
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
**
ulsch
,
uint16_t
N_RB_UL
);
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
,
uint16_t
N_RB_UL
);
NR_gNB_ULSCH_t
*
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint16_t
N_RB_UL
);
NR_gNB_ULSCH_t
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint16_t
N_RB_UL
);
/*! \brief Perform PUSCH decoding. TS 38.212 V15.4.0 subclause 6.2
/*! \brief Perform PUSCH decoding. TS 38.212 V15.4.0 subclause 6.2
@param phy_vars_gNB, Pointer to PHY data structure for gNB
@param phy_vars_gNB, Pointer to PHY data structure for gNB
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
0d664103
...
@@ -55,11 +55,10 @@
...
@@ -55,11 +55,10 @@
//extern double cpuf;
//extern double cpuf;
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
*
ulschptr
,
uint16_t
N_RB_UL
)
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
,
uint16_t
N_RB_UL
)
{
{
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
;
//number of segments to be allocated
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
;
//number of segments to be allocated
NR_gNB_ULSCH_t
*
ulsch
=
*
ulschptr
;
if
(
N_RB_UL
!=
273
)
{
if
(
N_RB_UL
!=
273
)
{
a_segments
=
a_segments
*
N_RB_UL
;
a_segments
=
a_segments
*
N_RB_UL
;
...
@@ -80,11 +79,10 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
...
@@ -80,11 +79,10 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
free_and_zero
(
ulsch
->
harq_process
);
free_and_zero
(
ulsch
->
harq_process
);
ulsch
->
harq_process
=
NULL
;
ulsch
->
harq_process
=
NULL
;
}
}
free_and_zero
(
*
ulschptr
);
free_and_zero
(
ulsch
);
}
}
NR_gNB_ULSCH_t
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint16_t
N_RB_UL
)
NR_gNB_ULSCH_t
*
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint16_t
N_RB_UL
)
{
{
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
;
//number of segments to be allocated
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
;
//number of segments to be allocated
...
@@ -95,14 +93,14 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
...
@@ -95,14 +93,14 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
}
}
uint32_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
uint32_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
NR_gNB_ULSCH_t
*
ulsch
=
malloc16_clear
(
sizeof
(
*
ulsch
))
;
NR_gNB_ULSCH_t
ulsch
;
ulsch
->
max_ldpc_iterations
=
max_ldpc_iterations
;
ulsch
.
max_ldpc_iterations
=
max_ldpc_iterations
;
ulsch
->
harq_pid
=
-
1
;
ulsch
.
harq_pid
=
-
1
;
ulsch
->
active
=
false
;
ulsch
.
active
=
false
;
NR_UL_gNB_HARQ_t
*
harq
=
malloc16_clear
(
sizeof
(
harq
));
NR_UL_gNB_HARQ_t
*
harq
=
malloc16_clear
(
sizeof
(
*
harq
));
ulsch
->
harq_process
=
harq
;
ulsch
.
harq_process
=
harq
;
harq
->
b
=
malloc16_clear
(
ulsch_bytes
*
sizeof
(
*
harq
->
b
));
harq
->
b
=
malloc16_clear
(
ulsch_bytes
*
sizeof
(
*
harq
->
b
));
harq
->
c
=
malloc16_clear
(
a_segments
*
sizeof
(
*
harq
->
c
));
harq
->
c
=
malloc16_clear
(
a_segments
*
sizeof
(
*
harq
->
c
));
harq
->
d
=
malloc16_clear
(
a_segments
*
sizeof
(
*
harq
->
d
));
harq
->
d
=
malloc16_clear
(
a_segments
*
sizeof
(
*
harq
->
d
));
...
@@ -117,10 +115,9 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
...
@@ -117,10 +115,9 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
static
uint32_t
prnt_crc_cnt
=
0
;
static
uint32_t
prnt_crc_cnt
=
0
;
#endif
#endif
void
nr_processULSegment
(
void
*
arg
)
void
nr_processULSegment
(
void
*
arg
)
{
{
ldpcDecode_t
*
rdata
=
(
ldpcDecode_t
*
)
arg
;
ldpcDecode_t
*
rdata
=
(
ldpcDecode_t
*
)
arg
;
PHY_VARS_gNB
*
phy_vars_gNB
=
rdata
->
gNB
;
PHY_VARS_gNB
*
phy_vars_gNB
=
rdata
->
gNB
;
NR_UL_gNB_HARQ_t
*
ulsch_harq
=
rdata
->
ulsch_harq
;
NR_UL_gNB_HARQ_t
*
ulsch_harq
=
rdata
->
ulsch_harq
;
t_nrLDPC_dec_params
*
p_decoderParms
=
&
rdata
->
decoderParms
;
t_nrLDPC_dec_params
*
p_decoderParms
=
&
rdata
->
decoderParms
;
...
@@ -139,24 +136,24 @@ void nr_processULSegment(void* arg)
...
@@ -139,24 +136,24 @@ void nr_processULSegment(void* arg)
int
rv_index
=
rdata
->
rv_index
;
int
rv_index
=
rdata
->
rv_index
;
int
r_offset
=
rdata
->
r_offset
;
int
r_offset
=
rdata
->
r_offset
;
uint8_t
kc
=
rdata
->
Kc
;
uint8_t
kc
=
rdata
->
Kc
;
short
*
ulsch_llr
=
rdata
->
ulsch_llr
;
short
*
ulsch_llr
=
rdata
->
ulsch_llr
;
int
max_ldpc_iterations
=
p_decoderParms
->
numMaxIter
;
int
max_ldpc_iterations
=
p_decoderParms
->
numMaxIter
;
int8_t
llrProcBuf
[
OAI_UL_LDPC_MAX_NUM_LLR
]
__attribute__
((
aligned
(
32
)));
int8_t
llrProcBuf
[
OAI_UL_LDPC_MAX_NUM_LLR
]
__attribute__
((
aligned
(
32
)));
int16_t
z
[
68
*
384
+
16
]
__attribute__
((
aligned
(
16
)));
int16_t
z
[
68
*
384
+
16
]
__attribute__
((
aligned
(
16
)));
int8_t
l
[
68
*
384
+
16
]
__attribute__
((
aligned
(
16
)));
int8_t
l
[
68
*
384
+
16
]
__attribute__
((
aligned
(
16
)));
__m128i
*
pv
=
(
__m128i
*
)
&
z
;
__m128i
*
pv
=
(
__m128i
*
)
&
z
;
__m128i
*
pl
=
(
__m128i
*
)
&
l
;
__m128i
*
pl
=
(
__m128i
*
)
&
l
;
Kr
=
ulsch_harq
->
K
;
Kr
=
ulsch_harq
->
K
;
Kr_bytes
=
Kr
>>
3
;
Kr_bytes
=
Kr
>>
3
;
K_bits_F
=
Kr
-
ulsch_harq
->
F
;
K_bits_F
=
Kr
-
ulsch_harq
->
F
;
t_nrLDPC_time_stats
procTime
=
{
0
};
t_nrLDPC_time_stats
procTime
=
{
0
};
t_nrLDPC_time_stats
*
p_procTime
=
&
procTime
;
t_nrLDPC_time_stats
*
p_procTime
=
&
procTime
;
//
start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
//
start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
...
@@ -167,27 +164,22 @@ void nr_processULSegment(void* arg)
...
@@ -167,27 +164,22 @@ void nr_processULSegment(void* arg)
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
int16_t
harq_e
[
E
];
int16_t
harq_e
[
E
];
nr_deinterleaving_ldpc
(
E
,
nr_deinterleaving_ldpc
(
E
,
Qm
,
harq_e
,
ulsch_llr
+
r_offset
);
Qm
,
harq_e
,
ulsch_llr
+
r_offset
);
//
for (int i =0; i<16; i++)
//
for (int i =0; i<16; i++)
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,ulsch_harq->w[r][i], r_offset);
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,ulsch_harq->w[r][i], r_offset);
stop_meas
(
&
phy_vars_gNB
->
ulsch_deinterleaving_stats
);
stop_meas
(
&
phy_vars_gNB
->
ulsch_deinterleaving_stats
);
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// nr_rate_matching_ldpc_rx ////////////////////////////////
//////////////////////////////// nr_rate_matching_ldpc_rx ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////// ulsch_harq->e =====> ulsch_harq->d /////////////////////////
///////////////////////// ulsch_harq->e =====> ulsch_harq->d /////////////////////////
//
start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
//
start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
if
(
nr_rate_matching_ldpc_rx
(
rdata
->
tbslbrm
,
if
(
nr_rate_matching_ldpc_rx
(
rdata
->
tbslbrm
,
p_decoderParms
->
BG
,
p_decoderParms
->
BG
,
...
@@ -199,18 +191,18 @@ void nr_processULSegment(void* arg)
...
@@ -199,18 +191,18 @@ void nr_processULSegment(void* arg)
ulsch_harq
->
new_rx
,
ulsch_harq
->
new_rx
,
E
,
E
,
ulsch_harq
->
F
,
ulsch_harq
->
F
,
Kr
-
ulsch_harq
->
F
-
2
*
(
p_decoderParms
->
Z
))
==-
1
)
{
Kr
-
ulsch_harq
->
F
-
2
*
(
p_decoderParms
->
Z
))
==
-
1
)
{
stop_meas
(
&
phy_vars_gNB
->
ulsch_rate_unmatching_stats
);
stop_meas
(
&
phy_vars_gNB
->
ulsch_rate_unmatching_stats
);
LOG_E
(
PHY
,
"ulsch_decoding.c: Problem in rate_matching
\n
"
);
LOG_E
(
PHY
,
"ulsch_decoding.c: Problem in rate_matching
\n
"
);
rdata
->
decodeIterations
=
max_ldpc_iterations
+
1
;
rdata
->
decodeIterations
=
max_ldpc_iterations
+
1
;
return
;
return
;
}
else
{
}
else
{
stop_meas
(
&
phy_vars_gNB
->
ulsch_rate_unmatching_stats
);
stop_meas
(
&
phy_vars_gNB
->
ulsch_rate_unmatching_stats
);
}
}
memset
(
ulsch_harq
->
c
[
r
],
0
,
Kr_bytes
);
memset
(
ulsch_harq
->
c
[
r
],
0
,
Kr_bytes
);
if
(
ulsch_harq
->
C
==
1
)
{
if
(
ulsch_harq
->
C
==
1
)
{
if
(
A
>
3824
)
if
(
A
>
3824
)
...
@@ -219,42 +211,36 @@ void nr_processULSegment(void* arg)
...
@@ -219,42 +211,36 @@ void nr_processULSegment(void* arg)
crc_type
=
CRC16
;
crc_type
=
CRC16
;
length_dec
=
ulsch_harq
->
B
;
length_dec
=
ulsch_harq
->
B
;
}
}
else
{
else
{
crc_type
=
CRC24_B
;
crc_type
=
CRC24_B
;
length_dec
=
(
ulsch_harq
->
B
+
24
*
ulsch_harq
->
C
)
/
ulsch_harq
->
C
;
length_dec
=
(
ulsch_harq
->
B
+
24
*
ulsch_harq
->
C
)
/
ulsch_harq
->
C
;
}
}
//
start_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
//
start_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
//set first 2*Z_c bits to zeros
// set first 2*Z_c bits to zeros
memset
(
&
z
[
0
],
0
,
2
*
ulsch_harq
->
Z
*
sizeof
(
int16_t
));
memset
(
&
z
[
0
],
0
,
2
*
ulsch_harq
->
Z
*
sizeof
(
int16_t
));
//set Filler bits
// set Filler bits
memset
((
&
z
[
0
]
+
K_bits_F
),
127
,
ulsch_harq
->
F
*
sizeof
(
int16_t
));
memset
((
&
z
[
0
]
+
K_bits_F
),
127
,
ulsch_harq
->
F
*
sizeof
(
int16_t
));
//Move coded bits before filler bits
// Move coded bits before filler bits
memcpy
((
&
z
[
0
]
+
2
*
ulsch_harq
->
Z
),
ulsch_harq
->
d
[
r
],(
K_bits_F
-
2
*
ulsch_harq
->
Z
)
*
sizeof
(
int16_t
));
memcpy
((
&
z
[
0
]
+
2
*
ulsch_harq
->
Z
),
ulsch_harq
->
d
[
r
],
(
K_bits_F
-
2
*
ulsch_harq
->
Z
)
*
sizeof
(
int16_t
));
//skip filler bits
// skip filler bits
memcpy
((
&
z
[
0
]
+
Kr
),
ulsch_harq
->
d
[
r
]
+
(
Kr
-
2
*
ulsch_harq
->
Z
),(
kc
*
ulsch_harq
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
memcpy
((
&
z
[
0
]
+
Kr
),
ulsch_harq
->
d
[
r
]
+
(
Kr
-
2
*
ulsch_harq
->
Z
),
(
kc
*
ulsch_harq
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
//Saturate coded bits before decoding into 8 bits values
// Saturate coded bits before decoding into 8 bits values
for
(
i
=
0
,
j
=
0
;
j
<
((
kc
*
ulsch_harq
->
Z
)
>>
4
)
+
1
;
i
+=
2
,
j
++
)
for
(
i
=
0
,
j
=
0
;
j
<
((
kc
*
ulsch_harq
->
Z
)
>>
4
)
+
1
;
i
+=
2
,
j
++
)
{
{
pl
[
j
]
=
_mm_packs_epi16
(
pv
[
i
],
pv
[
i
+
1
]);
pl
[
j
]
=
_mm_packs_epi16
(
pv
[
i
],
pv
[
i
+
1
]);
}
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// nrLDPC_decoder /////////////////////////////////////
///////////////////////////////////// nrLDPC_decoder /////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
p_decoderParms
->
block_length
=
length_dec
;
p_decoderParms
->
block_length
=
length_dec
;
no_iteration_ldpc
=
nrLDPC_decoder
(
p_decoderParms
,
no_iteration_ldpc
=
nrLDPC_decoder
(
p_decoderParms
,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
p_procTime
);
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
p_procTime
);
if
(
check_crc
((
uint8_t
*
)
llrProcBuf
,
length_dec
,
ulsch_harq
->
F
,
crc_type
))
{
if
(
check_crc
((
uint8_t
*
)
llrProcBuf
,
length_dec
,
ulsch_harq
->
F
,
crc_type
))
{
#ifdef PRINT_CRC_CHECK
#ifdef PRINT_CRC_CHECK
LOG_I
(
PHY
,
"Segment %d CRC OK, iterations %d/%d
\n
"
,
r
,
no_iteration_ldpc
,
max_ldpc_iterations
);
LOG_I
(
PHY
,
"Segment %d CRC OK, iterations %d/%d
\n
"
,
r
,
no_iteration_ldpc
,
max_ldpc_iterations
);
#endif
#endif
...
@@ -272,7 +258,7 @@ void nr_processULSegment(void* arg)
...
@@ -272,7 +258,7 @@ void nr_processULSegment(void* arg)
}
}
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
}
}
uint32_t
nr_ulsch_decoding
(
PHY_VARS_gNB
*
phy_vars_gNB
,
uint32_t
nr_ulsch_decoding
(
PHY_VARS_gNB
*
phy_vars_gNB
,
uint8_t
ULSCH_id
,
uint8_t
ULSCH_id
,
...
@@ -284,13 +270,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
...
@@ -284,13 +270,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint8_t
harq_pid
,
uint8_t
harq_pid
,
uint32_t
G
)
uint32_t
G
)
{
{
#ifdef PRINT_CRC_CHECK
#ifdef PRINT_CRC_CHECK
prnt_crc_cnt
++
;
prnt_crc_cnt
++
;
#endif
#endif
NR_gNB_ULSCH_t
*
ulsch
=
phy_vars_gNB
->
ulsch
[
ULSCH_id
];
NR_gNB_ULSCH_t
*
ulsch
=
&
phy_vars_gNB
->
ulsch
[
ULSCH_id
];
NR_gNB_PUSCH
*
pusch
=
phy_vars_gNB
->
pusch_vars
[
ULSCH_id
];
NR_gNB_PUSCH
*
pusch
=
&
phy_vars_gNB
->
pusch_vars
[
ULSCH_id
];
NR_UL_gNB_HARQ_t
*
harq_process
=
ulsch
->
harq_process
;
NR_UL_gNB_HARQ_t
*
harq_process
=
ulsch
->
harq_process
;
if
(
!
harq_process
)
{
if
(
!
harq_process
)
{
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
View file @
0d664103
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
0d664103
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_TRANSPORT/srs_rx.c
View file @
0d664103
...
@@ -44,33 +44,17 @@
...
@@ -44,33 +44,17 @@
//#define SRS_DEBUG
//#define SRS_DEBUG
NR_gNB_SRS_t
*
new_gNB_srs
(
void
){
void
nr_fill_srs
(
PHY_VARS_gNB
*
gNB
,
frame_t
frame
,
slot_t
slot
,
nfapi_nr_srs_pdu_t
*
srs_pdu
)
NR_gNB_SRS_t
*
srs
;
srs
=
(
NR_gNB_SRS_t
*
)
malloc16
(
sizeof
(
NR_gNB_SRS_t
));
srs
->
active
=
0
;
return
(
srs
);
}
void
free_gNB_srs
(
NR_gNB_SRS_t
*
srs
)
{
free_and_zero
(
srs
);
}
void
nr_fill_srs
(
PHY_VARS_gNB
*
gNB
,
frame_t
frame
,
slot_t
slot
,
nfapi_nr_srs_pdu_t
*
srs_pdu
)
{
{
bool
found
=
false
;
bool
found
=
false
;
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_srs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_srs
;
i
++
)
{
if
(
gNB
->
srs
[
i
]
->
active
==
0
)
{
NR_gNB_SRS_t
*
srs
=
&
gNB
->
srs
[
i
];
if
(
srs
->
active
==
0
)
{
found
=
true
;
found
=
true
;
NR_gNB_SRS_t
*
srs
=
gNB
->
srs
[
i
];
srs
->
frame
=
frame
;
srs
->
frame
=
frame
;
srs
->
slot
=
slot
;
srs
->
slot
=
slot
;
srs
->
active
=
1
;
srs
->
active
=
1
;
memcpy
((
void
*
)
&
srs
->
srs_pdu
,
(
void
*
)
srs_pdu
,
sizeof
(
nfapi_nr_srs_pdu_t
));
memcpy
((
void
*
)
&
srs
->
srs_pdu
,
(
void
*
)
srs_pdu
,
sizeof
(
nfapi_nr_srs_pdu_t
));
break
;
break
;
}
}
}
}
...
...
openair1/PHY/defs_gNB.h
View file @
0d664103
...
@@ -613,10 +613,10 @@ typedef struct PHY_VARS_gNB_s {
...
@@ -613,10 +613,10 @@ typedef struct PHY_VARS_gNB_s {
NR_gNB_COMMON
common_vars
;
NR_gNB_COMMON
common_vars
;
NR_gNB_PRACH
prach_vars
;
NR_gNB_PRACH
prach_vars
;
NR_gNB_PRS
prs_vars
;
NR_gNB_PRS
prs_vars
;
NR_gNB_PUSCH
*
*
pusch_vars
;
NR_gNB_PUSCH
*
pusch_vars
;
NR_gNB_PUCCH_t
*
*
pucch
;
NR_gNB_PUCCH_t
*
pucch
;
NR_gNB_SRS_t
*
*
srs
;
NR_gNB_SRS_t
*
srs
;
NR_gNB_ULSCH_t
*
*
ulsch
;
NR_gNB_ULSCH_t
*
ulsch
;
NR_gNB_PHY_STATS_t
phy_stats
[
MAX_MOBILES_PER_GNB
];
NR_gNB_PHY_STATS_t
phy_stats
[
MAX_MOBILES_PER_GNB
];
t_nrPolar_params
**
polarParams
;
t_nrPolar_params
**
polarParams
;
...
@@ -811,7 +811,7 @@ typedef struct processingData_L1tx {
...
@@ -811,7 +811,7 @@ typedef struct processingData_L1tx {
nfapi_nr_dl_tti_pdcch_pdu
pdcch_pdu
[
NFAPI_NR_MAX_NB_CORESETS
];
nfapi_nr_dl_tti_pdcch_pdu
pdcch_pdu
[
NFAPI_NR_MAX_NB_CORESETS
];
nfapi_nr_ul_dci_request_pdus_t
ul_pdcch_pdu
[
NFAPI_NR_MAX_NB_CORESETS
];
nfapi_nr_ul_dci_request_pdus_t
ul_pdcch_pdu
[
NFAPI_NR_MAX_NB_CORESETS
];
NR_gNB_CSIRS_t
csirs_pdu
[
NR_SYMBOLS_PER_SLOT
];
NR_gNB_CSIRS_t
csirs_pdu
[
NR_SYMBOLS_PER_SLOT
];
NR_gNB_DLSCH_t
**
*
dlsch
;
NR_gNB_DLSCH_t
**
dlsch
;
NR_gNB_SSB_t
ssb
[
64
];
NR_gNB_SSB_t
ssb
[
64
];
uint16_t
num_pdsch_slot
;
uint16_t
num_pdsch_slot
;
int
num_dl_pdcch
;
int
num_dl_pdcch
;
...
...
openair1/SCHED_NR/fapi_nr_l1.c
View file @
0d664103
...
@@ -100,10 +100,7 @@ void handle_nr_nfapi_ssb_pdu(processingData_L1tx_t *msgTx,int frame,int slot,
...
@@ -100,10 +100,7 @@ void handle_nr_nfapi_ssb_pdu(processingData_L1tx_t *msgTx,int frame,int slot,
}*/
}*/
void
handle_nfapi_nr_csirs_pdu
(
processingData_L1tx_t
*
msgTx
,
int
frame
,
int
slot
,
nfapi_nr_dl_tti_csi_rs_pdu
*
csirs_pdu
)
void
handle_nfapi_nr_csirs_pdu
(
processingData_L1tx_t
*
msgTx
,
int
frame
,
int
slot
,
nfapi_nr_dl_tti_csi_rs_pdu
*
csirs_pdu
)
{
{
int
found
=
0
;
int
found
=
0
;
...
@@ -121,7 +118,6 @@ void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
...
@@ -121,7 +118,6 @@ void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
LOG_E
(
MAC
,
"CSI-RS list is full
\n
"
);
LOG_E
(
MAC
,
"CSI-RS list is full
\n
"
);
}
}
void
handle_nr_nfapi_pdsch_pdu
(
processingData_L1tx_t
*
msgTx
,
void
handle_nr_nfapi_pdsch_pdu
(
processingData_L1tx_t
*
msgTx
,
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
uint8_t
*
sdu
)
uint8_t
*
sdu
)
...
@@ -133,7 +129,6 @@ void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
...
@@ -133,7 +129,6 @@ void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
void
nr_schedule_response
(
NR_Sched_Rsp_t
*
Sched_INFO
)
void
nr_schedule_response
(
NR_Sched_Rsp_t
*
Sched_INFO
)
{
{
// copy data from L2 interface into L1 structures
// copy data from L2 interface into L1 structures
module_id_t
Mod_id
=
Sched_INFO
->
module_id
;
module_id_t
Mod_id
=
Sched_INFO
->
module_id
;
nfapi_nr_dl_tti_request_t
*
DL_req
=
Sched_INFO
->
DL_req
;
nfapi_nr_dl_tti_request_t
*
DL_req
=
Sched_INFO
->
DL_req
;
...
@@ -202,8 +197,10 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO)
...
@@ -202,8 +197,10 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO)
AssertFatal
(
TX_req
->
pdu_list
[
pduIndex
].
num_TLV
==
1
,
"TX_req->pdu_list[%d].num_TLV %d != 1
\n
"
,
AssertFatal
(
TX_req
->
pdu_list
[
pduIndex
].
num_TLV
==
1
,
"TX_req->pdu_list[%d].num_TLV %d != 1
\n
"
,
pduIndex
,
TX_req
->
pdu_list
[
pduIndex
].
num_TLV
);
pduIndex
,
TX_req
->
pdu_list
[
pduIndex
].
num_TLV
);
uint8_t
*
sdu
=
(
uint8_t
*
)
TX_req
->
pdu_list
[
pduIndex
].
TLVs
[
0
].
value
.
direct
;
uint8_t
*
sdu
=
(
uint8_t
*
)
TX_req
->
pdu_list
[
pduIndex
].
TLVs
[
0
].
value
.
direct
;
AssertFatal
(
msgTx
->
num_pdsch_slot
<
gNB
->
max_nb_pdsch
,
"Number of PDSCH PDUs %d exceeded the limit %d
\n
"
,
AssertFatal
(
msgTx
->
num_pdsch_slot
<
gNB
->
max_nb_pdsch
,
msgTx
->
num_pdsch_slot
,
gNB
->
max_nb_pdsch
);
"Number of PDSCH PDUs %d exceeded the limit %d
\n
"
,
msgTx
->
num_pdsch_slot
,
gNB
->
max_nb_pdsch
);
handle_nr_nfapi_pdsch_pdu
(
msgTx
,
&
dl_tti_pdu
->
pdsch_pdu
,
sdu
);
handle_nr_nfapi_pdsch_pdu
(
msgTx
,
&
dl_tti_pdu
->
pdsch_pdu
,
sdu
);
}
}
}
}
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
0d664103
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
0d664103
...
@@ -422,7 +422,7 @@ int main(int argc, char **argv)
...
@@ -422,7 +422,7 @@ int main(int argc, char **argv)
unsigned
char
harq_pid
=
0
;
//dlsch->harq_ids[subframe];
unsigned
char
harq_pid
=
0
;
//dlsch->harq_ids[subframe];
processingData_L1tx_t
msgDataTx
;
processingData_L1tx_t
msgDataTx
;
init_DLSCH_struct
(
gNB
,
&
msgDataTx
);
init_DLSCH_struct
(
gNB
,
&
msgDataTx
);
NR_gNB_DLSCH_t
*
dlsch
=
msgDataTx
.
dlsch
[
0
][
0
];
NR_gNB_DLSCH_t
*
dlsch
=
&
msgDataTx
.
dlsch
[
0
][
0
];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
dlsch
->
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
dlsch
->
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
;
//time_stats_t *rm_stats, *te_stats, *i_stats;
//time_stats_t *rm_stats, *te_stats, *i_stats;
unsigned
int
TBS
=
8424
;
unsigned
int
TBS
=
8424
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
0d664103
...
@@ -983,7 +983,7 @@ int main(int argc, char **argv)
...
@@ -983,7 +983,7 @@ int main(int argc, char **argv)
int
harq_pid
=
slot
;
int
harq_pid
=
slot
;
NR_DL_UE_HARQ_t
*
UE_harq_process
=
&
UE
->
dl_harq_processes
[
0
][
harq_pid
];
NR_DL_UE_HARQ_t
*
UE_harq_process
=
&
UE
->
dl_harq_processes
[
0
][
harq_pid
];
NR_gNB_DLSCH_t
*
gNB_dlsch
=
msgDataTx
->
dlsch
[
0
][
0
];
NR_gNB_DLSCH_t
*
gNB_dlsch
=
&
msgDataTx
->
dlsch
[
0
][
0
];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
gNB_dlsch
->
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
rel15
=
&
gNB_dlsch
->
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
;
UE_harq_process
->
ack
=
0
;
UE_harq_process
->
ack
=
0
;
...
@@ -1245,8 +1245,10 @@ int main(int argc, char **argv)
...
@@ -1245,8 +1245,10 @@ int main(int argc, char **argv)
if
(
print_perf
==
1
)
{
if
(
print_perf
==
1
)
{
printf
(
"
\n
gNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)
\n
"
,
printf
(
"
\n
gNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)
\n
"
,
1000
>>*
scc
->
ssbSubcarrierSpacing
,
g_rbSize
,
g_mcsIndex
,
1000
>>
*
scc
->
ssbSubcarrierSpacing
,
msgDataTx
->
dlsch
[
0
][
0
]
->
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
.
TBSize
[
0
]
<<
3
);
g_rbSize
,
g_mcsIndex
,
msgDataTx
->
dlsch
[
0
][
0
].
harq_process
.
pdsch_pdu
.
pdsch_pdu_rel15
.
TBSize
[
0
]
<<
3
);
printDistribution
(
&
gNB
->
phy_proc_tx
,
table_tx
,
"PHY proc tx"
);
printDistribution
(
&
gNB
->
phy_proc_tx
,
table_tx
,
"PHY proc tx"
);
printStatIndent2
(
&
gNB
->
dlsch_encoding_stats
,
"DLSCH encoding time"
);
printStatIndent2
(
&
gNB
->
dlsch_encoding_stats
,
"DLSCH encoding time"
);
printStatIndent3
(
&
gNB
->
dlsch_segmentation_stats
,
"DLSCH segmentation time"
);
printStatIndent3
(
&
gNB
->
dlsch_segmentation_stats
,
"DLSCH segmentation time"
);
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
0d664103
openair1/SIMULATION/NR_PHY/ulschsim.c
View file @
0d664103
...
@@ -455,7 +455,7 @@ int main(int argc, char **argv)
...
@@ -455,7 +455,7 @@ int main(int argc, char **argv)
uint8_t
rvidx
=
0
;
uint8_t
rvidx
=
0
;
uint8_t
UE_id
=
0
;
uint8_t
UE_id
=
0
;
NR_gNB_ULSCH_t
*
ulsch_gNB
=
gNB
->
ulsch
[
UE_id
];
NR_gNB_ULSCH_t
*
ulsch_gNB
=
&
gNB
->
ulsch
[
UE_id
];
NR_UL_gNB_HARQ_t
*
harq_process_gNB
=
ulsch_gNB
->
harq_process
;
NR_UL_gNB_HARQ_t
*
harq_process_gNB
=
ulsch_gNB
->
harq_process
;
nfapi_nr_pusch_pdu_t
*
rel15_ul
=
&
harq_process_gNB
->
ulsch_pdu
;
nfapi_nr_pusch_pdu_t
*
rel15_ul
=
&
harq_process_gNB
->
ulsch_pdu
;
...
@@ -614,7 +614,7 @@ int main(int argc, char **argv)
...
@@ -614,7 +614,7 @@ int main(int argc, char **argv)
errors_bit
=
0
;
errors_bit
=
0
;
for
(
i
=
0
;
i
<
TBS
;
i
++
)
{
for
(
i
=
0
;
i
<
TBS
;
i
++
)
{
estimated_output_bit
[
i
]
=
(
ulsch_gNB
->
harq_process
->
b
[
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
estimated_output_bit
[
i
]
=
(
ulsch_gNB
->
harq_process
->
b
[
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
test_input_bit
[
i
]
=
(
test_input
[
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
// Further correct for multiple segments
test_input_bit
[
i
]
=
(
test_input
[
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
// Further correct for multiple segments
if
(
estimated_output_bit
[
i
]
!=
test_input_bit
[
i
])
{
if
(
estimated_output_bit
[
i
]
!=
test_input_bit
[
i
])
{
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
0d664103
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
0d664103
...
@@ -1981,7 +1981,6 @@ int get_nrofHARQ_ProcessesForPDSCH(e_NR_PDSCH_ServingCellConfig__nrofHARQ_Proces
...
@@ -1981,7 +1981,6 @@ int get_nrofHARQ_ProcessesForPDSCH(e_NR_PDSCH_ServingCellConfig__nrofHARQ_Proces
void
delete_nr_ue_data
(
NR_UE_info_t
*
UE
,
NR_COMMON_channels_t
*
ccPtr
,
uid_allocator_t
*
uia
)
void
delete_nr_ue_data
(
NR_UE_info_t
*
UE
,
NR_COMMON_channels_t
*
ccPtr
,
uid_allocator_t
*
uia
)
{
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
destroy_nr_list
(
&
sched_ctrl
->
available_dl_harq
);
destroy_nr_list
(
&
sched_ctrl
->
available_dl_harq
);
destroy_nr_list
(
&
sched_ctrl
->
feedback_dl_harq
);
destroy_nr_list
(
&
sched_ctrl
->
feedback_dl_harq
);
...
...
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