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
promise
OpenXG-RAN
Commits
f329139f
Commit
f329139f
authored
Sep 10, 2016
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanup in ulsch_decoding.c. Some modifications to comments in impl_defs_lte.h.
parent
b8b2edb3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
91 deletions
+83
-91
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+67
-75
openair1/PHY/impl_defs_lte.h
openair1/PHY/impl_defs_lte.h
+16
-16
No files found.
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
View file @
f329139f
...
...
@@ -127,7 +127,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
ulsch
->
Mlimit
=
4
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
//
msg
("new_ue_ulsch: Harq process %d\n",i);
//
printf
("new_ue_ulsch: Harq process %d\n",i);
ulsch
->
harq_processes
[
i
]
=
(
LTE_UL_eNB_HARQ_t
*
)
malloc16
(
sizeof
(
LTE_UL_eNB_HARQ_t
));
if
(
ulsch
->
harq_processes
[
i
])
{
...
...
@@ -202,11 +202,11 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
uint8_t
crc
;
crc
=
cqi
[
CQI_LENGTH
>>
3
];
//
msg
("crc1: %x, shift %d\n",crc,CQI_LENGTH&0x7);
//
printf
("crc1: %x, shift %d\n",crc,CQI_LENGTH&0x7);
crc
=
(
crc
<<
(
CQI_LENGTH
&
0x7
));
// clear crc bits
// ((char *)cqi)[CQI_LENGTH>>3] &= 0xff>>(8-(CQI_LENGTH&0x7));
//
msg
("crc2: %x, cqi0 %x\n",crc,cqi[1+(CQI_LENGTH>>3)]);
//
printf
("crc2: %x, cqi0 %x\n",crc,cqi[1+(CQI_LENGTH>>3)]);
crc
|=
(
cqi
[
1
+
(
CQI_LENGTH
>>
3
)])
>>
(
8
-
(
CQI_LENGTH
&
0x7
));
// clear crc bits
//(((char *)cqi)[1+(CQI_LENGTH>>3)]) = 0;
...
...
@@ -258,7 +258,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
// uint8_t ytag2[6*14*1200],*ytag2_ptr;
int16_t
cseq
[
6
*
14
*
1200
];
int
off
;
int
status
[
20
];
int
subframe
=
proc
->
subframe_rx
;
LTE_UL_eNB_HARQ_t
*
ulsch_harq
;
...
...
@@ -312,7 +312,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
#ifdef DEBUG_ULSCH_DECODING
msg
(
"ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d
\n
"
,
printf
(
"ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d
\n
"
,
frame_parms
->
Nid_cell
,
ulsch
->
rnti
,
x2
,
ulsch_harq
->
round
,
ulsch_harq
->
rvidx
,
...
...
@@ -401,7 +401,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
// Q_ACK = Qprime * Q_m;
Qprime_ACK
=
Qprime
;
#ifdef DEBUG_ULSCH_DECODING
msg
(
"ulsch_decoding.c: Qprime_ACK %d, Msc_initial %d, Nsymb_initial %d, sumKr %d
\n
"
,
printf
(
"ulsch_decoding.c: Qprime_ACK %d, Msc_initial %d, Nsymb_initial %d, sumKr %d
\n
"
,
Qprime_ACK
,
ulsch_harq
->
Msc_initial
,
ulsch_harq
->
Nsymb_initial
,
sumKr
);
#endif
...
...
@@ -430,7 +430,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
Q_CQI
=
Q_m
*
Qprime
;
#ifdef DEBUG_ULSCH_DECODING
msg
(
"ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d
\n
"
,
G
,
Q_RI
,
Q_CQI
,
L
,
ulsch_harq
->
Or1
,
ulsch_harq
->
O_ACK
);
printf
(
"ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d
\n
"
,
G
,
Q_RI
,
Q_CQI
,
L
,
ulsch_harq
->
Or1
,
ulsch_harq
->
O_ACK
);
#endif
G
=
G
-
Q_RI
-
Q_CQI
;
...
...
@@ -531,7 +531,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
msg
(
"ulsch_decoding.c: ACK i %d, r %d, j %d, ColumnSet[j] %d
\n
"
,
i
,
r
,
j
,
columnset
[
j
]);
printf
(
"ulsch_decoding.c: ACK i %d, r %d, j %d, ColumnSet[j] %d
\n
"
,
i
,
r
,
j
,
columnset
[
j
]);
#endif
j
=
(
j
+
3
)
&
3
;
}
...
...
@@ -964,15 +964,15 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
msg
(
"ulsch_decoding: Or1=%d
\n
"
,
ulsch_harq
->
Or1
);
printf
(
"ulsch_decoding: Or1=%d
\n
"
,
ulsch_harq
->
Or1
);
for
(
i
=
0
;
i
<
1
+
((
8
+
ulsch_harq
->
Or1
)
/
8
);
i
++
)
msg
(
"ulsch_decoding: O[%d] %d
\n
"
,
i
,
ulsch_harq
->
o
[
i
]);
printf
(
"ulsch_decoding: O[%d] %d
\n
"
,
i
,
ulsch_harq
->
o
[
i
]);
if
(
ulsch_harq
->
cqi_crc_status
==
1
)
msg
(
"RX CQI CRC OK (%x)
\n
"
,
extract_cqi_crc
(
o_flip
,
ulsch_harq
->
Or1
));
printf
(
"RX CQI CRC OK (%x)
\n
"
,
extract_cqi_crc
(
o_flip
,
ulsch_harq
->
Or1
));
else
msg
(
"RX CQI CRC NOT OK (%x)
\n
"
,
extract_cqi_crc
(
o_flip
,
ulsch_harq
->
Or1
));
printf
(
"RX CQI CRC NOT OK (%x)
\n
"
,
extract_cqi_crc
(
o_flip
,
ulsch_harq
->
Or1
));
#endif
}
...
...
@@ -985,6 +985,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
r_offset
=
0
;
offset
=
0
;
ret
=
1
;
for
(
r
=
0
;
r
<
ulsch_harq
->
C
;
r
++
)
{
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
...
...
@@ -1010,7 +1014,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
msg
(
"f1 %d, f2 %d, F %d
\n
"
,
f1f2mat_old
[
2
*
iind
],
f1f2mat_old
[
1
+
(
2
*
iind
)],(
r
==
0
)
?
ulsch_harq
->
F
:
0
);
printf
(
"f1 %d, f2 %d, F %d
\n
"
,
f1f2mat_old
[
2
*
iind
],
f1f2mat_old
[
1
+
(
2
*
iind
)],(
r
==
0
)
?
ulsch_harq
->
F
:
0
);
#endif
memset
(
&
dummy_w
[
r
][
0
],
0
,
3
*
(
6144
+
64
)
*
sizeof
(
short
));
...
...
@@ -1019,7 +1023,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
(
r
==
0
)
?
ulsch_harq
->
F
:
0
);
#ifdef DEBUG_ULSCH_DECODING
msg
(
"Rate Matching Segment %d (coded bits (G) %d,unpunctured/repeated bits %d, Q_m %d, nb_rb %d, Nl %d)...
\n
"
,
printf
(
"Rate Matching Segment %d (coded bits (G) %d,unpunctured/repeated bits %d, Q_m %d, nb_rb %d, Nl %d)...
\n
"
,
r
,
G
,
Kr
*
3
,
Q_m
,
...
...
@@ -1056,13 +1060,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
&
ulsch_harq
->
d
[
r
][
96
],
ulsch_harq
->
w
[
r
]);
stop_meas
(
&
eNB
->
ulsch_deinterleaving_stats
);
}
for
(
r
=
0
;
r
<
ulsch_harq
->
C
;
r
++
)
{
/* printf("c[%d] : %p\n",r,
ulsch_harq->c[r]);
*/
if
(
ulsch_harq
->
C
==
1
)
crc_type
=
CRC24_A
;
...
...
@@ -1089,17 +1087,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
stop_meas
(
&
eNB
->
ulsch_turbo_decoding_stats
);
status
[
r
]
=
ret
;
}
// Reassembly of Transport block here
offset
=
0
;
ret
=
1
;
for
(
r
=
0
;
r
<
ulsch_harq
->
C
;
r
++
)
{
if
(
status
[
r
]
!=
(
1
+
ulsch
->
max_turbo_iterations
))
{
// Reassembly of Transport block here
if
(
ret
!=
(
1
+
ulsch
->
max_turbo_iterations
))
{
if
(
r
<
ulsch_harq
->
Cminus
)
Kr
=
ulsch_harq
->
Kminus
;
else
...
...
@@ -1119,10 +1113,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
offset
+=
(
Kr_bytes
-
((
ulsch_harq
->
C
>
1
)
?
3
:
0
));
}
if
(
ret
!=
(
1
+
ulsch
->
max_turbo_iterations
))
ret
=
status
[
r
];
}
else
{
ret
=
1
+
ulsch
->
max_turbo_iterations
;
break
;
}
}
...
...
@@ -1208,7 +1200,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
sinr_db1
=
sinr_dB
[
offset
*
2
];
sinr_db2
=
sinr_dB
[
offset
*
2
+
1
];
msg
(
"sinr_db1=%f
\n
,sinr_db2=%f
\n
"
,
sinr_db1
,
sinr_db2
);
printf
(
"sinr_db1=%f
\n
,sinr_db2=%f
\n
"
,
sinr_db1
,
sinr_db2
);
//rounding up for the table lookup
sinr_db1
*=
10
;
...
...
@@ -1462,7 +1454,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
sinr_eff
=
sinr_eff
*
beta2_dlsch_MI
[
TM
][
mcs
];
}
msg
(
"SINR_Eff = %e
\n
"
,
sinr_eff
);
printf
(
"SINR_Eff = %e
\n
"
,
sinr_eff
);
sinr_eff
*=
10
;
sinr_eff
=
floor
(
sinr_eff
);
...
...
@@ -1470,7 +1462,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
// sinr_eff += 1;
// }
sinr_eff
/=
10
;
msg
(
"sinr_eff after rounding = %f
\n
"
,
sinr_eff
);
printf
(
"sinr_eff after rounding = %f
\n
"
,
sinr_eff
);
for
(
index
=
0
;
index
<
16
;
index
++
)
{
if
(
index
==
0
)
{
...
...
@@ -1488,10 +1480,10 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if
(
uniformrandom
()
<
bler
)
{
msg
(
"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)
\n
"
,
mcs
,
sinr_eff
,
bler
);
printf
(
"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)
\n
"
,
mcs
,
sinr_eff
,
bler
);
return
(
0
);
}
else
{
msg
(
"abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)
\n
"
,
mcs
,
sinr_eff
,
bler
);
printf
(
"abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)
\n
"
,
mcs
,
sinr_eff
,
bler
);
return
(
1
);
}
...
...
openair1/PHY/impl_defs_lte.h
View file @
f329139f
...
...
@@ -607,34 +607,34 @@ typedef struct {
int32_t
**
txdataF
[
3
];
/// \brief Holds the received data in time domain.
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: sample [0..]
int32_t
**
rxdata
[
3
];
/// \brief Holds the last subframe of received data in time domain after removal of 7.5kHz frequency offset.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
secotr
id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: sample [0..samples_per_tti[
int32_t
**
rxdata_7_5kHz
[
3
];
/// \brief Holds the received data in the frequency domain.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
int32_t
**
rxdataF
[
3
];
/// \brief Holds output of the sync correlator.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: sample [0..samples_per_tti*10[
uint32_t
*
sync_corr
[
3
];
}
LTE_eNB_COMMON
;
typedef
struct
{
/// \brief Hold the channel estimates in frequency domain based on SRS.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..ofdm_symbol_size[
int32_t
**
srs_ch_estimates
[
3
];
/// \brief Hold the channel estimates in time domain based on SRS.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size[
int32_t
**
srs_ch_estimates_time
[
3
];
...
...
@@ -645,54 +645,54 @@ typedef struct {
typedef
struct
{
/// \brief Holds the received data in the frequency domain for the allocated RBs in repeated format.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size[
/// - third index (definition from phy_init_lte_eNB()): ? [0..24*N_RB_UL*frame_parms->symbols_per_tti[
/// \warning inconsistent third index definition
int32_t
**
rxdataF_ext
[
3
];
/// \brief Holds the received data in the frequency domain for the allocated RBs in normal format.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
rxdataF_ext2
[
3
];
/// \brief Hold the channel estimates in time domain based on DRS.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..4*ofdm_symbol_size[
int32_t
**
drs_ch_estimates_time
[
3
];
/// \brief Hold the channel estimates in frequency domain based on DRS.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
drs_ch_estimates
[
3
];
/// \brief Hold the channel estimates for UE0 in case of Distributed Alamouti Scheme.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
drs_ch_estimates_0
[
3
];
/// \brief Hold the channel estimates for UE1 in case of Distributed Almouti Scheme.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
drs_ch_estimates_1
[
3
];
/// \brief Holds the compensated signal.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
rxdataF_comp
[
3
];
/// \brief Hold the compensated data (y)*(h0*) in case of Distributed Alamouti Scheme.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
rxdataF_comp_0
[
3
];
/// \brief Hold the compensated data (y*)*(h1) in case of Distributed Alamouti Scheme.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
rxdataF_comp_1
[
3
];
/// \brief ?.
/// - first index:
eNB
id [0..2] (hard coded)
/// - first index:
sector
id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t
**
ul_ch_mag
[
3
];
...
...
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