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
0fbe0e79
Commit
0fbe0e79
authored
May 28, 2018
by
Matthieu Kanj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix for scheduling
parent
fc831af9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
540 additions
and
126 deletions
+540
-126
openair1/PHY/LTE_TRANSPORT/first_sc_NB_IoT.h
openair1/PHY/LTE_TRANSPORT/first_sc_NB_IoT.h
+120
-0
openair1/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
openair1/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
+55
-7
openair1/PHY/defs.h
openair1/PHY/defs.h
+1
-1
openair1/PHY/defs_common.h
openair1/PHY/defs_common.h
+6
-2
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+357
-115
openair2/LAYER2/MAC/defs.h
openair2/LAYER2/MAC/defs.h
+1
-1
No files found.
openair1/PHY/LTE_TRANSPORT/first_sc_NB_IoT.h
0 → 100644
View file @
0fbe0e79
This source diff could not be displayed because it is too large. You can
view the blob
instead.
openair1/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
View file @
0fbe0e79
...
...
@@ -33,6 +33,7 @@
#include "PHY/defs_NB_IoT.h"
#include "PHY/TOOLS/defs.h" // to take into account the dft functions
#include "tables_nprach_NB_IoT.h"
#include "first_sc_NB_IoT.h"
//#include "PHY/extern.h"
//#include "prach.h"
//#include "PHY/LTE_TRANSPORT/if4_tools.h"
...
...
@@ -297,6 +298,47 @@ err
} */
uint16_t
subcarrier_estimation
(
int16_t
*
input_buffer
){
uint16_t
estimated_sc
;
int16_t
*
s_n_re
,
*
s_n_im
;
uint16_t
k
,
m
,
n
;
int64_t
max_correl_sc_m
=
0
;
int64_t
max_correl_sc_k
=
0
;
int64_t
max_correl_sc_glob
=
0
;
int
n_start_offset
=
1920
;
// start at t=8 ms
for
(
k
=
0
;
k
<
12
;
k
++
){
s_n_re
=
&
s_n_12_re
[
k
*
336
];
s_n_im
=
&
s_n_12_im
[
k
*
336
];
for
(
m
=
0
;
m
<
20
;
m
++
){
for
(
n
=
0
;
n
<
336
;
n
++
){
max_correl_sc_m
=
max_correl_sc_m
+
(
int16_t
)(((
int32_t
)
input_buffer
[(
m
<<
1
)
+
((
n
+
n_start_offset
)
<<
1
)]
*
(
int32_t
)
s_n_re
[
n
]
)
>>
15
)
+
(
int16_t
)(((
int32_t
)
input_buffer
[(
m
<<
1
)
+
((
n
+
n_start_offset
)
<<
1
)
+
1
]
*
(
int32_t
)
s_n_im
[
n
])
>>
15
);
}
if
(
max_correl_sc_m
>
max_correl_sc_k
){
max_correl_sc_k
=
max_correl_sc_m
;
}
max_correl_sc_m
=
0
;
}
//printf("correl = %li\n",max_correl_sc_k);
if
(
max_correl_sc_k
>
max_correl_sc_glob
){
max_correl_sc_glob
=
max_correl_sc_k
;
estimated_sc
=
k
;
}
max_correl_sc_k
=
0
;
}
return
estimated_sc
;
}
int16_t
*
sub_sampling_NB_IoT
(
int16_t
*
input_buffer
,
uint32_t
length_input
,
uint32_t
*
length_ouput
,
uint16_t
sub_sampling_rate
){
// void function ////// adding flag for switching between output_buffers
int
k
;
...
...
@@ -338,9 +380,14 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t
+
input_buffer
[(
n
<<
1
)
+
1
]
*
(
int32_t
)(
sin_x
[
n
]))
>>
15
);
signal_compensed_im
[
n
]
=
(
int16_t
)((
-
input_buffer
[
n
<<
1
]
*
(
int32_t
)(
sin_x
[
n
])
+
input_buffer
[(
n
<<
1
)
+
1
]
*
(
int32_t
)(
cos_x
[
n
]))
>>
15
);
filtered_buffer
[
n
<<
1
]
=
signal_compensed_re
[
n
];
filtered_buffer
[(
n
<<
1
)
+
1
]
=
signal_compensed_im
[
n
];
}
for
(
n
=
0
;
n
<
FRAME_LENGTH_COMPLEX_SAMPLESx
-
10
;
n
++
){
/*
for (n=0;n<FRAME_LENGTH_COMPLEX_SAMPLESx-10;n++){
if (n<20){
for (k=-n;k<20;k++){
filtered_buffer[n<<1] = filtered_buffer[n<<1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_re[n+k])>>15);
...
...
@@ -352,7 +399,7 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t
filtered_buffer[(n<<1)+1] = filtered_buffer[(n<<1)+1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_im[n+k])>>15);
}
}
}
}
*/
}
...
...
@@ -427,8 +474,9 @@ uint32_t RX_NPRACH_NB_IoT(PHY_VARS_eNB *eNB, int frame){
//fprintf(f,"%i \n",Rx_buffer[2*n+1]);
//}*/
printf
(
"
\n
detection !!! est_TA = %i ---- %i
\n
"
,
estimated_TA_coarse
,
estimated_TA
);
printf
(
"
\n
detection !!! at frame %i
\n
"
,
frame
);
eNB
->
preamble_index_NB_IoT
=
subcarrier_estimation
(
Rx_sub_sampled_buffer_128
);
// c'est un uint16_t
printf
(
"estimated subaccier = %i
\n
"
,
eNB
->
preamble_index_NB_IoT
);
return
1
;
//estimated_TA;
}
else
{
...
...
openair1/PHY/defs.h
View file @
0fbe0e79
...
...
@@ -509,7 +509,7 @@ typedef struct PHY_VARS_eNB_s {
/////////////// NB-IoT testing ////////////////////////////
volatile
uint16_t
preamble_index_NB_IoT
;
NB_IoT_eNB_NPBCH_t
npbch
;
NB_IoT_eNB_NDLSCH_t
*
ndlsch
[
NUMBER_OF_UE_MAX
];
NB_IoT_eNB_NDLSCH_t
ndlsch_SIB
;
...
...
openair1/PHY/defs_common.h
View file @
0fbe0e79
...
...
@@ -77,12 +77,16 @@ typedef struct {
uint8_t
dci_to_transmit
;
uint8_t
rar_to_transmit
;
uint8_t
subframe_SP
;
int
next_frame_tx
;
int
next_subframe_tx
;
uint8_t
SP
;
uint8_t
there_is_sib23
;
int
next_frame_tx_DCI
;
int
next_subframe_tx_DCI
;
uint32_t
sheduling_info_rar
;
uint8_t
flag_scrambling
;
uint8_t
remaining_dci
;
uint8_t
remaining_rar
;
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
0fbe0e79
...
...
@@ -498,13 +498,15 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
// NB-IoT synchro signals
common_signal_procedures_NB_IoT
(
eNB
,
proc
);
//
common_signal_procedures_NB_IoT(eNB,proc);
/////////////////// NB-IoT broadcast channel //////////////////////////
//RA_template[i].RA_active=TRUE;
RA_TEMPLATE
*
RA_template
=
(
RA_TEMPLATE
*
)
&
eNB_mac_inst
[
eNB
->
Mod_id
].
common_channels
[
eNB
->
CC_id
].
RA_template
[
0
];
if
(
frame
%
2
==
0
&&
subframe
==
1
)
RA_TEMPLATE
*
RA_template
=
(
RA_TEMPLATE
*
)
&
eNB_mac_inst
[
eNB
->
Mod_id
].
common_channels
[
eNB
->
CC_id
].
RA_template
[
0
];
///if( frame%2 ==0 && subframe ==1)
if
(
subframe
==
7
)
{
if
(
RA_template
[
0
].
generate_rar
==
1
&&
proc
->
sheduling_info_rar
!=
1
)
{
...
...
@@ -513,32 +515,40 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
proc
->
remaining_dci
=
4
;
proc
->
sheduling_info_rar
=
1
;
proc
->
rar_to_transmit
=
0
;
proc
->
SP
=
0
;
proc
->
flag_scrambling
=
0
;
//printf("detection ok in TX !!!!!!!!!!!!!!!!!");
//RA_template[0].generate_rar = 0;
//RA_template[0].RA_active = FALSE;
eNB
->
npdcch_tmp
.
pdu
[
0
][
0
]
=
1
44
;
//90
eNB
->
npdcch_tmp
.
pdu
[
0
][
0
]
=
1
28
;
//90
eNB
->
npdcch_tmp
.
pdu
[
0
][
1
]
=
66
;
//42
eNB
->
npdcch_tmp
.
pdu
[
0
][
2
]
=
4
;
//4
}
}
if
(
frame
%
4
==
0
&&
proc
->
dci_to_transmit
==
1
&&
proc
->
remaining_dci
>
0
)
//if(frame%4==0 && proc->dci_to_transmit ==1 && proc->remaining_dci >0)
if
(
proc
->
dci_to_transmit
==
1
&&
proc
->
remaining_dci
>
0
)
{
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
2
)
if
(((
10
*
frame
+
subframe
)
%
8
)
==
2
&&
subframe
!=
0
&&
subframe
!=
4
&&
subframe
!=
6
&&
proc
->
SP
!=
1
)
{
printf
(
"
\n
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxframe %d, subframe %dxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
,
frame
,
subframe
);
proc
->
SP
=
1
;
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
2
)
{
proc
->
subframe_SP
=
0
;
printf
(
"
\n
DCI 2 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
printf
(
"
\n
xxxxxxxxx RA-RNTI = %d xxxxxxxxxxxxxxx"
,
RA_template
[
0
].
RA_rnti
);
int32_t
numbits
=
23
;
uint8_t
RCC
;
uint16_t
npdcch_D
=
16
+
23
;
uint16_t
npdcch_E
=
236
;
//uint16_t E = 200;
//uint8_t A = 3;
uint8_t
agr_level
=
2
;
uint8_t
dci_number
=
1
;
uint8_t
tab_a
[
3
];
tab_a
[
0
]
=
144
;
tab_a
[
0
]
=
128
;
tab_a
[
1
]
=
66
;
tab_a
[
2
]
=
4
;
int
RB_ID_IoT
=
22
;
...
...
@@ -555,23 +565,67 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
else
{
proc
->
subframe_SP
=
1
;
if
(
((
frame
)
%
2
==
1
)
&&
((
frame
)
%
64
<
16
))
{
proc
->
there_is_sib23
=
8
;
}
else
{
printf
(
"
\n
DCI 8 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
printf
(
"
\n
xxxxxxxxx RA-RNTI = %d xxxxxxxxxxxxxxx"
,
RA_template
[
0
].
RA_rnti
);
int32_t
numbits
=
23
;
uint8_t
RCC
;
uint16_t
npdcch_D
=
16
+
23
;
uint16_t
npdcch_E
=
236
;
uint8_t
agr_level
=
2
;
uint8_t
dci_number
=
1
;
uint8_t
tab_a
[
3
];
tab_a
[
0
]
=
128
;
tab_a
[
1
]
=
66
;
tab_a
[
2
]
=
4
;
int
RB_ID_IoT
=
22
;
bzero
(
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
);
memset
(
npdcch_struct
->
npdcch_d
[
0
],
LTE_NULL_NB_IoT
,
96
);
ccode_encode_NB_IoT
(
numbits
,
2
,
tab_a
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
RA_template
[
0
].
RA_rnti
);
RCC
=
sub_block_interleaving_cc_NB_IoT
(
npdcch_D
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
npdcch_struct
->
npdcch_w
[
0
]);
lte_rate_matching_cc_NB_IoT
(
RCC
,
npdcch_E
,
npdcch_struct
->
npdcch_w
[
0
],
npdcch_struct
->
npdcch_e
[
0
]);
npdcch_scrambling_NB_IoT
(
fp
,
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
,(
uint8_t
)
subframe
*
2
,
1
,
agr_level
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
}
}
if
(
proc
->
subframe_SP
==
0
&&
proc
->
SP
==
1
)
{
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
3
)
{
printf
(
"
\n
DCI 3 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
]
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
((
subframe
==
4
)
&&
(
frame
%
2
==
0
)
&&
(
frame
%
32
>=
16
)
)
{
printf
(
"
\n
DCI 4 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
]
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
(
subframe
==
6
)
{
printf
(
"
\n
DCI 6 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
]
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
...
...
@@ -580,141 +634,286 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
proc
->
remaining_rar
=
4
;
printf
(
"xxxxx ERROR %d XXXXXX"
,
proc
->
remaining_dci
);
// uint8_t sib23x=0;
// uint8_t sib23v1x=0;
// uint8_t sib1v1x=0;
/* if( ((frame+1)%2==1) && ((frame+1)%64<16))
// proc->next_frame_tx=frame+2;
// proc->next_subframe_tx=1;
if
(((
frame
+
1
)
%
2
==
1
)
&&
((
frame
+
1
)
%
64
<
16
))
{
sib23x =1;
}*/
//if(sib23x ==1)
//{
/* if( ((frame+3)%2==1) && ((frame+3)%64<16))
{
sib23v1x =1;
}
if( ((frame+2)%2==0) && ((frame+2)%32<16))
{
sib1v1x =1;
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
1
;
}
else
{
proc
->
next_frame_tx
=
frame
+
1
;
proc
->
next_subframe_tx
=
2
;
}
if(sib23v1x ==1)
}
}
if
(
subframe
==
7
)
{
printf
(
"
\n
DCI 7 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
if(sib1v1x ==1)
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
// proc->next_frame_tx=frame+2;
// proc->next_subframe_tx=1;
if
(((
frame
+
1
)
%
2
==
1
)
&&
((
frame
+
1
)
%
64
<
16
))
{
proc->next_frame_tx=frame+4;
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
1
;
}
else
{
proc
->
next_frame_tx
=
frame
+
1
;
proc
->
next_subframe_tx
=
3
;
}else{
}
proc->next_frame_tx=frame+4;
proc->next_subframe_tx=2;
}
}
} else {
if(sib1v1x ==1)
}
if
(
proc
->
subframe_SP
==
1
&&
proc
->
SP
==
1
)
{
proc->next_frame_tx=frame+3;
proc->next_subframe_tx=3;
}else{
if
(
proc
->
there_is_sib23
==
8
)
{
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
1
)
{
printf
(
"
\n
DCI 1 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
printf
(
"
\n
xxxxxxxxx RA-RNTI = %d xxxxxxxxxxxxxxx"
,
RA_template
[
0
].
RA_rnti
);
int32_t
numbits
=
23
;
uint8_t
RCC
;
uint16_t
npdcch_D
=
16
+
23
;
uint16_t
npdcch_E
=
236
;
uint8_t
agr_level
=
2
;
uint8_t
dci_number
=
1
;
uint8_t
tab_a
[
3
];
tab_a
[
0
]
=
128
;
tab_a
[
1
]
=
66
;
tab_a
[
2
]
=
4
;
int
RB_ID_IoT
=
22
;
proc->next_frame_tx=frame+3;
proc->next_subframe_tx=2;
}
bzero
(
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
);
memset
(
npdcch_struct
->
npdcch_d
[
0
],
LTE_NULL_NB_IoT
,
96
);
ccode_encode_NB_IoT
(
numbits
,
2
,
tab_a
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
RA_template
[
0
].
RA_rnti
);
RCC
=
sub_block_interleaving_cc_NB_IoT
(
npdcch_D
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
npdcch_struct
->
npdcch_w
[
0
]);
lte_rate_matching_cc_NB_IoT
(
RCC
,
npdcch_E
,
npdcch_struct
->
npdcch_w
[
0
],
npdcch_struct
->
npdcch_e
[
0
]);
npdcch_scrambling_NB_IoT
(
fp
,
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
,(
uint8_t
)
subframe
*
2
,
1
,
agr_level
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
*/
///} else {
if
(
subframe
==
2
)
{
printf
(
"
\n
DCI 2 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
(
subframe
==
3
)
{
printf
(
"
\n
DCI 3 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
((
subframe
==
4
)
&&
(
frame
%
2
==
0
)
&&
(
frame
%
32
>=
16
)
)
{
printf
(
"
\n
DCI 4 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
printf
(
"xxxxx ERROR %d XXXXXX"
,
proc
->
remaining_dci
);
//proc->next_frame_tx=frame+1;
// proc->next_subframe_tx=8;
if
(((
frame
+
1
)
%
2
==
1
)
&&
((
frame
+
1
)
%
64
<
16
))
{
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
1
;
// }
}
else
{
proc
->
next_frame_tx
=
frame
+
1
;
proc
->
next_subframe_tx
=
1
;
}
}
}
if
(
subframe
==
7
)
if
((
subframe
==
6
)
)
{
printf
(
"
\n
DCI 7
sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
printf
(
"
\n
DCI 6
sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
]
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
printf
(
"xxxxx ERROR %d XXXXXX"
,
proc
->
remaining_dci
);
/* uint8_t sib23=0;
uint8_t sib23v1=0;
uint8_t sib1v1=0;
if( ((frame+1)%2==1) && ((frame+1)%64<16))
// proc->next_frame_tx=frame+2;
// proc->next_subframe_tx=1;
if
(((
frame
+
1
)
%
2
==
1
)
&&
((
frame
+
1
)
%
64
<
16
))
{
sib23 =1;
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
1
;
}
else
{
proc
->
next_frame_tx
=
frame
+
1
;
proc
->
next_subframe_tx
=
2
;
}
if(sib23 ==1)
{
if( ((frame+3)%2==1) && ((frame+3)%64<16))
}
}
}
else
{
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
9
)
{
sib23v1 =1;
printf
(
"
\n
DCI 9 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if( ((frame+2)%2==0) && ((frame+2)%32<16)
)
if
(
subframe
==
1
)
{
sib1v1 =1;
printf
(
"
\n
DCI 1 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if(sib23v1 ==1)
if
(
subframe
==
2
)
{
if(sib1v1 ==1)
printf
(
"
\n
DCI 2 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
proc->next_frame_tx=frame+4;
proc->next_subframe_tx=3;
}else{
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
printf
(
"xxxxx ERROR %d XXXXXX"
,
proc
->
remaining_dci
);
proc->next_frame_tx=frame+4;
proc->next_subframe_tx=2;
proc
->
next_frame_tx
=
frame
;
proc
->
next_subframe_tx
=
7
;
}
}
} else {
if(sib1v1 ==1)
{
proc->next_frame_tx=frame+3;
proc->next_subframe_tx=3;
}else{
}
proc->next_frame_tx=frame+3;
proc->next_subframe_tx=2;
}
NB_IoT_eNB_NPDCCH_temp_t
*
npdcch_struct
=
&
eNB
->
npdcch_tmp
;
if
(
subframe
==
2
)
{
printf
(
"
\n
DCI 2 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
printf
(
"
\n
xxxxxxxxx RA-RNTI = %d xxxxxxxxxxxxxxx"
,
RA_template
[
0
].
RA_rnti
);
int32_t
numbits
=
23
;
uint8_t
RCC
;
uint16_t
npdcch_D
=
16
+
23
;
uint16_t
npdcch_E
=
236
;
//uint16_t E = 200;
//uint8_t A = 3;
uint8_t
agr_level
=
2
;
uint8_t
dci_number
=
1
;
uint8_t
tab_a
[
3
];
tab_a
[
0
]
=
144
;
tab_a
[
1
]
=
66
;
tab_a
[
2
]
=
4
;
int
RB_ID_IoT
=
22
;
bzero
(
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
);
memset
(
npdcch_struct
->
npdcch_d
[
0
],
LTE_NULL_NB_IoT
,
96
);
ccode_encode_NB_IoT
(
numbits
,
2
,
tab_a
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
RA_template
[
0
].
RA_rnti
);
RCC
=
sub_block_interleaving_cc_NB_IoT
(
npdcch_D
,
npdcch_struct
->
npdcch_d
[
0
]
+
96
,
npdcch_struct
->
npdcch_w
[
0
]);
lte_rate_matching_cc_NB_IoT
(
RCC
,
npdcch_E
,
npdcch_struct
->
npdcch_w
[
0
],
npdcch_struct
->
npdcch_e
[
0
]);
npdcch_scrambling_NB_IoT
(
fp
,
npdcch_struct
->
npdcch_e
[
0
],
npdcch_E
,(
uint8_t
)
subframe
*
2
,
1
,
agr_level
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
[
0
],
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
(
subframe
==
3
)
{
printf
(
"
\n
DCI 3 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
((
subframe
==
4
)
&&
(
frame
%
2
==
0
)
&&
(
frame
%
32
>=
16
)
)
{
printf
(
"
\n
DCI 4 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
}
if
(
subframe
==
6
)
{
printf
(
"
\n
DCI 6 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
printf
(
"xxxxx ERROR %d XXXXXX"
,
proc
->
remaining_dci
);
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
1
;
} else {*/
}
}
if
(
subframe
==
7
)
{
printf
(
"
\n
DCI 7 sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dci_modulation_NB_IoT
(
txdataF
,
AMP
,
fp
,
3
,
npdcch_struct
->
npdcch_e
,
1
,
2
,
22
,
subframe
);
proc
->
remaining_dci
--
;
if
(
proc
->
remaining_dci
==
0
)
{
proc
->
dci_to_transmit
=
0
;
proc
->
rar_to_transmit
=
1
;
proc
->
remaining_rar
=
4
;
proc
->
next_frame_tx
=
frame
+
2
;
proc
->
next_subframe_tx
=
2
;
// }
// uint32_t sheduling_info_rar;
}
}
}
if
(
subframe
!=
5
&&
subframe
!=
0
)
if
(
subframe
!=
5
&&
subframe
!=
0
)
{
if
(
proc
->
rar_to_transmit
==
1
&&
proc
->
remaining_rar
>
0
)
{
NB_IoT_DL_eNB_RAR_t
*
rar
=
&
eNB
->
ndlsch_rar
.
content_rar
;
uint8_t
tab_rar
[
7
];
tab_rar
[
0
]
=
64
;
// printf("xxxxx index verif %d XXXXXX",RA_template[0].preamble_index);
tab_rar
[
0
]
=
64
+
RA_template
[
0
].
preamble_index
;
tab_rar
[
1
]
=
0
;
tab_rar
[
2
]
=
42
;
tab_rar
[
3
]
=
67
;
tab_rar
[
4
]
=
64
;
tab_rar
[
5
]
=
0
;
// 16
tab_rar
[
6
]
=
5
;
// 5
tab_rar
[
6
]
=
5
;
// 5
*/
//T-CRNTI =4101
if
(
proc
->
remaining_rar
==
4
)
/*
if(proc->remaining_rar == 4)
{
dlsch_encoding_rar_NB_IoT(tab_rar,
rar,
...
...
@@ -730,7 +929,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
subframe*2,
RA_template[0].RA_rnti);
}
}
*/
if
(
frame
==
proc
->
next_frame_tx
&&
subframe
==
proc
->
next_subframe_tx
)
...
...
@@ -750,6 +949,25 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
proc
->
next_subframe_tx
=
subframe
+
2
;
}
else
{
if
(
proc
->
flag_scrambling
==
0
)
{
dlsch_encoding_rar_NB_IoT
(
tab_rar
,
rar
,
8
,
///// number_of_subframes_required
236
,
1
);
//////////// G*2
dlsch_sib_scrambling_rar_NB_IoT
(
fp
,
rar
,
236
,
frame
,
subframe
*
2
,
RA_template
[
0
].
RA_rnti
);
}
proc
->
flag_scrambling
=
1
;
printf
(
"
\n
RAR sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dlsch_modulation_rar_NB_IoT
(
txdataF
,
AMP
,
...
...
@@ -766,6 +984,29 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
}
}
else
{
if
(
((
frame
)
%
2
==
0
)
&&
(
subframe
==
9
))
{
proc
->
next_subframe_tx
=
1
;
proc
->
next_frame_tx
=
proc
->
next_frame_tx
+
1
;
}
else
{
if
(
proc
->
flag_scrambling
==
0
)
{
dlsch_encoding_rar_NB_IoT
(
tab_rar
,
rar
,
8
,
///// number_of_subframes_required
236
,
1
);
//////////// G*2
dlsch_sib_scrambling_rar_NB_IoT
(
fp
,
rar
,
236
,
frame
,
subframe
*
2
,
RA_template
[
0
].
RA_rnti
);
}
proc
->
flag_scrambling
=
1
;
printf
(
"
\n
RAR sentttttt frame %d, subframe %d"
,
frame
,
subframe
);
dlsch_modulation_rar_NB_IoT
(
txdataF
,
...
...
@@ -780,7 +1021,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
proc
->
remaining_rar
--
;
proc
->
next_subframe_tx
=
subframe
+
1
;
}
}
...
...
@@ -790,6 +1031,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
}
}
/////////////////////////// END ///////////////////////////////////////
/*
...
...
@@ -2432,7 +2674,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
mac_xface
->
initiate_ra_proc
(
eNB
->
Mod_id
,
eNB
->
CC_id
,
frame
,
preamble_max
,
eNB
->
preamble_index_NB_IoT
,
estimated_TA
,
0
,
subframe
,
0
);
...
...
openair2/LAYER2/MAC/defs.h
View file @
0fbe0e79
...
...
@@ -822,7 +822,7 @@ typedef struct {
/// RA RNTI allocated from received PRACH
volatile
uint16_t
RA_rnti
;
/// Received preamble_index
uint8_t
preamble_index
;
volatile
uint8_t
preamble_index
;
/// Received UE Contention Resolution Identifier
uint8_t
cont_res_id
[
6
];
/// Timing offset indicated by PHY
...
...
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