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
ao gleen
OpenXG-RAN
Commits
8756afdb
Commit
8756afdb
authored
Oct 09, 2024
by
Yi-Hung Chang
Committed by
Romain Beurdouche
Dec 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(nrLDPC_coding_interface): Add ldpc_xdma coding library
parent
73770da5
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1450 additions
and
2 deletions
+1450
-2
CMakeLists.txt
CMakeLists.txt
+25
-1
cmake_targets/build_oai
cmake_targets/build_oai
+1
-1
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
...ING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
+455
-0
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.c
...PC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.c
+783
-0
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h
...PC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h
+67
-0
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/xdma_diag.h
...1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/xdma_diag.h
+119
-0
No files found.
CMakeLists.txt
View file @
8756afdb
...
...
@@ -508,6 +508,19 @@ endif()
##########################################################
# LDPC offload library - XDMA
##########################################################
add_boolean_option
(
ENABLE_LDPC_XDMA OFF
"Build support for LDPC Offload to XDMA library"
OFF
)
if
(
ENABLE_LDPC_XDMA
)
set
(
PHY_NRLDPC_CODING_XDMA_SRC
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_load.c
)
add_library
(
ldpc_xdma MODULE
${
PHY_NRLDPC_CODING_XDMA_SRC
}
)
endif
()
include_directories
(
"
${
OPENAIR_DIR
}
/radio/COMMON"
)
##############################################################
...
...
@@ -2065,6 +2078,10 @@ if (ENABLE_LDPC_T2)
add_dependencies
(
nr-softmodem ldpc_t2
)
endif
()
if
(
ENABLE_LDPC_XDMA
)
add_dependencies
(
nr-softmodem ldpc_xdma
)
endif
()
# force the generation of ASN.1 so that we don't need to wait during the build
target_link_libraries
(
nr-softmodem PRIVATE
asn1_lte_rrc asn1_nr_rrc asn1_s1ap asn1_ngap asn1_m2ap asn1_m3ap asn1_x2ap asn1_f1ap asn1_lpp
)
...
...
@@ -2126,6 +2143,10 @@ if (ENABLE_LDPC_T2)
add_dependencies
(
nr-uesoftmodem ldpc_t2
)
endif
()
if
(
ENABLE_LDPC_XDMA
)
add_dependencies
(
nr-uesoftmodem ldpc_xdma
)
endif
()
# force the generation of ASN.1 so that we don't need to wait during the build
target_link_libraries
(
nr-uesoftmodem PRIVATE
asn1_lte_rrc asn1_nr_rrc asn1_s1ap asn1_ngap asn1_m2ap asn1_m3ap asn1_x2ap asn1_f1ap asn1_lpp
)
...
...
@@ -2283,6 +2304,9 @@ add_executable(nr_ulsim
if
(
ENABLE_LDPC_T2
)
add_dependencies
(
nr_ulsim ldpc_t2
)
endif
()
if
(
ENABLE_LDPC_XDMA
)
add_dependencies
(
nr_ulsim ldpc_xdma
)
endif
()
add_dependencies
(
nr_ulsim ldpc_slot_segment
)
target_link_libraries
(
nr_ulsim PRIVATE
...
...
@@ -2350,7 +2374,7 @@ if (${T_TRACER})
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_cl ldpc_cuda ldpc ldpc_slot_segment ldpc_t2
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_cl ldpc_cuda ldpc ldpc_slot_segment ldpc_t2
ldpc_xdma
dfts config_internals nr_common
)
if
(
TARGET
${
i
}
)
add_dependencies
(
${
i
}
generate_T
)
...
...
cmake_targets/build_oai
View file @
8756afdb
...
...
@@ -46,7 +46,7 @@ BUILD_DOXYGEN=0
DISABLE_HARDWARE_DEPENDENCY
=
"False"
CMAKE_BUILD_TYPE
=
"RelWithDebInfo"
CMAKE_CMD
=
"
$CMAKE
"
OPTIONAL_LIBRARIES
=
"telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t2 websrv oai_iqplayer imscope"
OPTIONAL_LIBRARIES
=
"telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t2
ldpc_xdma
websrv oai_iqplayer imscope"
TARGET_LIST
=
""
BUILD_TOOL_OPT
=
"-j
$(
nproc
)
"
...
...
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
0 → 100644
View file @
8756afdb
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.c
0 → 100644
View file @
8756afdb
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h
0 → 100644
View file @
8756afdb
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* -------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h
* \briefFPGA accelerator integrated into OAI (for one and multi code block)
* \author Sendren Xu, SY Yeh(fdragon), Hongming, Terng-Yin Hsu
* \date 2022-05-31
* \version 5.0
* \email: summery19961210@gmail.com
*/
#ifndef __NRLDPC_CODING_XDMA_OFFLOAD__H_
#define __NRLDPC_CODING_XDMA_OFFLOAD__H_
#include <stdint.h>
#define DEVICE_NAME_DEFAULT_USER "/dev/xdma0_user"
#define DEVICE_NAME_DEFAULT_ENC_READ "/dev/xdma0_c2h_1"
#define DEVICE_NAME_DEFAULT_ENC_WRITE "/dev/xdma0_h2c_1"
#define DEVICE_NAME_DEFAULT_DEC_READ "/dev/xdma0_c2h_0"
#define DEVICE_NAME_DEFAULT_DEC_WRITE "/dev/xdma0_h2c_0"
/**
\brief LDPC input parameter
\param Zc shifting size
\param Rows
\param baseGraph base graph
\param CB_num number of code block
\param numChannelLlrs input soft bits length, Zc x 66 - length of filler bits
\param numFillerBits filler bits length
*/
typedef
struct
{
char
*
user_device
,
*
enc_write_device
,
*
enc_read_device
,
*
dec_write_device
,
*
dec_read_device
;
unsigned
char
max_schedule
;
unsigned
char
SetIdx
;
int
Zc
;
unsigned
char
numCB
;
unsigned
char
BG
;
unsigned
char
max_iter
;
int
nRows
;
int
numChannelLls
;
int
numFillerBits
;
}
DecIFConf
;
int
nrLDPC_decoder_FPGA_PYM
(
uint8_t
*
buf_in
,
uint8_t
*
buf_out
,
DecIFConf
dec_conf
);
#endif // __NRLDPC_CODING_XDMA_OFFLOAD__H_
openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/xdma_diag.h
0 → 100644
View file @
8756afdb
/*
* Copyright (c) 2016-present, Xilinx, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license
* the terms of the BSD Licence are reported below:
*
* BSD License
*
* For Xilinx DMA IP software
*
* Copyright (c) 2016-present, Xilinx, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name Xilinx nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MODULES_TXCTRL_INC_XDMA_DIAG_H_
#define MODULES_TXCTRL_INC_XDMA_DIAG_H_
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
unsigned
char
max_schedule
;
// max_schedule = 0;
unsigned
char
mb
;
// mb = 32;
unsigned
char
CB_num
;
// id = CB_num;
unsigned
char
BGSel
;
// bg = 1;
unsigned
char
z_set
;
// z_set = 0;
unsigned
char
z_j
;
// z_j = 6;
unsigned
char
max_iter
;
// max_iter = 8;
unsigned
char
SetIdx
;
// sc_idx = 12;
}
DecIPConf
;
typedef
struct
{
int
SetIdx
;
int
NumCBSegm
;
int
PayloadLen
;
int
Z
;
int
z_set
;
int
z_j
;
int
Kbmax
;
int
BGSel
;
unsigned
mb
;
unsigned
char
CB_num
;
unsigned
char
kb_1
;
}
EncIPConf
;
typedef
struct
{
char
*
user_device
,
*
enc_write_device
,
*
enc_read_device
,
*
dec_write_device
,
*
dec_read_device
;
}
devices_t
;
/* ltoh: little to host */
/* htol: little to host */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define ltohl(x) (x)
#define ltohs(x) (x)
#define htoll(x) (x)
#define htols(x) (x)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define ltohl(x) __bswap_32(x)
#define ltohs(x) __bswap_16(x)
#define htoll(x) __bswap_32(x)
#define htols(x) __bswap_16(x)
#endif
#define MAP_SIZE (32 * 1024UL)
#define MAP_MASK (MAP_SIZE - 1)
#define SIZE_DEFAULT (32)
#define COUNT_DEFAULT (1)
#define OFFSET_DEC_IN 0x0000
#define OFFSET_DEC_OUT 0x0004
#define OFFSET_ENC_IN 0x0008
#define OFFSET_ENC_OUT 0x000c
#define OFFSET_RESET 0x0020
#define PCIE_OFF 0x0030
#define CB_PROCESS_NUMBER 24 // add by JW
#define CB_PROCESS_NUMBER_Dec 24
// dma_from_device.c
int
test_dma_enc_read
(
char
*
EncOut
,
EncIPConf
Confparam
);
int
test_dma_enc_write
(
char
*
data
,
EncIPConf
Confparam
);
int
test_dma_dec_read
(
char
*
DecOut
,
DecIPConf
Confparam
);
int
test_dma_dec_write
(
char
*
data
,
DecIPConf
Confparam
);
void
test_dma_init
(
devices_t
devices
);
void
test_dma_shutdown
();
void
dma_reset
(
devices_t
devices
);
#ifdef __cplusplus
}
#endif
#endif
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