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
canghaiwuhen
OpenXG-RAN
Commits
d351060b
Commit
d351060b
authored
Sep 27, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
making segmentation BG dependent
parent
ef850d12
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
63 deletions
+78
-63
openair1/PHY/CODING/coding_defs.h
openair1/PHY/CODING/coding_defs.h
+2
-1
openair1/PHY/CODING/nr_segmentation.c
openair1/PHY/CODING/nr_segmentation.c
+44
-29
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+11
-9
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+21
-24
No files found.
openair1/PHY/CODING/coding_defs.h
View file @
d351060b
...
...
@@ -454,7 +454,8 @@ int32_t nr_segmentation(unsigned char *input_buffer,
unsigned
int
*
C
,
unsigned
int
*
K
,
unsigned
int
*
Zout
,
unsigned
int
*
F
);
unsigned
int
*
F
,
uint8_t
BG
);
uint32_t
nr_compute_tbs
(
uint8_t
mcs
,
uint16_t
nb_rb
,
...
...
openair1/PHY/CODING/nr_segmentation.c
View file @
d351060b
...
...
@@ -35,20 +35,26 @@ int32_t nr_segmentation(unsigned char *input_buffer,
unsigned
int
*
C
,
unsigned
int
*
K
,
unsigned
int
*
Zout
,
// [hna] Zout is Zc
unsigned
int
*
F
)
unsigned
int
*
F
,
uint8_t
BG
)
{
unsigned
int
L
,
Bprime
,
Bprime_by_C
,
Z
,
r
,
Kb
,
k
,
s
,
crc
,
Kprime
;
unsigned
int
L
,
Bprime
,
Z
,
r
,
Kcb
,
Kb
,
k
,
s
,
crc
,
Kprime
;
if
(
B
<=
8448
)
{
if
(
BG
==
1
)
Kcb
=
8448
;
else
Kcb
=
3840
;
if
(
B
<=
Kcb
)
{
L
=
0
;
*
C
=
1
;
Bprime
=
B
;
}
else
{
L
=
24
;
*
C
=
B
/
(
8448
-
L
);
*
C
=
B
/
(
Kcb
-
L
);
if
((
8448
-
L
)
*
(
*
C
)
<
B
)
if
((
Kcb
-
L
)
*
(
*
C
)
<
B
)
*
C
=*
C
+
1
;
Bprime
=
B
+
((
*
C
)
*
L
);
...
...
@@ -63,27 +69,31 @@ int32_t nr_segmentation(unsigned char *input_buffer,
}
// Find K+
Bprime_by_C
=
Bprime
/
(
*
C
);
if
(
Bprime
<=
192
)
{
Kb
=
6
;
}
else
if
(
Bprime
<=
560
)
{
Kb
=
8
;
}
else
if
(
Bprime
<=
640
)
{
Kb
=
9
;
}
else
if
(
Bprime
<=
3840
)
{
Kb
=
10
;;
}
else
{
Kprime
=
Bprime
/
(
*
C
);
if
(
BG
==
1
)
Kb
=
22
;
else
{
if
(
B
>
640
)
{
Kb
=
10
;
}
else
if
(
B
>
560
)
{
Kb
=
9
;
}
else
if
(
B
>
192
)
{
Kb
=
8
;
}
else
{
Kb
=
6
;
}
}
if
((
Bprime_by_C
%
Kb
)
>
0
)
Z
=
(
Bprime_by_C
/
Kb
)
+
1
;
if
((
Kprime
%
Kb
)
>
0
)
Z
=
(
Kprime
/
Kb
)
+
1
;
else
Z
=
(
Bprime_by_C
/
Kb
);
Z
=
(
Kprime
/
Kb
);
#ifdef DEBUG_SEGMENTATION
printf
(
"nr segmetation B %d Bprime %d
Bprime_by_C %d z %d
\n
"
,
B
,
Bprime
,
Bprime_by_C
,
Z
);
printf
(
"nr segmetation B %d Bprime %d
Kprime %d z %d
\n
"
,
B
,
Bprime
,
Kprime
,
Z
);
#endif
if
(
Z
<=
2
)
{
...
...
@@ -128,10 +138,15 @@ else
//msg("nr_segmentation.c: Illegal codeword size !!!\n");
return
-
1
;
}
*
Zout
=
*
K
;
*
K
=
*
K
*
Kb
;
*
F
=
((
*
K
)
-
Bprime_by_C
);
if
(
BG
==
1
)
*
K
=
*
K
*
22
;
else
*
K
=
*
K
*
10
;
*
F
=
((
*
K
)
-
Kprime
);
#ifdef DEBUG_SEGMENTATION
printf
(
"final nr seg output Z %d K %d F %d
\n
"
,
*
Zout
,
*
K
,
*
F
);
...
...
@@ -145,7 +160,6 @@ else
for
(
r
=
0
;
r
<*
C
;
r
++
)
{
k
=
0
;
Kprime
=
Bprime_by_C
;
while
(
k
<
((
Kprime
-
L
)
>>
3
))
{
output_buffers
[
r
][
k
]
=
input_buffer
[
s
];
...
...
@@ -154,6 +168,13 @@ else
s
++
;
}
if
(
*
C
>
1
)
{
// add CRC
crc
=
crc24b
(
output_buffers
[
r
],
Kprime
-
L
)
>>
8
;
output_buffers
[
r
][(
Kprime
-
L
)
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
2
];
output_buffers
[
r
][
1
+
((
Kprime
-
L
)
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
1
];
output_buffers
[
r
][
2
+
((
Kprime
-
L
)
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
}
if
(
*
F
>
0
)
{
for
(
k
=
Kprime
>>
3
;
k
<
(
*
K
)
>>
3
;
k
++
)
{
output_buffers
[
r
][
k
]
=
0
;
...
...
@@ -161,12 +182,6 @@ else
}
}
if
(
*
C
>
1
)
{
// add CRC
crc
=
crc24b
(
output_buffers
[
r
],
Kprime
-
L
)
>>
8
;
output_buffers
[
r
][(
Kprime
-
L
)
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
2
];
output_buffers
[
r
][
1
+
((
Kprime
-
L
)
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
1
];
output_buffers
[
r
][
2
+
((
Kprime
-
L
)
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
}
}
}
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
d351060b
...
...
@@ -340,15 +340,6 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
memcpy
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
a
,(
A
/
8
)
+
4
);
nr_segmentation
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
dlsch
->
harq_processes
[
harq_pid
]
->
B
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
C
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
K
,
pz
,
// [hna] pz is Zc
&
dlsch
->
harq_processes
[
harq_pid
]
->
F
);
F
=
dlsch
->
harq_processes
[
harq_pid
]
->
F
;
Coderate
=
(
float
)
A
/
(
float
)
G
;
if
((
A
<=
292
)
||
((
A
<=
3824
)
&&
(
Coderate
<=
0
.
6667
))
||
Coderate
<=
0
.
25
){
...
...
@@ -358,6 +349,17 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
BG
=
1
;
}
nr_segmentation
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
dlsch
->
harq_processes
[
harq_pid
]
->
B
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
C
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
K
,
pz
,
// [hna] pz is Zc
&
dlsch
->
harq_processes
[
harq_pid
]
->
F
,
BG
);
F
=
dlsch
->
harq_processes
[
harq_pid
]
->
F
;
Kr
=
dlsch
->
harq_processes
[
harq_pid
]
->
K
;
#ifdef DEBUG_DLSCH_CODING
uint16_t
Kr_bytes
;
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
d351060b
...
...
@@ -350,29 +350,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
LOG_I
(
PHY
,
"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d
\n
"
,
harq_pid
,
A
,
G
,
mcs
,
n_layers
,
nb_symb_sch
,
nb_rb
);
if
(
harq_process
->
round
==
0
)
{
// This is a new packet, so compute quantities regarding segmentation
harq_process
->
B
=
A
+
24
;
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
nr_segmentation
(
NULL
,
NULL
,
harq_process
->
B
,
&
harq_process
->
C
,
&
harq_process
->
K
,
&
harq_process
->
Z
,
// [hna] Z is Zc
&
harq_process
->
F
);
p_decParams
->
Z
=
harq_process
->
Z
;
#ifdef DEBUG_ULSCH_DECODING
printf
(
"ulsch decoding nr segmentation Z %d
\n
"
,
p_decParams
->
Z
);
if
(
!
frame
%
100
)
printf
(
"K %d C %d Z %d nl %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
p_decParams
->
Z
,
harq_process
->
Nl
);
#endif
}
Coderate
=
(
float
)
A
/
(
float
)
G
;
if
((
A
<=
292
)
||
((
A
<=
3824
)
&&
(
Coderate
<=
0
.
6667
))
||
Coderate
<=
0
.
25
){
...
...
@@ -405,9 +382,29 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
}
}
//printf("coderate %f kc %d \n", Coderate, kc);
if
(
harq_process
->
round
==
0
)
{
// This is a new packet, so compute quantities regarding segmentation
harq_process
->
B
=
A
+
24
;
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
nr_segmentation
(
NULL
,
NULL
,
harq_process
->
B
,
&
harq_process
->
C
,
&
harq_process
->
K
,
&
harq_process
->
Z
,
// [hna] Z is Zc
&
harq_process
->
F
,
p_decParams
->
BG
);
p_decParams
->
Z
=
harq_process
->
Z
;
#ifdef DEBUG_ULSCH_DECODING
printf
(
"ulsch decoding nr segmentation Z %d
\n
"
,
p_decParams
->
Z
);
if
(
!
frame
%
100
)
printf
(
"K %d C %d Z %d nl %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
p_decParams
->
Z
,
harq_process
->
Nl
);
#endif
}
p_decParams
->
numMaxIter
=
ulsch
->
max_ldpc_iterations
;
p_decParams
->
outMode
=
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