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
lizhongxiao
OpenXG-RAN
Commits
2423996b
Commit
2423996b
authored
3 years ago
by
Florian Kaltenberger
Committed by
Hongzhi Wang
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding some error checks
parent
00ba6b6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
55 deletions
+75
-55
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
+62
-43
openair1/PHY/CODING/nrLDPC_load.c
openair1/PHY/CODING/nrLDPC_load.c
+12
-11
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+1
-1
No files found.
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
View file @
2423996b
...
...
@@ -166,7 +166,7 @@ struct thread_params {
uint8_t
iter_count
;
double
iter_average
;
double
bler
;
struct
t_
nrLDPCoffload_params
*
p_offloadParams
;
struct
nrLDPCoffload_params
*
p_offloadParams
;
int8_t
*
p_out
;
rte_atomic16_t
nb_dequeued
;
rte_atomic16_t
processing_status
;
...
...
@@ -1574,46 +1574,60 @@ int32_t nrLDPC_decod_offload(t_nrLDPC_dec_params* p_decParams, uint8_t C, uint8_
if
(
mode
==
0
){
ret
=
rte_eal_init
(
argc_re
,
argv_re
);
device_setup
();
ut_setup
();
p_offloadParams
->
E
=
E
;
p_offloadParams
->
n_cb
=
(
p_decParams
->
BG
==
1
)
?
(
66
*
p_decParams
->
Z
)
:
(
50
*
p_decParams
->
Z
);
p_offloadParams
->
BG
=
p_decParams
->
BG
;
p_offloadParams
->
Z
=
p_decParams
->
Z
;
p_offloadParams
->
rv
=
rv
;
p_offloadParams
->
F
=
F
;
p_offloadParams
->
Qm
=
Qm
;
//struct test_op_params *op_params = rte_zmalloc(NULL,
op_params
=
rte_zmalloc
(
NULL
,
ret
=
rte_eal_init
(
argc_re
,
argv_re
);
if
(
ret
<
0
)
{
printf
(
"Could not init EAL, ret %d
\n
"
,
ret
);
return
(
-
1
);
}
ret
=
device_setup
();
if
(
ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't create mempools"
);
return
(
-
1
);
}
ret
=
ut_setup
();
if
(
ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't create mempools"
);
return
(
-
1
);
}
p_offloadParams
->
E
=
E
;
p_offloadParams
->
n_cb
=
(
p_decParams
->
BG
==
1
)
?
(
66
*
p_decParams
->
Z
)
:
(
50
*
p_decParams
->
Z
);
p_offloadParams
->
BG
=
p_decParams
->
BG
;
p_offloadParams
->
Z
=
p_decParams
->
Z
;
p_offloadParams
->
rv
=
rv
;
p_offloadParams
->
F
=
F
;
p_offloadParams
->
Qm
=
Qm
;
//struct test_op_params *op_params = rte_zmalloc(NULL,
op_params
=
rte_zmalloc
(
NULL
,
sizeof
(
struct
test_op_params
),
RTE_CACHE_LINE_SIZE
);
TEST_ASSERT_NOT_NULL
(
op_params
,
"Failed to alloc %zuB for op_params"
,
RTE_ALIGN
(
sizeof
(
struct
test_op_params
),
RTE_CACHE_LINE_SIZE
));
int
socket_id
;
int
f_ret
;
struct
rte_bbdev_info
info
;
rte_bbdev_info_get
(
ad
->
dev_id
,
&
info
);
socket_id
=
GET_SOCKET
(
info
.
socket_id
);
enum
rte_bbdev_op_type
op_type
=
RTE_BBDEV_OP_LDPC_DEC
;
f_ret
=
create_mempools
(
ad
,
socket_id
,
op_type
,
get_num_ops
(),
p_offloadParams
);
if
(
f_ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't create mempools"
);
}
f_ret
=
init_test_op_params
(
op_params
,
op_type
,
0
,
0
,
ad
->
ops_mempool
,
1
,
get_num_ops
(),
get_num_lcores
());
if
(
f_ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't init test op params"
);
}
TEST_ASSERT_NOT_NULL
(
op_params
,
"Failed to alloc %zuB for op_params"
,
RTE_ALIGN
(
sizeof
(
struct
test_op_params
),
RTE_CACHE_LINE_SIZE
));
int
socket_id
;
int
f_ret
;
struct
rte_bbdev_info
info
;
rte_bbdev_info_get
(
ad
->
dev_id
,
&
info
);
socket_id
=
GET_SOCKET
(
info
.
socket_id
);
enum
rte_bbdev_op_type
op_type
=
RTE_BBDEV_OP_LDPC_DEC
;
f_ret
=
create_mempools
(
ad
,
socket_id
,
op_type
,
get_num_ops
(),
p_offloadParams
);
if
(
f_ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't create mempools"
);
return
(
-
1
);
}
f_ret
=
init_test_op_params
(
op_params
,
op_type
,
0
,
0
,
ad
->
ops_mempool
,
1
,
get_num_ops
(),
get_num_lcores
());
if
(
f_ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't init test op params"
);
return
(
-
1
);
}
}
else
{
...
...
@@ -1659,15 +1673,20 @@ int32_t nrLDPC_decod_offload(t_nrLDPC_dec_params* p_decParams, uint8_t C, uint8_
socket_id
);
if
(
f_ret
!=
TEST_SUCCESS
)
{
printf
(
"Couldn't init queue buffers"
);
return
(
-
1
);
}
}
start_pmd_dec
(
ad
,
op_params
,
p_offloadParams
,
p_out
);
ret
=
start_pmd_dec
(
ad
,
op_params
,
p_offloadParams
,
p_out
);
if
(
ret
<
0
)
{
printf
(
"Couldn't start pmd dec"
);
return
(
-
1
);
}
//
free_buffers(ad, op_params);
//
free_buffers(ad, op_params);
//
rte_free(op_params);
//
rte_free(op_params);
}
//ut_teardown();
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_load.c
View file @
2423996b
...
...
@@ -87,17 +87,18 @@ int load_nrLDPClib_offload(void) {
p_decParams
->
Z
=
384
;
p_decParams
->
BG
=
1
;
nrLDPC_decoder_offload
(
p_decParams
,
1
,
0
,
0
,
25344
,
8
,
l
,
llrProcBuf
,
0
);
return
0
;
AssertFatal
(
nrLDPC_decoder_offload
(
p_decParams
,
1
,
0
,
0
,
25344
,
8
,
l
,
llrProcBuf
,
0
)
>
0
,
"error loading LDPC decoder offload library
\n
"
);
return
0
;
}
int
load_nrLDPClib_ref
(
char
*
libversion
,
nrLDPC_encoderfunc_t
*
nrLDPC_encoder_ptr
)
{
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
2423996b
...
...
@@ -647,7 +647,7 @@ int main(int argc, char **argv)
get_softmodem_params
()
->
do_ra
=
0
;
get_softmodem_params
()
->
usim_test
=
1
;
load_nrLDPClib_offload
();
//
load_nrLDPClib_offload();
if
(
snr1set
==
0
)
snr1
=
snr0
+
10
;
...
...
This diff is collapsed.
Click to expand it.
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