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
cb0eabe7
Commit
cb0eabe7
authored
Dec 05, 2015
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated unitary simulations for new CCE interfaces. Cleaned up warnings in dlsim/pdcchsim/ulsim.
parent
1fc396f5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
238 additions
and
116 deletions
+238
-116
openair1/PHY/LTE_TRANSPORT/dci.c
openair1/PHY/LTE_TRANSPORT/dci.c
+101
-0
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+4
-4
openair1/PHY/LTE_TRANSPORT/proto.h
openair1/PHY/LTE_TRANSPORT/proto.h
+6
-0
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+39
-31
openair1/SIMULATION/LTE_PHY/pdcchsim.c
openair1/SIMULATION/LTE_PHY/pdcchsim.c
+71
-62
openair1/SIMULATION/LTE_PHY/ulsim.c
openair1/SIMULATION/LTE_PHY/ulsim.c
+11
-14
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+1
-0
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+0
-1
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+4
-4
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+1
-0
No files found.
openair1/PHY/LTE_TRANSPORT/dci.c
View file @
cb0eabe7
...
...
@@ -2546,6 +2546,107 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub
get_mi
(
&
PHY_vars_eNB_g
[
Mod_id
][
CC_id
]
->
lte_frame_parms
,
subframe
)));
}
int
get_nCCE_offset_l1
(
int
*
CCE_table
,
const
unsigned
char
L
,
const
int
nCCE
,
const
int
common_dci
,
const
unsigned
short
rnti
,
const
unsigned
char
subframe
)
{
int
search_space_free
,
m
,
nb_candidates
=
0
,
l
,
i
;
unsigned
int
Yk
;
/*
printf("CCE Allocation: ");
for (i=0;i<nCCE;i++)
printf("%d.",CCE_table[i]);
printf("\n");
*/
if
(
common_dci
==
1
)
{
// check CCE(0 ... L-1)
nb_candidates
=
(
L
==
4
)
?
4
:
2
;
nb_candidates
=
min
(
nb_candidates
,
nCCE
/
L
);
// printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
for
(
m
=
nb_candidates
-
1
;
m
>=
0
;
m
--
)
{
search_space_free
=
1
;
for
(
l
=
0
;
l
<
L
;
l
++
)
{
// printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
if
(
CCE_table
[(
m
*
L
)
+
l
]
==
1
)
{
search_space_free
=
0
;
break
;
}
}
if
(
search_space_free
==
1
)
{
// printf("returning %d\n",m*L);
for
(
l
=
0
;
l
<
L
;
l
++
)
CCE_table
[(
m
*
L
)
+
l
]
=
1
;
return
(
m
*
L
);
}
}
return
(
-
1
);
}
else
{
// Find first available in ue specific search space
// according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
// compute Yk
Yk
=
(
unsigned
int
)
rnti
;
for
(
i
=
0
;
i
<=
subframe
;
i
++
)
Yk
=
(
Yk
*
39827
)
%
65537
;
Yk
=
Yk
%
(
nCCE
/
L
);
switch
(
L
)
{
case
1
:
case
2
:
nb_candidates
=
6
;
break
;
case
4
:
case
8
:
nb_candidates
=
2
;
break
;
default:
DevParam
(
L
,
nCCE
,
rnti
);
break
;
}
LOG_D
(
MAC
,
"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d
\n
"
,
rnti
,
Yk
,
nCCE
,
nCCE
/
L
,
nb_candidates
);
for
(
m
=
0
;
m
<
nb_candidates
;
m
++
)
{
search_space_free
=
1
;
for
(
l
=
0
;
l
<
L
;
l
++
)
{
if
(
CCE_table
[(((
Yk
+
m
)
%
(
nCCE
/
L
))
*
L
)
+
l
]
==
1
)
{
search_space_free
=
0
;
break
;
}
}
if
(
search_space_free
==
1
)
{
for
(
l
=
0
;
l
<
L
;
l
++
)
CCE_table
[(((
Yk
+
m
)
%
(
nCCE
/
L
))
*
L
)
+
l
]
=
1
;
return
(((
Yk
+
m
)
%
(
nCCE
/
L
))
*
L
);
}
}
return
(
-
1
);
}
}
void
dci_decoding_procedure0
(
LTE_UE_PDCCH
**
lte_ue_pdcch_vars
,
int
do_common
,
uint8_t
subframe
,
...
...
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
cb0eabe7
...
...
@@ -2667,7 +2667,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq
->
subframe
=
subframe
;
}
//
#ifdef DEBUG_DCI
#ifdef DEBUG_DCI
if
(
dlsch0
)
{
printf
(
"dlsch0 eNB: dlsch0 %p
\n
"
,
dlsch0
);
...
...
@@ -2683,7 +2683,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
printf
(
"dlsch0 eNB: mimo_mode %d
\n
"
,
dlsch0_harq
->
mimo_mode
);
}
//
#endif
#endif
// compute DL power control parameters
computeRhoA_eNB
(
pdsch_config_dedicated
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
);
...
...
@@ -5534,7 +5534,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
}
//
#ifdef DEBUG_DCI
#ifdef DEBUG_DCI
if
(
dlsch
[
0
])
{
printf
(
"PDSCH dlsch0 UE: rnti %x
\n
"
,
dlsch
[
0
]
->
rnti
);
...
...
@@ -5548,7 +5548,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
printf
(
"PDSCH dlsch0 UE: pwr_off %d
\n
"
,
dlsch0_harq
->
dl_power_off
);
}
//
#endif
#endif
dlsch
[
0
]
->
active
=
1
;
// compute DL power control parameters
...
...
openair1/PHY/LTE_TRANSPORT/proto.h
View file @
cb0eabe7
...
...
@@ -1595,6 +1595,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
uint32_t
pmi_extend
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
wideband_pmi
);
int
get_nCCE_offset_l1
(
int
*
CCE_table
,
const
unsigned
char
L
,
const
int
nCCE
,
const
int
common_dci
,
const
unsigned
short
rnti
,
const
unsigned
char
subframe
);
uint16_t
get_nCCE
(
uint8_t
num_pdcch_symbols
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
mi
);
...
...
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
cb0eabe7
...
...
@@ -266,15 +266,15 @@ int main(int argc, char **argv)
unsigned
int
ret
;
unsigned
int
coded_bits_per_codeword
=
0
,
nsymb
,
dci_cnt
,
tbs
=
0
;
unsigned
int
tx_lev
=
0
,
tx_lev_dB
=
0
,
trials
,
errs
[
4
]
=
{
0
,
0
,
0
,
0
},
errs2
[
4
]
=
{
0
,
0
,
0
,
0
},
round_trials
[
4
]
=
{
0
,
0
,
0
,
0
},
dci_errors
=
0
,
dlsch_active
=
0
,
num_layers
;
int
re_allocated
;
unsigned
int
tx_lev
=
0
,
tx_lev_dB
=
0
,
trials
,
errs
[
4
]
=
{
0
,
0
,
0
,
0
},
errs2
[
4
]
=
{
0
,
0
,
0
,
0
},
round_trials
[
4
]
=
{
0
,
0
,
0
,
0
},
dci_errors
=
0
,
dlsch_active
=
0
;
//
,num_layers;
//
int re_allocated;
char
fname
[
32
],
vname
[
32
];
FILE
*
bler_fd
;
char
bler_fname
[
256
];
FILE
*
time_meas_fd
;
char
time_meas_fname
[
256
];
FILE
*
tikz_fd
;
char
tikz_fname
[
256
];
//
FILE *tikz_fd;
//
char tikz_fname[256];
FILE
*
input_trch_fd
=
NULL
;
unsigned
char
input_trch_file
=
0
;
...
...
@@ -300,7 +300,7 @@ int main(int argc, char **argv)
uint8_t
rx_sample_offset
=
0
;
//char stats_buffer[4096];
//int len;
uint8_t
num_rounds
=
4
,
fix_rounds
=
0
;
uint8_t
num_rounds
=
4
;
//
,fix_rounds=0;
uint8_t
subframe
=
7
;
int
u
;
int
n
=
0
;
...
...
@@ -314,8 +314,8 @@ int main(int argc, char **argv)
// void *data;
// int ii;
int
bler
;
double
blerr
[
4
],
uncoded_ber
,
avg_ber
;
//
int bler;
double
blerr
[
4
],
uncoded_ber
;
//
,avg_ber;
short
*
uncoded_ber_bit
=
NULL
;
uint8_t
N_RB_DL
=
25
,
osf
=
1
;
uint8_t
fdd_flag
=
0
;
...
...
@@ -330,7 +330,7 @@ int main(int argc, char **argv)
int
common_flag
=
0
,
TPC
=
0
;
double
cpu_freq_GHz
;
time_stats_t
ts
;
//,sts,usts;
//
time_stats_t ts;//,sts,usts;
int
avg_iter
,
iter_trials
;
int
rballocset
=
0
;
int
print_perf
=
0
;
...
...
@@ -344,17 +344,22 @@ int main(int argc, char **argv)
int
TB0_active
=
1
;
uint32_t
perfect_ce
=
0
;
LTE_DL_UE_HARQ_t
*
dlsch0_ue_harq
;
LTE_DL_eNB_HARQ_t
*
dlsch0_eNB_harq
;
//
LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
//
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
uint8_t
Kmimo
;
uint8_t
ue_category
=
4
;
uint32_t
Nsoft
;
FILE
*
proc_fd
=
NULL
;
char
buf
[
64
];
int
CCE_table
[
800
];
opp_enabled
=
1
;
// to enable the time meas
#if defined(__arm__)
FILE
*
proc_fd
=
NULL
;
char
buf
[
64
];
proc_fd
=
fopen
(
"/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq"
,
"r"
);
if
(
!
proc_fd
)
printf
(
"cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq"
);
...
...
@@ -377,7 +382,7 @@ int main(int argc, char **argv)
// default parameters
n_frames
=
1000
;
snr0
=
0
;
num_layers
=
1
;
//
num_layers = 1;
perfect_ce
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:U:v:w:B:PLl:Y"
))
!=
-
1
)
{
...
...
@@ -1328,7 +1333,7 @@ int main(int argc, char **argv)
dci_alloc
[
num_dci
].
L
=
1
;
dci_alloc
[
num_dci
].
rnti
=
SI_RNTI
;
dci_alloc
[
num_dci
].
format
=
format1A
;
dci_alloc
[
num_dci
].
n
CCE
=
0
;
dci_alloc
[
num_dci
].
first
CCE
=
0
;
dump_dci
(
&
PHY_vars_eNB
->
lte_frame_parms
,
&
dci_alloc
[
num_dci
]);
printf
(
"Generating dlsch params for user %d
\n
"
,
k
);
...
...
@@ -1635,7 +1640,7 @@ int main(int argc, char **argv)
dci_alloc
[
num_dci
].
L
=
1
;
dci_alloc
[
num_dci
].
rnti
=
SI_RNTI
;
dci_alloc
[
num_dci
].
format
=
format1A
;
dci_alloc
[
num_dci
].
n
CCE
=
0
;
dci_alloc
[
num_dci
].
first
CCE
=
0
;
dump_dci
(
&
PHY_vars_eNB
->
lte_frame_parms
,
&
dci_alloc
[
num_dci
]);
printf
(
"Generating dlsch params for user %d
\n
"
,
k
);
...
...
@@ -1943,7 +1948,7 @@ int main(int argc, char **argv)
dci_alloc
[
num_dci
].
L
=
1
;
dci_alloc
[
num_dci
].
rnti
=
SI_RNTI
;
dci_alloc
[
num_dci
].
format
=
format1A
;
dci_alloc
[
num_dci
].
n
CCE
=
0
;
dci_alloc
[
num_dci
].
first
CCE
=
0
;
dump_dci
(
&
PHY_vars_eNB
->
lte_frame_parms
,
&
dci_alloc
[
num_dci
]);
printf
(
"Generating dlsch params for user %d
\n
"
,
k
);
...
...
@@ -1974,7 +1979,7 @@ int main(int argc, char **argv)
dci_alloc
[
num_dci
].
L
=
1
;
dci_alloc
[
num_dci
].
rnti
=
n_rnti
+
k
;
dci_alloc
[
num_dci
].
format
=
format1E_2A_M10PRB
;
dci_alloc
[
num_dci
].
n
CCE
=
4
*
k
;
dci_alloc
[
num_dci
].
first
CCE
=
4
*
k
;
printf
(
"Generating dlsch params for user %d
\n
"
,
k
);
generate_eNB_dlsch_params_from_dci
(
0
,
subframe
,
...
...
@@ -2019,9 +2024,12 @@ int main(int argc, char **argv)
if
(
n_frames
==
1
)
printf
(
"%d
\n
"
,
numCCE
);
// apply RNTI-based nCCE allocation
memset
(
CCE_table
,
0
,
800
*
sizeof
(
int
));
for
(
i
=
num_common_dci
;
i
<
num_dci
;
i
++
)
{
dci_alloc
[
i
].
nCCE
=
get_nCCE_offset
(
1
<<
dci_alloc
[
i
].
L
,
dci_alloc
[
i
].
firstCCE
=
get_nCCE_offset_l1
(
CCE_table
,
1
<<
dci_alloc
[
i
].
L
,
numCCE
,
(
dci_alloc
[
i
].
rnti
==
SI_RNTI
)
?
1
:
0
,
dci_alloc
[
i
].
rnti
,
...
...
@@ -2029,7 +2037,7 @@ int main(int argc, char **argv)
if
(
n_frames
==
1
)
printf
(
"dci %d: rnti %x, format %d : nCCE %d/%d
\n
"
,
i
,
dci_alloc
[
i
].
rnti
,
dci_alloc
[
i
].
format
,
dci_alloc
[
i
].
n
CCE
,
numCCE
);
dci_alloc
[
i
].
first
CCE
,
numCCE
);
}
for
(
k
=
0
;
k
<
n_users
;
k
++
)
{
...
...
@@ -2112,7 +2120,7 @@ int main(int argc, char **argv)
round_trials
[
3
]
=
0
;
dci_errors
=
0
;
avg_ber
=
0
;
//
avg_ber = 0;
round
=
0
;
avg_iter
=
0
;
...
...
@@ -2697,7 +2705,7 @@ PMI_FEEDBACK:
}
start_meas
(
&
PHY_vars_eNB
->
dlsch_modulation_stats
);
re_allocated
=
dlsch_modulation
(
PHY_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
eNB_id
],
dlsch_modulation
(
PHY_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
eNB_id
],
AMP
,
subframe
,
&
PHY_vars_eNB
->
lte_frame_parms
,
...
...
openair1/SIMULATION/LTE_PHY/pdcchsim.c
View file @
cb0eabe7
...
...
@@ -56,7 +56,7 @@ PHY_VARS_UE *PHY_vars_UE;
#define UL_RB_ALLOC 0x1ff;
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
#define DLSCH_RB_ALLOC
0x1fbf
// igore DC component,RB13
#define DLSCH_RB_ALLOC
((uint16_t)0x1fbf)
// igore DC component,RB13
void
lte_param_init
(
unsigned
char
N_tx
,
unsigned
char
N_rx
,
unsigned
char
transmission_mode
,
unsigned
char
extended_prefix_flag
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
lte_frame_type_t
frame_type
,
uint8_t
osf
,
uint32_t
perfect_ce
)
...
...
@@ -154,9 +154,9 @@ DCI_PDU DCI_pdu;
DCI_PDU
*
get_dci
(
LTE_DL_FRAME_PARMS
*
lte_frame_parms
,
uint8_t
log2L
,
uint8_t
log2Lcommon
,
uint8_t
format_selector
,
uint32_t
rnti
)
{
uint
8_t
BCCH_alloc_pdu
[
8
];
uint
8_t
DLSCH_alloc_pdu
[
8
];
uint
8_t
UL_alloc_pdu
[
8
];
uint
32_t
BCCH_alloc_pdu
[
2
];
uint
32_t
DLSCH_alloc_pdu
[
2
];
uint
32_t
UL_alloc_pdu
[
2
];
int
i
;
int
dci_length_bytes
,
dci_length
;
...
...
@@ -462,7 +462,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
DCI_pdu
.
dci_alloc
[
0
].
ra_flag
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
.
dci_alloc
[
0
].
dci_pdu
[
0
],
&
BCCH_alloc_pdu
[
0
],
BCCH_pdu_size_bytes
);
DCI_pdu
.
Num_common_dci
++
;
/*
if
(
lte_frame_parms
->
N_RB_DL
>=
25
)
{
// add ue specific dci
DCI_pdu
.
dci_alloc
[
1
].
dci_length
=
dci_length
;
DCI_pdu
.
dci_alloc
[
1
].
L
=
log2L
;
...
...
@@ -472,15 +472,19 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
memcpy
((
void
*
)
&
DCI_pdu
.
dci_alloc
[
1
].
dci_pdu
[
0
],
&
DLSCH_alloc_pdu
[
0
],
dci_length_bytes
);
DCI_pdu
.
Num_ue_spec_dci
++
;
DCI_pdu.dci_alloc[0
].dci_length = UL_pdu_size_bits;
DCI_pdu.dci_alloc[0
].L = log2L;
DCI_pdu.dci_alloc[0
].rnti = rnti;
DCI_pdu.dci_alloc[0
].format = format0;
DCI_pdu.dci_alloc[0
].ra_flag = 0;
if
(
lte_frame_parms
->
N_RB_DL
>=
50
)
{
DCI_pdu
.
dci_alloc
[
2
].
dci_length
=
UL_pdu_size_bits
;
DCI_pdu
.
dci_alloc
[
2
].
L
=
log2L
;
DCI_pdu
.
dci_alloc
[
2
].
rnti
=
rnti
;
DCI_pdu
.
dci_alloc
[
2
].
format
=
format0
;
DCI_pdu
.
dci_alloc
[
2
].
ra_flag
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
.
dci_alloc
[
0
].
dci_pdu
[
0
],
&
UL_alloc_pdu
[
0
],
UL_pdu_size_bytes
);
DCI_pdu
.
Num_ue_spec_dci
++
;
*/
}
}
DCI_pdu
.
nCCE
=
0
;
for
(
i
=
0
;
i
<
DCI_pdu
.
Num_common_dci
+
DCI_pdu
.
Num_ue_spec_dci
;
i
++
)
{
...
...
@@ -523,10 +527,8 @@ int main(int argc, char **argv)
uint8_t
dci_cnt
=
0
;
LTE_DL_FRAME_PARMS
*
frame_parms
;
uint8_t
log2L
=
2
,
log2Lcommon
=
2
,
format_selector
=
0
;
uint8_t
numCCE
,
nCCE_max
,
common_active
=
0
,
ul_active
=
0
,
dl_active
=
0
;
uint32_t
rv
;
uint8_t
numCCE
,
common_active
=
0
,
ul_active
=
0
,
dl_active
=
0
;
DCI_format_t
format
=
format1
;
uint32_t
n_trials_common
=
0
,
n_trials_ul
=
0
,
n_trials_dl
=
0
,
false_detection_cnt
=
0
;
uint8_t
common_rx
,
ul_rx
,
dl_rx
;
uint8_t
tdd_config
=
3
;
...
...
@@ -540,20 +542,20 @@ int main(int argc, char **argv)
DCI_ALLOC_t
dci_alloc_rx
[
8
];
void
*
dlsch_pdu
=
NULL
;
// int ret;
int
ret
;
uint8_t
harq_pid
;
uint8_t
phich_ACK
;
uint8_t
num_phich_interf
=
0
;
lte_frame_type_t
frame_type
=
TDD
;
int
re_offset
;
uint32_t
*
txptr
;
//
int re_offset;
//
uint32_t *txptr;
int
aarx
;
int
k
;
double
BW
=
5
.
0
;
uint32_t
perfect_ce
=
0
;
int
CCE_table
[
800
];
number_of_cards
=
1
;
openair_daq_vars
.
rx_rf_mode
=
1
;
...
...
@@ -894,7 +896,7 @@ int main(int argc, char **argv)
i
=
0
;
while
(
!
feof
(
input_fd
))
{
fscanf
(
input_fd
,
"%s %s"
,
input_val_str
,
input_val_str2
);
//&input_val1,&input_val2);
ret
=
fscanf
(
input_fd
,
"%s %s"
,
input_val_str
,
input_val_str2
);
//&input_val1,&input_val2);
if
((
i
%
4
)
==
0
)
{
((
short
*
)
txdata
[
0
])[
i
/
2
]
=
(
short
)((
1
<<
15
)
*
strtod
(
input_val_str
,
NULL
));
...
...
@@ -921,7 +923,7 @@ int main(int argc, char **argv)
PHY_vars_UE
->
UE_mode
[
0
]
=
PUSCH
;
nCCE_max
=
get_nCCE
(
3
,
&
PHY_vars_eNB
->
lte_frame_parms
,
get_mi
(
&
PHY_vars_eNB
->
lte_frame_parms
,
0
));
//
nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
//printf("nCCE_max %d\n",nCCE_max);
//printf("num_phich interferers %d\n",num_phich_interf);
...
...
@@ -973,45 +975,52 @@ int main(int argc, char **argv)
numCCE
=
0
;
n_trials_common
++
;
common_active
=
1
;
if
(
PHY_vars_eNB
->
lte_frame_parms
.
N_RB_DL
>=
50
)
{
n_trials_ul
++
;
ul_active
=
1
;
}
if
(
PHY_vars_eNB
->
lte_frame_parms
.
N_RB_DL
>=
25
)
{
n_trials_dl
++
;
dl_active
=
1
;
}
init_nCCE_table
();
num_pdcch_symbols
=
get_num_pdcch_symbols
(
DCI_pdu
.
Num_common_dci
+
DCI_pdu
.
Num_ue_spec_dci
,
DCI_pdu
.
dci_alloc
,
frame_parms
,
subframe
);
DCI_pdu
.
n
CCE
=
get_nCCE
(
num_pdcch_symbols
,
&
PHY_vars_eNB
->
lte_frame_parms
,
get_mi
(
&
PHY_vars_eNB
->
lte_frame_parms
,
subframe
));
num
CCE
=
get_nCCE
(
num_pdcch_symbols
,
&
PHY_vars_eNB
->
lte_frame_parms
,
get_mi
(
&
PHY_vars_eNB
->
lte_frame_parms
,
subframe
));
if
(
n_frames
==
1
)
{
printf
(
"num_dci %d, num_pddch_symbols %d, nCCE %d
\n
"
,
DCI_pdu
.
Num_common_dci
+
DCI_pdu
.
Num_ue_spec_dci
,
num_pdcch_symbols
,
DCI_pdu
.
nCCE
);
num_pdcch_symbols
,
numCCE
);
}
// apply RNTI-based nCCE allocation
memset
(
CCE_table
,
0
,
800
*
sizeof
(
int
));
for
(
i
=
0
;
i
<
DCI_pdu
.
Num_common_dci
+
DCI_pdu
.
Num_ue_spec_dci
;
i
++
)
{
// SI RNTI
if
(
DCI_pdu
.
dci_alloc
[
i
].
rnti
==
SI_RNTI
)
{
DCI_pdu
.
dci_alloc
[
i
].
nCCE
=
get_nCCE_offset
(
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
DCI_pdu
.
nCCE
,
DCI_pdu
.
dci_alloc
[
i
].
firstCCE
=
get_nCCE_offset_l1
(
CCE_table
,
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
numCCE
,
1
,
SI_RNTI
,
subframe
);
}
// RA RNTI
else
if
(
DCI_pdu
.
dci_alloc
[
i
].
ra_flag
==
1
)
{
DCI_pdu
.
dci_alloc
[
i
].
nCCE
=
get_nCCE_offset
(
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
DCI_pdu
.
nCCE
,
DCI_pdu
.
dci_alloc
[
i
].
firstCCE
=
get_nCCE_offset_l1
(
CCE_table
,
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
numCCE
,
1
,
DCI_pdu
.
dci_alloc
[
i
].
rnti
,
subframe
);
}
// C RNTI
else
{
DCI_pdu
.
dci_alloc
[
i
].
nCCE
=
get_nCCE_offset
(
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
DCI_pdu
.
nCCE
,
DCI_pdu
.
dci_alloc
[
i
].
firstCCE
=
get_nCCE_offset_l1
(
CCE_table
,
1
<<
DCI_pdu
.
dci_alloc
[
i
].
L
,
numCCE
,
0
,
DCI_pdu
.
dci_alloc
[
i
].
rnti
,
subframe
);
...
...
@@ -1019,9 +1028,9 @@ int main(int argc, char **argv)
if
(
n_frames
==
1
)
printf
(
"dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d
\n
"
,
i
,
DCI_pdu
.
dci_alloc
[
i
].
rnti
,
DCI_pdu
.
dci_alloc
[
i
].
format
,
DCI_pdu
.
dci_alloc
[
i
].
L
,
DCI_pdu
.
dci_alloc
[
i
].
nCCE
,
DCI_pdu
.
n
CCE
,
DCI_pdu
.
dci_alloc
[
i
].
dci_length
);
DCI_pdu
.
dci_alloc
[
i
].
L
,
DCI_pdu
.
dci_alloc
[
i
].
firstCCE
,
num
CCE
,
DCI_pdu
.
dci_alloc
[
i
].
dci_length
);
if
(
DCI_pdu
.
dci_alloc
[
i
].
n
CCE
==-
1
)
if
(
DCI_pdu
.
dci_alloc
[
i
].
first
CCE
==-
1
)
exit
(
-
1
);
}
...
...
@@ -1055,7 +1064,7 @@ int main(int argc, char **argv)
generate_phich_top
(
PHY_vars_eNB
,
subframe
,
AMP
,
0
,
0
);
/*
// generate 3 interfering PHICH
if
(
num_phich_interf
>
0
)
{
PHY_vars_eNB
->
ulsch_eNB
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
4
;
...
...
@@ -1082,7 +1091,7 @@ int main(int argc, char **argv)
}
PHY_vars_eNB
->
ulsch_eNB
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
0
;
*/
}
// write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
...
...
@@ -1262,7 +1271,7 @@ int main(int argc, char **argv)
for
(
i
=
0
;
i
<
dci_cnt
;
i
++
)
printf
(
"dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d
\n
"
,
i
,
dci_alloc_rx
[
i
].
rnti
,
dci_alloc_rx
[
i
].
format
,
dci_alloc_rx
[
i
].
L
,
dci_alloc_rx
[
i
].
n
CCE
,
numCCE
,
dci_alloc_rx
[
i
].
dci_length
);
dci_alloc_rx
[
i
].
L
,
dci_alloc_rx
[
i
].
first
CCE
,
numCCE
,
dci_alloc_rx
[
i
].
dci_length
);
}
for
(
i
=
0
;
i
<
dci_cnt
;
i
++
)
{
...
...
@@ -1337,8 +1346,8 @@ int main(int argc, char **argv)
}
//trials
printf
(
"SNR %f : n_errors_common = %d/%d (%e)
\n
"
,
SNR
,
n_errors_common
,
n_trials_common
,(
double
)
n_errors_common
/
n_trials_common
);
printf
(
"SNR %f : n_errors_ul = %d/%d (%e)
\n
"
,
SNR
,
n_errors_ul
,
n_trials_ul
,(
double
)
n_errors_ul
/
n_trials_ul
);
printf
(
"SNR %f : n_errors_dl = %d/%d (%e)
\n
"
,
SNR
,
n_errors_dl
,
n_trials_dl
,(
double
)
n_errors_dl
/
n_trials_dl
);
if
(
ul_active
==
1
)
printf
(
"SNR %f : n_errors_ul = %d/%d (%e)
\n
"
,
SNR
,
n_errors_ul
,
n_trials_ul
,(
double
)
n_errors_ul
/
n_trials_ul
);
if
(
dl_active
==
1
)
printf
(
"SNR %f : n_errors_dl = %d/%d (%e)
\n
"
,
SNR
,
n_errors_dl
,
n_trials_dl
,(
double
)
n_errors_dl
/
n_trials_dl
);
printf
(
"SNR %f : n_errors_cfi = %d/%d (%e)
\n
"
,
SNR
,
n_errors_cfi
,
trial
,(
double
)
n_errors_cfi
/
trial
);
printf
(
"SNR %f : n_errors_hi = %d/%d (%e)
\n
"
,
SNR
,
n_errors_hi
,
trial
,(
double
)
n_errors_hi
/
trial
);
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
cb0eabe7
...
...
@@ -74,7 +74,7 @@ extern short *ul_ref_sigs[30][2][33];
PHY_VARS_eNB
*
PHY_vars_eNB
;
PHY_VARS_UE
*
PHY_vars_UE
;
#define MCS_COUNT 23//added for PHY abstraction
//
#define MCS_COUNT 23//added for PHY abstraction
channel_desc_t
*
eNB2UE
[
NUMBER_OF_eNB_MAX
][
NUMBER_OF_UE_MAX
];
channel_desc_t
*
UE2eNB
[
NUMBER_OF_UE_MAX
][
NUMBER_OF_eNB_MAX
];
...
...
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
int
aarx
,
aatx
;
double
channelx
,
channely
;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
SNR2
,
snr0
=-
2
.
0
,
snr1
,
SNRmeas
,
rate
,
saving_bler
;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
SNR2
,
snr0
=-
2
.
0
,
snr1
,
SNRmeas
,
rate
,
saving_bler
=
0
;
double
input_snr_step
=
.
2
,
snr_int
=
30
;
double
blerr
;
...
...
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
unsigned
int
coded_bits_per_codeword
,
nsymb
;
int
subframe
=
3
;
unsigned
int
tx_lev
=
0
,
tx_lev_dB
,
trials
,
errs
[
4
]
=
{
0
,
0
,
0
,
0
},
round_trials
[
4
]
=
{
0
,
0
,
0
,
0
};
uint8_t
transmission_mode
=
1
,
n_rx
=
1
,
n_tx
=
1
;
uint8_t
transmission_mode
=
1
,
n_rx
=
1
;
FILE
*
bler_fd
=
NULL
;
char
bler_fname
[
512
];
...
...
@@ -414,10 +414,6 @@ int main(int argc, char **argv)
exit
(
-
1
);
}
if
(
transmission_mode
>
1
)
{
n_tx
=
1
;
}
break
;
case
'y'
:
...
...
@@ -701,8 +697,8 @@ int main(int argc, char **argv)
// Create transport channel structures for 2 transport blocks (MIMO)
for
(
i
=
0
;
i
<
2
;
i
++
)
{
PHY_vars_eNB
->
dlsch_eNB
[
0
][
i
]
=
new_eNB_dlsch
(
1
,
8
,
N_RB_DL
,
0
);
PHY_vars_UE
->
dlsch_ue
[
0
][
i
]
=
new_ue_dlsch
(
1
,
8
,
MAX_TURBO_ITERATIONS
,
N_RB_DL
,
0
);
PHY_vars_eNB
->
dlsch_eNB
[
0
][
i
]
=
new_eNB_dlsch
(
1
,
8
,
1827072
,
N_RB_DL
,
0
);
PHY_vars_UE
->
dlsch_ue
[
0
][
i
]
=
new_ue_dlsch
(
1
,
8
,
1827072
,
MAX_TURBO_ITERATIONS
,
N_RB_DL
,
0
);
if
(
!
PHY_vars_eNB
->
dlsch_eNB
[
0
][
i
])
{
printf
(
"Can't get eNB dlsch structures
\n
"
);
...
...
@@ -905,11 +901,11 @@ int main(int argc, char **argv)
harq_pid
=
subframe2harq_pid
(
&
PHY_vars_UE
->
lte_frame_parms
,
PHY_vars_UE
->
frame_tx
,
subframe
);
// printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
if
(
input_fdUL
==
NULL
)
{
input_buffer_length
=
PHY_vars_UE
->
ulsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
TBS
/
8
;
input_buffer
=
(
unsigned
char
*
)
malloc
(
input_buffer_length
+
4
);
// printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
if
(
input_fdUL
==
NULL
)
{
if
(
n_frames
==
1
)
{
trch_out_fdUL
=
fopen
(
"ulsch_trchUL.txt"
,
"w"
);
...
...
@@ -931,7 +927,7 @@ int main(int argc, char **argv)
i
=
0
;
while
(
!
feof
(
input_fdUL
))
{
fscanf
(
input_fdUL
,
"%s %s"
,
input_val_str
,
input_val_str2
);
//&input_val1,&input_val2);
ret
=
fscanf
(
input_fdUL
,
"%s %s"
,
input_val_str
,
input_val_str2
);
//&input_val1,&input_val2);
if
((
i
%
4
)
==
0
)
{
((
short
*
)
txdata
[
0
])[
i
/
2
]
=
(
short
)((
1
<<
15
)
*
strtod
(
input_val_str
,
NULL
));
...
...
@@ -1261,6 +1257,7 @@ int main(int argc, char **argv)
start_meas
(
&
PHY_vars_eNB
->
phy_proc_rx
);
start_meas
(
&
PHY_vars_eNB
->
ofdm_demod_stats
);
lte_eNB_I0_measurements
(
PHY_vars_eNB
,
subframe
,
0
,
1
);
...
...
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
cb0eabe7
...
...
@@ -540,6 +540,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
LOG_D
(
MAC
,
"FrameP %d, subframeP %d : Scheduling CCEs
\n
"
,
frameP
,
subframeP
);
// Allocate CCEs for good after scheduling is done
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
allocate_CCEs
(
module_idP
,
CC_id
,
subframeP
,
0
);
...
...
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
View file @
cb0eabe7
...
...
@@ -543,7 +543,6 @@ schedule_ue_spec(
UE_list
);
// update UL DAI after DLSCH scheduling
set_ul_DAI
(
module_idP
,
UE_id
,
CC_id
,
frameP
,
subframeP
,
frame_parms
);
}
if
(
continue_flag
==
1
)
{
...
...
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
View file @
cb0eabe7
openair2/LAYER2/MAC/pre_processor.c
View file @
cb0eabe7
...
...
@@ -762,6 +762,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
ue_sched_ctl
->
dl_pow_off
[
CC_id
]
=
2
;
nb_rbs_required_remaining
[
CC_id
][
UE_id
]
=
0
;
// Initialize Subbands according to VRB map
for
(
i
=
0
;
i
<
N_RBG
;
i
++
)
{
ue_sched_ctl
->
rballoc_sub_UE
[
CC_id
][
UE_id
]
=
0
;
rballoc_sub
[
CC_id
][
i
]
=
0
;
...
...
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