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
zzha zzha
OpenXG-RAN
Commits
e5bcff48
Commit
e5bcff48
authored
Dec 18, 2015
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first version of phy only test
parent
ec399cd1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
826 additions
and
794 deletions
+826
-794
openair1/PHY/defs.h
openair1/PHY/defs.h
+2
-0
openair1/SCHED/phy_mac_stub.c
openair1/SCHED/phy_mac_stub.c
+732
-0
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+92
-794
No files found.
openair1/PHY/defs.h
View file @
e5bcff48
...
@@ -271,6 +271,8 @@ typedef struct PHY_VARS_eNB_s {
...
@@ -271,6 +271,8 @@ typedef struct PHY_VARS_eNB_s {
int
**
dl_precoder_SeNB
[
3
];
int
**
dl_precoder_SeNB
[
3
];
char
log2_maxp
;
/// holds the maximum channel/precoder coefficient
char
log2_maxp
;
/// holds the maximum channel/precoder coefficient
int
mac_enabled
;
/// For emulation only (used by UE abstraction to retrieve DCI)
/// For emulation only (used by UE abstraction to retrieve DCI)
uint8_t
num_common_dci
[
2
];
// num_dci in even/odd subframes
uint8_t
num_common_dci
[
2
];
// num_dci in even/odd subframes
uint8_t
num_ue_spec_dci
[
2
];
// num_dci in even/odd subframes
uint8_t
num_ue_spec_dci
[
2
];
// num_dci in even/odd subframes
...
...
openair1/SCHED/phy_mac_stub.c
0 → 100644
View file @
e5bcff48
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file phy_mac_stub.c
* \brief stimulates the phy without mac
* \author R. Knopp, F. Kaltenberger, N. Nikaein
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr
* \note
* \warning
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "MAC_INTERFACE/defs.h"
#include "MAC_INTERFACE/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
void
fill_dci
(
DCI_PDU
*
DCI_pdu
,
uint8_t
sched_subframe
,
PHY_VARS_eNB
*
phy_vars_eNB
)
{
int
i
;
uint8_t
cooperation_flag
=
phy_vars_eNB
->
cooperation_flag
;
uint8_t
transmission_mode
=
phy_vars_eNB
->
transmission_mode
[
0
];
uint32_t
rballoc
=
0x7FFF
;
uint32_t
rballoc2
=
0x000F
;
int
subframe
=
phy_vars_eNB
->
proc
[
sched_subframe
].
subframe_tx
;
LTE_eNB_DLSCH_t
*
DLSCH_ptr
=
phy_vars_eNB
->
dlsch_eNB
[
0
][
0
];
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
uint32_t
bcch_pdu
;
uint64_t
dlsch_pdu
;
DCI_pdu
->
Num_common_dci
=
0
;
DCI_pdu
->
Num_ue_spec_dci
=
0
;
switch
(
subframe
)
{
case
5
:
DCI_pdu
->
Num_common_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
SI_RNTI
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1A
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
case
6
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_1_5MHz_FDD_t
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_1_5MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_1_5MHz_TDD_1_6_t
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_1_5MHz_TDD_1_6_t
));
}
break
;
case
25
:
default:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_FDD_t
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_TDD_1_6_t
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
}
break
;
case
50
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_10MHz_FDD_t
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_10MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_10MHz_TDD_1_6_t
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_10MHz_TDD_1_6_t
));
}
break
;
case
100
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_20MHz_FDD_t
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_20MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_20MHz_TDD_1_6_t
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_20MHz_TDD_1_6_t
));
}
break
;
}
case
6
:
/*
DCI_pdu->Num_ue_spec_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1236;
DCI_pdu->dci_alloc[0].format = format2_2A_M10PRB;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DLSCH_alloc_pdu1.rballoc = 0x00ff;
DLSCH_alloc_pdu1.TPC = 0;
DLSCH_alloc_pdu1.dai = 0;
DLSCH_alloc_pdu1.harq_pid = 0;
DLSCH_alloc_pdu1.tb_swap = 0;
DLSCH_alloc_pdu1.mcs1 = 0;
DLSCH_alloc_pdu1.ndi1 = 1;
DLSCH_alloc_pdu1.rv1 = 0;
DLSCH_alloc_pdu1.tpmi = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
*/
break
;
case
7
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
if
(
transmission_mode
<
3
)
{
//user 1
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
case
25
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_FDD_t
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_TDD_t
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
break
;
case
50
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_10MHz_FDD_t
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_10MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_10MHz_TDD_t
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_10MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
*/
}
break
;
case
100
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_FDD_t
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_20MHz_TDD_t
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_20MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_20MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
break
;
}
}
else
if
(
transmission_mode
==
5
)
{
DCI_pdu
->
Num_ue_spec_dci
=
2
;
// user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
3
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu1E
.
tpmi
=
5
;
//5=use feedback
DLSCH_alloc_pdu1E
.
rv
=
0
;
DLSCH_alloc_pdu1E
.
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
DLSCH_alloc_pdu1E
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
phy_vars_eNB
->
eNB_UE_stats
[
0
].
dlsch_mcs1
=
DLSCH_alloc_pdu1E
.
mcs
;
DLSCH_alloc_pdu1E
.
harq_pid
=
DLSCH_ptr
->
harq_pid_freelist
[
DLSCH_ptr
->
head_freelist
];
DLSCH_alloc_pdu1E
.
dai
=
0
;
DLSCH_alloc_pdu1E
.
TPC
=
0
;
DLSCH_alloc_pdu1E
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu1E
.
rah
=
0
;
DLSCH_alloc_pdu1E
.
dl_power_off
=
0
;
//0=second user present
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
//user 2
DCI_pdu
->
dci_alloc
[
1
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
1
].
L
=
0
;
DCI_pdu
->
dci_alloc
[
1
].
rnti
=
0x1236
;
DCI_pdu
->
dci_alloc
[
1
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
1
].
ra_flag
=
0
;
//DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
DLSCH_alloc_pdu1E
.
mcs
=
(
unsigned
char
)
(((
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
%
1024
)
/
3
)
%
28
);
phy_vars_eNB
->
eNB_UE_stats
[
1
].
dlsch_mcs1
=
DLSCH_alloc_pdu1E
.
mcs
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
1
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
// set the precoder of the second UE orthogonal to the first
phy_vars_eNB
->
eNB_UE_stats
[
1
].
DL_pmi_single
=
(
phy_vars_eNB
->
eNB_UE_stats
[
0
].
DL_pmi_single
^
0x1555
);
}
break
;
/*
case 8:
DCI_pdu->Num_common_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
DCI_pdu->dci_alloc[0].format = format1A;
DCI_pdu->dci_alloc[0].ra_flag = 1;
RA_alloc_pdu.type = 1;
RA_alloc_pdu.vrb_type = 0;
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
RA_alloc_pdu.ndi = 1;
RA_alloc_pdu.rv = 1;
RA_alloc_pdu.mcs = 4;
RA_alloc_pdu.harq_pid = 0;
RA_alloc_pdu.TPC = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
break;
*/
case
9
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
//user 1
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_FDD_t
;
else
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format0
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
UL_alloc_pdu
.
type
=
0
;
UL_alloc_pdu
.
hopping
=
0
;
UL_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
2
,
openair_daq_vars
.
ue_ul_nb_rb
);
UL_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_ul_mcs
;
UL_alloc_pdu
.
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
UL_alloc_pdu
.
TPC
=
0
;
UL_alloc_pdu
.
cshift
=
0
;
UL_alloc_pdu
.
dai
=
0
;
UL_alloc_pdu
.
cqi_req
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
UL_alloc_pdu
,
sizeof
(
DCI0_5MHz_TDD_1_6_t
));
// user 2
/*
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break
;
default:
break
;
}
DCI_pdu
->
nCCE
=
0
;
for
(
i
=
0
;
i
<
DCI_pdu
->
Num_common_dci
+
DCI_pdu
->
Num_ue_spec_dci
;
i
++
)
{
DCI_pdu
->
nCCE
+=
(
1
<<
(
DCI_pdu
->
dci_alloc
[
i
].
L
));
}
}
void
fill_dci_emos
(
DCI_PDU
*
DCI_pdu
,
uint8_t
subframe
,
PHY_VARS_eNB
*
phy_vars_eNB
)
{
int
i
;
uint8_t
cooperation_flag
=
phy_vars_eNB
->
cooperation_flag
;
uint8_t
transmission_mode
=
phy_vars_eNB
->
transmission_mode
[
0
];
//uint32_t rballoc = 0x00F0;
//uint32_t rballoc2 = 0x000F;
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
DCI_pdu
->
Num_common_dci
=
0
;
DCI_pdu
->
Num_ue_spec_dci
=
0
;
switch
(
subframe
)
{
case
5
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
if
(
transmission_mode
<
3
)
{
//user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu
.
TPC
=
0
;
DLSCH_alloc_pdu
.
dai
=
0
;
DLSCH_alloc_pdu
.
harq_pid
=
1
;
DLSCH_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
DLSCH_alloc_pdu
.
ndi
=
1
;
DLSCH_alloc_pdu
.
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DLSCH_alloc_pdu.rballoc = rballoc2;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = openair_daq_vars.target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
if
(
transmission_mode
==
5
)
{
DCI_pdu
->
Num_ue_spec_dci
=
2
;
// user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu1E
.
tpmi
=
5
;
//5=use feedback
DLSCH_alloc_pdu1E
.
rv
=
0
;
DLSCH_alloc_pdu1E
.
ndi
=
1
;
DLSCH_alloc_pdu1E
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
DLSCH_alloc_pdu1E
.
harq_pid
=
1
;
DLSCH_alloc_pdu1E
.
dai
=
0
;
DLSCH_alloc_pdu1E
.
TPC
=
0
;
DLSCH_alloc_pdu1E
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu1E
.
rah
=
0
;
DLSCH_alloc_pdu1E
.
dl_power_off
=
0
;
//0=second user present
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
//user 2
DCI_pdu
->
dci_alloc
[
1
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
1
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
1
].
rnti
=
0x1236
;
DCI_pdu
->
dci_alloc
[
1
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
1
].
ra_flag
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
1
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
// set the precoder of the second UE orthogonal to the first
phy_vars_eNB
->
eNB_UE_stats
[
1
].
DL_pmi_single
=
(
phy_vars_eNB
->
eNB_UE_stats
[
0
].
DL_pmi_single
^
0x1555
);
}
break
;
case
7
:
DCI_pdu
->
Num_common_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0xbeef
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1A
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
1
;
RA_alloc_pdu
.
type
=
1
;
RA_alloc_pdu
.
vrb_type
=
0
;
RA_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
12
,
3
);
RA_alloc_pdu
.
ndi
=
1
;
RA_alloc_pdu
.
rv
=
1
;
RA_alloc_pdu
.
mcs
=
4
;
RA_alloc_pdu
.
harq_pid
=
0
;
RA_alloc_pdu
.
TPC
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
RA_alloc_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
break
;
case
9
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
//user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format0
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
UL_alloc_pdu
.
type
=
0
;
UL_alloc_pdu
.
hopping
=
0
;
UL_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
0
,
openair_daq_vars
.
ue_ul_nb_rb
);
UL_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_ul_mcs
;
UL_alloc_pdu
.
ndi
=
1
;
UL_alloc_pdu
.
TPC
=
0
;
UL_alloc_pdu
.
cshift
=
0
;
UL_alloc_pdu
.
dai
=
0
;
UL_alloc_pdu
.
cqi_req
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
UL_alloc_pdu
,
sizeof
(
DCI0_5MHz_TDD_1_6_t
));
/*
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break
;
default:
break
;
}
DCI_pdu
->
nCCE
=
0
;
for
(
i
=
0
;
i
<
DCI_pdu
->
Num_common_dci
+
DCI_pdu
->
Num_ue_spec_dci
;
i
++
)
{
DCI_pdu
->
nCCE
+=
(
1
<<
(
DCI_pdu
->
dci_alloc
[
i
].
L
));
}
}
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
e5bcff48
...
@@ -52,12 +52,10 @@
...
@@ -52,12 +52,10 @@
//#define DEBUG_PHY_PROC (Already defined in cmake)
//#define DEBUG_PHY_PROC (Already defined in cmake)
//#define DEBUG_ULSCH
//#define DEBUG_ULSCH
//#ifdef OPENAIR2
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/defs.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//#endif
#include "assertions.h"
#include "assertions.h"
#include "msc.h"
#include "msc.h"
...
@@ -575,689 +573,6 @@ void phy_procedures_emos_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eN
...
@@ -575,689 +573,6 @@ void phy_procedures_emos_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eN
}
}
#endif
#endif
#ifndef OPENAIR2
void
fill_dci
(
DCI_PDU
*
DCI_pdu
,
uint8_t
sched_subframe
,
PHY_VARS_eNB
*
phy_vars_eNB
)
{
int
i
;
uint8_t
cooperation_flag
=
phy_vars_eNB
->
cooperation_flag
;
uint8_t
transmission_mode
=
phy_vars_eNB
->
transmission_mode
[
0
];
uint32_t
rballoc
=
0x7FFF
;
uint32_t
rballoc2
=
0x000F
;
int
subframe
=
phy_vars_eNB
->
proc
[
sched_subframe
].
subframe_tx
;
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
uint32_t
bcch_pdu
;
uint64_t
dlsch_pdu
;
DCI_pdu
->
Num_common_dci
=
0
;
DCI_pdu
->
Num_ue_spec_dci
=
0
;
switch
(
subframe
)
{
case
5
:
DCI_pdu
->
Num_common_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
SI_RNTI
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1A
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
case
6
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_1_5MHz_FDD_t
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_1_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_1_5MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_1_5MHz_TDD_1_6_t
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_1_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_1_5MHz_TDD_1_6_t
));
}
break
;
case
25
:
default:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_FDD_t
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_5MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_TDD_1_6_t
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_5MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
}
break
;
case
50
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_10MHz_FDD_t
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_10MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_10MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_10MHz_TDD_1_6_t
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_10MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_10MHz_TDD_1_6_t
));
}
break
;
case
100
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_20MHz_FDD_t
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_20MHz_FDD_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_20MHz_TDD_1_6_t
));
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_20MHz_TDD_1_6_t
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
type
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
vrb_type
=
0
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rballoc
=
computeRIV
(
25
,
10
,
3
);
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
rv
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
mcs
=
1
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
harq_pid
=
0
;
((
DCI1A_20MHz_TDD_1_6_t
*
)
&
bcch_pdu
)
->
TPC
=
1
;
// set to 3 PRB
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
bcch_pdu
,
sizeof
(
DCI1A_20MHz_TDD_1_6_t
));
}
break
;
}
case
6
:
/*
DCI_pdu->Num_ue_spec_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1236;
DCI_pdu->dci_alloc[0].format = format2_2A_M10PRB;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DLSCH_alloc_pdu1.rballoc = 0x00ff;
DLSCH_alloc_pdu1.TPC = 0;
DLSCH_alloc_pdu1.dai = 0;
DLSCH_alloc_pdu1.harq_pid = 0;
DLSCH_alloc_pdu1.tb_swap = 0;
DLSCH_alloc_pdu1.mcs1 = 0;
DLSCH_alloc_pdu1.ndi1 = 1;
DLSCH_alloc_pdu1.rv1 = 0;
DLSCH_alloc_pdu1.tpmi = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
*/
break
;
case
7
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
if
(
transmission_mode
<
3
)
{
//user 1
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
case
25
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_FDD_t
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_TDD_t
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
break
;
case
50
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_10MHz_FDD_t
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_10MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_10MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_10MHz_TDD_t
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_10MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_10MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
*/
}
break
;
case
100
:
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_FDD_t
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_5MHz_FDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
{
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_20MHz_TDD_t
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rballoc
=
rballoc
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
TPC
=
0
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
dai
=
0
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
harq_pid
=
0
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
((
DCI1_20MHz_TDD_t
*
)
&
dlsch_pdu
)
->
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
dlsch_pdu
,
sizeof
(
DCI1_20MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_20MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
//((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
*/
}
break
;
}
}
else
if
(
transmission_mode
==
5
)
{
DCI_pdu
->
Num_ue_spec_dci
=
2
;
// user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
3
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu1E
.
tpmi
=
5
;
//5=use feedback
DLSCH_alloc_pdu1E
.
rv
=
0
;
DLSCH_alloc_pdu1E
.
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
DLSCH_alloc_pdu1E
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
phy_vars_eNB
->
eNB_UE_stats
[
0
].
dlsch_mcs1
=
DLSCH_alloc_pdu1E
.
mcs
;
DLSCH_alloc_pdu1E
.
harq_pid
=
0
;
DLSCH_alloc_pdu1E
.
dai
=
0
;
DLSCH_alloc_pdu1E
.
TPC
=
0
;
DLSCH_alloc_pdu1E
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu1E
.
rah
=
0
;
DLSCH_alloc_pdu1E
.
dl_power_off
=
0
;
//0=second user present
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
//user 2
DCI_pdu
->
dci_alloc
[
1
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
1
].
L
=
0
;
DCI_pdu
->
dci_alloc
[
1
].
rnti
=
0x1236
;
DCI_pdu
->
dci_alloc
[
1
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
1
].
ra_flag
=
0
;
//DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
DLSCH_alloc_pdu1E
.
mcs
=
(
unsigned
char
)
(((
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
%
1024
)
/
3
)
%
28
);
phy_vars_eNB
->
eNB_UE_stats
[
1
].
dlsch_mcs1
=
DLSCH_alloc_pdu1E
.
mcs
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
1
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
// set the precoder of the second UE orthogonal to the first
phy_vars_eNB
->
eNB_UE_stats
[
1
].
DL_pmi_single
=
(
phy_vars_eNB
->
eNB_UE_stats
[
0
].
DL_pmi_single
^
0x1555
);
}
break
;
/*
case 8:
DCI_pdu->Num_common_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
DCI_pdu->dci_alloc[0].format = format1A;
DCI_pdu->dci_alloc[0].ra_flag = 1;
RA_alloc_pdu.type = 1;
RA_alloc_pdu.vrb_type = 0;
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
RA_alloc_pdu.ndi = 1;
RA_alloc_pdu.rv = 1;
RA_alloc_pdu.mcs = 4;
RA_alloc_pdu.harq_pid = 0;
RA_alloc_pdu.TPC = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
break;
*/
case
9
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
//user 1
if
(
phy_vars_eNB
->
lte_frame_parms
.
frame_type
==
FDD
)
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_FDD_t
;
else
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format0
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
UL_alloc_pdu
.
type
=
0
;
UL_alloc_pdu
.
hopping
=
0
;
UL_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
2
,
openair_daq_vars
.
ue_ul_nb_rb
);
UL_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_ul_mcs
;
UL_alloc_pdu
.
ndi
=
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
&
1
;
UL_alloc_pdu
.
TPC
=
0
;
UL_alloc_pdu
.
cshift
=
0
;
UL_alloc_pdu
.
dai
=
0
;
UL_alloc_pdu
.
cqi_req
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
UL_alloc_pdu
,
sizeof
(
DCI0_5MHz_TDD_1_6_t
));
// user 2
/*
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break
;
default:
break
;
}
DCI_pdu
->
nCCE
=
0
;
for
(
i
=
0
;
i
<
DCI_pdu
->
Num_common_dci
+
DCI_pdu
->
Num_ue_spec_dci
;
i
++
)
{
DCI_pdu
->
nCCE
+=
(
1
<<
(
DCI_pdu
->
dci_alloc
[
i
].
L
));
}
}
#ifdef EMOS
void
fill_dci_emos
(
DCI_PDU
*
DCI_pdu
,
uint8_t
subframe
,
PHY_VARS_eNB
*
phy_vars_eNB
)
{
int
i
;
uint8_t
cooperation_flag
=
phy_vars_eNB
->
cooperation_flag
;
uint8_t
transmission_mode
=
phy_vars_eNB
->
transmission_mode
[
0
];
//uint32_t rballoc = 0x00F0;
//uint32_t rballoc2 = 0x000F;
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
DCI_pdu
->
Num_common_dci
=
0
;
DCI_pdu
->
Num_ue_spec_dci
=
0
;
switch
(
subframe
)
{
case
5
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
if
(
transmission_mode
<
3
)
{
//user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1_5MHz_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu
.
TPC
=
0
;
DLSCH_alloc_pdu
.
dai
=
0
;
DLSCH_alloc_pdu
.
harq_pid
=
1
;
DLSCH_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
DLSCH_alloc_pdu
.
ndi
=
1
;
DLSCH_alloc_pdu
.
rv
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu
,
sizeof
(
DCI1_5MHz_TDD_t
));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DLSCH_alloc_pdu.rballoc = rballoc2;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = openair_daq_vars.target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
*/
}
else
if
(
transmission_mode
==
5
)
{
DCI_pdu
->
Num_ue_spec_dci
=
2
;
// user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
DLSCH_alloc_pdu1E
.
tpmi
=
5
;
//5=use feedback
DLSCH_alloc_pdu1E
.
rv
=
0
;
DLSCH_alloc_pdu1E
.
ndi
=
1
;
DLSCH_alloc_pdu1E
.
mcs
=
openair_daq_vars
.
target_ue_dl_mcs
;
DLSCH_alloc_pdu1E
.
harq_pid
=
1
;
DLSCH_alloc_pdu1E
.
dai
=
0
;
DLSCH_alloc_pdu1E
.
TPC
=
0
;
DLSCH_alloc_pdu1E
.
rballoc
=
openair_daq_vars
.
ue_dl_rb_alloc
;
DLSCH_alloc_pdu1E
.
rah
=
0
;
DLSCH_alloc_pdu1E
.
dl_power_off
=
0
;
//0=second user present
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
//user 2
DCI_pdu
->
dci_alloc
[
1
].
dci_length
=
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t
;
DCI_pdu
->
dci_alloc
[
1
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
1
].
rnti
=
0x1236
;
DCI_pdu
->
dci_alloc
[
1
].
format
=
format1E_2A_M10PRB
;
DCI_pdu
->
dci_alloc
[
1
].
ra_flag
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
1
].
dci_pdu
[
0
],(
void
*
)
&
DLSCH_alloc_pdu1E
,
sizeof
(
DCI1E_5MHz_2A_M10PRB_TDD_t
));
// set the precoder of the second UE orthogonal to the first
phy_vars_eNB
->
eNB_UE_stats
[
1
].
DL_pmi_single
=
(
phy_vars_eNB
->
eNB_UE_stats
[
0
].
DL_pmi_single
^
0x1555
);
}
break
;
case
7
:
DCI_pdu
->
Num_common_dci
=
1
;
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI1A_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0xbeef
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format1A
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
1
;
RA_alloc_pdu
.
type
=
1
;
RA_alloc_pdu
.
vrb_type
=
0
;
RA_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
12
,
3
);
RA_alloc_pdu
.
ndi
=
1
;
RA_alloc_pdu
.
rv
=
1
;
RA_alloc_pdu
.
mcs
=
4
;
RA_alloc_pdu
.
harq_pid
=
0
;
RA_alloc_pdu
.
TPC
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],
&
RA_alloc_pdu
,
sizeof
(
DCI1A_5MHz_TDD_1_6_t
));
break
;
case
9
:
DCI_pdu
->
Num_ue_spec_dci
=
1
;
//user 1
DCI_pdu
->
dci_alloc
[
0
].
dci_length
=
sizeof_DCI0_5MHz_TDD_1_6_t
;
DCI_pdu
->
dci_alloc
[
0
].
L
=
2
;
DCI_pdu
->
dci_alloc
[
0
].
rnti
=
0x1235
;
DCI_pdu
->
dci_alloc
[
0
].
format
=
format0
;
DCI_pdu
->
dci_alloc
[
0
].
ra_flag
=
0
;
UL_alloc_pdu
.
type
=
0
;
UL_alloc_pdu
.
hopping
=
0
;
UL_alloc_pdu
.
rballoc
=
computeRIV
(
25
,
0
,
openair_daq_vars
.
ue_ul_nb_rb
);
UL_alloc_pdu
.
mcs
=
openair_daq_vars
.
target_ue_ul_mcs
;
UL_alloc_pdu
.
ndi
=
1
;
UL_alloc_pdu
.
TPC
=
0
;
UL_alloc_pdu
.
cshift
=
0
;
UL_alloc_pdu
.
dai
=
0
;
UL_alloc_pdu
.
cqi_req
=
1
;
memcpy
((
void
*
)
&
DCI_pdu
->
dci_alloc
[
0
].
dci_pdu
[
0
],(
void
*
)
&
UL_alloc_pdu
,
sizeof
(
DCI0_5MHz_TDD_1_6_t
));
/*
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break
;
default:
break
;
}
DCI_pdu
->
nCCE
=
0
;
for
(
i
=
0
;
i
<
DCI_pdu
->
Num_common_dci
+
DCI_pdu
->
Num_ue_spec_dci
;
i
++
)
{
DCI_pdu
->
nCCE
+=
(
1
<<
(
DCI_pdu
->
dci_alloc
[
i
].
L
));
}
}
#endif //EMOS
#endif //OPENAIR2
#define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15)
#define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15)
#define AMP_OVER_2 (AMP>>1)
#define AMP_OVER_2 (AMP>>1)
...
@@ -1404,10 +719,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1404,10 +719,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
uint8_t
harq_pid
;
uint8_t
harq_pid
;
DCI_PDU
*
DCI_pdu
;
DCI_PDU
*
DCI_pdu
;
uint8_t
*
DLSCH_pdu
=
NULL
;
uint8_t
*
DLSCH_pdu
=
NULL
;
#ifndef OPENAIR2
DCI_PDU
DCI_pdu_tmp
;
DCI_PDU
DCI_pdu_tmp
;
uint8_t
DLSCH_pdu_tmp
[
768
*
8
];
uint8_t
DLSCH_pdu_tmp
[
768
*
8
];
#endif
int8_t
UE_id
;
int8_t
UE_id
;
uint8_t
num_pdcch_symbols
=
0
;
uint8_t
num_pdcch_symbols
=
0
;
uint8_t
ul_subframe
;
uint8_t
ul_subframe
;
...
@@ -1449,13 +762,12 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1449,13 +762,12 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
}
}
#ifdef OPENAIR2
// Get scheduling info for next subframe
// Get scheduling info for next subframe
if
(
phy_vars_eNB
->
CC_id
==
0
)
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
mac_xface
->
eNB_dlsch_ulsch_scheduler
(
phy_vars_eNB
->
Mod_id
,
0
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
);
//,1);
if
(
phy_vars_eNB
->
CC_id
==
0
)
{
mac_xface
->
eNB_dlsch_ulsch_scheduler
(
phy_vars_eNB
->
Mod_id
,
0
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
);
//,1);
#endif
}
}
if
(
abstraction_flag
==
0
)
{
if
(
abstraction_flag
==
0
)
{
// clear the transmit data array for the current subframe
// clear the transmit data array for the current subframe
...
@@ -1783,36 +1095,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1783,36 +1095,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#endif
#endif
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
// Parse DCI received from MAC
// Parse DCI received from MAC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX
,
1
);
DCI_pdu
=
mac_xface
->
get_dci_sdu
(
phy_vars_eNB
->
Mod_id
,
DCI_pdu
=
mac_xface
->
get_dci_sdu
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
);
subframe
);
}
#else
else
{
DCI_pdu
=
&
DCI_pdu_tmp
;
DCI_pdu
=
&
DCI_pdu_tmp
;
#ifdef EMOS
/*
if (((phy_vars_eNB->proc[sched_subframe].frame_tx%1024)%3 == 0) && (next_slot == 0)) {
//openair_daq_vars.target_ue_dl_mcs = (openair_daq_vars.target_ue_dl_mcs+1)%28;
openair_daq_vars.target_ue_dl_mcs = taus()%28;
LOG_D(PHY,"[MYEMOS] frame %d, increasing MCS to %d\n",phy_vars_eNB->proc[sched_subframe].frame_tx,openair_daq_vars.target_ue_dl_mcs);
}
*/
/*
if (phy_vars_eNB->proc[sched_subframe].frame_tx > 28000) {
LOG_E(PHY,"More that 28000 frames reached! Exiting!\n");
}
*/
#endif
#ifdef EMOS_CHANNEL
#ifdef EMOS_CHANNEL
fill_dci_emos
(
DCI_pdu
,
sched_subframe
,
phy_vars_eNB
);
fill_dci_emos
(
DCI_pdu
,
sched_subframe
,
phy_vars_eNB
);
#else
#else
fill_dci
(
DCI_pdu
,
sched_subframe
,
phy_vars_eNB
);
fill_dci
(
DCI_pdu
,
sched_subframe
,
phy_vars_eNB
);
#endif
#endif
#endif
}
// clear existing ulsch dci allocations before applying info from MAC (this is table
// clear existing ulsch dci allocations before applying info from MAC (this is table
ul_subframe
=
pdcch_alloc2ul_subframe
(
&
phy_vars_eNB
->
lte_frame_parms
,
subframe
);
ul_subframe
=
pdcch_alloc2ul_subframe
(
&
phy_vars_eNB
->
lte_frame_parms
,
subframe
);
...
@@ -1875,6 +1173,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1875,6 +1173,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_PHY_PROC
LOG_D
(
PHY
,
"[eNB %"
PRIu8
"] SI generate_eNB_dlsch_params_from_dci
\n
"
,
phy_vars_eNB
->
Mod_id
);
LOG_D
(
PHY
,
"[eNB %"
PRIu8
"] SI generate_eNB_dlsch_params_from_dci
\n
"
,
phy_vars_eNB
->
Mod_id
);
#endif
#endif
generate_eNB_dlsch_params_from_dci
(
frame
,
generate_eNB_dlsch_params_from_dci
(
frame
,
subframe
,
subframe
,
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
...
@@ -1916,6 +1215,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1916,6 +1215,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_PHY_PROC
LOG_D
(
PHY
,
"[eNB %"
PRIu8
"] RA generate_eNB_dlsch_params_from_dci
\n
"
,
phy_vars_eNB
->
Mod_id
);
LOG_D
(
PHY
,
"[eNB %"
PRIu8
"] RA generate_eNB_dlsch_params_from_dci
\n
"
,
phy_vars_eNB
->
Mod_id
);
#endif
#endif
generate_eNB_dlsch_params_from_dci
(
frame
,
generate_eNB_dlsch_params_from_dci
(
frame
,
subframe
,
subframe
,
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
...
@@ -1958,14 +1258,14 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1958,14 +1258,14 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
else
if
(
DCI_pdu
->
dci_alloc
[
i
].
format
!=
format0
)
{
// this is a normal DLSCH allocation
else
if
(
DCI_pdu
->
dci_alloc
[
i
].
format
!=
format0
)
{
// this is a normal DLSCH allocation
#ifdef OPENAIR2
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_PHY_PROC
LOG_D
(
PHY
,
"[eNB] Searching for RNTI %"
PRIx16
"
\n
"
,
DCI_pdu
->
dci_alloc
[
i
].
rnti
);
LOG_D
(
PHY
,
"[eNB] Searching for RNTI %"
PRIx16
"
\n
"
,
DCI_pdu
->
dci_alloc
[
i
].
rnti
);
#endif
#endif
UE_id
=
find_ue
((
int16_t
)
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
phy_vars_eNB
);
#else
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
UE_id
=
i
;
UE_id
=
find_ue
((
int16_t
)
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
phy_vars_eNB
);
#endif
else
UE_id
=
i
;
if
(
UE_id
>=
0
)
{
if
(
UE_id
>=
0
)
{
// dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
// dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
...
@@ -1978,6 +1278,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -1978,6 +1278,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
}
}
#endif
#endif
generate_eNB_dlsch_params_from_dci
(
frame
,
generate_eNB_dlsch_params_from_dci
(
frame
,
subframe
,
subframe
,
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
...
@@ -2049,11 +1350,10 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2049,11 +1350,10 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
return
;
// not reached
return
;
// not reached
}
}
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
UE_id
=
find_ue
((
int16_t
)
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
phy_vars_eNB
);
UE_id
=
find_ue
((
int16_t
)
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
phy_vars_eNB
);
#else
else
UE_id
=
i
;
UE_id
=
i
;
#endif
if
(
UE_id
<
0
)
{
if
(
UE_id
<
0
)
{
LOG_E
(
PHY
,
"[eNB %"
PRIu8
"] Frame %d: Unknown UE_id for rnti %"
PRIx16
"
\n
"
,
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
DCI_pdu
->
dci_alloc
[
i
].
rnti
);
LOG_E
(
PHY
,
"[eNB %"
PRIu8
"] Frame %d: Unknown UE_id for rnti %"
PRIx16
"
\n
"
,
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
DCI_pdu
->
dci_alloc
[
i
].
rnti
);
...
@@ -2082,6 +1382,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2082,6 +1382,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
//dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
//LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti);
//LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti);
generate_eNB_ulsch_params_from_dci
(
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
generate_eNB_ulsch_params_from_dci
(
&
DCI_pdu
->
dci_alloc
[
i
].
dci_pdu
[
0
],
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
DCI_pdu
->
dci_alloc
[
i
].
rnti
,
sched_subframe
,
sched_subframe
,
...
@@ -2191,19 +1492,19 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2191,19 +1492,19 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
input_buffer_length
=
phy_vars_eNB
->
dlsch_eNB_SI
->
harq_processes
[
0
]
->
TBS
/
8
;
input_buffer_length
=
phy_vars_eNB
->
dlsch_eNB_SI
->
harq_processes
[
0
]
->
TBS
/
8
;
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
DLSCH_pdu
=
mac_xface
->
get_dlsch_sdu
(
phy_vars_eNB
->
Mod_id
,
DLSCH_pdu
=
mac_xface
->
get_dlsch_sdu
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
SI_RNTI
,
SI_RNTI
,
0
);
0
);
#else
}
DLSCH_pdu
=
DLSCH_pdu_tmp
;
else
{
DLSCH_pdu
=
DLSCH_pdu_tmp
;
for
(
i
=
0
;
i
<
input_buffer_length
;
i
++
)
DLSCH_pdu
[
i
]
=
(
unsigned
char
)(
taus
()
&
0xff
);
#endif
for
(
i
=
0
;
i
<
input_buffer_length
;
i
++
)
DLSCH_pdu
[
i
]
=
(
unsigned
char
)(
taus
()
&
0xff
);
}
#if defined(SMBV) && !defined(EXMIMO)
#if defined(SMBV) && !defined(EXMIMO)
...
@@ -2293,7 +1594,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2293,7 +1594,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
input_buffer_length
=
phy_vars_eNB
->
dlsch_eNB_ra
->
harq_processes
[
0
]
->
TBS
/
8
;
input_buffer_length
=
phy_vars_eNB
->
dlsch_eNB_ra
->
harq_processes
[
0
]
->
TBS
/
8
;
#ifdef OPENAIR2
int16_t
crnti
=
mac_xface
->
fill_rar
(
phy_vars_eNB
->
Mod_id
,
int16_t
crnti
=
mac_xface
->
fill_rar
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
...
@@ -2342,15 +1642,14 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2342,15 +1642,14 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
UE_id
]
->
Msg3_frame
,
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
UE_id
]
->
Msg3_frame
,
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
UE_id
]
->
Msg3_subframe
);
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
UE_id
]
->
Msg3_subframe
);
#else
/*
for (i=0; i<input_buffer_length; i++)
for
(
i
=
0
;
i
<
input_buffer_length
;
i
++
)
dlsch_input_buffer[i]= (unsigned char) i; //(taus()&0xff);
dlsch_input_buffer
[
i
]
=
(
unsigned
char
)
i
;
//(taus()&0xff);
dlsch_input_buffer[1] = (phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)>>(2+4); // 7 MSBs of timing advance + divide by 4
dlsch_input_buffer
[
1
]
=
(
phy_vars_eNB
->
eNB_UE_stats
[
0
].
UE_timing_offset
)
>>
(
2
+
4
);
// 7 MSBs of timing advance + divide by 4
dlsch_input_buffer[2] = ((phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4
dlsch_input_buffer
[
2
]
=
((
phy_vars_eNB
->
eNB_UE_stats
[
0
].
UE_timing_offset
)
<<
(
4
-
2
))
&
0xf0
;
// 4 LSBs of timing advance + divide by 4
//LOG_I(PHY,"UE %d: timing_offset = %d\n",UE_id,phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset);
//LOG_I(PHY,"UE %d: timing_offset = %d\n",UE_id,phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset);
*/
#endif
#if defined(SMBV) && !defined(EXMIMO)
#if defined(SMBV) && !defined(EXMIMO)
...
@@ -2419,10 +1718,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2419,10 +1718,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
,
re_allocated
);
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
,
re_allocated
);
#endif
#endif
#ifdef OPENAIR2
}
//max user count
}
//max user count
#endif
phy_vars_eNB
->
dlsch_eNB_ra
->
active
=
0
;
phy_vars_eNB
->
dlsch_eNB_ra
->
active
=
0
;
}
}
...
@@ -2479,21 +1776,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
...
@@ -2479,21 +1776,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB
->
eNB_UE_stats
[(
uint32_t
)
UE_id
].
dlsch_trials
[
harq_pid
][
0
]
++
;
phy_vars_eNB
->
eNB_UE_stats
[(
uint32_t
)
UE_id
].
dlsch_trials
[
harq_pid
][
0
]
++
;
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
DLSCH_pdu
=
mac_xface
->
get_dlsch_sdu
(
phy_vars_eNB
->
Mod_id
,
DLSCH_pdu
=
mac_xface
->
get_dlsch_sdu
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
phy_vars_eNB
->
dlsch_eNB
[(
uint8_t
)
UE_id
][
0
]
->
rnti
,
phy_vars_eNB
->
dlsch_eNB
[(
uint8_t
)
UE_id
][
0
]
->
rnti
,
0
);
0
);
phy_vars_eNB
->
eNB_UE_stats
[
UE_id
].
total_TBS_MAC
+=
phy_vars_eNB
->
dlsch_eNB
[(
uint8_t
)
UE_id
][
0
]
->
harq_processes
[
harq_pid
]
->
TBS
;
phy_vars_eNB
->
eNB_UE_stats
[
UE_id
].
total_TBS_MAC
+=
phy_vars_eNB
->
dlsch_eNB
[(
uint8_t
)
UE_id
][
0
]
->
harq_processes
[
harq_pid
]
->
TBS
;
#else
}
DLSCH_pdu
=
DLSCH_pdu_tmp
;
else
{
DLSCH_pdu
=
DLSCH_pdu_tmp
;
for
(
i
=
0
;
i
<
input_buffer_length
;
i
++
)
DLSCH_pdu
[
i
]
=
(
unsigned
char
)(
taus
()
&
0xff
);
for
(
i
=
0
;
i
<
input_buffer_length
;
i
++
)
DLSCH_pdu
[
i
]
=
(
unsigned
char
)(
taus
()
&
0xff
);
#endif
}
#if defined(SMBV) && !defined(EXMIMO)
#if defined(SMBV) && !defined(EXMIMO)
// Configures the data source of allocation (allocation is configured by DCI)
// Configures the data source of allocation (allocation is configured by DCI)
...
@@ -3184,7 +2481,8 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
...
@@ -3184,7 +2481,8 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
preamble_energy_max
/
10
,
preamble_energy_max
/
10
,
preamble_energy_max
%
10
,
preamble_energy_max
%
10
,
preamble_delay_list
[
preamble_max
]);
preamble_delay_list
[
preamble_max
]);
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
uint8_t
update_TA
=
4
;
uint8_t
update_TA
=
4
;
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
switch
(
phy_vars_eNB
->
lte_frame_parms
.
N_RB_DL
)
{
...
@@ -3205,16 +2503,14 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
...
@@ -3205,16 +2503,14 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
break
;
break
;
}
}
mac_xface
->
initiate_ra_proc
(
phy_vars_eNB
->
Mod_id
,
mac_xface
->
initiate_ra_proc
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
frame
,
frame
,
preamble_max
,
preamble_max
,
preamble_delay_list
[
preamble_max
]
*
update_TA
,
preamble_delay_list
[
preamble_max
]
*
update_TA
,
0
,
subframe
,
0
);
0
,
subframe
,
0
);
}
#endif
}
else
{
}
else
{
MSC_LOG_EVENT
(
MSC_PHY_ENB
,
"0 RA Failed add user, too many"
);
MSC_LOG_EVENT
(
MSC_PHY_ENB
,
"0 RA Failed add user, too many"
);
LOG_I
(
PHY
,
"[eNB %d][RAPROC] frame %d, subframe %d: Unable to add user, max user count reached
\n
"
,
LOG_I
(
PHY
,
"[eNB %d][RAPROC] frame %d, subframe %d: Unable to add user, max user count reached
\n
"
,
...
@@ -3395,11 +2691,13 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3395,11 +2691,13 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
if ((i == 1) && (phy_vars_eNB->cooperation_flag > 0) && (two_ues_connected == 1))
if ((i == 1) && (phy_vars_eNB->cooperation_flag > 0) && (two_ues_connected == 1))
break;
break;
*/
*/
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
==
RA_RESPONSE
)
process_Msg3
(
phy_vars_eNB
,
sched_subframe
,
i
,
harq_pid
);
#endif
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
if
(
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
==
RA_RESPONSE
)
{
process_Msg3
(
phy_vars_eNB
,
sched_subframe
,
i
,
harq_pid
);
}
}
/*
/*
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_PHY_PROC
...
@@ -3630,12 +2928,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3630,12 +2928,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
LOG_I
(
PHY
,
"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d
\n
"
,
LOG_I
(
PHY
,
"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d
\n
"
,
phy_vars_eNB
->
Mod_id
,
i
);
phy_vars_eNB
->
Mod_id
,
i
);
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
=
PRACH
;
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
=
PRACH
;
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
mac_xface
->
cancel_ra_proc
(
phy_vars_eNB
->
Mod_id
,
mac_xface
->
cancel_ra_proc
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
frame
,
frame
,
phy_vars_eNB
->
eNB_UE_stats
[
i
].
crnti
);
phy_vars_eNB
->
eNB_UE_stats
[
i
].
crnti
);
#endif
}
remove_ue
(
phy_vars_eNB
->
eNB_UE_stats
[
i
].
crnti
,
phy_vars_eNB
,
abstraction_flag
);
remove_ue
(
phy_vars_eNB
->
eNB_UE_stats
[
i
].
crnti
,
phy_vars_eNB
,
abstraction_flag
);
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
i
]
->
Msg3_active
=
0
;
phy_vars_eNB
->
ulsch_eNB
[(
uint32_t
)
i
]
->
Msg3_active
=
0
;
//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0;
//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0;
...
@@ -3755,7 +3053,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3755,7 +3053,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
phy_vars_eNB
->
eNB_UE_stats
[
i
].
ulsch_consecutive_errors
=
0
;
phy_vars_eNB
->
eNB_UE_stats
[
i
].
ulsch_consecutive_errors
=
0
;
if
(
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
Msg3_flag
==
1
)
{
if
(
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
Msg3_flag
==
1
)
{
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_PHY_PROC
LOG_I
(
PHY
,
"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d
\n
"
,
LOG_I
(
PHY
,
"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d
\n
"
,
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
Mod_id
,
...
@@ -3788,7 +3086,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3788,7 +3086,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
*/
*/
#endif
}
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
=
PUSCH
;
phy_vars_eNB
->
eNB_UE_stats
[
i
].
mode
=
PUSCH
;
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
Msg3_flag
=
0
;
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
Msg3_flag
=
0
;
...
@@ -3837,7 +3135,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3837,7 +3135,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
//dump_ulsch(phy_vars_eNB,sched_subframe,i);
//dump_ulsch(phy_vars_eNB,sched_subframe,i);
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
// if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->calibration_flag == 0) {
// if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->calibration_flag == 0) {
mac_xface
->
rx_sdu
(
phy_vars_eNB
->
Mod_id
,
mac_xface
->
rx_sdu
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
...
@@ -3864,7 +3162,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3864,7 +3162,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
stop_meas
(
&
phy_vars_eNB
->
localization_stats
);
stop_meas
(
&
phy_vars_eNB
->
localization_stats
);
#endif
#endif
#endif
}
}
}
// estimate timing advance for MAC
// estimate timing advance for MAC
...
@@ -3987,12 +3285,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
...
@@ -3987,12 +3285,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
rnti
,
frame
,
subframe
);
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
rnti
,
frame
,
subframe
);
}
}
#ifdef OPENAIR2
if
(
phy_vars_eNB
->
mac_enabled
==
1
)
{
mac_xface
->
SR_indication
(
phy_vars_eNB
->
Mod_id
,
mac_xface
->
SR_indication
(
phy_vars_eNB
->
Mod_id
,
phy_vars_eNB
->
CC_id
,
phy_vars_eNB
->
CC_id
,
frame
,
frame
,
phy_vars_eNB
->
dlsch_eNB
[
i
][
0
]
->
rnti
,
subframe
);
phy_vars_eNB
->
dlsch_eNB
[
i
][
0
]
->
rnti
,
subframe
);
#endif
}
}
}
}
// do_SR==1
}
// do_SR==1
...
...
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