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
94b7762b
Commit
94b7762b
authored
Nov 20, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic allocation of e and f vectors
parent
e8b69323
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
125 additions
and
38 deletions
+125
-38
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+1
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+44
-4
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.h
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
+1
-1
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+14
-6
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+14
-6
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+2
-2
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+2
-2
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+36
-5
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+2
-2
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+2
-2
openair1/SIMULATION/NR_PHY/ulschsim.c
openair1/SIMULATION/NR_PHY/ulschsim.c
+3
-3
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+3
-3
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
View file @
94b7762b
...
@@ -80,7 +80,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
...
@@ -80,7 +80,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
time_stats_t
*
dlsch_modulation_stats
);
time_stats_t
*
dlsch_modulation_stats
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
N_RB
);
void
clean_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
);
void
clean_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
94b7762b
...
@@ -48,12 +48,22 @@
...
@@ -48,12 +48,22 @@
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_FREE 1
//#define DEBUG_DLSCH_FREE 1
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
)
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
,
uint16_t
N_RB
)
{
{
int
i
;
int
i
;
int
r
;
int
r
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
if
(
dlsch
)
{
if
(
dlsch
)
{
if
(
N_RB
!=
273
)
{
a_segments
=
a_segments
*
N_RB
;
a_segments
=
a_segments
/
273
;
}
uint16_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
#ifdef DEBUG_DLSCH_FREE
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch %p
\n
"
,
dlsch
);
printf
(
"Freeing dlsch %p
\n
"
,
dlsch
);
#endif
#endif
...
@@ -69,18 +79,34 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
...
@@ -69,18 +79,34 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
#endif
#endif
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
{
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
{
free16
(
dlsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_DLSCH_PAYLOAD_BYTES
);
free16
(
dlsch
->
harq_processes
[
i
]
->
b
,
dlsch_bytes
);
dlsch
->
harq_processes
[
i
]
->
b
=
NULL
;
dlsch
->
harq_processes
[
i
]
->
b
=
NULL
;
#ifdef DEBUG_DLSCH_FREE
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch process %d b (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
b
);
printf
(
"Freeing dlsch process %d b (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
b
);
#endif
#endif
}
}
if
(
dlsch
->
harq_processes
[
i
]
->
e
)
{
free16
(
dlsch
->
harq_processes
[
i
]
->
e
,
14
*
N_RB
*
12
*
8
);
dlsch
->
harq_processes
[
i
]
->
e
=
NULL
;
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch process %d e (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
e
);
#endif
}
if
(
dlsch
->
harq_processes
[
i
]
->
f
)
{
free16
(
dlsch
->
harq_processes
[
i
]
->
f
,
14
*
N_RB
*
12
*
8
);
dlsch
->
harq_processes
[
i
]
->
f
=
NULL
;
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch process %d f (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
f
);
#endif
}
#ifdef DEBUG_DLSCH_FREE
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch process %d c (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
c
);
printf
(
"Freeing dlsch process %d c (%p)
\n
"
,
i
,
dlsch
->
harq_processes
[
i
]
->
c
);
#endif
#endif
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
#ifdef DEBUG_DLSCH_FREE
#ifdef DEBUG_DLSCH_FREE
printf
(
"Freeing dlsch process %d c[%d] (%p)
\n
"
,
i
,
r
,
dlsch
->
harq_processes
[
i
]
->
c
[
r
]);
printf
(
"Freeing dlsch process %d c[%d] (%p)
\n
"
,
i
,
r
,
dlsch
->
harq_processes
[
i
]
->
c
[
r
]);
...
@@ -210,6 +236,20 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
...
@@ -210,6 +236,20 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
exit_flag
=
2
;
exit_flag
=
2
;
}
}
}
}
dlsch
->
harq_processes
[
i
]
->
e
=
(
uint8_t
*
)
malloc16
(
14
*
N_RB
*
12
*
8
);
if
(
dlsch
->
harq_processes
[
i
]
->
e
)
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
e
,
14
*
N_RB
*
12
*
8
);
}
else
{
printf
(
"Can't get e
\n
"
);
exit_flag
=
1
;
}
dlsch
->
harq_processes
[
i
]
->
f
=
(
uint8_t
*
)
malloc16
(
14
*
N_RB
*
12
*
8
);
if
(
dlsch
->
harq_processes
[
i
]
->
f
)
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
f
,
14
*
N_RB
*
12
*
8
);
}
else
{
printf
(
"Can't get f
\n
"
);
exit_flag
=
1
;
}
}
}
}
else
{
}
else
{
printf
(
"Can't get harq_p %d
\n
"
,
i
);
printf
(
"Can't get harq_p %d
\n
"
,
i
);
...
@@ -228,7 +268,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
...
@@ -228,7 +268,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
LOG_D
(
PHY
,
"new_gNB_dlsch exit flag %d, size of %ld
\n
"
,
LOG_D
(
PHY
,
"new_gNB_dlsch exit flag %d, size of %ld
\n
"
,
exit_flag
,
sizeof
(
NR_gNB_DLSCH_t
));
exit_flag
,
sizeof
(
NR_gNB_DLSCH_t
));
free_gNB_dlsch
(
dlsch
);
free_gNB_dlsch
(
dlsch
,
N_RB
);
return
(
NULL
);
return
(
NULL
);
...
...
openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h
View file @
94b7762b
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*
6
) // 14 symbols, 273 RB
#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*
8
) // 14 symbols, 273 RB
#define MAX_NUM_NR_RE (14*273*12)
#define MAX_NUM_NR_RE (14*273*12)
#define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1
#define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
View file @
94b7762b
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#include "PHY/defs_gNB.h"
#include "PHY/defs_gNB.h"
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
);
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
,
uint8_t
N_RB_UL
);
NR_gNB_ULSCH_t
*
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint8_t
N_RB_UL
,
uint8_t
abstraction_flag
);
NR_gNB_ULSCH_t
*
new_gNB_ulsch
(
uint8_t
max_ldpc_iterations
,
uint8_t
N_RB_UL
,
uint8_t
abstraction_flag
);
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
94b7762b
...
@@ -57,30 +57,38 @@ static uint64_t nb_error_decod =0;
...
@@ -57,30 +57,38 @@ static uint64_t nb_error_decod =0;
//extern double cpuf;
//extern double cpuf;
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
)
void
free_gNB_ulsch
(
NR_gNB_ULSCH_t
*
ulsch
,
uint8_t
N_RB_UL
)
{
{
int
i
,
r
;
int
i
,
r
;
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
if
(
ulsch
)
{
if
(
ulsch
)
{
if
(
N_RB_UL
!=
273
)
{
a_segments
=
a_segments
*
N_RB_UL
;
a_segments
=
a_segments
/
273
;
}
uint16_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
if
(
ulsch
->
harq_processes
[
i
])
{
if
(
ulsch
->
harq_processes
[
i
])
{
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_ULSCH_PAYLOAD_BYTES
);
free16
(
ulsch
->
harq_processes
[
i
]
->
b
,
ulsch_bytes
);
ulsch
->
harq_processes
[
i
]
->
b
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
b
=
NULL
;
}
}
for
(
r
=
0
;
r
<
MAX_NUM_NR_ULSCH_SEGMENTS
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],(
8448
)
*
sizeof
(
uint8_t
));
free16
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],(
8448
)
*
sizeof
(
uint8_t
));
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
}
}
for
(
r
=
0
;
r
<
MAX_NUM_NR_ULSCH_SEGMENTS
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
])
{
if
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
])
{
free16
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
],(
68
*
384
)
*
sizeof
(
int16_t
));
free16
(
ulsch
->
harq_processes
[
i
]
->
d
[
r
],(
68
*
384
)
*
sizeof
(
int16_t
));
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
d
[
r
]
=
NULL
;
}
}
}
}
for
(
r
=
0
;
r
<
(
MAX_NUM_NR_ULSCH_SEGMENTS
)
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]){
if
(
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]){
nrLDPC_free_mem
(
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]);
nrLDPC_free_mem
(
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]);
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
NULL
;
...
@@ -164,7 +172,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
...
@@ -164,7 +172,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
}
}
printf
(
"new_gNB_ulsch with size %zu: exit_flag = %u
\n
"
,
sizeof
(
NR_UL_gNB_HARQ_t
),
exit_flag
);
printf
(
"new_gNB_ulsch with size %zu: exit_flag = %u
\n
"
,
sizeof
(
NR_UL_gNB_HARQ_t
),
exit_flag
);
free_gNB_ulsch
(
ulsch
);
free_gNB_ulsch
(
ulsch
,
N_RB_UL
);
return
(
NULL
);
return
(
NULL
);
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
94b7762b
...
@@ -56,31 +56,39 @@ notifiedFIFO_elt_t *msgToPush;
...
@@ -56,31 +56,39 @@ notifiedFIFO_elt_t *msgToPush;
//extern double cpuf;
//extern double cpuf;
void
free_nr_ue_dlsch
(
NR_UE_DLSCH_t
*
dlsch
)
void
free_nr_ue_dlsch
(
NR_UE_DLSCH_t
*
dlsch
,
uint8_t
N_RB_DL
)
{
{
int
i
,
r
;
int
i
,
r
;
uint16_t
a_segments
=
MAX_NUM_NR_DLSCH_SEGMENTS
;
//number of segments to be allocated
if
(
dlsch
)
{
if
(
dlsch
)
{
if
(
N_RB_DL
!=
273
)
{
a_segments
=
a_segments
*
N_RB_DL
;
a_segments
=
a_segments
/
273
;
}
uint16_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
for
(
i
=
0
;
i
<
dlsch
->
Mdlharq
;
i
++
)
{
for
(
i
=
0
;
i
<
dlsch
->
Mdlharq
;
i
++
)
{
if
(
dlsch
->
harq_processes
[
i
])
{
if
(
dlsch
->
harq_processes
[
i
])
{
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
{
if
(
dlsch
->
harq_processes
[
i
]
->
b
)
{
free16
(
dlsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_DLSCH_PAYLOAD_BYTES
);
free16
(
dlsch
->
harq_processes
[
i
]
->
b
,
dlsch_bytes
);
dlsch
->
harq_processes
[
i
]
->
b
=
NULL
;
dlsch
->
harq_processes
[
i
]
->
b
=
NULL
;
}
}
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
free16
(
dlsch
->
harq_processes
[
i
]
->
c
[
r
],
1056
);
free16
(
dlsch
->
harq_processes
[
i
]
->
c
[
r
],
1056
);
dlsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
dlsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
}
}
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
;
r
++
)
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
if
(
dlsch
->
harq_processes
[
i
]
->
d
[
r
])
{
if
(
dlsch
->
harq_processes
[
i
]
->
d
[
r
])
{
free16
(
dlsch
->
harq_processes
[
i
]
->
d
[
r
],(
3
*
8448
)
*
sizeof
(
short
));
free16
(
dlsch
->
harq_processes
[
i
]
->
d
[
r
],(
3
*
8448
)
*
sizeof
(
short
));
dlsch
->
harq_processes
[
i
]
->
d
[
r
]
=
NULL
;
dlsch
->
harq_processes
[
i
]
->
d
[
r
]
=
NULL
;
}
}
for
(
r
=
0
;
r
<
(
MAX_NUM_NR_DLSCH_SEGMENTS
)
;
r
++
)
{
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
if
(
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]){
if
(
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]){
nrLDPC_free_mem
(
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]);
nrLDPC_free_mem
(
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]);
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
NULL
;
dlsch
->
harq_processes
[
i
]
->
p_nrLDPC_procBuf
[
r
]
=
NULL
;
...
@@ -164,7 +172,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
...
@@ -164,7 +172,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
}
}
printf
(
"new_ue_dlsch with size %zu: exit_flag = %u
\n
"
,
sizeof
(
NR_DL_UE_HARQ_t
),
exit_flag
);
printf
(
"new_ue_dlsch with size %zu: exit_flag = %u
\n
"
,
sizeof
(
NR_DL_UE_HARQ_t
),
exit_flag
);
free_nr_ue_dlsch
(
dlsch
);
free_nr_ue_dlsch
(
dlsch
,
N_RB_DL
);
return
(
NULL
);
return
(
NULL
);
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
View file @
94b7762b
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
\brief This function frees memory allocated for a particular DLSCH at UE
\brief This function frees memory allocated for a particular DLSCH at UE
@param dlsch Pointer to DLSCH to be removed
@param dlsch Pointer to DLSCH to be removed
*/
*/
void
free_nr_ue_dlsch
(
NR_UE_DLSCH_t
*
dlsch
);
void
free_nr_ue_dlsch
(
NR_UE_DLSCH_t
*
dlsch
,
uint8_t
N_RB_DL
);
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
\brief This function allocates structures for a particular DLSCH at UE
\brief This function allocates structures for a particular DLSCH at UE
...
@@ -61,7 +61,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch);
...
@@ -61,7 +61,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch);
NR_UE_DLSCH_t
*
new_nr_ue_dlsch
(
uint8_t
Kmimo
,
uint8_t
Mdlharq
,
uint32_t
Nsoft
,
uint8_t
max_turbo_iterations
,
uint8_t
N_RB_DL
,
uint8_t
abstraction_flag
);
NR_UE_DLSCH_t
*
new_nr_ue_dlsch
(
uint8_t
Kmimo
,
uint8_t
Mdlharq
,
uint32_t
Nsoft
,
uint8_t
max_turbo_iterations
,
uint8_t
N_RB_DL
,
uint8_t
abstraction_flag
);
void
free_nr_ue_ulsch
(
NR_UE_ULSCH_t
*
ulsch
);
void
free_nr_ue_ulsch
(
NR_UE_ULSCH_t
*
ulsch
,
unsigned
char
N_RB_UL
);
NR_UE_ULSCH_t
*
new_nr_ue_ulsch
(
unsigned
char
N_RB_UL
,
int
number_of_harq_pids
,
uint8_t
abstraction_flag
);
NR_UE_ULSCH_t
*
new_nr_ue_ulsch
(
unsigned
char
N_RB_UL
,
int
number_of_harq_pids
,
uint8_t
abstraction_flag
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
View file @
94b7762b
...
@@ -127,9 +127,9 @@ typedef struct {
...
@@ -127,9 +127,9 @@ typedef struct {
/// LDPC-code outputs
/// LDPC-code outputs
uint8_t
*
d
[
MAX_NUM_NR_ULSCH_SEGMENTS
];
uint8_t
*
d
[
MAX_NUM_NR_ULSCH_SEGMENTS
];
/// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17)
/// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17)
uint8_t
e
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)))
;
uint8_t
*
e
;
/// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30)
/// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30)
uint8_t
f
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)))
;
uint8_t
*
f
;
/// Number of code segments
/// Number of code segments
uint32_t
C
;
uint32_t
C
;
/// Number of bits in code segments
/// Number of bits in code segments
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
View file @
94b7762b
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
void
free_nr_ue_ulsch
(
NR_UE_ULSCH_t
*
ulsch
)
void
free_nr_ue_ulsch
(
NR_UE_ULSCH_t
*
ulsch
,
unsigned
char
N_RB_UL
)
{
{
int
i
,
r
;
int
i
,
r
;
...
@@ -51,18 +51,35 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
...
@@ -51,18 +51,35 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
printf
(
"Freeing ulsch %p
\n
"
,
ulsch
);
printf
(
"Freeing ulsch %p
\n
"
,
ulsch
);
#endif
#endif
uint16_t
a_segments
=
MAX_NUM_NR_ULSCH_SEGMENTS
;
//number of segments to be allocated
if
(
N_RB_UL
!=
273
)
{
a_segments
=
a_segments
*
N_RB_UL
;
a_segments
=
a_segments
/
273
;
}
uint16_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
if
(
ulsch
->
harq_processes
[
i
])
{
if
(
ulsch
->
harq_processes
[
i
])
{
if
(
ulsch
->
harq_processes
[
i
]
->
a
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
a
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
a
,
MAX_NR_ULSCH_PAYLOAD_BYTES
);
free16
(
ulsch
->
harq_processes
[
i
]
->
a
,
ulsch_bytes
);
ulsch
->
harq_processes
[
i
]
->
a
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
a
=
NULL
;
}
}
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
b
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
b
,
MAX_NR_ULSCH_PAYLOAD_BYTES
);
free16
(
ulsch
->
harq_processes
[
i
]
->
b
,
ulsch_bytes
);
ulsch
->
harq_processes
[
i
]
->
b
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
b
=
NULL
;
}
}
for
(
r
=
0
;
r
<
MAX_NUM_NR_ULSCH_SEGMENTS
;
r
++
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
e
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
e
,
14
*
N_RB_UL
*
12
*
8
);
ulsch
->
harq_processes
[
i
]
->
e
=
NULL
;
}
if
(
ulsch
->
harq_processes
[
i
]
->
f
)
{
free16
(
ulsch
->
harq_processes
[
i
]
->
f
,
14
*
N_RB_UL
*
12
*
8
);
ulsch
->
harq_processes
[
i
]
->
f
=
NULL
;
}
for
(
r
=
0
;
r
<
a_segments
;
r
++
)
{
if
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
])
{
if
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
])
{
free16
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
free16
(
ulsch
->
harq_processes
[
i
]
->
c
[
r
],((
r
==
0
)
?
8
:
0
)
+
3
+
768
);
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
ulsch
->
harq_processes
[
i
]
->
c
[
r
]
=
NULL
;
...
@@ -155,6 +172,20 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
...
@@ -155,6 +172,20 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
exit_flag
=
2
;
exit_flag
=
2
;
}
}
}
}
ulsch
->
harq_processes
[
i
]
->
e
=
(
uint8_t
*
)
malloc16
(
14
*
N_RB_UL
*
12
*
8
);
if
(
ulsch
->
harq_processes
[
i
]
->
e
)
{
bzero
(
ulsch
->
harq_processes
[
i
]
->
e
,
14
*
N_RB_UL
*
12
*
8
);
}
else
{
printf
(
"Can't get e
\n
"
);
exit_flag
=
1
;
}
ulsch
->
harq_processes
[
i
]
->
f
=
(
uint8_t
*
)
malloc16
(
14
*
N_RB_UL
*
12
*
8
);
if
(
ulsch
->
harq_processes
[
i
]
->
f
)
{
bzero
(
ulsch
->
harq_processes
[
i
]
->
f
,
14
*
N_RB_UL
*
12
*
8
);
}
else
{
printf
(
"Can't get f
\n
"
);
exit_flag
=
1
;
}
}
}
ulsch
->
harq_processes
[
i
]
->
subframe_scheduling_flag
=
0
;
ulsch
->
harq_processes
[
i
]
->
subframe_scheduling_flag
=
0
;
...
@@ -175,7 +206,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
...
@@ -175,7 +206,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
}
}
LOG_E
(
PHY
,
"new_ue_ulsch exit flag, size of %d , %zu
\n
"
,
exit_flag
,
sizeof
(
LTE_UE_ULSCH_t
));
LOG_E
(
PHY
,
"new_ue_ulsch exit flag, size of %d , %zu
\n
"
,
exit_flag
,
sizeof
(
LTE_UE_ULSCH_t
));
free_nr_ue_ulsch
(
ulsch
);
free_nr_ue_ulsch
(
ulsch
,
N_RB_UL
);
return
(
NULL
);
return
(
NULL
);
...
...
openair1/PHY/defs_gNB.h
View file @
94b7762b
...
@@ -112,11 +112,11 @@ typedef struct {
...
@@ -112,11 +112,11 @@ typedef struct {
/// MIMO mode for this DLSCH
/// MIMO mode for this DLSCH
MIMO_mode_t
mimo_mode
;
MIMO_mode_t
mimo_mode
;
/// Concatenated sequences
/// Concatenated sequences
uint8_t
e
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)))
;
uint8_t
*
e
;
/// LDPC-code outputs
/// LDPC-code outputs
uint8_t
*
d
[
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
*
d
[
MAX_NUM_NR_DLSCH_SEGMENTS
];
/// Interleaver outputs
/// Interleaver outputs
uint8_t
f
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)))
;
uint8_t
*
f
;
/// Number of code segments
/// Number of code segments
uint32_t
C
;
uint32_t
C
;
/// Number of bits in "small" code segments
/// Number of bits in "small" code segments
...
...
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
94b7762b
...
@@ -621,9 +621,9 @@ int main(int argc, char **argv)
...
@@ -621,9 +621,9 @@ int main(int argc, char **argv)
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
printf
(
"gNB %d
\n
"
,
i
);
printf
(
"gNB %d
\n
"
,
i
);
free_gNB_dlsch
(
gNB
->
dlsch
[
0
][
i
]);
free_gNB_dlsch
(
gNB
->
dlsch
[
0
][
i
]
,
N_RB_DL
);
printf
(
"UE %d
\n
"
,
i
);
printf
(
"UE %d
\n
"
,
i
);
free_nr_ue_dlsch
(
UE
->
dlsch
[
0
][
0
][
i
]);
free_nr_ue_dlsch
(
UE
->
dlsch
[
0
][
0
][
i
]
,
N_RB_DL
);
}
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
...
...
openair1/SIMULATION/NR_PHY/ulschsim.c
View file @
94b7762b
...
@@ -573,18 +573,18 @@ int main(int argc, char **argv)
...
@@ -573,18 +573,18 @@ int main(int argc, char **argv)
printf
(
"gNB ulsch[0][%d]
\n
"
,
i
);
// [hna] ulsch[0] is for RA
printf
(
"gNB ulsch[0][%d]
\n
"
,
i
);
// [hna] ulsch[0] is for RA
free_gNB_ulsch
(
gNB
->
ulsch
[
0
][
i
]);
free_gNB_ulsch
(
gNB
->
ulsch
[
0
][
i
]
,
N_RB_UL
);
printf
(
"gNB ulsch[%d][%d]
\n
"
,
UE_id
+
1
,
i
);
printf
(
"gNB ulsch[%d][%d]
\n
"
,
UE_id
+
1
,
i
);
free_gNB_ulsch
(
gNB
->
ulsch
[
UE_id
+
1
][
i
]);
free_gNB_ulsch
(
gNB
->
ulsch
[
UE_id
+
1
][
i
]
,
N_RB_UL
);
for
(
sf
=
0
;
sf
<
2
;
sf
++
)
{
for
(
sf
=
0
;
sf
<
2
;
sf
++
)
{
printf
(
"UE ulsch[%d][0][%d]
\n
"
,
sf
,
i
);
printf
(
"UE ulsch[%d][0][%d]
\n
"
,
sf
,
i
);
if
(
UE
->
ulsch
[
sf
][
0
][
i
])
if
(
UE
->
ulsch
[
sf
][
0
][
i
])
free_nr_ue_ulsch
(
UE
->
ulsch
[
sf
][
0
][
i
]);
free_nr_ue_ulsch
(
UE
->
ulsch
[
sf
][
0
][
i
]
,
N_RB_UL
);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
94b7762b
...
@@ -605,18 +605,18 @@ int main(int argc, char **argv)
...
@@ -605,18 +605,18 @@ int main(int argc, char **argv)
printf
(
"gNB ulsch[0][%d]
\n
"
,
i
);
// [hna] ulsch[0] is for RA
printf
(
"gNB ulsch[0][%d]
\n
"
,
i
);
// [hna] ulsch[0] is for RA
free_gNB_ulsch
(
gNB
->
ulsch
[
0
][
i
]);
free_gNB_ulsch
(
gNB
->
ulsch
[
0
][
i
]
,
N_RB_UL
);
printf
(
"gNB ulsch[%d][%d]
\n
"
,
UE_id
+
1
,
i
);
printf
(
"gNB ulsch[%d][%d]
\n
"
,
UE_id
+
1
,
i
);
free_gNB_ulsch
(
gNB
->
ulsch
[
UE_id
+
1
][
i
]);
// "+1" because first element in ulsch is for RA
free_gNB_ulsch
(
gNB
->
ulsch
[
UE_id
+
1
][
i
]
,
N_RB_UL
);
// "+1" because first element in ulsch is for RA
for
(
sf
=
0
;
sf
<
2
;
sf
++
)
{
for
(
sf
=
0
;
sf
<
2
;
sf
++
)
{
printf
(
"UE ulsch[%d][0][%d]
\n
"
,
sf
,
i
);
printf
(
"UE ulsch[%d][0][%d]
\n
"
,
sf
,
i
);
if
(
UE
->
ulsch
[
sf
][
0
][
i
])
if
(
UE
->
ulsch
[
sf
][
0
][
i
])
free_nr_ue_ulsch
(
UE
->
ulsch
[
sf
][
0
][
i
]);
free_nr_ue_ulsch
(
UE
->
ulsch
[
sf
][
0
][
i
]
,
N_RB_UL
);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
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