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
9c652258
Commit
9c652258
authored
Nov 16, 2016
by
Elena_Lukashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Full Support for TM4 HARQ, excpept for PUSCH precoder at this moment.
parent
630e39ae
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1827 additions
and
1677 deletions
+1827
-1677
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+48
-7
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+778
-753
openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+32
-8
openair1/PHY/LTE_TRANSPORT/power_control.c
openair1/PHY/LTE_TRANSPORT/power_control.c
+24
-24
openair1/PHY/LTE_TRANSPORT/proto.h
openair1/PHY/LTE_TRANSPORT/proto.h
+93
-92
openair1/PHY/defs.h
openair1/PHY/defs.h
+1
-1
openair1/PHY/impl_defs_lte.h
openair1/PHY/impl_defs_lte.h
+1
-1
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+328
-271
openair1/SIMULATION/TOOLS/random_channel.c
openair1/SIMULATION/TOOLS/random_channel.c
+492
-492
openair1/SIMULATION/TOOLS/rangen_double.c
openair1/SIMULATION/TOOLS/rangen_double.c
+13
-12
openair1/SIMULATION/TOOLS/taus.c
openair1/SIMULATION/TOOLS/taus.c
+17
-16
No files found.
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
9c652258
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "PHY/vars.h"
#include "PHY/vars.h"
#endif
#endif
#include "assertions.h"
#include "assertions.h"
//#define DEBUG_HARQ
//#define DEBUG_DCI
//#define DEBUG_DCI
...
@@ -1525,7 +1526,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
...
@@ -1525,7 +1526,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq
->
status
=
ACTIVE
;
dlsch1_harq
->
status
=
ACTIVE
;
dlsch0_harq
->
codeword
=
0
;
dlsch0_harq
->
codeword
=
0
;
dlsch1_harq
->
codeword
=
1
;
dlsch1_harq
->
codeword
=
1
;
#ifdef DEBUG_HARQ
printf
(
"
\n
ENB: BOTH ACTIVE
\n
"
);
printf
(
"
\n
ENB: BOTH ACTIVE
\n
"
);
#endif
}
}
else
if
(
TB0_active
&&
TB1_active
&&
tbswap
==
1
)
{
else
if
(
TB0_active
&&
TB1_active
&&
tbswap
==
1
)
{
dlsch0
=
dlsch
[
0
];
dlsch0
=
dlsch
[
0
];
...
@@ -1564,7 +1567,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
...
@@ -1564,7 +1567,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq
->
codeword
=
0
;
dlsch1_harq
->
codeword
=
0
;
dlsch0
=
NULL
;
dlsch0
=
NULL
;
dlsch0_harq
=
NULL
;
dlsch0_harq
=
NULL
;
#ifdef DEBUG_HARQ
printf
(
"
\n
ENB: TB0 is deactivated, retransmit TB1 transmit in TM6
\n
"
);
printf
(
"
\n
ENB: TB0 is deactivated, retransmit TB1 transmit in TM6
\n
"
);
#endif
}
}
if
(
dlsch0
!=
NULL
){
if
(
dlsch0
!=
NULL
){
...
@@ -2800,8 +2805,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
...
@@ -2800,8 +2805,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
#endif
#endif
// compute DL power control parameters
// compute DL power control parameters
if
(
dlsch0
!=
NULL
){
computeRhoA_eNB
(
pdsch_config_dedicated
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoA_eNB
(
pdsch_config_dedicated
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoB_eNB
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
);
computeRhoB_eNB
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
);
}
if
(
dlsch1
!=
NULL
){
computeRhoA_eNB
(
pdsch_config_dedicated
,
dlsch
[
1
],
dlsch1_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoB_eNB
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
1
],
dlsch1_harq
->
dl_power_off
);
}
return
(
0
);
return
(
0
);
}
}
...
@@ -4879,6 +4891,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -4879,6 +4891,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
if
((
rv2
==
1
)
&&
(
mcs2
==
0
))
{
if
((
rv2
==
1
)
&&
(
mcs2
==
0
))
{
TB1_active
=
0
;
TB1_active
=
0
;
}
}
#ifdef DEBUG_HARQ
printf
(
"[DCI UE]: TB0 status %d , TB1 status %d
\n
"
,
TB0_active
,
TB1_active
);
#endif
//printf("RV TB0 = %d\n", rv1);
//printf("RV TB0 = %d\n", rv1);
...
@@ -4898,7 +4913,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -4898,7 +4913,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq
->
status
=
ACTIVE
;
dlsch1_harq
->
status
=
ACTIVE
;
dlsch0_harq
->
codeword
=
0
;
dlsch0_harq
->
codeword
=
0
;
dlsch1_harq
->
codeword
=
1
;
dlsch1_harq
->
codeword
=
1
;
//printf("\n UE: BOTH ACTIVE\n");
#ifdef DEBUG_HARQ
printf
(
"[DCI UE]: BOTH ACTIVE
\n
"
);
#endif
}
}
else
if
(
TB0_active
&&
TB1_active
&&
tbswap
==
1
)
{
else
if
(
TB0_active
&&
TB1_active
&&
tbswap
==
1
)
{
dlsch0
=
dlsch
[
0
];
dlsch0
=
dlsch
[
0
];
...
@@ -4937,7 +4954,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -4937,7 +4954,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq
->
codeword
=
0
;
dlsch1_harq
->
codeword
=
0
;
dlsch0
=
NULL
;
dlsch0
=
NULL
;
dlsch0_harq
=
NULL
;
dlsch0_harq
=
NULL
;
//printf("\n UE: TB0 is deactivated, retransmit TB1 transmit in TM6\n");
#ifdef DEBUG_HARQ
printf
(
"[DCI UE]: TB0 is deactivated, retransmit TB1 transmit in TM6
\n
"
);
#endif
}
}
...
@@ -4990,7 +5009,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -4990,7 +5009,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq
->
rb_alloc_odd
[
1
]
=
dlsch1_harq
->
rb_alloc_even
[
1
];
dlsch1_harq
->
rb_alloc_odd
[
1
]
=
dlsch1_harq
->
rb_alloc_even
[
1
];
dlsch1_harq
->
rb_alloc_odd
[
2
]
=
dlsch1_harq
->
rb_alloc_even
[
2
];
dlsch1_harq
->
rb_alloc_odd
[
2
]
=
dlsch1_harq
->
rb_alloc_even
[
2
];
dlsch1_harq
->
rb_alloc_odd
[
3
]
=
dlsch1_harq
->
rb_alloc_even
[
3
];
dlsch1_harq
->
rb_alloc_odd
[
3
]
=
dlsch1_harq
->
rb_alloc_even
[
3
];
dlsch1_harq
->
nb_rb
=
dlsch0_harq
->
nb_rb
;
dlsch1_harq
->
nb_rb
=
conv_nprb
(
rah
,
rballoc
,
frame_parms
->
N_RB_DL
);
}
}
...
@@ -5010,6 +5031,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -5010,6 +5031,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
if
(
dlsch1_harq
!=
NULL
)
if
(
dlsch1_harq
!=
NULL
)
dlsch1_harq
->
Nl
=
1
;
dlsch1_harq
->
Nl
=
1
;
#ifdef DEBUG_HARQ
printf
(
"[DCI UE] tpmi = %d
\n
"
,
tpmi
);
#endif
if
((
dlsch0
!=
NULL
)
&&
(
dlsch1
!=
NULL
)){
//two CW active
if
((
dlsch0
!=
NULL
)
&&
(
dlsch1
!=
NULL
)){
//two CW active
...
@@ -5112,7 +5136,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -5112,7 +5136,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
break
;
break
;
}
}
}
}
#ifdef DEBUG_HARQ
printf
(
"[DCI UE] harq1 MIMO mode = %d
\n
"
,
dlsch1_harq
->
mimo_mode
);
#endif
//printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode);
if
((
frame_parms
->
mode1_flag
==
1
)
&&
(
dlsch0_harq
!=
NULL
))
if
((
frame_parms
->
mode1_flag
==
1
)
&&
(
dlsch0_harq
!=
NULL
))
dlsch0_harq
->
mimo_mode
=
SISO
;
dlsch0_harq
->
mimo_mode
=
SISO
;
...
@@ -5196,6 +5223,12 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -5196,6 +5223,12 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1
->
rnti
=
rnti
;
dlsch1
->
rnti
=
rnti
;
}
}
#ifdef DEBUG_HARQ
if
(
dlsch0
!=
NULL
)
printf
(
"[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d
\n
"
,
dlsch0_harq
->
status
,
dlsch1_harq
->
status
);
else
printf
(
"[DCI UE] dlsch1_harq status = %d
\n
"
,
dlsch1_harq
->
status
);
#endif
break
;
break
;
...
@@ -5869,11 +5902,19 @@ int generate_ue_dlsch_params_from_dci(int frame,
...
@@ -5869,11 +5902,19 @@ int generate_ue_dlsch_params_from_dci(int frame,
}
}
#endif
#endif
dlsch
[
0
]
->
active
=
1
;
//
dlsch[0]->active=1;
// compute DL power control parameters
// compute DL power control parameters
if
(
dlsch0_harq
!=
NULL
){
computeRhoA_UE
(
pdsch_config_dedicated
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoA_UE
(
pdsch_config_dedicated
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoB_UE
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
);
computeRhoB_UE
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
0
],
dlsch0_harq
->
dl_power_off
);
}
if
(
dlsch1_harq
!=
NULL
)
{
computeRhoA_UE
(
pdsch_config_dedicated
,
dlsch
[
1
],
dlsch1_harq
->
dl_power_off
,
frame_parms
->
nb_antennas_tx_eNB
);
computeRhoB_UE
(
pdsch_config_dedicated
,
&
(
frame_parms
->
pdsch_config_common
),
frame_parms
->
nb_antennas_tx_eNB
,
dlsch
[
1
],
dlsch1_harq
->
dl_power_off
);
}
return
(
0
);
return
(
0
);
}
}
...
...
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
100755 → 100644
View file @
9c652258
...
@@ -37,8 +37,7 @@
...
@@ -37,8 +37,7 @@
* \note
* \note
* \warning
* \warning
*/
*/
//#include "PHY/defs.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/extern.h"
#include "defs.h"
#include "defs.h"
#include "extern.h"
#include "extern.h"
...
@@ -51,6 +50,8 @@
...
@@ -51,6 +50,8 @@
#define NOCYGWIN_STATIC
#define NOCYGWIN_STATIC
#endif
#endif
//#define DEBUG_HARQ
//#undef LOG_D
//#undef LOG_D
//#define LOG_D LOG_I
//#define LOG_D LOG_I
...
@@ -139,12 +140,30 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -139,12 +140,30 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
break
;
break
;
case
PDSCH
:
case
PDSCH
:
lte_ue_pdsch_vars
=
&
phy_vars_ue
->
lte_ue_pdsch_vars
[
eNB_id
];
lte_ue_pdsch_vars
=
&
phy_vars_ue
->
lte_ue_pdsch_vars
[
eNB_id
];
dlsch_ue
=
phy_vars_ue
->
dlsch_ue
[
eNB_id
];
dlsch_ue
=
phy_vars_ue
->
dlsch_ue
[
eNB_id
];
if
((
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
status
==
ACTIVE
)
&&
(
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
status
==
ACTIVE
)){
codeword_TB0
=
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
codeword
;
codeword_TB0
=
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
codeword
;
codeword_TB1
=
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
codeword
;
codeword_TB1
=
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
codeword
;
dlsch0_harq
=
dlsch_ue
[
codeword_TB0
]
->
harq_processes
[
harq_pid
];
dlsch0_harq
=
dlsch_ue
[
codeword_TB0
]
->
harq_processes
[
harq_pid
];
dlsch1_harq
=
dlsch_ue
[
codeword_TB1
]
->
harq_processes
[
harq_pid
];
dlsch1_harq
=
dlsch_ue
[
codeword_TB1
]
->
harq_processes
[
harq_pid
];
}
else
if
((
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
status
==
ACTIVE
)
&&
(
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
status
!=
ACTIVE
)
)
{
codeword_TB0
=
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
codeword
;
dlsch0_harq
=
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
];
dlsch1_harq
=
NULL
;
codeword_TB1
=
-
1
;
}
else
if
((
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
status
!=
ACTIVE
)
&&
(
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
status
==
ACTIVE
)
){
codeword_TB1
=
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
]
->
codeword
;
dlsch0_harq
=
dlsch_ue
[
1
]
->
harq_processes
[
harq_pid
];
dlsch1_harq
=
NULL
;
codeword_TB0
=
-
1
;
}
break
;
break
;
default:
default:
...
@@ -152,6 +171,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -152,6 +171,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
return
(
-
1
);
return
(
-
1
);
break
;
break
;
}
}
#ifdef DEBUG_HARQ
printf
(
"[DEMOD] MIMO mode = %d
\n
"
,
dlsch0_harq
->
mimo_mode
);
printf
(
"[DEMOD] cw for TB0 = %d, cw for TB1 = %d
\n
"
,
codeword_TB0
,
codeword_TB1
);
#endif
DevAssert
(
dlsch0_harq
);
DevAssert
(
dlsch0_harq
);
round
=
dlsch0_harq
->
round
;
round
=
dlsch0_harq
->
round
;
...
@@ -311,6 +334,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -311,6 +334,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
if
(
dlsch0_harq
->
mimo_mode
<
LARGE_CDD
)
{
// SISO or ALAMOUTI
if
(
dlsch0_harq
->
mimo_mode
<
LARGE_CDD
)
{
// SISO or ALAMOUTI
dlsch_scale_channel
(
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
dlsch_scale_channel
(
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
frame_parms
,
frame_parms
,
dlsch_ue
,
dlsch_ue
,
...
@@ -629,6 +653,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -629,6 +653,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
nb_rb
);
nb_rb
);
if
(
first_symbol_flag
==
1
)
{
if
(
first_symbol_flag
==
1
)
{
dlsch_channel_level
(
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
dlsch_channel_level
(
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
frame_parms
,
frame_parms
,
avg
,
avg
,
...
@@ -645,12 +670,12 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -645,12 +670,12 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
avgs
=
cmax
(
avgs
,
avg
[(
aatx
<<
1
)
+
aarx
]);
avgs
=
cmax
(
avgs
,
avg
[(
aatx
<<
1
)
+
aarx
]);
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
lte_ue_pdsch_vars
[
eNB_id
]
->
log2_maxh
=
(
log2_approx
(
avgs
)
/
2
)
+
interf_unaw_shift_tm1_mcs
[
dlsch0_harq
->
mcs
];
lte_ue_pdsch_vars
[
eNB_id
]
->
log2_maxh
=
(
log2_approx
(
avgs
)
/
2
)
+
1
;
lte_ue_pdsch_vars
[
eNB_id
]
->
log2_maxh
++
;
}
}
dlsch_channel_compensation_TM56
(
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_ext
,
dlsch_channel_compensation_TM56
(
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_ext
,
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
,
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_mag0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_ch_mag0
,
...
@@ -748,7 +773,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -748,7 +773,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
switch
(
dlsch0_harq
->
Qm
)
{
switch
(
dlsch0_harq
->
Qm
)
{
case
2
:
case
2
:
if
(
rx_type
==
rx_standard
)
{
if
(
(
rx_type
==
rx_standard
)
||
(
codeword_TB0
=
1
)
)
{
dlsch_qpsk_llr
(
frame_parms
,
dlsch_qpsk_llr
(
frame_parms
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
...
@@ -824,7 +849,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -824,7 +849,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
}
}
break
;
break
;
case
4
:
case
4
:
if
(
rx_type
==
rx_standard
)
{
if
(
(
rx_type
==
rx_standard
)
||
(
codeword_TB0
=
1
)
)
{
dlsch_16qam_llr
(
frame_parms
,
dlsch_16qam_llr
(
frame_parms
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
...
@@ -833,7 +858,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -833,7 +858,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
adjust_G2
(
frame_parms
,
dlsch0_harq
->
rb_alloc_even
,
4
,
subframe
,
symbol
),
adjust_G2
(
frame_parms
,
dlsch0_harq
->
rb_alloc_even
,
4
,
subframe
,
symbol
),
lte_ue_pdsch_vars
[
eNB_id
]
->
llr128
);
lte_ue_pdsch_vars
[
eNB_id
]
->
llr128
);
}
}
else
if
(
rx_type
>=
rx_IC_single_stream
)
{
else
if
(
(
rx_type
>=
rx_IC_single_stream
)
&&
(
codeword_TB0
!=
-
1
))
{
if
(
dlsch1_harq
->
Qm
==
2
)
{
if
(
dlsch1_harq
->
Qm
==
2
)
{
dlsch_16qam_qpsk_llr
(
frame_parms
,
dlsch_16qam_qpsk_llr
(
frame_parms
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
...
@@ -907,7 +932,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -907,7 +932,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
}
}
break
;
break
;
case
6
:
case
6
:
if
(
rx_type
==
rx_standard
)
{
if
(
(
rx_type
==
rx_standard
)
||
(
codeword_TB0
==
-
1
))
{
dlsch_64qam_llr
(
frame_parms
,
dlsch_64qam_llr
(
frame_parms
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
lte_ue_pdsch_vars
[
eNB_id
]
->
llr
[
0
],
...
@@ -917,7 +942,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -917,7 +942,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
adjust_G2
(
frame_parms
,
dlsch0_harq
->
rb_alloc_even
,
6
,
subframe
,
symbol
),
adjust_G2
(
frame_parms
,
dlsch0_harq
->
rb_alloc_even
,
6
,
subframe
,
symbol
),
lte_ue_pdsch_vars
[
eNB_id
]
->
llr128
);
lte_ue_pdsch_vars
[
eNB_id
]
->
llr128
);
}
}
else
if
(
rx_type
>=
rx_IC_single_stream
)
{
else
if
(
(
rx_type
>=
rx_IC_single_stream
)
&&
(
codeword_TB0
!=
-
1
))
{
if
(
dlsch1_harq
->
Qm
==
2
)
{
if
(
dlsch1_harq
->
Qm
==
2
)
{
dlsch_64qam_qpsk_llr
(
frame_parms
,
dlsch_64qam_qpsk_llr
(
frame_parms
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
lte_ue_pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
,
...
...
openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
View file @
9c652258
...
@@ -156,7 +156,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
...
@@ -156,7 +156,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
*
x0
=
NULL
;
//dlsch0_harq->e;
uint8_t
*
x0
=
NULL
;
//dlsch0_harq->e;
MIMO_mode_t
mimo_mode
=
dlsch0_harq
->
mimo_mode
;
MIMO_mode_t
mimo_mode
;
//
= dlsch0_harq->mimo_mode;
int
first_layer0
;
//= dlsch0_harq->first_layer;
int
first_layer0
;
//= dlsch0_harq->first_layer;
int
Nlayers0
;
// = dlsch0_harq->Nlayers;
int
Nlayers0
;
// = dlsch0_harq->Nlayers;
...
@@ -1411,8 +1411,13 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1411,8 +1411,13 @@ int dlsch_modulation(int32_t **txdataF,
nsymb
=
(
frame_parms
->
Ncp
==
0
)
?
14
:
12
;
nsymb
=
(
frame_parms
->
Ncp
==
0
)
?
14
:
12
;
if
(
dlsch0
!=
NULL
){
amp_rho_a
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch0
->
sqrt_rho_a
)
>>
13
);
//amp=512 in full scale; dlsch0->sqrt_rho_a=8192in Q2.13, 1 in full scale
amp_rho_a
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch0
->
sqrt_rho_a
)
>>
13
);
//amp=512 in full scale; dlsch0->sqrt_rho_a=8192in Q2.13, 1 in full scale
amp_rho_b
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch0
->
sqrt_rho_b
)
>>
13
);
amp_rho_b
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch0
->
sqrt_rho_b
)
>>
13
);
}
else
{
amp_rho_a
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch1
->
sqrt_rho_a
)
>>
13
);
amp_rho_b
=
(
int16_t
)(((
int32_t
)
amp
*
dlsch1
->
sqrt_rho_b
)
>>
13
);
}
if
(
mod_order0
==
4
)
if
(
mod_order0
==
4
)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
@@ -1445,6 +1450,7 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1445,6 +1450,7 @@ int dlsch_modulation(int32_t **txdataF,
// printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
// printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
for
(
l
=
num_pdcch_symbols
;
l
<
nsymb
;
l
++
)
{
for
(
l
=
num_pdcch_symbols
;
l
<
nsymb
;
l
++
)
{
if
(
dlsch0
!=
NULL
)
{
#ifdef DEBUG_DLSCH_MODULATION
#ifdef DEBUG_DLSCH_MODULATION
printf
(
"Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d
\n
"
,
printf
(
"Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d
\n
"
,
harq_pid
,
harq_pid
,
...
@@ -1455,6 +1461,7 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1455,6 +1461,7 @@ int dlsch_modulation(int32_t **txdataF,
rb_alloc
[
0
],
rb_alloc
[
0
],
len
);
len
);
#endif
#endif
}
if
(
frame_parms
->
Ncp
==
0
)
{
// normal prefix
if
(
frame_parms
->
Ncp
==
0
)
{
// normal prefix
if
((
l
==
4
)
||
(
l
==
11
))
if
((
l
==
4
)
||
(
l
==
11
))
...
@@ -1611,10 +1618,12 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1611,10 +1618,12 @@ int dlsch_modulation(int32_t **txdataF,
}
}
}
}
if
(
dlsch0
)
{
if
(
dlsch0_harq
->
Nlayers
>
1
)
{
if
(
dlsch0_harq
->
Nlayers
>
1
)
{
msg
(
"Nlayers %d: re_offset %d, symbol %d offset %d
\n
"
,
dlsch0_harq
->
Nlayers
,
re_offset
,
l
,
symbol_offset
);
msg
(
"Nlayers %d: re_offset %d, symbol %d offset %d
\n
"
,
dlsch0_harq
->
Nlayers
,
re_offset
,
l
,
symbol_offset
);
return
(
-
1
);
return
(
-
1
);
}
}
}
if
(
dlsch1
)
{
if
(
dlsch1
)
{
if
(
dlsch1_harq
->
Nlayers
>
1
)
{
if
(
dlsch1_harq
->
Nlayers
>
1
)
{
...
@@ -1639,6 +1648,17 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1639,6 +1648,17 @@ int dlsch_modulation(int32_t **txdataF,
if
(
rb_alloc_ind
>
0
)
{
if
(
rb_alloc_ind
>
0
)
{
// printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
// printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
if
(
dlsch0
!=
NULL
)
{
get_pmi_temp
=
get_pmi
(
frame_parms
->
N_RB_DL
,
dlsch0
->
harq_processes
[
harq_pid
]
->
mimo_mode
,
dlsch0
->
harq_processes
[
harq_pid
]
->
pmi_alloc
,
rb
);
}
else
get_pmi_temp
=
get_pmi
(
frame_parms
->
N_RB_DL
,
dlsch1
->
harq_processes
[
harq_pid
]
->
mimo_mode
,
dlsch1
->
harq_processes
[
harq_pid
]
->
pmi_alloc
,
rb
);
allocate_REs_in_RB
(
frame_parms
,
allocate_REs_in_RB
(
frame_parms
,
txdataF
,
txdataF
,
...
@@ -1646,11 +1666,11 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1646,11 +1666,11 @@ int dlsch_modulation(int32_t **txdataF,
&
jj2
,
&
jj2
,
re_offset
,
re_offset
,
symbol_offset
,
symbol_offset
,
dlsch0
->
harq_processes
[
harq_pid
],
(
dlsch0
==
NULL
)
?
NULL
:
dlsch0
->
harq_processes
[
harq_pid
],
(
dlsch1
==
NULL
)
?
NULL
:
dlsch1
->
harq_processes
[
harq_pid
],
(
dlsch1
==
NULL
)
?
NULL
:
dlsch1
->
harq_processes
[
harq_pid
],
pilots
,
pilots
,
((
pilots
)
?
amp_rho_b
:
amp_rho_a
),
((
pilots
)
?
amp_rho_b
:
amp_rho_a
),
get_pmi
(
frame_parms
->
N_RB_DL
,
dlsch0
->
harq_processes
[
harq_pid
]
->
mimo_mode
,
dlsch0
->
harq_processes
[
harq_pid
]
->
pmi_alloc
,
rb
)
,
get_pmi
_temp
,
qam_table_s0
,
qam_table_s0
,
qam_table_s1
,
qam_table_s1
,
&
re_allocated
,
&
re_allocated
,
...
@@ -1672,7 +1692,11 @@ int dlsch_modulation(int32_t **txdataF,
...
@@ -1672,7 +1692,11 @@ int dlsch_modulation(int32_t **txdataF,
}
}
#ifdef DEBUG_DLSCH_MODULATION
#ifdef DEBUG_DLSCH_MODULATION
if
(
dlsch0
!=
NULL
){
msg
(
"generate_dlsch : jj = %d,re_allocated = %d (G %d)
\n
"
,
jj
,
re_allocated
,
get_G
(
frame_parms
,
dlsch0_harq
->
nb_rb
,
dlsch0_harq
->
rb_alloc
,
mod_order0
,
Nl0
,
2
,
0
,
subframe_offset
));
msg
(
"generate_dlsch : jj = %d,re_allocated = %d (G %d)
\n
"
,
jj
,
re_allocated
,
get_G
(
frame_parms
,
dlsch0_harq
->
nb_rb
,
dlsch0_harq
->
rb_alloc
,
mod_order0
,
Nl0
,
2
,
0
,
subframe_offset
));
}
else
{
msg
(
"generate_dlsch : jj = %d,re_allocated = %d (G %d)
\n
"
,
jj
,
re_allocated
,
get_G
(
frame_parms
,
dlsch1_harq
->
nb_rb
,
dlsch1_harq
->
rb_alloc
,
mod_order1
,
Nl1
,
2
,
0
,
subframe_offset
));
}
#endif
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION
,
VCD_FUNCTION_OUT
);
...
...
openair1/PHY/LTE_TRANSPORT/power_control.c
View file @
9c652258
...
@@ -46,7 +46,7 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
...
@@ -46,7 +46,7 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
}
}
double
computeRhoA_eNB
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
double
computeRhoA_eNB
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
LTE_eNB_DLSCH_t
*
dlsch_eNB
,
int
dl_power_off
,
uint8_t
n_antenna_port
){
LTE_eNB_DLSCH_t
*
dlsch_eNB
,
int
dl_power_off
,
uint8_t
n_antenna_port
){
double
rho_a_dB
;
double
rho_a_dB
;
double
sqrt_rho_a_lin
;
double
sqrt_rho_a_lin
;
...
...
openair1/PHY/LTE_TRANSPORT/proto.h
View file @
9c652258
...
@@ -1871,7 +1871,8 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
...
@@ -1871,7 +1871,8 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
double
computeRhoB_eNB
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
double
computeRhoB_eNB
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
PDSCH_CONFIG_COMMON
*
pdsch_config_common
,
PDSCH_CONFIG_COMMON
*
pdsch_config_common
,
uint8_t
n_antenna_port
,
uint8_t
n_antenna_port
,
LTE_eNB_DLSCH_t
*
dlsch_eNB
,
int
dl_power_off
);
LTE_eNB_DLSCH_t
*
dlsch_eNB
,
int
dl_power_off
);
double
computeRhoA_UE
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
double
computeRhoA_UE
(
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
LTE_UE_DLSCH_t
*
dlsch_ue
,
LTE_UE_DLSCH_t
*
dlsch_ue
,
...
...
openair1/PHY/defs.h
View file @
9c652258
openair1/PHY/impl_defs_lte.h
View file @
9c652258
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
9c652258
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/TOOLS/random_channel.c
View file @
9c652258
openair1/SIMULATION/TOOLS/rangen_double.c
View file @
9c652258
...
@@ -46,7 +46,7 @@ static unsigned int seed, iy, ir[98];
...
@@ -46,7 +46,7 @@ static unsigned int seed, iy, ir[98];
#define a 1664525lu
#define a 1664525lu
#define mod 4294967296.0
/* is 2**32 */
#define mod 4294967296.0
/* is 2**32 */
#if 1
void
randominit
(
unsigned
seed_init
)
void
randominit
(
unsigned
seed_init
)
{
{
int
i
;
int
i
;
...
@@ -70,9 +70,10 @@ void randominit(unsigned seed_init)
...
@@ -70,9 +70,10 @@ void randominit(unsigned seed_init)
iy
=
1
;
iy
=
1
;
}
}
#endif
#if 0
/*
void randominit(unsigned seed_init)
void randominit(unsigned seed_init)
{
{
int i;
int i;
// this need to be integrated with the existing rng, like taus: navid
// this need to be integrated with the existing rng, like taus: navid
...
@@ -90,14 +91,14 @@ void randominit(unsigned seed_init)
...
@@ -90,14 +91,14 @@ void randominit(unsigned seed_init)
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
// for (i=1; i<=97; i++) {
for (i=1; i<=97; i++) {
// seed = a*seed; /* mod 2**32 */
seed = a*seed; /* mod 2**32 */
// ir[i]= seed; /* initialize the shuffle table */
ir[i]= seed; /* initialize the shuffle table */
// }
}
// iy=1;
//}
iy=1;
}
#endif
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
double
uniformrandom
(
void
)
double
uniformrandom
(
void
)
...
...
openair1/SIMULATION/TOOLS/taus.c
View file @
9c652258
...
@@ -58,7 +58,7 @@ unsigned int taus(void)
...
@@ -58,7 +58,7 @@ unsigned int taus(void)
s2
=
(((
s2
&
0xFFFFFFF0
)
<<
17
)
^
b
);
s2
=
(((
s2
&
0xFFFFFFF0
)
<<
17
)
^
b
);
return
s0
^
s1
^
s2
;
return
s0
^
s1
^
s2
;
}
}
#if 1
void
set_taus_seed
(
unsigned
int
seed_init
)
void
set_taus_seed
(
unsigned
int
seed_init
)
{
{
...
@@ -88,8 +88,10 @@ void set_taus_seed(unsigned int seed_init)
...
@@ -88,8 +88,10 @@ void set_taus_seed(unsigned int seed_init)
#endif
#endif
}
}
}
}
#endif
/* void set_taus_seed(unsigned int seed_init)
#if 0
void set_taus_seed(unsigned int seed_init)
{
{
#ifdef USER_MODE
#ifdef USER_MODE
...
@@ -113,18 +115,17 @@ void set_taus_seed(unsigned int seed_init)
...
@@ -113,18 +115,17 @@ void set_taus_seed(unsigned int seed_init)
s2 = (unsigned int)0xfe1a133e;
s2 = (unsigned int)0xfe1a133e;
#else
#else
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
// srand48_r((long int)seed_init, &buffer);
srand48_r((long int)seed_init, &buffer);
// mrand48_r(&buffer, (long int *)&result);
mrand48_r(&buffer, (long int *)&result);
// s0 = result;
s0 = result;
// mrand48_r(&buffer, (long int *)&result);
mrand48_r(&buffer, (long int *)&result);
// s1 = result;
s1 = result;
// mrand48_r(&buffer, (long int *)&result);
mrand48_r(&buffer, (long int *)&result);
// s2 = result;
s2 = result;
//#endif
#endif
// }
}
//}
}
#endif
#ifdef MAIN
#ifdef MAIN
...
...
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