Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dyyu
openairinterface5G
Commits
cb0eabe7
Commit
cb0eabe7
authored
Dec 05, 2015
by
knopp
Browse files
updated unitary simulations for new CCE interfaces. Cleaned up warnings in dlsim/pdcchsim/ulsim.
parent
1fc396f5
Changes
10
Hide whitespace changes
Inline
Side-by-side
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,17 +2024,20 @@ 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
,
numCCE
,
(
dci_alloc
[
i
].
rnti
==
SI_RNTI
)
?
1
:
0
,
dci_alloc
[
i
].
rnti
,
subframe
);
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
,
subframe
);
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,13 +2705,13 @@ PMI_FEEDBACK:
}
start_meas
(
&
PHY_vars_eNB
->
dlsch_modulation_stats
);
re_allocated
=
dlsch_modulation
(
PHY_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
eNB_id
],
AMP
,
subframe
,
&
PHY_vars_eNB
->
lte_frame_parms
,
num_pdcch_symbols
,
PHY_vars_eNB
->
dlsch_eNB
[
k
][
0
],
PHY_vars_eNB
->
dlsch_eNB
[
k
][
1
]);
dlsch_modulation
(
PHY_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
eNB_id
],
AMP
,
subframe
,
&
PHY_vars_eNB
->
lte_frame_parms
,
num_pdcch_symbols
,
PHY_vars_eNB
->
dlsch_eNB
[
k
][
0
],
PHY_vars_eNB
->
dlsch_eNB
[
k
][
1
]);
stop_meas
(
&
PHY_vars_eNB
->
dlsch_modulation_stats
);
/*
if (trials==0 && round==0)
...
...
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,31 +462,35 @@ 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;
DCI_pdu.dci_alloc[1].rnti = rnti;
DCI_pdu.dci_alloc[1].format = format1;
DCI_pdu.dci_alloc[1].ra_flag = 0;
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;
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
.
dci_alloc
[
1
].
dci_length
=
dci_length
;
DCI_pdu
.
dci_alloc
[
1
].
L
=
log2L
;
DCI_pdu
.
dci_alloc
[
1
].
rnti
=
rnti
;
DCI_pdu
.
dci_alloc
[
1
].
format
=
format1
;
DCI_pdu
.
dci_alloc
[
1
].
ra_flag
=
0
;
memcpy
((
void
*
)
&
DCI_pdu
.
dci_alloc
[
1
].
dci_pdu
[
0
],
&
DLSCH_alloc_pdu
[
0
],
dci_length_bytes
);
DCI_pdu
.
Num_ue_spec_dci
++
;
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
++
)
{
DCI_pdu
.
nCCE
+=
(
1
<<
(
DCI_pdu
.
dci_alloc
[
i
].
L
));
}
return
(
&
DCI_pdu
);
}
...
...
@@ -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,55 +975,62 @@ int main(int argc, char **argv)
numCCE
=
0
;
n_trials_common
++
;
common_active
=
1
;
n_trials_ul
++
;
ul_active
=
1
;
n_trials_dl
++
;
dl_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
,
1
,
SI_RNTI
,
subframe
);
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
,
1
,
DCI_pdu
.
dci_alloc
[
i
].
rnti
,
subframe
);
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
,
0
,
DCI_pdu
.
dci_alloc
[
i
].
rnti
,
subframe
);
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
);
}
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
;