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
a51fa4f3
Commit
a51fa4f3
authored
Nov 18, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing segments and sch bytes allocation in coding/decoding
parent
0c408e96
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
115 deletions
+72
-115
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+14
-18
openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h
+1
-1
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+16
-25
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+30
-56
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+11
-15
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
a51fa4f3
...
...
@@ -118,19 +118,15 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
NR_gNB_DLSCH_t
*
dlsch
;
unsigned
char
exit_flag
=
0
,
i
,
r
,
aa
,
layer
;
int
re
;
unsigned
char
bw_scaling
=
1
;
uint16_t
N_RB
=
config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
N_RB
)
{
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
case
106
:
bw_scaling
=
2
;
break
;
default:
bw_scaling
=
1
;
break
;
}
uint16_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
dlsch
=
(
NR_gNB_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_gNB_DLSCH_t
));
...
...
@@ -170,31 +166,31 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
for
(
i
=
0
;
i
<
Mdlharq
;
i
++
)
{
dlsch
->
harq_processes
[
i
]
=
(
NR_DL_gNB_HARQ_t
*
)
malloc16
(
sizeof
(
NR_DL_gNB_HARQ_t
));
LOG_T
(
PHY
,
"Required mem size %d
(bw scaling %d),
dlsch->harq_processes[%d] %p
\n
"
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
,
bw_scaling
,
i
,
dlsch
->
harq_processes
[
i
]);
LOG_T
(
PHY
,
"Required mem size %d dlsch->harq_processes[%d] %p
\n
"
,
dlsch_bytes
,
i
,
dlsch
->
harq_processes
[
i
]);
if
(
dlsch
->
harq_processes
[
i
])
{
bzero
(
dlsch
->
harq_processes
[
i
],
sizeof
(
NR_DL_gNB_HARQ_t
));
// dlsch->harq_processes[i]->first_tx=1;
dlsch
->
harq_processes
[
i
]
->
b
=
(
unsigned
char
*
)
malloc16
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
dlsch
->
harq_processes
[
i
]
->
pdu
=
(
uint8_t
*
)
malloc16
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
dlsch
->
harq_processes
[
i
]
->
b
=
(
unsigned
char
*
)
malloc16
(
dlsch_bytes
);
dlsch
->
harq_processes
[
i
]
->
pdu
=
(
uint8_t
*
)
malloc16
(
dlsch_bytes
);
if
(
dlsch
->
harq_processes
[
i
]
->
pdu
)
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
nr_emulate_dlsch_payload
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
)
>>
3
);
bzero
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
dlsch_bytes
);
nr_emulate_dlsch_payload
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
(
dlsch_bytes
)
>>
3
);
}
else
{
printf
(
"Can't allocate PDU
\n
"
);
exit_flag
=
1
;
}
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
bzero
(
dlsch
->
harq_processes
[
i
]
->
b
,
dlsch_bytes
);
}
else
{
printf
(
"Can't get b
\n
"
);
exit_flag
=
1
;
}
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
// account for filler in first segment and CRCs for multiple segment case
// [hna] 8448 is the maximum CB size in NR
// 68*348 = 68*(maximum size of Zc)
...
...
openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h
View file @
a51fa4f3
...
...
@@ -36,7 +36,7 @@
#include "PHY/defs_nr_common.h"
#define MAX_NUM_NR_DLSCH_SEGMENTS
16
#define MAX_NUM_NR_DLSCH_SEGMENTS
34
#define MAX_NUM_NR_ULSCH_SEGMENTS MAX_NUM_NR_DLSCH_SEGMENTS
#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
a51fa4f3
...
...
@@ -101,17 +101,14 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
NR_gNB_ULSCH_t
*
ulsch
;
uint8_t
exit_flag
=
0
,
i
,
r
;
u
nsigned
char
bw_scaling
=
1
;
u
int16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
N_RB_UL
)
{
case
106
:
bw_scaling
=
2
;
break
;
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
default:
bw_scaling
=
1
;
break
;
}
uint16_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
ulsch
=
(
NR_gNB_ULSCH_t
*
)
malloc16
(
sizeof
(
NR_gNB_ULSCH_t
));
...
...
@@ -130,15 +127,15 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
memset
(
ulsch
->
harq_processes
[
i
],
0
,
sizeof
(
NR_UL_gNB_HARQ_t
));
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
ulsch_bytes
);
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
memset
(
ulsch
->
harq_processes
[
i
]
->
b
,
0
,
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
memset
(
ulsch
->
harq_processes
[
i
]
->
b
,
0
,
ulsch_bytes
);
else
exit_flag
=
3
;
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
MAX_NUM_NR_ULSCH_SEGMENTS
/
bw_scaling
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
nrLDPC_init_mem
();
...
...
@@ -413,21 +410,15 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
err_flag
=
0
;
r_offset
=
0
;
unsigned
char
bw_scaling
=
1
;
switch
(
frame_parms
->
N_RB_UL
)
{
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
case
106
:
bw_scaling
=
2
;
break
;
default:
bw_scaling
=
1
;
break
;
}
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
if
(
harq_process
->
C
>
MAX_NUM_NR_ULSCH_SEGMENTS
/
bw_scaling
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
MAX_NUM_NR_ULSCH_SEGMENTS
/
bw_scaling
);
if
(
harq_process
->
C
>
a_segments
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
a_segments
);
return
(
ulsch
->
max_ldpc_iterations
+
1
);
}
#ifdef DEBUG_ULSCH_DECODING
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
a51fa4f3
...
...
@@ -103,25 +103,14 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
NR_UE_DLSCH_t
*
dlsch
;
uint8_t
exit_flag
=
0
,
i
,
r
;
u
nsigned
char
bw_scaling
=
1
;
u
int16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
N_RB_DL
)
{
case
6
:
bw_scaling
=
16
;
break
;
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
case
25
:
bw_scaling
=
4
;
break
;
case
50
:
bw_scaling
=
2
;
break
;
default:
bw_scaling
=
1
;
break
;
}
uint16_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
dlsch
=
(
NR_UE_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_DLSCH_t
));
...
...
@@ -140,15 +129,15 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
if
(
dlsch
->
harq_processes
[
i
])
{
memset
(
dlsch
->
harq_processes
[
i
],
0
,
sizeof
(
NR_DL_UE_HARQ_t
));
dlsch
->
harq_processes
[
i
]
->
first_tx
=
1
;
dlsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
dlsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
dlsch_bytes
);
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
memset
(
dlsch
->
harq_processes
[
i
]
->
b
,
0
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
memset
(
dlsch
->
harq_processes
[
i
]
->
b
,
0
,
dlsch_bytes
);
else
exit_flag
=
3
;
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
nrLDPC_init_mem
();
dlsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
uint8_t
*
)
malloc16
(
1056
);
...
...
@@ -387,20 +376,15 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
err_flag
=
0
;
r_offset
=
0
;
u
nsigned
char
bw_scaling
=
1
;
u
int16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
frame_parms
->
N_RB_DL
)
{
case
106
:
bw_scaling
=
2
;
break
;
default:
bw_scaling
=
1
;
break
;
}
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
if
(
harq_process
->
C
>
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
);
if
(
harq_process
->
C
>
a_segments
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
a_segments
);
return
((
1
+
dlsch
->
max_ldpc_iterations
));
}
...
...
@@ -918,20 +902,15 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
err_flag
=
0
;
r_offset
=
0
;
u
nsigned
char
bw_scaling
=
1
;
u
int16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
frame_parms
->
N_RB_DL
)
{
case
106
:
bw_scaling
=
2
;
break
;
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
default:
bw_scaling
=
1
;
break
;
}
if
(
harq_process
->
C
>
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
);
if
(
harq_process
->
C
>
a_segments
)
{
LOG_E
(
PHY
,
"Illegal harq_process->C %d > %d
\n
"
,
harq_process
->
C
,
a_segments
);
return
((
1
+
dlsch
->
max_ldpc_iterations
));
}
#ifdef DEBUG_DLSCH_DECODING
...
...
@@ -1497,20 +1476,15 @@ void *nr_dlsch_decoding_process(void *arg)
//r_offset = 0;
/*
u
nsigned char bw_scaling =1;
u
int16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
switch (frame_parms->N_RB_DL) {
case 106:
bw_scaling =2;
break;
default:
bw_scaling =1;
break;
}
if (N_RB != 273) {
a_segments = a_segments*N_RB;
a_segments = a_segments/273;
}
if (harq_process->C >
MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling
) {
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,
MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling
);
if (harq_process->C >
a_segments
) {
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,
a_segments
);
return((1+dlsch->max_ldpc_iterations));
}*/
#ifdef DEBUG_DLSCH_DECODING
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
View file @
a51fa4f3
...
...
@@ -92,18 +92,14 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
{
NR_UE_ULSCH_t
*
ulsch
;
unsigned
char
exit_flag
=
0
,
i
,
r
;
u
nsigned
char
bw_scaling
=
1
;
u
int16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
switch
(
N_RB_UL
)
{
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
case
106
:
bw_scaling
=
2
;
break
;
default:
bw_scaling
=
1
;
break
;
}
uint16_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
ulsch
=
(
NR_UE_ULSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_ULSCH_t
));
...
...
@@ -123,25 +119,25 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
// printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
if
(
ulsch
->
harq_processes
[
i
])
{
memset
(
ulsch
->
harq_processes
[
i
],
0
,
sizeof
(
NR_UL_UE_HARQ_t
));
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
ulsch
->
harq_processes
[
i
]
->
a
=
(
unsigned
char
*
)
malloc16
(
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
ulsch
->
harq_processes
[
i
]
->
b
=
(
uint8_t
*
)
malloc16
(
ulsch_bytes
);
ulsch
->
harq_processes
[
i
]
->
a
=
(
unsigned
char
*
)
malloc16
(
ulsch_bytes
);
if
(
ulsch
->
harq_processes
[
i
]
->
a
)
{
bzero
(
ulsch
->
harq_processes
[
i
]
->
a
,
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
bzero
(
ulsch
->
harq_processes
[
i
]
->
a
,
ulsch_bytes
);
}
else
{
printf
(
"Can't allocate PDU
\n
"
);
exit_flag
=
1
;
}
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
bzero
(
ulsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_ULSCH_PAYLOAD_BYTES
/
bw_scaling
);
bzero
(
ulsch
->
harq_processes
[
i
]
->
b
,
ulsch_bytes
);
else
{
LOG_E
(
PHY
,
"Can't get b
\n
"
);
exit_flag
=
1
;
}
if
(
abstraction_flag
==
0
)
{
for
(
r
=
0
;
r
<
MAX_NUM_NR_ULSCH_SEGMENTS
/
bw_scaling
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
// account for filler in first segment and CRCs for multiple segment case
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
uint8_t
*
)
malloc16
(
8448
);
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
(
uint8_t
*
)
malloc16
(
68
*
384
);
//max size for coded output
...
...
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