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
Michael Black
OpenXG-RAN
Commits
9b4a7526
Commit
9b4a7526
authored
Feb 21, 2022
by
Sakthivel Velumani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect merge
parent
1c49cadd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
160 deletions
+117
-160
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+3
-3
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+12
-53
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+102
-104
No files found.
openair1/PHY/CODING/TESTBENCH/ldpctest.c
View file @
9b4a7526
...
...
@@ -718,9 +718,9 @@ int main(int argc, char *argv[])
(
double
)
time_decoder
->
diff
/
time_decoder
->
trials
/
1000
.
0
/
get_cpu_freq_GHz
(),
sqrt
((
double
)
time_decoder
->
diff_square
/
time_decoder
->
trials
/
pow
(
1000
,
2
)
/
pow
(
get_cpu_freq_GHz
(),
2
)
-
pow
((
double
)
time_decoder
->
diff
/
time_decoder
->
trials
/
1000
.
0
/
get_cpu_freq_GHz
(),
2
)),
(
double
)
time_decoder
->
max
/
1000
.
0
/
get_cpu_freq_GHz
(),
dec_iter
.
n_iter_mean
[
i
],
dec_iter
.
n_iter_std
[
i
],
dec_iter
.
n_iter_max
[
i
]
dec_iter
.
n_iter_mean
[
i
],
dec_iter
.
n_iter_std
[
i
],
dec_iter
.
n_iter_max
[
i
]
);
i
=
i
+
1
;
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
9b4a7526
...
...
@@ -105,7 +105,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
{
NR_gNB_ULSCH_t
*
ulsch
;
uint8_t
exit_flag
=
0
,
i
,
r
;
uint8_t
i
,
r
;
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
if
(
N_RB_UL
!=
273
)
{
...
...
@@ -116,63 +116,22 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
uint16_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
ulsch
=
(
NR_gNB_ULSCH_t
*
)
malloc16
(
sizeof
(
NR_gNB_ULSCH_t
));
if
(
ulsch
)
{
memset
(
ulsch
,
0
,
sizeof
(
NR_gNB_ULSCH_t
));
ulsch
->
max_ldpc_iterations
=
max_ldpc_iterations
;
ulsch
->
Mlimit
=
4
;
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
ulsch
->
harq_processes
[
i
]
=
(
NR_UL_gNB_HARQ_t
*
)
malloc16
(
sizeof
(
NR_UL_gNB_HARQ_t
));
if
(
ulsch
->
harq_processes
[
i
])
{
memset
(
ulsch
->
harq_processes
[
i
],
0
,
sizeof
(
NR_UL_gNB_HARQ_t
));
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
ulsch_bytes
);
ulsch
->
max_ldpc_iterations
=
max_ldpc_iterations
;
ulsch
->
Mlimit
=
4
;
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
memset
(
ulsch
->
harq_processes
[
i
]
->
b
,
0
,
ulsch_bytes
);
else
exit_flag
=
3
;
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
uint8_t
*
)
malloc16
(
8448
*
sizeof
(
uint8_t
));
if
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
])
memset
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],
0
,
8448
*
sizeof
(
uint8_t
));
else
exit_flag
=
2
;
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
(
int16_t
*
)
malloc16
((
68
*
384
)
*
sizeof
(
int16_t
));
if
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
])
memset
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
],
0
,(
68
*
384
)
*
sizeof
(
int16_t
));
else
exit_flag
=
2
;
ulsch
->
harq_processes
[
i
]
->
w
[
r
]
=
(
int16_t
*
)
malloc16
((
3
*
(
6144
+
64
))
*
sizeof
(
int16_t
));
if
(
ulsch
->
harq_processes
[
i
]
->
w
[
r
])
memset
(
ulsch
->
harq_processes
[
i
]
->
w
[
r
],
0
,(
3
*
(
6144
+
64
))
*
sizeof
(
int16_t
));
else
exit_flag
=
2
;
}
}
}
else
{
exit_flag
=
1
;
ulsch
->
harq_processes
[
i
]
=
(
NR_UL_gNB_HARQ_t
*
)
malloc16_clear
(
sizeof
(
NR_UL_gNB_HARQ_t
));
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16_clear
(
ulsch_bytes
);
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
uint8_t
*
)
malloc16_clear
(
8448
*
sizeof
(
uint8_t
));
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
(
int16_t
*
)
malloc16_clear
((
68
*
384
)
*
sizeof
(
int16_t
));
ulsch
->
harq_processes
[
i
]
->
w
[
r
]
=
(
int16_t
*
)
malloc16_clear
((
3
*
(
6144
+
64
))
*
sizeof
(
int16_t
));
}
}
if
(
exit_flag
==
0
)
return
(
ulsch
);
}
printf
(
"new_gNB_ulsch with size %zu: exit_flag = %hhu
\n
"
,
sizeof
(
NR_UL_gNB_HARQ_t
),
exit_flag
);
free_gNB_ulsch
(
&
ulsch
,
N_RB_UL
);
return
(
NULL
);
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
9b4a7526
...
...
@@ -312,126 +312,124 @@ void nr_processDLSegment(void* arg) {
t_nrLDPC_time_stats
procTime
=
{
0
};
t_nrLDPC_time_stats
*
p_procTime
=
&
procTime
;
t_nrLDPC_procBuf
**
p_nrLDPC_procBuf
=
harq_process
->
p_nrLDPC_procBuf
;
start_meas
(
&
rdata
->
ts_deinterleave
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
nr_deinterleaving_ldpc
(
E
,
Qm
,
harq_process
->
w
[
r
],
// [hna] w is e
dlsch_llr
+
r_offset
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
stop_meas
(
&
rdata
->
ts_deinterleave
);
start_meas
(
&
rdata
->
ts_rate_unmatch
);
/* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,E,harq_process->F,
Kr*3,
harq_process->TBS,
Qm,
harq_process->nb_rb,
harq_process->Nl,
harq_process->rvidx,
harq_process->round); */
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
if
(
nr_rate_matching_ldpc_rx
(
Ilbrm
,
Tbslbrm
,
p_decoderParms
->
BG
,
p_decoderParms
->
Z
,
harq_process
->
d
[
r
],
harq_process
->
w
[
r
],
harq_process
->
C
,
harq_process
->
rvidx
,
(
harq_process
->
first_rx
==
1
)
?
1
:
0
,
E
,
harq_process
->
F
,
Kr
-
harq_process
->
F
-
2
*
(
p_decoderParms
->
Z
))
==-
1
)
{
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
stop_meas
(
&
rdata
->
ts_rate_unmatch
);
LOG_E
(
PHY
,
"dlsch_decoding.c: Problem in rate_matching
\n
"
);
rdata
->
decodeIterations
=
dlsch
->
max_ldpc_iterations
+
1
;
return
;
}
start_meas
(
&
rdata
->
ts_deinterleave
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
nr_deinterleaving_ldpc
(
E
,
Qm
,
harq_process
->
w
[
r
],
// [hna] w is e
dlsch_llr
+
r_offset
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
stop_meas
(
&
rdata
->
ts_deinterleave
);
start_meas
(
&
rdata
->
ts_rate_unmatch
);
/* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,E,harq_process->F,
Kr*3,
harq_process->TBS,
Qm,
harq_process->nb_rb,
harq_process->Nl,
harq_process->rvidx,
harq_process->round); */
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
if
(
nr_rate_matching_ldpc_rx
(
Ilbrm
,
Tbslbrm
,
p_decoderParms
->
BG
,
p_decoderParms
->
Z
,
harq_process
->
d
[
r
],
harq_process
->
w
[
r
],
harq_process
->
C
,
harq_process
->
rvidx
,
(
harq_process
->
first_rx
==
1
)
?
1
:
0
,
E
,
harq_process
->
F
,
Kr
-
harq_process
->
F
-
2
*
(
p_decoderParms
->
Z
))
==-
1
)
{
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
stop_meas
(
&
rdata
->
ts_rate_unmatch
);
LOG_E
(
PHY
,
"dlsch_decoding.c: Problem in rate_matching
\n
"
);
rdata
->
decodeIterations
=
dlsch
->
max_ldpc_iterations
+
1
;
return
;
}
stop_meas
(
&
rdata
->
ts_rate_unmatch
);
r_offset
+=
E
;
if
(
LOG_DEBUGFLAG
(
DEBUG_DLSCH_DECOD
))
{
LOG_D
(
PHY
,
"decoder input(segment %u) :"
,
r
);
r_offset
+=
E
;
for
(
int
i
=
0
;
i
<
E
;
i
++
)
LOG_D
(
PHY
,
"%d : %d
\n
"
,
i
,
harq_process
->
d
[
r
][
i
]
);
if
(
LOG_DEBUGFLAG
(
DEBUG_DLSCH_DECOD
))
{
LOG_D
(
PHY
,
"decoder input(segment %u) :"
,
r
);
LOG_D
(
PHY
,
"
\n
"
);
}
for
(
int
i
=
0
;
i
<
E
;
i
++
)
LOG_D
(
PHY
,
"%d : %d
\n
"
,
i
,
harq_process
->
d
[
r
][
i
]);
memset
(
harq_process
->
c
[
r
],
0
,
Kr_bytes
);
LOG_D
(
PHY
,
"
\n
"
);
}
if
(
harq_process
->
C
==
1
)
{
if
(
A
>
NR_MAX_PDSCH_TBS
)
crc_type
=
CRC24_A
;
else
crc_type
=
CRC16
;
memset
(
harq_process
->
c
[
r
],
0
,
Kr_bytes
);
length_dec
=
harq_process
->
B
;
}
else
{
crc_type
=
CRC24_
B
;
length_dec
=
(
harq_process
->
B
+
24
*
harq_process
->
C
)
/
harq_process
->
C
;
}
if
(
harq_process
->
C
==
1
)
{
if
(
A
>
NR_MAX_PDSCH_TBS
)
crc_type
=
CRC24_
A
;
else
crc_type
=
CRC16
;
{
start_meas
(
&
rdata
->
ts_ldpc_decode
);
//set first 2*Z_c bits to zeros
memset
(
&
z
[
0
],
0
,
2
*
harq_process
->
Z
*
sizeof
(
int16_t
));
//set Filler bits
memset
((
&
z
[
0
]
+
K_bits_F
),
127
,
harq_process
->
F
*
sizeof
(
int16_t
));
//Move coded bits before filler bits
memcpy
((
&
z
[
0
]
+
2
*
harq_process
->
Z
),
harq_process
->
d
[
r
],(
K_bits_F
-
2
*
harq_process
->
Z
)
*
sizeof
(
int16_t
));
//skip filler bits
memcpy
((
&
z
[
0
]
+
Kr
),
harq_process
->
d
[
r
]
+
(
Kr
-
2
*
harq_process
->
Z
),(
kc
*
harq_process
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
//Saturate coded bits before decoding into 8 bits values
for
(
i
=
0
,
j
=
0
;
j
<
((
kc
*
harq_process
->
Z
)
>>
4
)
+
1
;
i
+=
2
,
j
++
)
{
pl
[
j
]
=
_mm_packs_epi16
(
pv
[
i
],
pv
[
i
+
1
]);
}
length_dec
=
harq_process
->
B
;
}
else
{
crc_type
=
CRC24_B
;
length_dec
=
(
harq_process
->
B
+
24
*
harq_process
->
C
)
/
harq_process
->
C
;
}
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN);
p_decoderParms
->
block_length
=
length_dec
;
nrLDPC_initcall
(
p_decoderParms
,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
);
no_iteration_ldpc
=
nrLDPC_decoder
(
p_decoderParms
,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
p_procTime
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT);
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if
(
check_crc
((
uint8_t
*
)
llrProcBuf
,
length_dec
,
harq_process
->
F
,
crc_type
))
{
LOG_D
(
PHY
,
"Segment %u CRC OK
\n\033
[0m"
,
r
);
if
(
r
==
0
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
LOG_D
(
PHY
,
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
}
{
start_meas
(
&
rdata
->
ts_ldpc_decode
);
//set first 2*Z_c bits to zeros
memset
(
&
z
[
0
],
0
,
2
*
harq_process
->
Z
*
sizeof
(
int16_t
));
//set Filler bits
memset
((
&
z
[
0
]
+
K_bits_F
),
127
,
harq_process
->
F
*
sizeof
(
int16_t
));
//Move coded bits before filler bits
memcpy
((
&
z
[
0
]
+
2
*
harq_process
->
Z
),
harq_process
->
d
[
r
],(
K_bits_F
-
2
*
harq_process
->
Z
)
*
sizeof
(
int16_t
));
//skip filler bits
memcpy
((
&
z
[
0
]
+
Kr
),
harq_process
->
d
[
r
]
+
(
Kr
-
2
*
harq_process
->
Z
),(
kc
*
harq_process
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
//Saturate coded bits before decoding into 8 bits values
for
(
i
=
0
,
j
=
0
;
j
<
((
kc
*
harq_process
->
Z
)
>>
4
)
+
1
;
i
+=
2
,
j
++
)
{
pl
[
j
]
=
_mm_packs_epi16
(
pv
[
i
],
pv
[
i
+
1
]);
}
//Temporary hack
no_iteration_ldpc
=
dlsch
->
max_ldpc_iterations
;
rdata
->
decodeIterations
=
no_iteration_ldpc
;
}
else
{
LOG_D
(
PHY
,
"CRC NOT OK
\n\033
[0m"
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN);
p_decoderParms
->
block_length
=
length_dec
;
nrLDPC_initcall
(
p_decoderParms
,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
);
no_iteration_ldpc
=
nrLDPC_decoder
(
p_decoderParms
,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
p_procTime
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT);
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if
(
check_crc
((
uint8_t
*
)
llrProcBuf
,
length_dec
,
harq_process
->
F
,
crc_type
))
{
LOG_D
(
PHY
,
"Segment %u CRC OK
\n\033
[0m"
,
r
);
if
(
r
==
0
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
LOG_D
(
PHY
,
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
}
nb_total_decod
++
;
//Temporary hack
no_iteration_ldpc
=
dlsch
->
max_ldpc_iterations
;
rdata
->
decodeIterations
=
no_iteration_ldpc
;
}
else
{
LOG_D
(
PHY
,
"CRC NOT OK
\n\033
[0m"
);
}
if
(
no_iteration_ldpc
>
dlsch
->
max_ldpc_iterations
)
{
nb_error_decod
++
;
}
nb_total_decod
++
;
for
(
int
m
=
0
;
m
<
Kr
>>
3
;
m
++
)
{
harq_process
->
c
[
r
][
m
]
=
(
uint8_t
)
llrProcBuf
[
m
]
;
}
if
(
no_iteration_ldpc
>
dlsch
->
max_ldpc_iterations
)
{
nb_error_decod
++
;
}
stop_meas
(
&
rdata
->
ts_ldpc_decode
);
for
(
int
m
=
0
;
m
<
Kr
>>
3
;
m
++
)
{
harq_process
->
c
[
r
][
m
]
=
(
uint8_t
)
llrProcBuf
[
m
];
}
stop_meas
(
&
rdata
->
ts_ldpc_decode
);
}
}
uint32_t
nr_dlsch_decoding
(
PHY_VARS_NR_UE
*
phy_vars_ue
,
...
...
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