Merge branch 'integration_2026_w15' into 'develop'

Integration `2026.w15`

* !4014 Microamp FR2 configuration file and documentation
* !4029 nr rlc: tolerate bogus data
* !4032 build_oai fixes: harmonize duplicate options, remove wrong --build-lib handling
* !3977 Further unused arguments cleanup
* !4009 Fix for NULL pucch-ResourceCommon at MSG4
* !4037 Increase reliability of ltebox start
* !4034 Prevent infinite loop on Single Entry PHR handling
* !4038 doc(record_db): explain how to use record_db
* fix compilation of T tracers with 'make'
* !3489 Thread-pool support for TX symbol processing.

See merge request oai/openairinterface5g!4033
This commit is contained in:
Jaroslava Fiedlerova
2026-04-10 08:17:46 +00:00
192 changed files with 1801 additions and 1331 deletions
+3 -3
View File
@@ -143,7 +143,7 @@ ltebox-nano:
- "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'"
- "sleep 1"
- "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &"
- "sleep 1"
- "sleep 2"
Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen"
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%"
@@ -154,7 +154,7 @@ sabox-nepes:
- "sudo su -c 'screen -dm -S simulated_5g_hss /opt/hss_sim0609/start_5g_hss'"
- "sleep 1"
- "sudo /opt/ltebox/tools/start_sabox < /dev/null &> /dev/null"
- "sleep 1"
- "sleep 2"
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{amfLog.0,ngapcLog.0,ngapcommonLog.0,ngapsLog.0,xGwLog.0,upfLog.0} %%log_dir%%"
Undeploy: "sudo /opt/ltebox/tools/stop_sabox; sudo killall screen"
@@ -165,7 +165,7 @@ ltebox-nepes:
- "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'"
- "sleep 1"
- "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &"
- "sleep 1"
- "sleep 2"
Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen"
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%"
+7 -26
View File
@@ -4,8 +4,6 @@
# file build_oai
# brief OAI automated build tool that can be used to install, compile, run OAI.
set -e
# Include helper functions
THIS_SCRIPT_PATH=$(dirname $(readlink -f "$0"))
source "$THIS_SCRIPT_PATH"/tools/build_helper
@@ -132,16 +130,9 @@ function main() {
--build-tool-opt)
BUILD_TOOL_OPT+=" $2"
shift 2;;
-c | --clean)
-c | --clean | -C | --clean-all)
CLEAN=1
shift;;
-C | --clean-all)
CLEAN_ALL=1
shift;;
--clean-kernel)
clean_kernel
echo_info "Erased iptables config and removed modules from kernel"
shift;;
--cmake-opt)
CMAKE_CMD="$CMAKE_CMD $2"
shift 2;;
@@ -330,8 +321,8 @@ function main() {
echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)"
else
for reqlib in $2; do
lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w $reqlib) # search given parameter in list
[[ $? -ne 0 ]] && echo_fatal "Unknown optional library in $reqlib, valid libraries are $OPTIONAL_LIBRARIES"
lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w -- $reqlib) # search given parameter in list
[[ $? -ne 0 ]] && echo_fatal "Unknown optional library \"$reqlib\", valid libraries are: $OPTIONAL_LIBRARIES"
TARGET_LIST="$TARGET_LIST $lib" # will append the found library
CMAKE_CMD="$CMAKE_CMD -DENABLE_${lib^^}=ON"
echo_info "Enabling build of optional shared library $lib"
@@ -384,13 +375,8 @@ function main() {
echo "OPENAIR_DIR = $OPENAIR_DIR"
if [ "$CLEAN_ALL" = "1" ] ; then
clean_all_files
echo "Erased all previously producted files"
fi
dlog=$OPENAIR_DIR/cmake_targets/log
mkdir -p $dlog
DIR=$OPENAIR_DIR/cmake_targets
[ "$CLEAN" = "1" ] && rm -rf "$DIR/$BUILD_DIR"
if [ "$INSTALL_EXTERNAL" = "1" ] ; then
echo_info "Installing packages"
@@ -423,10 +409,6 @@ function main() {
check_install_additional_tools
fi
DIR=$OPENAIR_DIR/cmake_targets
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
if [[ $TARGET_LIST != "" ]] && [[ -f $OPENAIR_DIR/CMakeLists.txt ]]; then
# add some default libraries that should always be built
# for eNB, gNB, UEs, simulators
@@ -441,11 +423,10 @@ function main() {
# e.g., cmake_targets/ran_build/build, hence the ../../..
CMAKE_CMD="$CMAKE_CMD ../../.."
echo_info "Running \"$CMAKE_CMD\""
eval $CMAKE_CMD
eval $CMAKE_CMD || echo_fatal "cmake configuration failed"
cmd="$CMAKE --build . --target ${TARGET_LIST} -- ${BUILD_TOOL_OPT}"
echo_info "Running \"${cmd}\"" $green
eval $cmd
ret=$?
eval $cmd || echo_fatal "build failed"
if [ "$UE" = 1 ] ; then
echo_info "Generate LTE USIM default sim content UE specific part"
+1 -1
View File
@@ -83,7 +83,7 @@ function(run_asn1c ASN1C_GRAMMAR ASN1C_PREFIX)
get_filename_component(GRAMMAR_FILE ${ASN1C_GRAMMAR} NAME)
set(LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/${GRAMMAR_FILE}.log")
add_custom_command(OUTPUT ${ASN1C_OUTPUT}
COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || cat ${LOGFILE}
COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || ( cat ${LOGFILE} && false )
DEPENDS ${ASN1C_GRAMMAR}
COMMENT "Generating ${ASN1C_COMMENT} from ${GRAMMAR_FILE}"
)
-26
View File
@@ -120,32 +120,6 @@ handler_EXIT() {
trap handler_EXIT EXIT
###########################
# Cleaners
###########################
clean_kernel() {
$SUDO modprobe ip_tables
$SUDO modprobe x_tables
$SUDO iptables -P INPUT ACCEPT
$SUDO iptables -F INPUT
$SUDO iptables -P OUTPUT ACCEPT
$SUDO iptables -F OUTPUT
$SUDO iptables -P FORWARD ACCEPT
$SUDO iptables -F FORWARD
$SUDO iptables -t nat -F
$SUDO iptables -t mangle -F
$SUDO iptables -t filter -F
$SUDO iptables -t raw -F
echo_info "Flushed iptables"
}
clean_all_files() {
set_openair_env
dir=$OPENAIR_DIR/cmake_targets
rm -rf $dir/ran_build $dir/ran_build_noLOG
}
############################################
# External packages installers
############################################
+6 -6
View File
@@ -133,7 +133,7 @@ int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoption
return status;
}
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
@@ -193,7 +193,7 @@ int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgo
return status;
}
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
@@ -229,7 +229,7 @@ int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions
return 0;
}
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
@@ -333,13 +333,13 @@ int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoptio
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
return config_setdefault_intlist(cfg, cfgoption, prefix);
return config_setdefault_intlist(cfg, cfgoption);
case TYPE_DOUBLE:
return config_setdefault_double(cfg, cfgoption, prefix);
return config_setdefault_double(cfg, cfgoption);
case TYPE_IPV4ADDR:
return config_setdefault_ipv4addr(cfg, cfgoption, prefix);
return config_setdefault_ipv4addr(cfg, cfgoption);
case TYPE_LIST:
// No default value for list type
+3 -3
View File
@@ -20,11 +20,11 @@ void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
/* functions to set a parameter to its default value */
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val);
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, const char *prefix);
+7 -3
View File
@@ -123,6 +123,10 @@ int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
int numparams,
const char *prefix)
{
UNUSED(cfg);
UNUSED(params);
UNUSED(numparams);
UNUSED(prefix);
ParamList->numelt = 0;
return 0;
}
@@ -162,15 +166,15 @@ int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_intlist(cfg, &cfgoptions[i]);
break;
case TYPE_DOUBLE:
defval = config_setdefault_double(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_double(cfg, &cfgoptions[i]);
break;
case TYPE_IPV4ADDR:
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i]);
break;
default:
+3
View File
@@ -177,6 +177,7 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
return -1;
@@ -212,6 +213,7 @@ int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
return 0;
}
@@ -234,6 +236,7 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
return -1;
+1
View File
@@ -158,6 +158,7 @@ extern "C" int config_yaml_init(configmodule_interface_t *cfg)
extern "C" void config_yaml_end(configmodule_interface_t *cfg)
{
UNUSED(cfg);
delete config_yaml::config;
}
+3
View File
@@ -241,6 +241,9 @@ typedef struct protocol_ctxt_s {
bool brOption;
} protocol_ctxt_t;
/// suppress compiler warning for unused arguments
#define UNUSED(x) (void)x;
#define UE_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD + RC.nb_inst
#define ENB_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD
#define UE_INSTANCE_TO_MODULE_ID(iNSTANCE) iNSTANCE - RC.nb_inst
+5 -9
View File
@@ -519,13 +519,7 @@ void logTerm(void)
}
#include <sys/syscall.h>
static inline int log_header(log_component_t *c,
char *log_buffer,
int buffsize,
const char *file,
const char *func,
int line,
int level)
static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, const char *func, int line, int level)
{
int flag = g_log->flag;
@@ -666,7 +660,7 @@ void log_dump(int component,
if (wbuf != NULL) {
va_start(args, format);
int pos=log_header(c, wbuf,MAX_LOG_TOTAL,"noFile","noFunc",0, OAILOG_INFO);
int pos = log_header(c, wbuf, MAX_LOG_TOTAL, "noFunc", 0, OAILOG_INFO);
pos+=vsprintf(wbuf+pos,format, args);
va_end(args);
@@ -875,6 +869,8 @@ void flush_mem_to_file(void)
static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args)
{
UNUSED(comp);
UNUSED(file);
//logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
int len = 0;
/* The main difference with the version above is the use of this local log_buffer.
@@ -887,7 +883,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
// make sure that for log trace the extra info is only printed once, reset when the level changes
if (level < OAILOG_TRACE) {
int n = log_header(c, log_buffer+len, sizeof(log_buffer), file, func, line, level);
int n = log_header(c, log_buffer+len, sizeof(log_buffer), func, line, level);
if (n > 0) {
len += n;
if (len > sizeof(log_buffer)) {
+1
View File
@@ -14,6 +14,7 @@ It is made of two main parts:
* [Basic usage](./T/basic.md)
* [Record](./T/record.md)
* [Record to ClickHouse](./T/record_db.md)
* [Replay](./T/replay.md)
* [Multiple tracers](./T/multi.md)
* [MAC PDUs and wireshark](./T/wireshark.md)
+177
View File
@@ -0,0 +1,177 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
# Record to ClickHouse
This document describes the database-backed T tracer. Unlike [`record`](./record.md),
which writes a `.raw` file, `record_db` writes T tracer events
directly into a [ClickHouse database](https://clickhouse.com/docs/intro).
## What `record_db` does
`record_db` connects to a running OAI softmodem instance through
the standard T tracer TCP interface and:
- Enables the selected events
- Creates one ClickHouse table per enabled event
- Batches received rows and inserts them into ClickHouse
Each table always contains:
- `TsSwNs`: software receive timestamp created by `record_db`
If an event has both `frame` and `slot` (or `subframe`) fields, the
tool also adds:
- `TsTxUtcNs`: transmission timestamp reconstructed from frame/slot
The remaining columns come from the event definition in
`T_messages.txt`.
## Build
`record_db` pulls external dependencies (`clickhouse-cpp` and `fmtlog`).
Also make sure you have `libzstd-dev` version > 1.5.X.
From the repository using build_oai:
```shell
cd cmake_targets
./build_oai --gNB --nrUE --cmake-opt -DT_RECORD_DB=ON
```
Or, from an existing build directory using cmake:
```shell
cd cmake_targets/ran_build/build
cmake -DT_RECORD_DB=ON .
make T_tools
```
The binary is then available in:
```shell
cmake_targets/ran_build/build/common/utils/T/tracer/record_db
```
## Prerequisites
- a running ClickHouse server reachable from `record_db`
- an OAI softmodem started with T tracer enabled, typically with `--T_stdout 2`
- the tracer message description file, usually `common/utils/T/T_messages.txt`
By default `record_db` connects to:
- T tracer endpoint: `127.0.0.1:2021`
- ClickHouse native endpoint: `localhost:9000`
- ClickHouse database: `oai`
## Start the softmodem
Start the gNB or UE with T tracer enabled as described in
[basic usage](./basic.md). For example:
```shell
cd cmake_targets/ran_build/build
sudo ./nr-softmodem -O <config-file> --T_stdout 2 --T_nowait
```
Use `--T_port <port>` on the softmodem side if you want a port other
than `2021`, and pass the same value to `record_db` with `-p`.
## Basic example
To enable all events except the most verbose groups and write them to
ClickHouse:
```shell
cd cmake_targets/ran_build/build/common/utils/T/tracer
./record_db -d ../T_messages.txt \
-ON \
-off VCD \
-off HEAVY \
-off LEGACY_GROUP_TRACE \
-off LEGACY_GROUP_DEBUG
```
To stop recording, press `Ctrl-C`. The tool flushes pending buffered
rows before exiting.
## Select specific events
The event selection rules are the same as for [`record`](./record.md):
- `-ON` enables all events
- `-OFF` disables all events
- `-on <GROUP or ID>` enables one group or one event
- `-off <GROUP or ID>` disables one group or one event
These options are processed in order. For example:
```shell
./record_db -d ../T_messages.txt -OFF -on GNB_PHY_UL_FD_PUSCH_IQ -on GNB_PHY_UL_PAYLOAD_RX_BITS
```
This starts from everything disabled and enables only the two listed
events.
## ClickHouse options
`record_db` accepts the following database-related options:
```shell
-ch-host <host> ClickHouse host, default `localhost`
-ch-port <port> ClickHouse native port, default `9000`
-ch-db <database> database name, default `oai`
-ch-user <user> optional ClickHouse user
-ch-pass <password> optional ClickHouse password
-ch-droptables drop the target database before starting
-debug enable debug logging
```
Example using a remote ClickHouse instance:
```shell
./record_db -d ../T_messages.txt \
-ON -off HEAVY \
-ip 192.168.1.10 -p 2021 \
-ch-host 192.168.1.20 -ch-port 9000 -ch-db oai_traces
```
## Inspect the data
Once `record_db` is running, connect to ClickHouse and inspect the
generated tables:
```shell
clickhouse-client --host localhost --port 9000 --query "SHOW TABLES FROM oai"
```
Count rows in one event table:
```shell
clickhouse-client --host localhost --port 9000 --query "SELECT count(*) FROM oai.GNB_PHY_UL_FD_PUSCH_IQ"
```
Inspect the latest samples:
```shell
clickhouse-client --host localhost --port 9000 --query "SELECT * FROM oai.GNB_PHY_UL_FD_PUSCH_IQ ORDER BY TsSwNs DESC LIMIT 5"
```
## Important behavior
- Tables are created only for enabled events.
- Table names match the event names from `T_messages.txt`.
- The current implementation creates tables with ClickHouse
`ENGINE = Memory()`.
- Because of that engine choice, recorded data remains available while
ClickHouse is running, but is not persistent across a ClickHouse
restart.
- If `-ch-droptables` is used, the whole target database is dropped and
recreated before capture starts.
## Get the full option list
```shell
./record_db -h
```
+1
View File
@@ -89,6 +89,7 @@ static int get_message(int s)
static void *T_receive_thread(void *_)
{
UNUSED(_);
int err = 0;
while (!err) err = get_message(T_socket);
+4
View File
@@ -27,6 +27,10 @@
*/
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(file);
UNUSED(function);
UNUSED(line);
UNUSED(s);
if (assert) {
abort();
} else {
+1 -1
View File
@@ -428,7 +428,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
for (i = 0; i < 8; i++)
timeline_set_subline_background_color(g, timeline_plot, i,
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
timeview = new_view_time(3600, 10, g, timeline_plot);
timeview = new_view_time(10, g, timeline_plot);
/* DL tick logging */
timelog = new_timelog(h, database, "ENB_PHY_DL_TICK");
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
+3 -2
View File
@@ -41,6 +41,7 @@ int eval_eq(struct filter *f, event e)
int eval_int(struct filter *f, event e)
{
UNUSED(e);
return f->v.v;
}
@@ -152,9 +153,9 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
return ret;
}
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
void *priv, filter *x)
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x)
{
UNUSED(database);
struct filter *ret = calloc(1, sizeof(struct filter));
if (ret == NULL) abort();
ret->eval = eval_evfun;
+1 -4
View File
@@ -13,11 +13,8 @@ filter *filter_and(filter *a, filter *b);
filter *filter_eq(filter *a, filter *b);
filter *filter_int(int v);
filter *filter_evarg(void *database, char *event_name, char *varname);
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
void *priv, filter *x);
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x);
int filter_eval(filter *f, event e);
void free_filter(filter *f);
#endif /* _FILTER_H_ */
+5 -4
View File
@@ -52,8 +52,7 @@ event_handler *new_handler(void *database)
return ret;
}
unsigned long register_handler_function(event_handler *_h, int event_id,
void (*f)(void *, event), void *p)
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p)
{
struct _event_handler *h = _h;
unsigned long ret = h->next_id;
@@ -78,9 +77,11 @@ unsigned long register_handler_function(event_handler *_h, int event_id,
return ret;
}
void remove_handler_function(event_handler *h, int event_id,
unsigned long handler_id)
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id)
{
UNUSED(h);
UNUSED(event_id);
UNUSED(handler_id);
printf("%s:%d: TODO\n", __FILE__, __LINE__);
abort();
}
+2 -5
View File
@@ -11,10 +11,7 @@ typedef void event_handler;
event_handler *new_handler(void *database);
void handle_event(event_handler *h, event e);
unsigned long register_handler_function(event_handler *_h, int event_id,
void (*f)(void *, event), void *p);
void remove_handler_function(event_handler *h, int event_id,
unsigned long handler_id);
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p);
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id);
#endif /* _HANDLER_H_ */
+1 -1
View File
@@ -7,7 +7,7 @@
#include "handler.h"
#include "database.h"
#include "view/view.h"
#include "utils.h"
#include "../utils.h"
#include "filter/filter.h"
#include <stdlib.h>
#include <string.h>
+11 -12
View File
@@ -406,7 +406,7 @@ void sr(void *_d, event e)
void trace_nr(struct timespec sending_time, ev_data *d, int direction,
int rnti_type, int rnti, int frame, int slot, int harq_pid, void *buf,
int bufsize, int preamble)
int bufsize)
{
ssize_t ret;
int i;
@@ -475,7 +475,7 @@ void nr_ul(void *_d, event e)
NR_C_RNTI, e.e[d->nr_ul_rnti].i,
e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i,
e.e[d->nr_ul_harq_pid].i, e.e[d->nr_ul_data].b,
e.e[d->nr_ul_data].bsize, NO_PREAMBLE);
e.e[d->nr_ul_data].bsize);
}
void nr_dl(void *_d, event e)
@@ -494,7 +494,7 @@ void nr_dl(void *_d, event e)
e.e[d->nr_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
e.e[d->nr_dl_rnti].i, e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i,
e.e[d->nr_dl_harq_pid].i, e.e[d->nr_dl_data].b,
e.e[d->nr_dl_data].bsize, NO_PREAMBLE);
e.e[d->nr_dl_data].bsize);
}
void nr_dl_retx(void *_d, event e)
@@ -505,7 +505,7 @@ void nr_dl_retx(void *_d, event e)
NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i,
e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i,
e.e[d->nr_dl_retx_harq_pid].i, e.e[d->nr_dl_retx_data].b,
e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE);
e.e[d->nr_dl_retx_data].bsize);
}
void nr_mib(void *_d, event e)
@@ -520,7 +520,7 @@ void nr_mib(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, 0 /* harq pid */,
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE);
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize);
}
void nr_ue_mib(void *_d, event e)
@@ -535,7 +535,7 @@ void nr_ue_mib(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
e.e[d->nr_ue_mib_frame].i, e.e[d->nr_ue_mib_slot].i, 0 /* harq pid */,
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize);
}
void nr_rar(void *_d, event e)
@@ -545,7 +545,7 @@ void nr_rar(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK,
NR_RA_RNTI, e.e[d->nr_rar_rnti].i,
e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, 0 /* harq pid */,
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE);
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize);
}
void nr_ue_ul(void *_d, event e)
@@ -556,7 +556,7 @@ void nr_ue_ul(void *_d, event e)
NR_C_RNTI, e.e[d->nr_ue_ul_rnti].i,
e.e[d->nr_ue_ul_frame].i, e.e[d->nr_ue_ul_slot].i,
e.e[d->nr_ue_ul_harq_pid].i, e.e[d->nr_ue_ul_data].b,
e.e[d->nr_ue_ul_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_ul_data].bsize);
}
void nr_ue_dl(void *_d, event e)
@@ -575,7 +575,7 @@ void nr_ue_dl(void *_d, event e)
e.e[d->nr_ue_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
e.e[d->nr_ue_dl_rnti].i, e.e[d->nr_ue_dl_frame].i,
e.e[d->nr_ue_dl_slot].i, e.e[d->nr_ue_dl_harq_pid].i,
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize);
}
void nr_ue_rar(void *_d, event e)
@@ -584,8 +584,7 @@ void nr_ue_rar(void *_d, event e)
trace_nr(e.sending_time, d, DIRECTION_DOWNLINK,
RA_RNTI, e.e[d->nr_ue_rar_rnti].i,
e.e[d->nr_ue_rar_frame].i, e.e[d->nr_ue_rar_slot].i, 0,
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize,
NO_PREAMBLE);
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize);
}
/****************************************************************************/
@@ -961,7 +960,7 @@ static int sock = -1;
void force_stop(int x)
{
printf("\ngently quit...\n");
printf("\ngently quit(%d)...\n", x);
close(sock);
sock = -1;
run = 0;
+1 -1
View File
@@ -39,7 +39,7 @@ static int socket = -1;
void force_stop(int x)
{
printf("\ngently quit...\n");
printf("\ngently quit (%d)...\n", x);
close(socket);
socket = -1;
run = 0;
+3 -10
View File
@@ -249,7 +249,7 @@ static int socket_fd = -1;
void force_stop(int x)
{
logi("gently quit...");
logi("gently quit %d", x);
close(socket_fd);
socket_fd = -1;
run = 0;
@@ -785,12 +785,7 @@ uint8_t should_insert(EventBuffer &buf)
return 0;
}
int insert_event(clickhouse_config_t *ch,
void *database,
int event_id,
const char *event_data,
int data_length,
std::chrono::high_resolution_clock::time_point t_start)
int insert_event(clickhouse_config_t *ch, int event_id, const char *event_data, int data_length)
{
auto t_fn_start = std::chrono::high_resolution_clock::now();
@@ -1270,14 +1265,12 @@ int main(int n, char **v)
if (fullread(socket_fd, v + vpos, length) == -1)
goto read_error;
auto t_start = std::chrono::high_resolution_clock::now();
if (type == -1) {
append_received_config_chunk(v + vpos, length);
} else if (type == -2) {
verify_config();
} else if (type >= 0 && type < number_of_events && is_on[type]) {
if (insert_event(&ch_config, database, type, v + vpos, length, t_start) != 0) {
if (insert_event(&ch_config, type, v + vpos, length) != 0) {
loge("Failed to insert event type {}", type);
}
}
+1 -1
View File
@@ -417,7 +417,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database,
for (i = 0; i < 8; i++)
timeline_set_subline_background_color(g, timeline_plot, i,
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
timeview = new_view_time(3600, 10, g, timeline_plot);
timeview = new_view_time(10, g, timeline_plot);
/* DL tick logging */
timelog = new_timelog(h, database, "UE_PHY_DL_TICK");
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
+2
View File
@@ -5,6 +5,8 @@
#ifndef _UTILS_H_
#define _UTILS_H_
#define UNUSED(x) (void)x
void new_thread(void *(*f)(void *), void *data);
void sleepms(int ms);
void bps(char *out, float v, char *suffix);
+1 -1
View File
@@ -100,7 +100,7 @@ static void vcd_main_gui(gui *g, event_handler *h, void *database)
for (i = 0; i < nb_functions; i++)
timeline_set_subline_background_color(g, w, i,
new_color(g, i & 1 ? "#ddd" : "#eee"));
timeview = new_view_time(3600, 10, g, w);
timeview = new_view_time(10, g, w);
i = 0;
for (j = 0; j < n; j++) {
if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue;
+1
View File
@@ -70,6 +70,7 @@ static void *scrolltti_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void insert(struct scrolltti *this, double value)
+2
View File
@@ -3,6 +3,7 @@
*/
#include "view.h"
#include "../utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
@@ -15,6 +16,7 @@ struct stdout {
static void clear(view *this)
{
/* do nothing */
UNUSED(this);
}
static void append(view *_this, char *s)
+5 -2
View File
@@ -71,6 +71,7 @@ static void *textlist_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append(view *_this, char *s)
@@ -120,9 +121,11 @@ static void scroll(void *private, gui *g,
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(notification);
UNUSED(g);
UNUSED(w);
struct textlist *this = private;
int *d = notification_data;
int button = d[1];
+9 -6
View File
@@ -164,9 +164,10 @@ static void *ticktime_thread(void *_this)
return 0;
}
static void scroll(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
struct ticktime *this = private;
int *d = notification_data;
int x = d[0];
@@ -225,9 +226,11 @@ end:
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
UNUSED(notification);
struct ticktime *this = private;
int *d = notification_data;
int button = *d;
@@ -365,9 +368,9 @@ struct clock_ticktime {
struct ticktime *parent;
};
static void clock_append(view *_this, struct timespec t,
int frame, int subframe)
static void clock_append(view *_this, struct timespec t, int frame, int subframe)
{
UNUSED(t);
struct clock_ticktime *this = (struct clock_ticktime *)_this;
struct ticktime *tt = this->parent;
int64_t diff;
+8 -6
View File
@@ -156,9 +156,10 @@ static void *time_thread(void *_this)
return 0;
}
static void scroll(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
struct time *this = private;
int *d = notification_data;
int x = d[0];
@@ -217,9 +218,11 @@ end:
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
UNUSED(notification);
struct time *this = private;
int *d = notification_data;
int button = *d;
@@ -228,8 +231,7 @@ static void click(void *private, gui *g,
if (button == 1) this->autoscroll = 1;
}
view *new_view_time(int number_of_seconds, float refresh_rate,
gui *g, widget *w)
view *new_view_time(float refresh_rate, gui *g, widget *w)
{
struct time *ret = calloc(1, sizeof(struct time));
if (ret == NULL) abort();
+1
View File
@@ -94,6 +94,7 @@ static void *tti_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append(view *_this, int frame, int tick, double value)
+4 -8
View File
@@ -19,14 +19,10 @@ enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE };
view *new_view_stdout(void);
view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w);
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
int color, enum xy_mode mode);
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color,
int ticks_per_frame);
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w,
int color, widget *throughput_label, int ticks_per_frame);
view *new_view_time(int number_of_seconds, float refresh_rate,
gui *g, widget *w);
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, int color, enum xy_mode mode);
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color, int ticks_per_frame);
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, int color, widget *throughput_label, int ticks_per_frame);
view *new_view_time(float refresh_rate, gui *g, widget *w);
view *new_subview_time(view *time, int line, int color, int size);
view *new_view_ticktime(float refresh_rate, gui *g, widget *w);
view *new_subview_ticktime(view *ticktime, int line, int color, int size);
+1
View File
@@ -42,6 +42,7 @@ static void *xy_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append_loop(view *_this, float *x, float *y, int length)
+4 -1
View File
@@ -45,7 +45,10 @@ char *hashtable_rc_code2string(hashtable_rc_t rcP)
* hash_free_int_func() is used when this hashtable is used to store int values as data (pointer = value).
*/
void hash_free_int_func(void *memoryP) {}
void hash_free_int_func(void *memoryP)
{
UNUSED(memoryP);
}
//-------------------------------------------------------------------------------------------------------------------------------
/*
+2 -6
View File
@@ -284,12 +284,8 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
// Legacy, pthread_create + thread_top_init() should be replaced by threadCreate
// threadCreate encapsulates the posix pthread api
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period) {
void thread_top_init(char *thread_name)
{
int policy, s, j;
struct sched_param sparam;
char cpu_affinity[1024];
+1 -5
View File
@@ -36,11 +36,7 @@ void threadCreate(pthread_t *t, void *(*func)(void *), void *param, char *name,
#define OAI_PRIORITY_RT ((sched_get_priority_min(SCHED_OAI)+sched_get_priority_max(SCHED_OAI))/2)
#define OAI_PRIORITY_RT_MAX sched_get_priority_max(SCHED_OAI)-2
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period);
void thread_top_init(char *thread_name);
/****************************************************
* Functions to check system at runtime.
+15 -11
View File
@@ -81,7 +81,6 @@ int get_phybsize(void) {
};
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ...);
int setparam(char *buff, int debug, telnet_printfunc_t prnt);
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...);
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
@@ -245,12 +244,9 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) {
}
}
int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ...)
int setoutput(char *buff, int debug, telnet_printfunc_t prnt)
{
return 0;
}
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
UNUSED(debug);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
char *logfname;
char stdout_str[64];
@@ -288,10 +284,16 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...)
{
UNUSED(buff);
UNUSED(debug);
UNUSED(prnt);
return 0;
}
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
int setparam(char *buff, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(prnt);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
memset(cmds,0,sizeof(cmds));
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
@@ -322,7 +324,9 @@ int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
return CMDSTATUS_NOTFOUND;
} /* setparam */
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
memset(cmds,0,sizeof(cmds));
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
@@ -502,7 +506,7 @@ void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t
pushNotifiedFIFO(cmd->qptr, msg);
}
int process_command(char *buf, int iteration)
int process_command(char *buf)
{
int i,j,k;
char modulename[TELNET_CMD_MAXSIZE];
@@ -581,7 +585,7 @@ int process_command(char *buf, int iteration)
char tbuff[64];
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
process_command(buf + strlen("loop") + 1, lc);
process_command(buf + strlen("loop") + 1);
errno=0;
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
@@ -710,7 +714,7 @@ void run_telnetsrv(void) {
}
if (strlen(buf) > 2 ) {
status = process_command(buf, 0);
status = process_command(buf);
} else
status=CMDSTATUS_NOCMD;
@@ -28,6 +28,7 @@ static int get_single_ue_rnti(void)
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -42,6 +43,7 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
//void rrc_gNB_trigger_new_bearer(int rnti);
int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = -1;
if (!buf) {
rnti = get_single_ue_rnti();
@@ -67,6 +69,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
//void rrc_gNB_trigger_release_bearer(int rnti);
int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = -1;
if (!buf) {
rnti = get_single_ue_rnti();
+10
View File
@@ -47,6 +47,7 @@ static int get_single_ue_rnti_mac(void)
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -81,6 +82,7 @@ rrc_gNB_ue_context_t *get_single_rrc_ue(void)
int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
rrc_gNB_ue_context_t *ue = NULL;
@@ -119,6 +121,7 @@ int fetch_rnti(char *buf, telnet_printfunc_t prnt)
int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, cannot trigger reestablishment\n");
int rnti = fetch_rnti(buf, prnt);
@@ -134,6 +137,7 @@ extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
/** @brief Get connected DU by the UE ID */
int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
@@ -169,6 +173,7 @@ extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
*/
int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
rrc_gNB_ue_context_t *ue = NULL;
@@ -198,6 +203,7 @@ extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, u
* @return 0 on success, -1 on failure */
int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
@@ -238,6 +244,7 @@ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
int force_ul_failure(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, force_ul_failure failed\n");
int rnti = fetch_rnti(buf, prnt);
@@ -263,6 +270,7 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt)
static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
@@ -288,6 +296,7 @@ static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
* @return 0 on success; negative value on error. */
static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf == NULL) {
ERROR_MSG_RET("Missing input. Usage: trigger_pdu_session_release [ue_id=gNB_ue_ngap_id(int,opt)],pdusession_id(int)[,pdusession_id(int)...]\n");
}
@@ -360,6 +369,7 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
static int trigger_bwp_switch(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
char *sbwpId = strtok(buf, " ");
int bwpId = atoi(sbwpId);
char *srnti = strtok(NULL, " ");
+16
View File
@@ -52,6 +52,7 @@ static int get_default_ue_id(void)
*/
int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int ue_id = -1;
if (!buf) {
ERROR_MSG_RET("no UE ID provided to telnet command\n");
@@ -71,6 +72,9 @@ int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
*/
int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
handle_rlf_detection(rrc);
return 0;
@@ -81,6 +85,9 @@ int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
*/
int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
nr_rrc_going_to_IDLE(rrc, OTHER, NULL);
return 0;
@@ -89,6 +96,9 @@ int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
/** @brief Trigger RA with Msg3 C-RNTI */
int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
trigger_MAC_UE_RA(mac, NULL);
return 0;
@@ -96,6 +106,9 @@ int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
MessageDef *msg = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_DEREGISTRATION_REQ);
NAS_DEREGISTRATION_REQ(msg).cause = AS_DETACH;
itti_send_msg_to_task(TASK_NAS_NRUE, 0, msg);
@@ -105,6 +118,8 @@ static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
extern float get_prs_max_dl_toa(prs_meas_t *prs_meas);
static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
// TODO multiple antennas, resources, gNBs?
int gNB_id = 0;
int rsc_id = 0;
@@ -124,6 +139,7 @@ static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
static int add_pdu_session(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int ue_id = -1;
int pdusession_id = -1;
@@ -46,11 +46,15 @@ void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) {
}
void display_uestats(int debug, telnet_printfunc_t prnt, int ue) {
UNUSED(debug);
UNUSED(prnt);
UNUSED(ue);
for (int cc=0; cc<1 ; cc++) {
}
}
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) {
UNUSED(buf);
prnt(" DLSCH kb DLSCH kb/s\n");
dump_uestats(debug, prnt,0);
}
@@ -206,6 +206,7 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) {
}
void measurcmd_async_help(telnet_printfunc_t prnt) {
UNUSED(prnt);
}
int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt) {
+9
View File
@@ -62,6 +62,7 @@ typedef struct ue_stat {
static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -209,6 +210,7 @@ static int read_long(const char *buf, const char *end, const char *id, long *val
bool running = true; // in the beginning, the softmodem is started automatically
static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!buf)
ERROR_MSG_RET("need param: o1 config param1 val1 [param2 val2 ...]\n");
if (running)
@@ -271,6 +273,7 @@ static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (running)
ERROR_MSG_RET("cannot set parameters while L1 is running\n");
if (!buf)
@@ -344,6 +347,8 @@ static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
extern int stop_L1(module_id_t gnb_id);
static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
if (!running)
ERROR_MSG_RET("cannot stop, nr-softmodem not running\n");
@@ -366,6 +371,8 @@ static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
extern int start_L1L2(module_id_t gnb_id);
static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
if (running)
ERROR_MSG_RET("cannot start, nr-softmodem already running\n");
start_L1L2(0);
@@ -377,6 +384,8 @@ static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
extern void du_clear_all_ue_states();
static int remove_mac_ues(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
du_clear_all_ue_states();
prnt("OK\n");
return 0;
+8 -6
View File
@@ -36,6 +36,7 @@
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
{
UNUSED(debug);
char prntline[160];
char *procfile_fields;
char *strtokptr;
@@ -169,10 +170,11 @@ char arecord[1024];
int nullprnt(char *fmt, ...)
{
UNUSED(fmt);
return 0;
}
void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
void proccmd_get_threaddata(int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
{
char aname[256];
@@ -222,9 +224,9 @@ char aname[256];
closedir(proc_dir);
} /* proccmd_get_threaddata */
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
void print_threads(int debug, telnet_printfunc_t prnt)
{
proccmd_get_threaddata(buf, debug, prnt, NULL);
proccmd_get_threaddata(debug, prnt, NULL);
}
#define FLAG_PRINT_DEBUG_DUMP(flag) \
@@ -349,7 +351,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
}
}
if (strcasestr(cmdbuff, "threadsched") != NULL) {
proccmd_get_threaddata(cmdbuff, debug, prnt, (webdatadef_t *)data);
proccmd_get_threaddata(debug, prnt, (webdatadef_t *)data);
}
} // show
@@ -373,7 +375,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
if (debug > 0)
prnt(" proccmd_show received %s\n",buf);
if (strcasestr(buf,"thread") != NULL) {
print_threads(buf,debug,prnt);
print_threads(debug, prnt);
}
if (strcasestr(buf,"loglvl") != NULL) {
prnt("\n component level enabled output\n");
@@ -466,7 +468,7 @@ if (buf == NULL) {
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
if(res != 3)
{
print_threads(buf, debug, prnt);
print_threads(debug, prnt);
return 0;
}
+3
View File
@@ -53,6 +53,7 @@ static int get_single_ue_id(void)
*/
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
ue_id_t ue_id = -1;
if (!buf) {
@@ -91,6 +92,8 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
*/
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
rrc_gNB_ue_context_t *ue_context_p = NULL;
gNB_RRC_INST *rrc = RC.nrrrc[0];
+1
View File
@@ -26,6 +26,7 @@ static int tick_functions_count;
*/
static void tick(void *unused)
{
UNUSED(unused);
for (int i = 0; i < tick_functions_count; i++)
tick_functions[i]();
}
+2 -3
View File
@@ -35,10 +35,9 @@ double get_cpu_freq_GHz(void)
void print_meas_now(time_stats_t *ts,
const char *name,
FILE *file_name)
void print_meas_now(time_stats_t *ts, const char *name, FILE *file_name)
{
UNUSED(name);
if (cpu_meas_enabled) {
//static double cpu_freq_GHz = 3.2;
+1
View File
@@ -193,6 +193,7 @@ sudo ethtool -G enp1s0f0 tx 4096 rx 4096
- Enable Performance Mode `sudo cpupower idle-set -D 0`
- If you get real-time problems on heavy UL traffic, reduce the maximum UL MCS using an additional command-line switch: `--MACRLCs.[0].ul_max_mcs 14`.
- You can also reduce the number of LDPC decoder iterations, which will make the LDPC decoder take less time: `--L1s.[0].max_ldpc_iterations 4`.
- Read more on system tuning in the [dedicated document on performance tuning](./tuning_and_security.md#performance-tuning).
### 6.3 Uplink issues related with noise on the DC carriers
+76
View File
@@ -629,6 +629,82 @@ eAXC_id 0 1 # set PRACH eAxC IDs
...
```
#### MICROAMP FR2
Interaction with RU is performed using `rucfg` utility provided by Microamp.
To check PTP status, you can use `rucfg ptp`. the output should be similar to:
```bash
[INFO] Check if RU is available
[INFO] RU available
[INFO] Check SSH to RU available
[INFO] SSH to RU available
[INFO] Getting PTP status
[INFO] ptp4l status =
{
Feb 12 16:26:02 bbv1 ptp4l[23822]: ptp4l[6280.658]: rms 0 max 1 freq +2 +/- 7 delay 1184 +/- 0
Feb 12 16:26:00 bbv1 ptp4l[23822]: ptp4l[6279.535]: rms 0 max 1 freq -8 +/- 13 delay 1184 +/- 0
Feb 12 16:25:59 bbv1 ptp4l[23822]: ptp4l[6278.413]: rms 1 max 1 freq -35 +/- 13 delay 1184 +/- 0
Feb 12 16:25:58 bbv1 ptp4l[23822]: ptp4l[6277.290]: rms 0 max 1 freq -68 +/- 9 delay 1184 +/- 0
Feb 12 16:25:57 bbv1 ptp4l[23822]: ptp4l[6276.167]: rms 1 max 1 freq -69 +/- 10 delay 1184 +/- 0
Feb 12 16:25:56 bbv1 ptp4l[23822]: ptp4l[6275.044]: rms 0 max 1 freq -46 +/- 9 delay 1184 +/- 0
Feb 12 16:25:55 bbv1 ptp4l[23822]: ptp4l[6273.921]: rms 1 max 1 freq -65 +/- 10 delay 1184 +/- 0
Feb 12 16:25:54 bbv1 ptp4l[23822]: ptp4l[6272.800]: rms 0 max 1 freq -91 +/- 6 delay 1184 +/- 0
Feb 12 16:25:53 bbv1 ptp4l[23822]: ptp4l[6271.677]: rms 4 max 17 freq -107 +/- 48 delay 1184 +/- 0
Feb 12 16:25:52 bbv1 ptp4l[23822]: ptp4l[6270.554]: rms 6 max 17 freq +179 +/- 106 delay 1184 +/- 0
Feb 12 16:25:50 bbv1 ptp4l[23822]: ptp4l[6269.431]: rms 1 max 2 freq +191 +/- 12 delay 1184 +/- 0
Feb 12 16:25:49 bbv1 ptp4l[23822]: ptp4l[6268.308]: rms 1 max 1 freq +119 +/- 21 delay 1184 +/- 0
Feb 12 16:25:48 bbv1 ptp4l[23822]: ptp4l[6267.186]: rms 1 max 1 freq +103 +/- 13 delay 1184 +/- 0
Feb 12 16:25:47 bbv1 ptp4l[23822]: ptp4l[6266.063]: rms 7 max 17 freq -101 +/- 160 delay 1184 +/- 0
Feb 12 16:25:46 bbv1 ptp4l[23822]: ptp4l[6264.940]: rms 7 max 17 freq -65 +/- 154 delay 1184 +/- 0
Feb 12 16:25:45 bbv1 ptp4l[23822]: ptp4l[6263.817]: rms 1 max 2 freq +176 +/- 33 delay 1183 +/- 0
Feb 12 16:25:44 bbv1 ptp4l[23822]: ptp4l[6262.695]: rms 0 max 1 freq +100 +/- 7 delay 1184 +/- 0
Feb 12 16:25:43 bbv1 ptp4l[23822]: ptp4l[6261.572]: rms 1 max 2 freq +56 +/- 34 delay 1184 +/- 0
Feb 12 16:25:41 bbv1 ptp4l[23822]: ptp4l[6260.449]: rms 1 max 1 freq -37 +/- 14 delay 1184 +/- 0
Feb 12 16:25:40 bbv1 ptp4l[23822]: ptp4l[6259.326]: rms 7 max 16 freq +114 +/- 149 delay 1183 +/- 0
}
```
##### RU configuration
You can use `rucfg show` to display the current RU configuration.
The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-microamp.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf) corresponds to the following RU configuration:
```bash
[INFO] Check if RU is available
[INFO] RU available
[INFO] Check SSH to RU available
[INFO] SSH to RU available
[INFO] Downloading oran_autostart
[INFO] Downloading ructl_config.sh
[INFO] Downloading udc_pll_configurator_startup
[INFO] Downloaded Cellbox config =
{
eCPRI Compression: True
RF Bandwidth: 200MHz
CC Bandwidth: 200MHz
CCs: 1
LO frequency: 7.91642667e9
UL compensation frequency: 28.04928e9
DL compensation frequency: -28.04928e9
RU MAC: 10:70:FD:B8:86:02
DU MAC: 50:7C:6F:31:00:61
TDD config: dddsu
RF Power level: -5 dB - relative to maximum
VLAN ORAN: Enabled, tag: 600
VLAN PTP: Enabled, tag: 1
VLAN MGMT: False
Beamforming: dynamic-mirrored-beam
}
```
Execute `rucfg config -h` to check how to configure the RU.
You can also execute `rucfg stats` to show fronthaul statistics including on-time/late packet' counters.
#### VVDN LPRU
**Version 3.x**
+103
View File
@@ -69,6 +69,109 @@ sudo sysctl -n -e -q -w net.core.wmem_default=134217728
sudo sysctl -n -e -q -w net.core.wmem_max=134217728
```
### System tuning
In order to get an optimal real-time behavior, a few tunings can be performed on the host system:
- The use of isolated cores for the softmodem prevents competitions on the usage of core between the softmodem and other processes.
Core isolation is enabled through the kernel command line.
**Warning: modifying the kernel command line can harm the OS behavior. Proceed with caution.**
Refer to the [OAI 7.2 Fronthaul Interface Tutorial](./ORAN_FHI7.2_Tutorial.md) for examples.
### Softmodem tuning
The way the NR softmodem uses the computing ressource can be configured.
It can have a significant effect on the performance and real-time behavior:
- The L1 TX and L1 RX threads are the two main threads
executing the L1 RX and L1 TX pipelines.
These threads are ideally assigned to two dedicated cores.
To be dedicated, the cores should be isolated in the
kernel parameters and not be assigned elsewhere.
They can be assigned to specified cores with options
`--L1s.[0].L1_tx_thread_core` and `--L1s.[0].L1_rx_thread_core`
followed by a core id.
- The thread pool is a group of processor cores over which
some baseband processing worker cores execute.
It is configured by providing a list of core ids
after option `--thread-pool`.
`-1` can also be passed instead of a core id
in order to use a floating core.
By default, the thread pool is 8 floating cores.
- PDSCH generation (i.e., layer mapping and precoding) is by default executed
in the L1 TX thread but can be multithreaded using the thread pool.
This is enabled by option `--L1s.[0].L1_num_tx_sym_per_thread` followed
by the number of symbols that should be processed in each thread.
This option can also be set in the gNB configuration file in field
`L1_num_tx_sym_per_thread` in the `L1s` section.
### Workarounds
If the real-time performance remains bad after tuning the system and softmodem,
some workarounds allow to lower the computing demand
at the cost of lower network performance:
- If you get real-time problems on heavy UL traffic,
reduce the maximum UL MCS using an additional
command-line switch: `--MACRLCs.[0].ul_max_mcs 14`.
This comes at the cost of a lower spectral efficiency
(i.e., less data for the same radio resource).
- You can also reduce the number of LDPC decoder iterations,
which will make the LDPC decoder take less time:
`--L1s.[0].max_ldpc_iterations 4`.
The default number of LDPC iterations is 8.
Lowering the number of iteration comes at the cost
of more unsuccessful transmissions.
OAI offers multiple implementation of LDPC coding,
including offloading to an accelerator,
the number of LDPC iteration should be chosen accordingly.
### Known hardware behaviors
Here is a **non-exhaustive** list of known behaviors related to hardware architecture:
- On some AMD EPYC series processors with Zen architecture
(at least every Zen4, Zen4c, Zen5 and Zen5c based processors
experience this behavior),
the processor is made of multiple dies holding one or multiple
core complexes which are groups of cores with an L3 cache.
This means that cores from different core complexes
do not share the same L3 cache and communication between
these cores implies inter L3 cache communication
within a die or, even worse, between dies,
which has a cost in term of latency.
Depending on the system configuration,
the NUMA topology may reflect this physical topology,
which can induce even further latency for
inter core complex communication.
The softmodem is sensitive to this latency and its performance
can be harmed if it uses cores across the border of dies or core complexes,
especially when multithreading of PDSCH generation is enabled
(argument of `--L1s.[0].L1_num_tx_sym_per_thread` is superior to 0).
**Solution**: We recommend to use only one core complex
or one die for allocating cores to nr-softmodem process.
- NUMA architecture: Make sure you don't assign cores to nr-softmodem from
different numa nodes. Cores from different numa cores can induce latency.
It is preferred to use the cores from numa node
which is used by the Fronthaul NIC.
**Example**: How to assign cores to `nr-softmodem` process for gNB/DU connected to an o-ran 7.2 O-RU on EPYC 9575F (64 Zen5)
assuming that we have configured `L1s.[0].L1_num_tx_sym_per_thread = 1`
There are 8 cores per core complex and one core complex per die. You can visulize this topology using
```bash
# Ubuntu 25.04
for X in $(seq 0 63); do echo -n "cpu$X -> die "; cat /sys/devices/system/cpu/cpu$X/topology/die_id; done
```
A 100MHz 4x4 FR1 gNB/DU with FHI 7.2 can be executed with full capabilities (4DL and 2UL layers)
on a single core complex (cpus 0-7 in this example) by folowing the instructions of the
[OAI 7.2 Fronthaul Interface Tutorial](./ORAN_FHI7.2_Tutorial.md)
with the following core assignment:
- `L1s.[0].L1_tx_thread_core = 0`
- `L1s.[0].L1_rx_thread_core = 1`
- `RUs.[0].ru_thread_core = 2`
- `fhi_72.system_core = 3`
- `fhi_72.io_core = 4`
- `fhi_72.worker_cores.[0] = 5` (minimum 1 core)
- `thread-pool: 2,3,6,7`
(thread pool can overlap with `RUs.[0].ru_thread_core` and `fhi_72.system_core`)
## Capabilities
Historically, all softmodems are executed as `root`, typically using `sudo`.
+4 -4
View File
@@ -259,7 +259,7 @@ static void *L1_thread_tx(void *param) {
PHY_VARS_eNB *eNB = eNB_proc->eNB;
char thread_name[100];
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
thread_top_init(thread_name,1,470000,500000,500000);
thread_top_init(thread_name);
int ret;
//wait_sync("tx_thread");
@@ -342,7 +342,7 @@ static void *L1_thread( void *param ) {
}
}
#else
thread_top_init(thread_name,1,470000,500000,500000);
thread_top_init(thread_name);
#endif
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
@@ -699,7 +699,7 @@ static void *eNB_thread_prach( void *param ) {
L1_proc_t *proc = &eNB->proc;
// set default return value
eNB_thread_prach_status = 0;
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
thread_top_init("eNB_thread_prach");
//wait_sync("eNB_thread_prach");
@@ -732,7 +732,7 @@ static void *eNB_thread_prach_br( void *param ) {
L1_proc_t *proc = &eNB->proc;
// set default return value
eNB_thread_prach_status = 0;
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
thread_top_init("eNB_thread_prach_br");
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
+9 -9
View File
@@ -778,7 +778,7 @@ static void *ru_thread_asynch_rxtx( void *param ) {
RU_t *ru = (RU_t *)param;
RU_proc_t *proc = &ru->proc;
int subframe=0, frame=0;
thread_top_init("ru_thread_asynch_rxtx",1,870000,1000000,1000000);
thread_top_init("ru_thread_asynch_rxtx");
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe
wait_sync("ru_thread_asynch_rxtx");
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe
@@ -869,7 +869,7 @@ void *ru_thread_prach( void *param ) {
RU_proc_t *proc = (RU_proc_t *)&ru->proc;
// set default return value
ru_thread_prach_status = 0;
thread_top_init("ru_thread_prach",1,500000,1000000,20000000);
thread_top_init("ru_thread_prach");
//wait_sync("ru_thread_prach");
while (*ru->ru_mask>0 && ru->function!=eNodeB_3GPP) {
@@ -919,7 +919,7 @@ void *ru_thread_prach_br( void *param ) {
RU_proc_t *proc = (RU_proc_t *)&ru->proc;
// set default return value
ru_thread_prach_status = 0;
thread_top_init("ru_thread_prach_br",1,500000,1000000,20000000);
thread_top_init("ru_thread_prach_br");
//wait_sync("ru_thread_prach_br");
while (!oai_exit) {
@@ -1411,7 +1411,7 @@ static void *ru_thread_tx( void *param ) {
L1_rxtx_proc_t *L1_proc;
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
thread_top_init("ru_thread_tx",1,400000,500000,500000);
thread_top_init("ru_thread_tx");
//CPU_SET(5, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
//wait_sync("ru_thread_tx");
@@ -1518,7 +1518,7 @@ static void *ru_thread( void *param ) {
dlsch_ue_select_tbl_in_use = 1;
#endif
// set default return value
thread_top_init("ru_thread",1,400000,500000,500000);
thread_top_init("ru_thread");
//CPU_SET(1, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
pthread_setname_np( pthread_self(),"ru thread");
@@ -1799,7 +1799,7 @@ static void *ru_thread_synch(void *arg) {
int64_t peak_val, avg;
static int ru_thread_synch_status = 0;
int cnt=0;
thread_top_init("ru_thread_synch",0,5000000,10000000,10000000);
thread_top_init("ru_thread_synch");
wait_sync("ru_thread_synch");
// initialize variables for PSS detection
ru_sync_time_init(ru); //lte_sync_time_init(ru->frame_parms);
@@ -1873,7 +1873,7 @@ void *pre_scd_thread( void *param ) {
frame = 0;
subframe = 4;
thread_top_init("pre_scd_thread",0,870000,1000000,1000000);
thread_top_init("pre_scd_thread");
while (!oai_exit) {
if(oai_exit) {
@@ -1933,7 +1933,7 @@ static void *eNB_thread_phy_tx( void *param ) {
// set default return value
eNB_thread_phy_tx_status = 0;
int ret;
thread_top_init("eNB_thread_phy_tx",1,500000L,1000000L,20000000L);
thread_top_init("eNB_thread_phy_tx");
while (!oai_exit) {
if (oai_exit) break;
@@ -1988,7 +1988,7 @@ static void *rf_tx( void *param ) {
RU_proc_t *proc = &ru->proc;
// set default return value
rf_tx_status = 0;
thread_top_init("rf_tx",1,500000L,1000000L,20000000L);
thread_top_init("rf_tx");
while (!oai_exit) {
if (oai_exit) break;
+3 -3
View File
@@ -879,7 +879,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) {
}
}
#else
thread_top_init("UE_phy_stub_thread_rxn_txnp4", 1, 870000L, 1000000L, 1000000L);
thread_top_init("UE_phy_stub_thread_rxn_txnp4");
#endif
// for multipule UE's L2-emulator
//module_id_t Mod_id = 0;
@@ -1233,7 +1233,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) {
static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
#if 0 // TODO: doesn't currently compile, obviated by multi-ue proxy
thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L);
thread_top_init("UE_phy_stub_thread_rxn_txnp4");
// for multipule UE's L2-emulator
//module_id_t Mod_id = 0;
//int init_ra_UE = -1; // This counter is used to initiate the RA of each UE in different SFrames
@@ -2225,7 +2225,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue,
//02/02/2018
static void *timer_thread( void *param ) {
thread_top_init("timer_thread",1,870000L,1000000L,1000000L);
thread_top_init("timer_thread");
timer_subframe =9;
timer_frame =1023;
//phy_stub_ticking = (SF_ticking*)malloc(sizeof(SF_ticking));
+2 -6
View File
@@ -208,8 +208,7 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output);
output += print_meas_log(&gNB->dlsch_modulation_stats, "DLSCH modulation", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->dlsch_resource_mapping_stats, "DLSCH resource mapping", NULL, NULL, output,end-output);
output += print_meas_log(&gNB->dlsch_precoding_stats, "DLSCH precoding", NULL, NULL, output,end-output);
output += print_meas_log(&gNB->dlsch_pdsch_generation_stats, "PDSCH generation", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->ts_deinterleave, "UL segment deinterleaving", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->ts_rate_unmatch, "UL segment rate recovery", NULL, NULL, output, end - output);
@@ -280,8 +279,7 @@ void *nrL1_stats_thread(void *param) {
reset_meas(&gNB->rx_pusch_stats);
reset_meas(&gNB->dlsch_scrambling_stats);
reset_meas(&gNB->dlsch_modulation_stats);
reset_meas(&gNB->dlsch_resource_mapping_stats);
reset_meas(&gNB->dlsch_precoding_stats);
reset_meas(&gNB->dlsch_pdsch_generation_stats);
while (!oai_exit) {
sleep(1);
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
@@ -309,8 +307,6 @@ void init_gNB_Tpool(int inst)
PHY_VARS_gNB *gNB;
gNB = RC.gNB[inst];
gNB_L1_proc_t *proc = &gNB->proc;
// PUSCH symbols per thread need to be calculated by how many threads we have
gNB->num_pusch_symbols_per_thread = 1;
// ULSCH decoding threadpool
initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
+1
View File
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
add_compile_options(-Wunused-parameter)
add_subdirectory(oai_integration/aerial)
if (OAI_WLS)
add_subdirectory(oai_integration/wls_integration)
+8 -11
View File
@@ -63,7 +63,7 @@ static uint16_t old_sfn = 0;
static uint16_t old_slot = 0;
////////////////////////////////////////////////////////////////////////
// Handle an RX message
static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
static int ipc_handle_rx_msg(nv_ipc_msg_t *msg)
{
if (msg == NULL) {
LOG_E(NFAPI_VNF, "%s: ERROR: buffer is empty\n", __func__);
@@ -121,12 +121,7 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
int dataBufLen = msg->data_len;
uint8_t *data_end = msg->data_buf + dataBufLen;
nfapi_nr_srs_indication_t ind;
aerial_unpack_nr_srs_indication(&pReadPackedMessage,
end,
&pReadData,
data_end,
&ind,
&vnf_p7_config->_public.codec_config);
aerial_unpack_nr_srs_indication(&pReadPackedMessage, end, &pReadData, data_end, &ind);
if (vnf_p7_config->_public.nr_srs_indication) {
(vnf_p7_config->_public.nr_srs_indication)(&ind);
}
@@ -285,7 +280,7 @@ bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_messa
}
// Always allocate message buffer, but allocate data buffer only when data_len > 0
static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg)
static int aerial_recv_msg(nv_ipc_msg_t *recv_msg)
{
if (ipc == NULL) {
return -1;
@@ -305,7 +300,7 @@ static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg)
recv_msg->msg_len,
recv_msg->data_len,
recv_msg->data_pool);
ipc_handle_rx_msg(ipc, recv_msg);
ipc_handle_rx_msg(recv_msg);
// Release buffer of RX message
int release_retval = ipc->rx_release(ipc, recv_msg);
@@ -318,6 +313,7 @@ static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg)
void *epoll_recv_task(void *arg)
{
UNUSED(arg);
struct epoll_event ev, events[MAX_EVENTS];
LOG_D(NFAPI_VNF,"Aerial recv task start \n");
@@ -356,7 +352,7 @@ void *epoll_recv_task(void *arg)
if (events[n].data.fd == ipc_rx_event_fd) {
ipc->get_value(ipc);
nv_ipc_msg_t recv_msg;
while (aerial_recv_msg(ipc, &recv_msg) == 0);
while (aerial_recv_msg(&recv_msg) == 0);
}
}
}
@@ -482,7 +478,8 @@ int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
return retval;
}
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){
int oai_fapi_send_end_request(uint32_t frame, uint32_t slot)
{
nfapi_vnf_p7_config_t *p7_config = get_p7_vnf_config();
nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot};
+1 -1
View File
@@ -24,7 +24,7 @@ void release_msg(nv_ipc_msg_t* send_msg);
bool send_nvipc_msg(nv_ipc_msg_t* send_msg);
bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len);
int nvIPC_Init(nvipc_params_t nvipc_params_s);
int oai_fapi_send_end_request(int cell_id, uint32_t frame, uint32_t slot);
int oai_fapi_send_end_request(uint32_t frame, uint32_t slot);
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req);
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req);
+2 -7
View File
@@ -68,14 +68,9 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
return 1;
}
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
uint8_t **pDataMsg,
uint8_t *data_end,
void *msg,
nfapi_p7_codec_config_t *config)
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, uint8_t **pDataMsg, uint8_t *data_end, void *msg)
{
uint8_t retval = unpack_nr_srs_indication(ppReadPackedMsg, end, msg, config);
uint8_t retval = unpack_nr_srs_indication(ppReadPackedMsg, end, msg);
nfapi_nr_srs_indication_t *srs_ind = (nfapi_nr_srs_indication_t *)msg;
for (uint8_t pdu_idx = 0; pdu_idx < srs_ind->number_of_pdus; pdu_idx++) {
nfapi_nr_srs_indication_pdu_t *pdu = &srs_ind->pdu_list[pdu_idx];
+1 -6
View File
@@ -33,11 +33,6 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
nfapi_nr_rx_data_indication_t *msg,
nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
uint8_t **pDataMsg,
uint8_t *data_end,
void *msg,
nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, uint8_t **pDataMsg, uint8_t *data_end, void *msg);
bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header);
#endif // OPENAIRINTERFACE_FAPI_VNF_P7_H
+1 -1
View File
@@ -915,7 +915,7 @@ int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind)
send_slt_resp = true;
}
if (send_slt_resp) {
oai_fapi_send_end_request(0, ind->sfn, ind->slot);
oai_fapi_send_end_request(ind->sfn, ind->slot);
}
#else
if (sched_response.DL_req.dl_tti_request_body.nPDUs > 0)
@@ -61,6 +61,7 @@ static int send_p7_msg(pnf_p7_t *pnf_p7, uint8_t *msg, uint32_t len)
bool pnf_nr_send_p7_message(pnf_p7_t *pnf_p7, nfapi_nr_p7_message_header_t *header, uint32_t msg_len)
{
UNUSED(msg_len);
if (pnf_p7->terminate) {
//don't send any further P7 messages after terminating
return false;
+20 -23
View File
@@ -12,28 +12,25 @@ bool fapi_nr_p7_message_unpack(void *pMessageBuf,
uint32_t unpackedBufLen,
nfapi_p7_codec_config_t *config);
uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_nr_slot_indication_scf_t *msg,
nfapi_p7_codec_config_t *config);
uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg);
uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
uint8_t unpack_nr_srs_report_tlv_value(nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppReadPackedMsg, uint8_t *end);
uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg);
#endif // OPENAIRINTERFACE_NR_FAPI_P7_H
+2
View File
@@ -153,6 +153,7 @@ bool fapi_nr_p7_message_header_unpack(void *pMessageBuf,
uint32_t unpackedBufLen,
nfapi_p7_codec_config_t *config)
{
UNUSED(config);
return fapi_nr_message_header_unpack(pMessageBuf,
messageBufLen,
pUnpackedBuf,
@@ -166,6 +167,7 @@ bool fapi_nr_message_header_unpack(void *pMessageBuf,
uint32_t unpackedBufLen,
nfapi_p4_p5_codec_config_t *config)
{
UNUSED(config);
uint8_t *pReadPackedMessage = pMessageBuf;
nfapi_nr_p4_p5_message_header_t *header = pUnpackedBuf;
fapi_message_header_t fapi_msg = {0};
+2
View File
@@ -66,6 +66,7 @@ int fapi_nr_p5_message_pack(void *pMessageBuf,
const uint32_t packedBufLen,
nfapi_p4_p5_codec_config_t *config)
{
UNUSED(messageBufLen);
nfapi_nr_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
uint8_t *pWritePackedMessage = pPackedBuf;
AssertFatal(isFAPIMessageIDValid(pMessageHeader->message_id),
@@ -1141,6 +1142,7 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
// END Digital Beam Table (DBT) PDU
#ifdef ENABLE_AERIAL
UNUSED(config);
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_NUM_TX_PORT_TAG,
&(pNfapiMsg->carrier_config.num_tx_port),
ppWritePackedMsg,
+59 -80
View File
@@ -15,38 +15,38 @@ uint8_t fapi_nr_p7_message_body_pack(nfapi_nr_p7_message_header_t *header,
uint8_t result = 0;
switch (header->message_id) {
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
result = pack_dl_tti_request(header, ppWritePackedMsg, end, config);
result = pack_dl_tti_request(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
result = pack_ul_tti_request(header, ppWritePackedMsg, end, config);
result = pack_ul_tti_request(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
result = pack_nr_slot_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_slot_indication(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
result = pack_ul_dci_request(header, ppWritePackedMsg, end, config);
result = pack_ul_dci_request(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
result = pack_tx_data_request(header, ppWritePackedMsg, end, config);
result = pack_tx_data_request(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
result = pack_nr_rx_data_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_rx_data_indication(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
result = pack_nr_crc_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_crc_indication(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
result = pack_nr_uci_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_uci_indication(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
result = pack_nr_srs_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_srs_indication(header, ppWritePackedMsg, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
result = pack_nr_rach_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_rach_indication(header, ppWritePackedMsg, end);
break;
#ifdef ENABLE_AERIAL
case NFAPI_NR_PHY_MSG_TYPE_VENDOR_EXT_SLOT_RESPONSE:
result = pack_nr_slot_indication(header, ppWritePackedMsg, end, config);
result = pack_nr_slot_indication(header, ppWritePackedMsg, end);
break;
#endif
default: {
@@ -150,49 +150,49 @@ bool fapi_nr_p7_message_unpack(void *pMessageBuf,
switch (pMessageHeader->message_id) {
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen))
result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen))
result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)) {
nfapi_nr_slot_indication_scf_t *msg = (nfapi_nr_slot_indication_scf_t *)pMessageHeader;
result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config);
result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen))
result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen))
result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)) {
result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)) {
result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)) {
result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)) {
result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)) {
result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
default:
@@ -435,7 +435,7 @@ static uint8_t pack_dl_tti_request_body_value(void *tlv, uint8_t **ppWritePacked
return push16(value->PDUSize, &pPackedLengthField, end);
}
uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg;
@@ -665,7 +665,7 @@ static uint8_t unpack_dl_tti_request_body_value(uint8_t **ppReadPackedMsg, uint8
return 1;
}
uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg;
pNfapiMsg->vendor_extension = NULL;
@@ -979,7 +979,7 @@ static uint8_t pack_ul_tti_groups_list_value(void *tlv, uint8_t **ppWritePackedM
return 1;
}
uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg;
pNfapiMsg->n_ulcch = 0;
@@ -1297,7 +1297,7 @@ static uint8_t unpack_ul_tti_groups_list_value(uint8_t **ppReadPackedMsg, uint8_
return 1;
}
uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg;
@@ -1328,7 +1328,7 @@ uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg
return 1;
}
uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t *)msg;
@@ -1338,10 +1338,7 @@ uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
return 1;
}
uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_nr_slot_indication_scf_t *msg,
nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg)
{
nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t *)msg;
@@ -1414,7 +1411,7 @@ static uint8_t pack_ul_dci_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg,
return push16(value->PDUSize, &pPackedLengthField, end);
}
uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg;
@@ -1485,7 +1482,7 @@ static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *
return 1;
}
uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg;
@@ -1554,7 +1551,7 @@ static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg
return 1;
}
uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg;
@@ -1622,7 +1619,7 @@ static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t
return 1;
}
uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg;
@@ -1653,7 +1650,7 @@ static uint8_t pack_nr_rx_data_indication_body(const nfapi_nr_rx_data_pdu_t *val
return 1;
}
uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t *)msg;
@@ -1669,10 +1666,7 @@ uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_
return 1;
}
static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end)
&& pull8(ppReadPackedMsg, &value->harq_id, end) && pull32(ppReadPackedMsg, &value->pdu_length, end)
@@ -1689,7 +1683,7 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
return 1;
}
uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t *)msg;
@@ -1702,7 +1696,7 @@ uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, vo
}
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) {
if (!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config))
if (!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end))
return 0;
}
@@ -1730,7 +1724,7 @@ static uint8_t pack_nr_crc_indication_body(const nfapi_nr_crc_t *value, uint8_t
return 1;
}
uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *)msg;
@@ -1768,7 +1762,7 @@ uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t *value, uint8_t **ppReadPac
return 1;
}
uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *)msg;
@@ -1971,7 +1965,7 @@ static uint8_t pack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t **ppWr
return 1;
}
uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t *)msg;
@@ -1990,10 +1984,7 @@ uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
return 1;
}
static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!pull8(ppReadPackedMsg, &value->pduBitmap, end))
return 0;
@@ -2063,10 +2054,7 @@ static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value,
return 1;
}
static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && pull32(ppReadPackedMsg, &value->handle, end)
&& pull16(ppReadPackedMsg, &value->rnti, end) && pull8(ppReadPackedMsg, &value->pucch_format, end)
@@ -2094,10 +2082,7 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
return 1;
}
static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!pull8(ppReadPackedMsg, &value->pduBitmap, end))
return 0;
@@ -2183,10 +2168,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *
return 1;
}
static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!pull16(ppReadPackedMsg, &value->pdu_type, end))
return 0;
@@ -2196,19 +2178,19 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
switch (value->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE: {
nfapi_nr_uci_pusch_pdu_t *uci_pdu = &value->pusch_pdu;
if (!unpack_nr_uci_pusch(uci_pdu, ppReadPackedMsg, end, config))
if (!unpack_nr_uci_pusch(uci_pdu, ppReadPackedMsg, end))
return 0;
break;
}
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end, config))
if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end))
return 0;
break;
}
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config))
if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end))
return 0;
break;
}
@@ -2220,7 +2202,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
return 1;
}
uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t *)msg;
@@ -2233,15 +2215,15 @@ uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *
pNfapiMsg->uci_list = calloc(pNfapiMsg->num_ucis, sizeof(*pNfapiMsg->uci_list));
for (int i = 0; i < pNfapiMsg->num_ucis; i++) {
if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config))
if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end))
return 0;
}
return 1;
}
static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
if(!(push16(report_tlv->tag, ppWritePackedMsg, end) &&
push32(report_tlv->length, ppWritePackedMsg, end))) {
return 0;
@@ -2256,8 +2238,8 @@ static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv,
return 1;
}
static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) {
static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end)
{
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push16(value->timing_advance_offset, ppWritePackedMsg, end) &&
@@ -2274,7 +2256,7 @@ static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t *
return 1;
}
uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t *)msg;
@@ -2328,8 +2310,8 @@ static uint8_t unpack_nr_srs_report_tlv(nfapi_srs_report_tlv_t *report_tlv, uint
return 1;
}
static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) {
static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull16(ppReadPackedMsg, &value->timing_advance_offset, end) &&
@@ -2346,7 +2328,7 @@ static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *valu
return 1;
}
uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t *)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn, end) && pull16(ppReadPackedMsg, &pNfapiMsg->slot, end)
@@ -2381,7 +2363,7 @@ static uint8_t pack_nr_rach_indication_body(void *tlv, uint8_t **ppWritePackedMs
return 1;
}
uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t *)msg;
@@ -2397,10 +2379,7 @@ uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
return 1;
}
static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t *config)
static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
if (!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) && pull8(ppReadPackedMsg, &value->symbol_index, end)
&& pull8(ppReadPackedMsg, &value->slot_index, end) && pull8(ppReadPackedMsg, &value->freq_index, end)
@@ -2419,7 +2398,7 @@ static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *v
return 1;
}
uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t *)msg;
@@ -2431,7 +2410,7 @@ uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void
if (pNfapiMsg->number_of_pdus > 0) {
pNfapiMsg->pdu_list = calloc(pNfapiMsg->number_of_pdus, sizeof(*pNfapiMsg->pdu_list));
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) {
if (!unpack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]), ppReadPackedMsg, end, config))
if (!unpack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]), ppReadPackedMsg, end))
return 0;
}
}
@@ -862,11 +862,13 @@ void free_ul_tti_request(nfapi_nr_ul_tti_request_t *msg)
void free_slot_indication(nfapi_nr_slot_indication_scf_t *msg)
{
// Nothing to free
UNUSED(msg);
}
void free_ul_dci_request(nfapi_nr_ul_dci_request_t *msg)
{
// Nothing to free
UNUSED(msg);
}
void free_tx_data_request(nfapi_nr_tx_data_request_t *msg)
+29 -29
View File
@@ -2620,19 +2620,19 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
uint8_t result = 0;
switch (pMessageHeader->message_id) {
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_UE_RELEASE_REQUEST:
result = pack_nr_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config);
@@ -2643,27 +2643,27 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
break;
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end);
break;
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
@@ -6258,20 +6258,20 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf,
switch (pMessageHeader->message_id) {
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen))
result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen))
result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen))
result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen))
result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader);
break;
case NFAPI_UE_RELEASE_REQUEST:
if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen))
@@ -6280,39 +6280,39 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf,
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)) {
nfapi_nr_slot_indication_scf_t *msg = (nfapi_nr_slot_indication_scf_t *)pMessageHeader;
result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config);
result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)) {
result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader, config);
result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
break;
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)) {
result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader, config);
}
break;
result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)) {
result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader, config);
}
break;
result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)) {
result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader, config);
}
break;
result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)) {
result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader, config);
}
break;
result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader);
}
break;
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC, unpackedBufLen))
@@ -15,6 +15,7 @@
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(assert);
if (s != NULL) {
printf("%s:%d %s() Exiting OAI (n)FAPI Hex Parser: %s\n", file, line, function, s);
}
@@ -152,12 +152,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
}
// generate pilot
lte_dl_cell_spec_rx(ue,
eNB_offset,
&pilot[p][0],
Ns,
(l==0)?0:1,
p);
lte_dl_cell_spec_rx(ue, eNB_offset, &pilot[p][0], Ns, (l == 0) ? 0 : 1);
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
c16_t *pil = (c16_t *)&pilot[p][0];
@@ -180,7 +180,6 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
c16_t **ul_ch_estimates,
c16_t **ul_ch_estimates_time,
c16_t **rxdataF_ext,
module_id_t UE_id,
uint8_t l,
uint8_t Ns);
@@ -56,7 +56,6 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
c16_t **ul_ch_estimates,
c16_t **ul_ch_estimates_time,
c16_t **rxdataF_ext,
module_id_t UE_id,
unsigned char l,
unsigned char Ns)
{
+1 -8
View File
@@ -174,15 +174,8 @@ int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
return(0);
}
int lte_dl_cell_spec_rx(PHY_VARS_UE *ue,
uint8_t eNB_offset,
int *output,
unsigned char Ns,
unsigned char l,
unsigned char p)
int lte_dl_cell_spec_rx(PHY_VARS_UE *ue, uint8_t eNB_offset, int *output, unsigned char Ns, unsigned char l)
{
unsigned char mprime,mprime_dword,mprime_qpsk_symb,m;
unsigned short k=0;
unsigned int qpsk[4];
+1 -7
View File
@@ -108,14 +108,8 @@ int lte_dl_mbsfn_khz_1dot25(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
@param output Output vector for OFDM symbol (Frequency Domain)
@param Ns Slot number (0..19)
@param l symbol (0,1) - Note 1 means 3!
@param p antenna intex
*/
int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_offset,
int *output,
unsigned char Ns,
unsigned char l,
unsigned char p);
int lte_dl_cell_spec_rx(PHY_VARS_UE *ue, uint8_t eNB_offset, int *output, unsigned char Ns, unsigned char l);
/*!\brief This function generates the ue-specific reference signal
* sequence (36-211, Sec 6.10.3.1) for beamforming channel estimation upon reception
@@ -834,13 +834,6 @@ void generate_RIV_tables(void)
// n_tilde_PRB(2,3) = (3,5)
// n_tilde_PRB(0,1) = (0,2)
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci)
{
return(localRIV2alloc_LUT25[rb_alloc_dci]);
}
uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
{
uint8_t ret = 255;
@@ -53,13 +53,6 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
*/
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
/* \brief Return prb for a given vrb index
@param vrb_type VRB type (0=localized,1=distributed)
@param rb_alloc_dci rballoc field from DCI
*/
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@returns Transmission mode (1-7)
*/
@@ -384,7 +384,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
int32_t **rxdataF_comp,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint8_t Qm,
uint16_t nb_rb,
uint8_t output_shift) {
@@ -518,7 +517,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
(c16_t **)eNB->pusch_vars[UE_id]->drs_ch_estimates,
(c16_t **)eNB->pusch_vars[UE_id]->drs_ch_estimates_time,
(c16_t **)eNB->pusch_vars[UE_id]->rxdataF_ext,
UE_id,
l % (frame_parms->symbols_per_tti / 2),
l / (frame_parms->symbols_per_tti / 2));
}
@@ -599,7 +597,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
pusch_vars->rxdataF_comp,
frame_parms,
l,
Qm,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
log2_maxh); // log2_maxh+I0_shift
@@ -135,13 +135,6 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
return(0);
}
int generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue,uint8_t subframe)
{
LOG_D(PHY,"[UE] generate_srs_tx_emul for subframe %d\n",subframe);
return(0);
}
#ifdef MAIN
main()
{
@@ -945,13 +945,6 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
@return Transport block size */
uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
/* \brief Return prb for a given vrb index
@param vrb_type VRB type (0=localized,1=distributed)
@param rb_alloc_dci rballoc field from DCI
*/
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@returns Transmission mode (1-7)
*/
-1
View File
@@ -86,7 +86,6 @@ void nr_beam_precoding(c16_t **txdataF,
c16_t **txdataF_BF,
NR_DL_FRAME_PARMS *frame_parms,
int32_t ***beam_weights,
int slot,
int symbol,
int aa,
int nb_antenna_ports,
-1
View File
@@ -80,7 +80,6 @@ void nr_beam_precoding(c16_t **txdataF,
c16_t **txdataF_BF,
NR_DL_FRAME_PARMS *frame_parms,
int32_t ***beam_weights,
int slot,
int symbol,
int aa,
int nb_antenna_ports,
@@ -783,6 +783,8 @@ int nr_srs_ls_channel_estimation(int ant,
#ifdef SRS_DEBUG
LOG_I(NR_PHY, "====================== UE port %d --> gNB Rx antenna %i ======================\n", p_index, ant);
LOG_I(NR_PHY, "============================== SRS symbol index %d ===========================\n", srs_symb);
#else
UNUSED(ant);
#endif
uint16_t subcarrier = CIRCULAR_INC(subcarrier_offset + nr_srs_info->k_0_p[p_index][srs_symb], 0, ofdm_symbol_size);
+176 -131
View File
@@ -17,8 +17,6 @@
#include "executables/softmodem-common.h"
#include "SCHED_NR/sched_nr.h"
// #define DEBUG_DLSCH
// #define DEBUG_DLSCH_MAPPING
#include <simde/x86/avx512.h>
#define USE128BIT
@@ -46,21 +44,9 @@ static int do_ptrs_symbol(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15,
/* check if cuurent RE is PTRS RE*/
uint16_t beta_ptrs = 1;
txF[k] = c16mulRealShift(mod_ptrs[ptrs_idx], beta_ptrs * amp, 15);
#ifdef DEBUG_DLSCH_MAPPING
printf("ptrs_idx %d\t \t k %d \t \t txdataF: %d %d, mod_ptrs: %d %d\n",
ptrs_idx,
k,
txF[k].r,
txF[k].i,
mod_ptrs[ptrs_idx].r,
mod_ptrs[ptrs_idx].i);
#endif
ptrs_idx++;
} else {
txF[k] = c16mulRealShift(*in++, amp, 15);
#ifdef DEBUG_DLSCH_MAPPING
printf("k %d \t txdataF: %d %d\n", k, txF[k].r, txF[k].i);
#endif
}
k++;
}
@@ -74,9 +60,6 @@ typedef union {
static inline int interleave_with_0_signal_first(c16_t *output, c16_t *mod_dmrs, const int16_t amp_dmrs, int sz)
{
#ifdef DEBUG_DLSCH_MAPPING
printf("doing DMRS pattern for port 0 : d0 0 d1 0 ... dNm2 0 dNm1 0 (ul %d, rr %d)\n", upper_limit, remaining_re);
#endif
// add filler to process all as SIMD
c16_t *out = output;
int i = 0;
@@ -126,9 +109,6 @@ static inline int interleave_with_0_signal_first(c16_t *output, c16_t *mod_dmrs,
static inline int interleave_with_0_start_with_0(c16_t *output, c16_t *mod_dmrs, const int16_t amp_dmrs, int sz)
{
#ifdef DEBUG_DLSCH_MAPPING
printf("doing DMRS pattern for port 2 : 0 d0 0 d1 ... 0 dNm2 0 dNm1\n");
#endif
c16_t *out = output;
int i = 0;
int end = sz / 2;
@@ -177,9 +157,6 @@ static inline int interleave_with_0_start_with_0(c16_t *output, c16_t *mod_dmrs,
static inline int interleave_signals(c16_t *output, c16_t *signal1, const int amp, c16_t *signal2, const int amp2, int sz)
{
#ifdef DEBUG_DLSCH_MAPPING
printf("doing DMRS pattern for port 0 : d0 X0 d1 X1 ... dNm2 XNm2 dNm1 XNm1\n");
#endif
// add filler to process all as SIMD
c16_t *out = output;
int i = 0;
@@ -311,22 +288,22 @@ static inline void neg_dmrs(c16_t *in, c16_t *out, int sz)
*out++ = i % 2 ? (c16_t){-in[i].r, -in[i].i} : in[i];
}
static inline int do_onelayer(NR_DL_FRAME_PARMS *frame_parms,
int slot,
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15,
int layer,
c16_t *output,
c16_t *txl_start,
int start_sc,
int symbol_sz,
int l_symbol,
uint16_t dlPtrsSymPos,
int n_ptrs,
int amp,
int16_t amp_dmrs,
int l_prime,
nfapi_nr_dmrs_type_e dmrs_Type,
c16_t *dmrs_start)
static inline void do_onelayer(NR_DL_FRAME_PARMS *frame_parms,
int slot,
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15,
int layer,
c16_t *output,
c16_t *txl_start,
int start_sc,
int symbol_sz,
int l_symbol,
uint16_t dlPtrsSymPos,
int n_ptrs,
int amp,
int16_t amp_dmrs,
int l_prime,
nfapi_nr_dmrs_type_e dmrs_Type,
c16_t *dmrs_start)
{
c16_t *txl = txl_start;
const uint sz = rel15->rbSize * NR_NB_SC_PER_RB;
@@ -408,7 +385,7 @@ static inline int do_onelayer(NR_DL_FRAME_PARMS *frame_parms,
} else { // no PTRS or DMRS in this symbol
txl += no_ptrs_dmrs_case(output + start_sc, txl, amp, sz);
} // no DMRS/PTRS in symbol
return txl - txl_start;
return;
}
static inline void do_txdataF(c16_t **txdataF,
@@ -472,28 +449,123 @@ static inline void do_txdataF(c16_t **txdataF,
} // RB loop: while(rb < rel15->rbSize)
}
typedef struct pdschSymbolProc_s {
PHY_VARS_gNB *gNB;
NR_DL_FRAME_PARMS *frame_parms;
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15;
unsigned int slot;
unsigned int startSymbol;
unsigned int numSymbols;
task_ans_t *ans;
unsigned int layerSz2;
unsigned int dlPtrsSymPos;
unsigned int n_ptrs;
unsigned int beam_nb;
unsigned int re_beginning_of_symbol[14];
c16_t *tx_layers[4];
time_stats_t dlsch_resource_mapping_stats;
time_stats_t dlsch_precoding_stats;
} pdschSymbolProc_t;
static void nr_pdsch_symbol_processing(void *arg)
{
pdschSymbolProc_t *rdata = (pdschSymbolProc_t *)arg;
PHY_VARS_gNB *gNB = rdata->gNB;
NR_DL_FRAME_PARMS *frame_parms = rdata->frame_parms;
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = rdata->rel15;
int slot = rdata->slot;
c16_t *tx_layers[rel15->nrOfLayers];
for (int l = 0; l < rel15->nrOfLayers; l++)
tx_layers[l] = rdata->tx_layers[l];
const int nb_re_dmrs = rel15->numDmrsCdmGrpsNoData * (rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
const int n_dmrs = (rel15->BWPStart + rel15->rbStart + rel15->rbSize) * nb_re_dmrs;
// Loop Over OFDM symbols:
c16_t mod_dmrs[(n_dmrs + 63) & ~63] __attribute__((aligned(64)));
const int symbol_sz = frame_parms->ofdm_symbol_size;
c16_t **txdataF = gNB->common_vars.txdataF[rdata->beam_nb];
uint16_t start_sc = (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB;
for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) {
start_meas(&rdata->dlsch_resource_mapping_stats);
int l_prime = 0; // single symbol layer 0
int l_overline = get_l0(rel15->dlDmrsSymbPos);
/// DMRS QPSK modulation
if ((rel15->dlDmrsSymbPos & (1 << l_symbol))) { // DMRS time occasion
// The reference point for is subcarrier -1 of the lowest-numbered resource block in CORESET 0 if the corresponding
// PDCCH is associated with CORESET -1 and Type0-PDCCH common search space and is addressed to SI-RNTI
// 2GPP TS 38.211 V15.8.0 Section 7.4.1.1.2 Mapping to physical resources
if (l_symbol == (l_overline + 1)) // take into account the double DMRS symbols
l_prime = 1;
else if (l_symbol > (l_overline + 1)) { // new DMRS pair
l_overline = l_symbol;
l_prime = 0;
}
const uint32_t *gold = nr_gold_pdsch(frame_parms->N_RB_DL,
frame_parms->symbols_per_slot,
rel15->dlDmrsScramblingId,
rel15->SCID,
slot,
l_symbol);
// Qm = 1 as DMRS is QPSK modulated
nr_modulation(gold, n_dmrs * DMRS_MOD_ORDER, DMRS_MOD_ORDER, (int16_t *)mod_dmrs);
}
uint32_t dmrs_idx = rel15->rbStart;
if (rel15->refPoint == 0)
dmrs_idx += rel15->BWPStart;
dmrs_idx *= rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4;
c16_t txdataF_precoding[rel15->nrOfLayers][symbol_sz] __attribute__((aligned(64)));
for (int layer = 0; layer < rel15->nrOfLayers; layer++) {
do_onelayer(frame_parms,
slot,
rel15,
layer,
txdataF_precoding[layer],
tx_layers[layer] + rdata->re_beginning_of_symbol[l_symbol],
start_sc,
symbol_sz,
l_symbol,
rdata->dlPtrsSymPos,
rdata->n_ptrs,
gNB->TX_AMP,
min((double)gNB->TX_AMP * sqrt(rel15->numDmrsCdmGrpsNoData), INT16_MAX),
l_prime,
rel15->dmrsConfigType,
mod_dmrs + dmrs_idx);
} // layer loop
stop_meas(&rdata->dlsch_resource_mapping_stats);
start_meas(&rdata->dlsch_precoding_stats);
for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) {
const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz;
do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol);
}
stop_meas(&rdata->dlsch_precoding_stats);
}
// Task running in // completed
completed_task_ans(rdata->ans);
}
static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSCH_t *dlsch, int slot)
{
const int16_t amp = gNB->TX_AMP;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
time_stats_t *dlsch_scrambling_stats = &gNB->dlsch_scrambling_stats;
time_stats_t *dlsch_modulation_stats = &gNB->dlsch_modulation_stats;
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu->pdsch_pdu_rel15;
const int layerSz = frame_parms->N_RB_DL * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB;
const int symbol_sz=frame_parms->ofdm_symbol_size;
const int dmrs_Type = rel15->dmrsConfigType;
const int nb_re_dmrs = rel15->numDmrsCdmGrpsNoData * (rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
const int16_t amp_dmrs = min((double)amp * sqrt(rel15->numDmrsCdmGrpsNoData), INT16_MAX); // 3GPP TS 38.214 Section 4.1: Table 4.1-1
LOG_D(PHY,
"pdsch: BWPStart %d, BWPSize %d, rbStart %d, rbsize %d\n",
rel15->BWPStart,
rel15->BWPSize,
rel15->rbStart,
rel15->rbSize);
const int n_dmrs = (rel15->BWPStart + rel15->rbStart + rel15->rbSize) * nb_re_dmrs;
const int n_dmrs = rel15->rbSize * nb_re_dmrs;
const int dmrs_symbol_map = rel15->dlDmrsSymbPos; // single DMRS: 010000100 Double DMRS 110001100
const int xOverhead = 0;
const int nb_re =
(12 * rel15->NrOfSymbols - nb_re_dmrs * get_num_dmrs(rel15->dlDmrsSymbPos) - xOverhead) * rel15->rbSize * rel15->nrOfLayers;
@@ -567,21 +639,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
start_meas(&gNB->dlsch_pdsch_generation_stats);
/// Resource mapping
// Non interleaved VRB to PRB mapping
uint16_t start_sc = (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB;
#ifdef DEBUG_DLSCH_MAPPING
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
start_sc,
rel15->StartSymbolIndex,
rel15->rbSize,
nb_re,
rel15->nrOfLayers);
#endif
AssertFatal(n_dmrs, "n_dmrs can't be 0\n");
// make a large enough tail to process all re with SIMD regardless a garbadge filler
c16_t mod_dmrs[(n_dmrs+63)&~63] __attribute__((aligned(64)));
unsigned int re_beginning_of_symbol = 0;
start_meas(&gNB->dlsch_layer_mapping_stats);
int layerSz2 = (layerSz + 63) & ~63;
@@ -605,84 +665,69 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
slot,
frame_parms->symbols_per_slot,
bitmap);
c16_t **txdataF = gNB->common_vars.txdataF[beam_nb];
stop_meas(&gNB->dlsch_layer_mapping_stats);
// Loop Over OFDM symbols:
for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; l_symbol++) {
start_meas(&gNB->dlsch_resource_mapping_stats);
int l_prime = 0; // single symbol layer 0
int l_overline = get_l0(rel15->dlDmrsSymbPos);
#ifdef DEBUG_DLSCH_MAPPING
printf("PDSCH resource mapping symbol %d\n", l_symbol);
#endif
/// DMRS QPSK modulation
if ((dmrs_symbol_map & (1 << l_symbol))) { // DMRS time occasion
// The reference point for is subcarrier -1 of the lowest-numbered resource block in CORESET 0 if the corresponding
// PDCCH is associated with CORESET -1 and Type0-PDCCH common search space and is addressed to SI-RNTI
// 2GPP TS 38.211 V15.8.0 Section 7.4.1.1.2 Mapping to physical resources
if (l_symbol == (l_overline + 1)) // take into account the double DMRS symbols
l_prime = 1;
else if (l_symbol > (l_overline + 1)) { // new DMRS pair
l_overline = l_symbol;
l_prime = 0;
// spawn symbol threads
int nb_tasks = 1;
int num_pdsch_symbols_per_task = rel15->NrOfSymbols;
if (gNB->num_pdsch_symbols_per_thread > 0) {
// symbol processing in thread pool enabled
num_pdsch_symbols_per_task = gNB->num_pdsch_symbols_per_thread;
nb_tasks = rel15->NrOfSymbols / num_pdsch_symbols_per_task;
if ((rel15->NrOfSymbols % num_pdsch_symbols_per_task) > 0)
nb_tasks++;
}
pdschSymbolProc_t arr[nb_tasks];
task_ans_t ans;
init_task_ans(&ans, nb_tasks);
int sz_arr = 0;
unsigned int re_beginning_of_symbol = 0;
int res = 0;
for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols;
l_symbol += num_pdsch_symbols_per_task) {
pdschSymbolProc_t *rdata = &arr[sz_arr];
rdata->ans = &ans;
++sz_arr;
rdata->gNB = gNB;
rdata->frame_parms = frame_parms;
rdata->rel15 = rel15;
rdata->slot = slot;
rdata->startSymbol = l_symbol;
res = rel15->NrOfSymbols - (l_symbol - rel15->StartSymbolIndex);
if (res >= num_pdsch_symbols_per_task)
rdata->numSymbols = num_pdsch_symbols_per_task;
else
rdata->numSymbols = res;
rdata->layerSz2 = layerSz2;
rdata->dlPtrsSymPos = dlPtrsSymPos;
rdata->n_ptrs = n_ptrs;
rdata->beam_nb = beam_nb;
for (int s = l_symbol; s < l_symbol + rdata->numSymbols; s++) {
rdata->re_beginning_of_symbol[s] = re_beginning_of_symbol;
re_beginning_of_symbol += rel15->rbSize * NR_NB_SC_PER_RB;
if (n_ptrs > 0 && is_ptrs_symbol(s, dlPtrsSymPos)) {
re_beginning_of_symbol -= n_ptrs;
} else if (rel15->dlDmrsSymbPos & (1 << s)) {
re_beginning_of_symbol -= n_dmrs;
}
#ifdef DEBUG_DLSCH_MAPPING
printf("dlDmrsScramblingId %d, SCID %d slot %d l_symbol %d\n", rel15->dlDmrsScramblingId, rel15->SCID, slot, l_symbol);
#endif
const uint32_t *gold = nr_gold_pdsch(frame_parms->N_RB_DL,
frame_parms->symbols_per_slot,
rel15->dlDmrsScramblingId,
rel15->SCID,
slot,
l_symbol);
// Qm = 1 as DMRS is QPSK modulated
nr_modulation(gold, n_dmrs * DMRS_MOD_ORDER, DMRS_MOD_ORDER, (int16_t *)mod_dmrs);
#ifdef DEBUG_DLSCH_MAPPING
printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l_symbol, n_dmrs, dmrs_Type);
for (int i = 0; i < n_dmrs / 2; i += 8) {
for (int j = 0; j < 8; j++) {
printf("%d %d\t", mod_dmrs[i + j].r, mod_dmrs[i + j].i);
}
printf("\n");
}
#endif
}
uint32_t dmrs_idx = rel15->rbStart;
if (rel15->refPoint == 0)
dmrs_idx += rel15->BWPStart;
dmrs_idx *= dmrs_Type == NFAPI_NR_DMRS_TYPE1 ? 6 : 4;
c16_t txdataF_precoding[rel15->nrOfLayers][symbol_sz] __attribute__((aligned(64)));
int layer_sz = 0;
for (int layer = 0; layer < rel15->nrOfLayers; layer++) {
layer_sz = do_onelayer(frame_parms,
slot,
rel15,
layer,
txdataF_precoding[layer],
tx_layers[layer] + re_beginning_of_symbol,
start_sc,
symbol_sz,
l_symbol,
dlPtrsSymPos,
n_ptrs,
amp,
amp_dmrs,
l_prime,
dmrs_Type,
mod_dmrs + dmrs_idx);
} // layer loop
re_beginning_of_symbol += layer_sz;
stop_meas(&gNB->dlsch_resource_mapping_stats);
start_meas(&gNB->dlsch_precoding_stats);
for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) {
const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz;
do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol);
reset_meas(&rdata->dlsch_resource_mapping_stats);
reset_meas(&rdata->dlsch_precoding_stats);
for (int l = 0; l < rel15->nrOfLayers; l++)
rdata->tx_layers[l] = tx_layers[l];
if (l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols - num_pdsch_symbols_per_task) {
task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata};
pushTpool(&gNB->threadPool, t);
} else {
nr_pdsch_symbol_processing(rdata);
}
stop_meas(&gNB->dlsch_precoding_stats);
}
join_task_ans(&ans);
for (int i = 0; i < nb_tasks; i++) {
merge_meas(&gNB->dlsch_resource_mapping_stats, &arr[i].dlsch_resource_mapping_stats);
merge_meas(&gNB->dlsch_precoding_stats, &arr[i].dlsch_precoding_stats);
}
stop_meas(&gNB->dlsch_pdsch_generation_stats);
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
+2 -10
View File
@@ -88,14 +88,8 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM
@param UE_id id of current UE
@param frame Frame number
@param slot Slot number
@param harq_pid HARQ process ID
*/
int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
uint8_t ulsch_id,
uint32_t frame,
uint8_t slot,
unsigned char harq_pid,
int beam_nb);
int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, uint8_t ulsch_id, uint32_t frame, uint8_t slot, int beam_nb);
/*!
\brief This function implements the idft transform precoding in PUSCH
@@ -147,9 +141,7 @@ void nr_ulsch_compute_llr(c16_t *rxdataF_comp,
void reset_active_stats(PHY_VARS_gNB *gNB, int frame);
void reset_active_ulsch(PHY_VARS_gNB *gNB, int frame);
void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars,
uint32_t symbol,
c16_t *rxdataF_comp0,
void nr_ulsch_compute_ML_llr(c16_t *rxdataF_comp0,
c16_t *rxdataF_comp1,
c16_t *ul_ch_mag0,
c16_t *ul_ch_mag1,
@@ -79,7 +79,6 @@ static void nr_ulsch_extract_rbs(c16_t* const rxdataF,
c16_t *chFext,
int rxoffset,
int choffset,
int aarx,
int is_dmrs_symbol,
nfapi_nr_pusch_pdu_t *pusch_pdu,
NR_DL_FRAME_PARMS *frame_parms)
@@ -265,9 +264,7 @@ static void nr_ulsch_det_HhH(c16_t *after_mf_00, // a
c16_t *after_mf_10, // c
c16_t *after_mf_11, // d
uint32_t *det_fin, // 1/ad-bc
unsigned short nb_rb,
unsigned char symbol,
int32_t shift)
unsigned short nb_rb)
{
simde__m128i *after_mf_00_128,*after_mf_01_128, *after_mf_10_128, *after_mf_11_128, ad_re_128, bc_re_128; //ad_im_128, bc_im_128;
simde__m128i *det_fin_128, det_re_128; //det_im_128, tmp_det0, tmp_det1;
@@ -390,8 +387,7 @@ static void nr_ulsch_construct_HhH_elements(c16_t *conjch00_ch00,
c16_t *after_mf_01,
c16_t *after_mf_10,
c16_t *after_mf_11,
unsigned short nb_rb,
unsigned char symbol)
unsigned short nb_rb)
{
//This function is used to construct the (H_hermitian * H matrix) matrix elements
simde__m128i *conjch00_ch00_128 = (simde__m128i *)conjch00_ch00;
@@ -678,8 +674,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp,
af_mf_01,
af_mf_10,
af_mf_11,
nb_rb_0,
symbol);
nb_rb_0);
}
if (nb_rx_ant == 2) {
nr_ulsch_construct_HhH_elements(conjch00_ch00,
@@ -702,8 +697,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp,
af_mf_01,
af_mf_10,
af_mf_11,
nb_rb_0,
symbol);
nb_rb_0);
}
// Add noise_var such that: H^h * H + noise_var * I
@@ -725,9 +719,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp,
af_mf_10,//c
af_mf_11,//d
determ_fin,
nb_rb_0,
symbol,
shift);
nb_rb_0);
/* 2- Compute the channel matrix inversion **********************************
*
* |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)|
@@ -871,10 +863,8 @@ static void inner_rx(PHY_VARS_gNB *gNB,
NR_gNB_PUSCH *pusch_vars,
nfapi_nr_pusch_pdu_t *rel15_ul,
c16_t **rxF,
c16_t **ul_ch,
int16_t **llr,
int soffset,
int length,
int symbol,
int output_shift,
uint32_t nvar,
@@ -906,7 +896,6 @@ static void inner_rx(PHY_VARS_gNB *gNB,
chFext[aatx][aarx],
soffset+(symbol * frame_parms->ofdm_symbol_size),
dmrs_symbol * frame_parms->ofdm_symbol_size,
aarx,
dmrs_symbol_flag,
rel15_ul,
frame_parms);
@@ -972,10 +961,8 @@ static void inner_rx(PHY_VARS_gNB *gNB,
if (nb_layer == 2) {
if (rel15_ul->qam_mod_order <= 6) {
nr_ulsch_compute_ML_llr(pusch_vars,
symbol,
&pusch_vars->rxdataF_comp[0][symbol * buffer_length],
&pusch_vars->rxdataF_comp[nb_rx_ant][symbol * buffer_length],
nr_ulsch_compute_ML_llr((c16_t *)&pusch_vars->rxdataF_comp[0][symbol * buffer_length],
(c16_t *)&pusch_vars->rxdataF_comp[nb_rx_ant][symbol * buffer_length],
rxF_ch_maga[0],
rxF_ch_maga[1],
llr[0],
@@ -1057,10 +1044,8 @@ static void nr_pusch_symbol_processing(void *arg)
pusch_vars,
rel15_ul,
gNB->common_vars.rxdataF[rdata->beam_nb],
(c16_t **)gNB->pusch_vars[ulsch_id].ul_ch_estimates,
llrss,
soffset,
gNB->pusch_vars[ulsch_id].ul_valid_re_per_slot[symbol],
symbol,
gNB->pusch_vars[ulsch_id].log2_maxh,
rdata->nvar,
@@ -1113,12 +1098,7 @@ static uint32_t average_u32(const uint32_t *x, uint16_t size)
return (uint32_t)(sum_x / size);
}
int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
uint8_t ulsch_id,
uint32_t frame,
uint8_t slot,
unsigned char harq_pid,
int beam_nb)
int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, uint8_t ulsch_id, uint32_t frame, uint8_t slot, int beam_nb)
{
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id].harq_process->ulsch_pdu;
@@ -1323,7 +1303,6 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
(c16_t*)&ul_ch_estimates_ext[nl * frame_parms->nb_antennas_rx + aarx][meas_symbol * nb_re_pusch],
soffset + meas_symbol * frame_parms->ofdm_symbol_size,
dmrs_symbol * frame_parms->ofdm_symbol_size,
aarx,
(rel15_ul->ul_dmrs_symb_pos >> meas_symbol) & 0x01,
rel15_ul,
frame_parms);
@@ -1741,12 +1741,7 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in,
#endif
}
static void nr_ulsch_shift_llr(int16_t *llr_layer0,
int16_t *llr_layer1,
uint32_t nb_re,
uint32_t rxdataF_ext_offset,
uint8_t mod_order,
int shift)
static void nr_ulsch_shift_llr(int16_t *llr_layer0, int16_t *llr_layer1, uint32_t nb_re, int shift)
{
simde__m128i *llr_layers0 = (simde__m128i *)llr_layer0;
simde__m128i *llr_layers1 = (simde__m128i *)llr_layer1;
@@ -1770,9 +1765,7 @@ static void nr_ulsch_shift_llr(int16_t *llr_layer0,
}
}
void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars,
uint32_t symbol,
c16_t *rxdataF_comp0,
void nr_ulsch_compute_ML_llr(c16_t *rxdataF_comp0,
c16_t *rxdataF_comp1,
c16_t *ul_ch_mag0,
c16_t *ul_ch_mag1,
@@ -1787,7 +1780,7 @@ void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars,
case 2:
nr_ulsch_qpsk_qpsk(rxdataF_comp0, rxdataF_comp1, llr_layers0, rho0, nb_re);
nr_ulsch_qpsk_qpsk(rxdataF_comp1, rxdataF_comp0, llr_layers1, rho1, nb_re);
nr_ulsch_shift_llr((int16_t *)llr_layers0, (int16_t *)llr_layers1, nb_re, pusch_vars->llr_offset[symbol] >> 1, 2, 4);
nr_ulsch_shift_llr((int16_t *)llr_layers0, (int16_t *)llr_layers1, nb_re, 4);
break;
case 4:
nr_ulsch_qam16_qam16(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re);
@@ -517,7 +517,6 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
}
c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp,
const UE_nr_rxtx_proc_t *proc,
const int symbol,
const int dmrss,
const int Nid_cell,
@@ -535,8 +534,7 @@ c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp,
unsigned int k = Nid_cell % 4;
DEBUG_PBCH("PBCH DMRS Correlation : gNB_id %d , OFDM size %d, Ncp=%d, k=%u symbol %d\n",
proc->gNB_id,
DEBUG_PBCH("PBCH DMRS Correlation : OFDM size %d, Ncp=%d, k=%u symbol %d\n",
fp->ofdm_symbol_size,
fp->Ncp,
k,
@@ -39,7 +39,6 @@ void nr_pdcch_channel_estimation(const PHY_VARS_NR_UE *ue,
c16_t *pilot);
c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp,
const UE_nr_rxtx_proc_t *proc,
const int symbol,
const int dmrss,
const int Nid_cell,
+20 -26
View File
@@ -211,6 +211,9 @@ static int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
ant_rx,
rx_csi_rs_signal[k].r,
rx_csi_rs_signal[k].i);
#else
UNUSED(proc);
UNUSED(nr_csi_info);
#endif
}
}
@@ -250,7 +253,6 @@ uint32_t calc_power_csirs(const uint16_t *x, const fapi_nr_dl_config_csirs_pdu_r
static int nr_csi_rs_channel_estimation(
const NR_DL_FRAME_PARMS *fp,
const UE_nr_rxtx_proc_t *proc,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_info_t *nr_csi_info,
const c16_t **csi_rs_generated_signal,
@@ -421,14 +423,13 @@ static int nr_csi_rs_channel_estimation(
return 0;
}
int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_info_t *nr_csi_info,
const uint8_t N_ports,
uint8_t mem_offset,
c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN],
const int16_t log2_maxh,
uint8_t *rank_indicator)
static int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const uint8_t N_ports,
uint8_t mem_offset,
c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN],
const int16_t log2_maxh,
uint8_t *rank_indicator)
{
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
const int16_t cond_dB_threshold = 5;
@@ -554,18 +555,16 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
return 0;
}
int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_info_t *nr_csi_info,
const uint8_t N_ports,
uint8_t mem_offset,
const c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN],
const uint32_t interference_plus_noise_power,
const uint8_t rank_indicator,
const int16_t log2_re,
uint8_t *i1,
uint8_t *i2,
int32_t *precoded_sinr_dB)
static int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const uint8_t N_ports,
uint8_t mem_offset,
const c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN],
const uint32_t interference_plus_noise_power,
const uint8_t rank_indicator,
const int16_t log2_re,
uint8_t *i2,
int32_t *precoded_sinr_dB)
{
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
@@ -787,7 +786,6 @@ static void nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue,
}
void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu)
{
@@ -898,7 +896,6 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
// if we need to measure only RSRP no need to do channel estimation
if (csirs_config_pdu->measurement_bitmap > 1)
nr_csi_rs_channel_estimation(frame_parms,
proc,
csirs_config_pdu,
csi_info,
(const c16_t **)csi_info->csi_rs_generated_signal,
@@ -917,7 +914,6 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
if (csirs_config_pdu->measurement_bitmap & 2) {
nr_csi_rs_ri_estimation(ue,
csirs_config_pdu,
csi_info,
mapping_parms.ports,
mem_offset,
csi_rs_estimated_channel_freq,
@@ -933,14 +929,12 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
if (csirs_config_pdu->measurement_bitmap & 8) {
nr_csi_rs_pmi_estimation(ue,
csirs_config_pdu,
csi_info,
mapping_parms.ports,
mem_offset,
csi_rs_estimated_channel_freq,
csi_info->csi_im_meas_computed ? csi_info->interference_plus_noise_power : noise_power,
rank_indicator,
log2_re,
i1,
i2,
&precoded_sinr_dB);
@@ -123,8 +123,7 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
int length,
unsigned char mod_order,
unsigned short nb_rb,
unsigned char output_shift,
PHY_NR_MEASUREMENTS *measurements)
unsigned char output_shift)
{
simde__m128i *dl_ch128, *dl_ch128_2, *dl_ch_mag128, *dl_ch_mag128b, *dl_ch_mag128r, *rxdataF128, *rxdataF_comp128, *rho128;
simde__m128i QAM_amp128 = {0}, QAM_amp128b = {0}, QAM_amp128r = {0};
@@ -967,7 +966,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
memset(dl_ch_estimates_ext, 0, sizeof(dl_ch_estimates_ext));
NR_UE_COMMON *common_vars = &ue->common_vars;
PHY_NR_MEASUREMENTS *measurements = &ue->measurements;
const int frame = proc->frame_rx;
const int nr_slot_rx = proc->nr_slot_rx;
const int gNB_id = proc->gNB_id;
@@ -1228,8 +1226,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nb_re_pdsch,
dlsch_config->qamModOrder,
nb_rb_pdsch,
*log2_maxh,
measurements); // log2_maxh+I0_shift
*log2_maxh); // log2_maxh+I0_shift
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_COMPENSATION_STATS);
if (meas_enabled) {
LOG_D(PHY,
@@ -58,7 +58,6 @@ static bool nr_pbch_detection(const UE_nr_rxtx_proc_t *proc,
cd_t cumul = {0};
for (int i = pbch_initial_symbol; i < pbch_initial_symbol + 3; i++) {
c32_t meas = nr_pbch_dmrs_correlation(frame_parms,
proc,
i,
i - pbch_initial_symbol,
Nid_cell,
@@ -141,6 +141,7 @@ There is no data in DMRS symbol for other scenarios in type 1.
*/
static void map_data_dmrs_type1_cdm1_rb(const unsigned int num_cdm_no_data, const c16_t *data, c16_t *out)
{
UNUSED(num_cdm_no_data);
*(out + 1) = *data++;
*(out + 3) = *data++;
*(out + 5) = *data++;
+1
View File
@@ -485,6 +485,7 @@ typedef struct PHY_VARS_gNB_s {
notifiedFIFO_t L1_rx_out;
tpool_t threadPool;
int num_pusch_symbols_per_thread;
int num_pdsch_symbols_per_thread;
int dmrs_num_antennas_per_thread;
pthread_t L1_rx_thread;
int L1_rx_thread_core;
-2
View File
@@ -47,8 +47,6 @@
#define openair_sched_exit() exit(-1)
#define bzero(s,n) (memset((s),0,(n)))
/// suppress compiler warning for unused arguments
#define UNUSED(x) (void)x;
// Set the number of barriers for processSlotTX to 512. This value has to be at least 483 for NTN where
// DL-to-UL offset is up to 483. The selected value is also half of the frame range so that
+1 -1
View File
@@ -1112,7 +1112,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
pusch_decode_done = 1;
start_meas(&gNB->rx_pusch_stats);
nr_rx_pusch_tp(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->harq_pid, ulsch->beam_nb);
nr_rx_pusch_tp(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->beam_nb);
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[ULSCH_id];
pusch_vars->ulsch_power_tot = 0;
pusch_vars->ulsch_noise_power_tot = 0;
-1
View File
@@ -127,7 +127,6 @@ void nr_pdcch_dci_indication(const UE_nr_rxtx_proc_t *proc,
c16_t llr[phy_data->phy_pdcch_config.nb_search_space][max_monOcc][llr_size]);
void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu);
+1 -1
View File
@@ -1241,7 +1241,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
slot_fep_map[symb] = true;
}
}
nr_ue_csi_im_procedures(ue, proc, rxdataF, &phy_data->csiim_vars.csiim_config_pdu);
nr_ue_csi_im_procedures(ue, rxdataF, &phy_data->csiim_vars.csiim_config_pdu);
}
// do procedures for CSI-RS
+8
View File
@@ -382,6 +382,8 @@ int main(int argc, char **argv)
uint8_t dlsch_threads = 0;
int chest_type[2] = {0};
uint8_t max_ldpc_iterations = 5;
// number of PDSCH symbols per thread = 0 means do not use thread pool
int num_pdsch_symbols_per_thread = 0;
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) {
exit_fun("[NR_DLSIM] Error, configuration module init failed\n");
}
@@ -583,6 +585,10 @@ int main(int argc, char **argv)
gNBthreads[sizeof(gNBthreads)-1]=0;
break;
case 'Y':
num_pdsch_symbols_per_thread = atoi(optarg);
break;
case 'Z' :
filename_csv = strdup(optarg);
AssertFatal(filename_csv != NULL, "strdup() error: errno %d\n", errno);
@@ -657,6 +663,7 @@ int main(int argc, char **argv)
printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n");
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n");
printf("-X gNB thread pool configuration, n => no threads\n");
printf("-Y Number of symbols processed per PDSCH generation thread\n");
printf("-Z Output filename (.csv format) for stats\n");
exit (-1);
break;
@@ -715,6 +722,7 @@ int main(int argc, char **argv)
AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface");
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
gNB->num_pdsch_symbols_per_thread = num_pdsch_symbols_per_thread;
NR_ServingCellConfigCommon_t *scc = calloc(1,sizeof(*scc));;
prepare_scc(scc);
+73 -28
View File
@@ -20,61 +20,62 @@ void sigint_handler(int arg)
{
static const char msg[] = "\nCaught SIGINT, shutting down\nPress again CTRL+C to force shutdown\n";
__attribute__((unused)) int unused = write(STDOUT_FILENO, msg, sizeof(msg) - 1);
UNUSED(arg);
stop = true;
}
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
{
return (0);
}
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
{
return (0);
}
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req)
{
return (0);
}
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req)
{
return (0);
}
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind)
{
UNUSED(ind);
return 0;
}
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot)
{
UNUSED(sfn);
UNUSED(slot);
}
int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen)
{
UNUSED(pMessageBuf);
UNUSED(pPackedBuf);
UNUSED(packedBufLen);
return 0;
}
int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen)
{
UNUSED(pMessageBuf);
UNUSED(messageBufLen);
UNUSED(pUnpackedBuf);
UNUSED(unpackedBufLen);
return 0;
}
int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen)
{
UNUSED(pMessageBuf);
UNUSED(pPackedBuf);
UNUSED(packedBufLen);
return 0;
}
int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf,
@@ -82,24 +83,31 @@ int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf,
void *pUnpackedBuf,
uint32_t unpackedBufLen)
{
UNUSED(pMessageBuf);
UNUSED(messageBufLen);
UNUSED(pUnpackedBuf);
UNUSED(unpackedBufLen);
return 0;
}
void get_position_coordinates(int Mod_id, position_t *position)
{
}
int32_t get_uldl_offset(int nr_bandP)
{
return (0);
}
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port)
{
UNUSED(vnf_ip_addr);
UNUSED(vnf_p5_port);
UNUSED(pnf_ip_addr);
UNUSED(pnf_p7_port);
UNUSED(vnf_p7_port);
}
void configure_nr_nfapi_vnf(eth_params_t params)
{
UNUSED(params);
}
int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t *config)
{
UNUSED(pMessageBuf);
UNUSED(pPackedBuf);
UNUSED(packedBufLen);
UNUSED(config);
return 0;
}
bool nfapi_nr_p7_message_unpack(void *pMessageBuf,
@@ -108,6 +116,11 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf,
uint32_t unpackedBufLen,
nfapi_p7_codec_config_t *config)
{
UNUSED(pMessageBuf);
UNUSED(messageBufLen);
UNUSED(pUnpackedBuf);
UNUSED(unpackedBufLen);
UNUSED(config);
return false;
}
int nfapi_p7_message_header_unpack(void *pMessageBuf,
@@ -116,23 +129,37 @@ int nfapi_p7_message_header_unpack(void *pMessageBuf,
uint32_t unpackedBufLen,
nfapi_p7_codec_config_t *config)
{
UNUSED(pMessageBuf);
UNUSED(messageBufLen);
UNUSED(pUnpackedBuf);
UNUSED(unpackedBufLen);
UNUSED(config);
return 0;
}
void nr_mac_rrc_sync_ind(const module_id_t module_id, const frame_t frame, const bool in_sync)
{
UNUSED(module_id);
UNUSED(frame);
UNUSED(in_sync);
}
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, int rnti, int gnb_id)
{
UNUSED(mod_id);
UNUSED(gnb_id);
UNUSED(rnti);
}
void nr_mac_rrc_ra_ind(const module_id_t mod_id, bool success)
{
UNUSED(mod_id);
UNUSED(success);
}
void nr_mac_rrc_inactivity_timer_ind(const module_id_t mod_id)
{
UNUSED(mod_id);
}
void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP,
@@ -140,6 +167,10 @@ void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP,
const sdu_size_t sdu_sizeP,
const uint8_t *const buffer_pP)
{
UNUSED(ctxt_pP);
UNUSED(Srb_id);
UNUSED(sdu_sizeP);
UNUSED(buffer_pP);
}
typedef uint32_t channel_t;
@@ -156,12 +187,20 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
const uint8_t *pduP,
const sdu_size_t pdu_len)
{
UNUSED(module_id);
UNUSED(CC_id);
UNUSED(gNB_index);
UNUSED(hfn);
UNUSED(frame);
UNUSED(slot);
UNUSED(rnti);
UNUSED(arfcn);
UNUSED(channel);
UNUSED(pduP);
UNUSED(pdu_len);
UNUSED(cellid);
return 0;
}
void *rrc_nrue(void *notUsed)
{
return NULL;
}
void nr_mac_rrc_meas_ind_ue(module_id_t module_id,
uint32_t gNB_index,
@@ -170,4 +209,10 @@ void nr_mac_rrc_meas_ind_ue(module_id_t module_id,
bool is_neighboring_cell,
int rsrp_dBm)
{
UNUSED(module_id);
UNUSED(Nid_cell);
UNUSED(gNB_index);
UNUSED(csi_meas);
UNUSED(is_neighboring_cell);
UNUSED(rsrp_dBm);
}

Some files were not shown because too many files have changed in this diff Show More