Commit 6cc01f7c authored by Robert Schmidt's avatar Robert Schmidt

Merge branch 'integration_2023_w17' into 'develop'

integration_2023_w17

See merge request oai/openairinterface5g!2083

* !2045 ssb offset to point A harmonization
* !2068 Add mac_CellGroupConfig in RRCReconfiguration after a RRCReestablisment
* !2052 fix(ci): for old versions of iperf, server process shall be killed manually
* !2056 Generic changes related to UEs used in CI
* !2074 Fix of command for USRP B200 reset in CI pipeline
* !2014 transform global variables into const or static
* !2082 Change of the PLMN in AW2S pipeline
* !2078 Improve PRS Tutorial
* !2079 Update scope (Xforms, Qt) documentation and list in doc/README.md
parents 6022fe5a fc010329
......@@ -775,7 +775,6 @@ add_library(UTIL
set(SECU_OSA_SRC
${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c
${OPENAIR2_DIR}/UTIL/OSA/osa_rijndael.c
${OPENAIR2_DIR}/UTIL/OSA/osa_snow3g.c
${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eea.c
${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eia.c
......@@ -1178,7 +1177,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/ptrs_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_measurements_gNB.c
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
......@@ -1229,7 +1227,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_REFSIG/ptrs_nr.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold_ue.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
......@@ -1355,7 +1352,6 @@ set(NR_PDCP_SRC
#of reusing code of osa_stream_eia.c
${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eia.c
${OPENAIR2_DIR}/UTIL/OSA/osa_snow3g.c
${OPENAIR2_DIR}/UTIL/OSA/osa_rijndael.c
)
set(NR_SDAP_SRC
......
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 2
#define TDD 1
log_options: "all.level=warn,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: 20,
band: 78,
dl_nr_arfcn:627360,
ssb_nr_arfcn:627360,
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* UE capabilities */
/* USIM data */
ue_list: [
{
"ue_id" : 1,
"imsi": "208970000000111",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 2,
"imsi": "208970000000112",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 3,
"imsi": "208970000000113",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 4,
"imsi": "208970000000114",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 5,
"imsi": "208970000000115",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 6,
"imsi": "208970000000116",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 7,
"imsi": "208970000000117",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 8,
"imsi": "208970000000118",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 9,
"imsi": "208970000000119",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 10,
"imsi": "208970000000120",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 11,
"imsi": "208970000000121",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 12,
"imsi": "208970000000122",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 13,
"imsi": "208970000000123",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 14,
"imsi": "208970000000124",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 15,
"imsi": "208970000000125",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
{
"ue_id" : 16,
"imsi": "208970000000126",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
tun_setup_script: "ue-ifup",
},
],
}
......@@ -49,7 +49,7 @@ adb_ue_2:
amarisoft_ue:
Host: amariue
InitScript: /root/NV18-06-2022/lteue-linux-2023-03-17/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-asue.cfg &
InitScript: /root/NV18-06-2022/lteue-linux-2023-03-17/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-20897.cfg &
TermScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"quit"}'
amarisoft_ue_1:
Host: amariue
......
......@@ -31,6 +31,9 @@ import subprocess as sp
import os
import paramiko
import uuid
import sys
SSHTIMEOUT=7
# helper that returns either LocalCmd or RemoteCmd based on passed host name
def getConnection(host, d=None):
......@@ -123,13 +126,21 @@ class LocalCmd(Cmd):
class RemoteCmd(Cmd):
def __init__(self, hostname, d=None):
cIdx = 0
logging.getLogger('paramiko').setLevel(logging.ERROR) # prevent spamming through Paramiko
self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
cfg = RemoteCmd._lookup_ssh_config(hostname)
self.client.connect(**cfg)
self.cwd = d
self.cp = sp.CompletedProcess(args='', returncode=0, stdout='')
while cIdx < 3:
try:
self.client.connect(**cfg)
return
except:
logging.error(f'Could not connect to {hostname}, tried for {cIdx} time')
cIdx +=1
raise Exception ("Error: max retries, did not connect to host")
def _lookup_ssh_config(hostname):
ssh_config = paramiko.SSHConfig()
......@@ -142,7 +153,7 @@ class RemoteCmd(Cmd):
ucfg = ssh_config.lookup(hostname)
if 'identityfile' not in ucfg or 'user' not in ucfg:
raise KeyError(f'no identityfile or user in SSH config for host {hostname}')
cfg = {'hostname':hostname, 'username':ucfg['user'], 'key_filename':ucfg['identityfile']}
cfg = {'hostname':hostname, 'username':ucfg['user'], 'key_filename':ucfg['identityfile'], 'timeout':SSHTIMEOUT}
if 'hostname' in ucfg:
cfg['hostname'] = ucfg['hostname'] # override user-given hostname with what is in config
if 'port' in ucfg:
......
......@@ -81,7 +81,7 @@ class Module_UE:
c = cls_cmd.RemoteCmd(self.host)
response = c.run(cmd, silent=silent)
c.close()
return response.stdout
return response
#-----------------$
#PUBLIC Methods$
......@@ -95,7 +95,11 @@ class Module_UE:
if self.cmd_dict["detach"]:
self._command(self.cmd_dict["detach"], silent=True)
self._command(self.cmd_dict["terminate"], silent=True)
self._command(self.cmd_dict["initialize"])
ret = self._command(self.cmd_dict["initialize"])
logging.info(f'For command: {ret.args} | return output: {ret.stdout} | Code: {ret.returncode}')
# Here each UE returns differently for the successful initialization, requires check based on UE
return ret.returncode == 0
def terminate(self):
self._command(self.cmd_dict["terminate"])
......@@ -122,9 +126,9 @@ class Module_UE:
self._command(self.cmd_dict["detach"])
time.sleep(5)
if ip:
logging.debug(f'\u001B[1mUE IP Address is {ip}\u001B[0m')
logging.debug(f'\u001B[1mUE IP Address for UE {self.module_name} is {ip}\u001B[0m')
else:
logging.debug('\u001B[1;37;41mUE IP Address Not Found!\u001B[0m')
logging.debug(f'\u001B[1;37;41mUE IP Address for UE {self.module_name} Not Found!\u001B[0m')
return ip
def detach(self):
......@@ -133,7 +137,7 @@ class Module_UE:
def check(self):
cmd = self.cmd_dict["check"]
if cmd:
return self._command(cmd)
return self._command(cmd).stdout
else:
logging.warning(f"requested status check of UE {self.getName()}, but operation is not supported")
return f"UE {self.getName()} does not support status checking"
......@@ -160,7 +164,7 @@ class Module_UE:
def getIP(self):
output = self._command(self.cmd_dict["getNetwork"], silent=True)
result = re.search('inet (?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output)
result = re.search('inet (?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output.stdout)
if result and result.group('ip'):
ip = result.group('ip')
return ip
......@@ -168,12 +172,12 @@ class Module_UE:
def checkMTU(self):
output = self._command(self.cmd_dict["getNetwork"], silent=True)
result = re.search('mtu (?P<mtu>[0-9]+)', output)
result = re.search('mtu (?P<mtu>[0-9]+)', output.stdout)
if result and result.group('mtu') and int(result.group('mtu')) == self.MTU:
logging.debug('\u001B[1mUE Module NIC MTU is ' + str(self.MTU) + ' as expected\u001B[0m')
logging.debug(f'\u001B[1mUE Module {self.module_name} NIC MTU is {self.MTU} as expected\u001B[0m')
return True
else:
logging.debug('\u001B[1;37;41m Incorrect Module NIC MTU or MTU not found! Expected: ' + str(self.MTU) + '\u001B[0m')
logging.debug(f'\u001B[1;37;41m UE module {self.module_name} has incorrect Module NIC MTU or MTU not found! Expected: {self.MTU} \u001B[0m')
return False
def getName(self):
......
......@@ -295,10 +295,13 @@ class OaiCiTest():
def InitializeUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
messages = []
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.initialize) for ue in ues]
for f, ue in zip(futures, ues):
uename = f'UE {ue.getName()}'
messages.append(f'{uename}: initialized' if f.result() else f'{uename}: ERROR during Initialization')
[f.result() for f in futures]
messages = [f'UE {ue.getName()}: initialized' for ue in ues]
HTML.CreateHtmlTestRowQueue('N/A', 'OK', messages)
......@@ -1273,7 +1276,7 @@ class OaiCiTest():
logging.debug("Iperf in UL requested")
cmd = cls_cmd.getConnection(EPC.IPAddress)
cmd.run(f'rm {EPC.SourceCodePath}/{server_filename}')
cmd.run(f'{cn_iperf_prefix} iperf -s {udpSwitch} -1 -t {iperf_time * 1.5} {port} &> {EPC.SourceCodePath}/{server_filename} &')
cmd.run(f'{cn_iperf_prefix} iperf -s {udpSwitch} -t {iperf_time * 1.5} {port} &> {EPC.SourceCodePath}/{server_filename} &')
cmd.close()
cmd = cls_cmd.getConnection(ue.getHost())
......
......@@ -16,7 +16,7 @@ gNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 0x1;
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst =0x1; }) });
plmn_list = ({ mcc = 208; mnc = 97; mnc_length = 2; snssaiList = ({ sst =0x1; }) });
nr_cellid = 12345678L
......
......@@ -263,7 +263,7 @@ class RANManagement():
cmd = cls_cmd.getConnection(self.node)
ret = cmd.run(self.command)
cmd.close()
logging.debug(f'CustomCommand: {self.command} returnCode: {ret.returncode}')
logging.debug(f"Custum command : {self.command} on node : {self.node} returnCode : {ret.returncode}")
status = 'OK'
message = []
if ret.returncode != 0 and not self.command_fail:
......
......@@ -69,8 +69,8 @@
<class>Custom_Command</class>
<desc>Reset USRP</desc>
<node>nepes</node>
<command>sudo -S b2xx_fx3_utils --reset-device</command>
</testCase>
<command>sudo -S /usr/lib/uhd/utils/b2xx_fx3_utils --reset-device</command>
</testCase>
<testCase id="200000">
<class>Custom_Command</class>
......
......@@ -45,6 +45,7 @@
#include "common/config/config_userapi.h"
#include <time.h>
#include <sys/time.h>
#include "common/utils/LOG/log_extern.h"
// main log variables
......@@ -66,32 +67,30 @@ char __log_mem_filename[1024]={0};
char * log_mem_filename = &__log_mem_filename[0];
char logmem_filename[1024] = {0};
mapping log_level_names[] = {
{"error", OAILOG_ERR},
{"warn", OAILOG_WARNING},
{"analysis", OAILOG_ANALYSIS},
{"info", OAILOG_INFO},
{"debug", OAILOG_DEBUG},
{"trace", OAILOG_TRACE},
{NULL, -1}
};
mapping log_options[] = {
{"nocolor", FLAG_NOCOLOR },
{"level", FLAG_LEVEL },
{"thread", FLAG_THREAD },
{"line_num", FLAG_FILE_LINE },
{"function", FLAG_FUNCT},
{"time", FLAG_TIME},
{"thread_id", FLAG_THREAD_ID},
{"wall_clock", FLAG_REAL_TIME},
{NULL,-1}
};
const mapping log_level_names[] = {{"error", OAILOG_ERR},
{"warn", OAILOG_WARNING},
{"analysis", OAILOG_ANALYSIS},
{"info", OAILOG_INFO},
{"debug", OAILOG_DEBUG},
{"trace", OAILOG_TRACE},
{NULL, -1}};
const mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
{"level", FLAG_LEVEL},
{"thread", FLAG_THREAD},
{"line_num", FLAG_FILE_LINE},
{"function", FLAG_FUNCT},
{"time", FLAG_TIME},
{"thread_id", FLAG_THREAD_ID},
{"wall_clock", FLAG_REAL_TIME},
{NULL, -1}};
mapping log_maskmap[] = LOG_MASKMAP_INIT;
char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
static const char *log_level_highlight_start[] =
{LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
static const char *log_level_highlight_end[] =
{LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
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);
......@@ -754,8 +753,7 @@ void close_component_filelog(int comp)
* with string value NULL
*/
/* map a string to an int. Takes a mapping array and a string as arg */
int map_str_to_int(mapping *map,
const char *str)
int map_str_to_int(const mapping *map, const char *str)
{
while (1) {
if (map->name == NULL) {
......@@ -771,8 +769,7 @@ int map_str_to_int(mapping *map,
}
/* map an int to a string. Takes a mapping array and a value */
char *map_int_to_str(mapping *map,
int val)
char *map_int_to_str(const mapping *map, const int val)
{
while (1) {
if (map->name == NULL) {
......
......@@ -315,8 +315,8 @@ void set_glog_filelog(int enable);
void set_component_filelog(int comp);
void close_component_filelog(int comp);
void set_component_consolelog(int comp);
int map_str_to_int(mapping *map, const char *str);
char *map_int_to_str(mapping *map, int val);
int map_str_to_int(const mapping *map, const char *str);
char *map_int_to_str(const mapping *map, const int val);
void logClean (void);
int is_newline( char *str, int size);
......
......@@ -23,9 +23,8 @@
extern log_t *g_log;
extern mapping log_level_names[];
extern mapping log_options[];
extern const mapping log_level_names[];
extern const mapping log_options[];
extern mapping log_maskmap[];
extern int log_mem_flag;
extern char * log_mem_filename;
......
......@@ -706,3 +706,27 @@ void SLIV2SL(int SLIV,int *S,int *L) {
}
}
int get_ssb_subcarrier_offset(uint32_t absoluteFrequencySSB, uint32_t absoluteFrequencyPointA)
{
uint32_t absolute_diff = (absoluteFrequencySSB - absoluteFrequencyPointA);
const int scaling_5khz = absoluteFrequencyPointA < 600000 ? 3 : 1;
return ((absolute_diff / scaling_5khz) % 24);
}
uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
uint32_t absoluteFrequencyPointA,
int ssbSubcarrierSpacing,
int frequency_range)
{
uint32_t absolute_diff = (absoluteFrequencySSB - absoluteFrequencyPointA);
const int scaling_5khz = absoluteFrequencyPointA < 600000 ? 3 : 1;
int sco = get_ssb_subcarrier_offset(absoluteFrequencySSB, absoluteFrequencyPointA);
const int scs_scaling = frequency_range == FR2 ? 1 << (ssbSubcarrierSpacing - 2) : 1 << ssbSubcarrierSpacing;
const int scaled_abs_diff = absolute_diff / scaling_5khz;
const int ssb_offset_point_a =
(scaled_abs_diff - sco) / 12
- 10 * scs_scaling; // absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
AssertFatal(ssb_offset_point_a % scs_scaling == 0, "PRB offset %d can create frequency offset\n", ssb_offset_point_a);
AssertFatal(sco % scs_scaling == 0, "ssb offset %d can create frequency offset\n", sco);
return ssb_offset_point_a;
}
......@@ -101,7 +101,11 @@ void get_samplerate_and_bw(int mu,
unsigned int *samples_per_frame,
double *tx_bw,
double *rx_bw);
uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
uint32_t absoluteFrequencyPointA,
int ssbSubcarrierSpacing,
int frequency_range);
int get_ssb_subcarrier_offset(uint32_t absoluteFrequencySSB, uint32_t absoluteFrequencyPointA);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
......
......@@ -94,6 +94,7 @@ The other SDRs (AW2S, LimeSDR, ...) have no READMEs.
## Special-purpose libraries
- OAI has two scopes, one based on Xforms, one on Qt5, described in [this README](../openair1/PHY/TOOLS/readme.md)
- OAI comes with an integrated [telnet server](../common/utils/telnetsrv/DOC/telnethelp.md) to monitor and control
- OAI comes with an integrated [web server](../common/utils/websrv/DOC/websrv.md)
......
......@@ -64,7 +64,7 @@ In our case the output is 0 and hence we use `numactl --cpunodebind=0 --membind=
## FR1 test
Open a terminal on the host machine, and execute below command to launch gNB with **X310 USRPs**
```sudo numactl --cpunodebind=0 --membind=0 ./nr-softmodem -E -O../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.sa.band78.fr1.106PRB.prs.usrpx310.conf --phy-test```
```sudo numactl --cpunodebind=0 --membind=0 ./nr-softmodem -E -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.sa.band78.fr1.106PRB.prs.usrpx310.conf --phy-test```
If **N310 USRPs** are used, then run above command `without -E option` i.e without 3/4 sampling rate.<br><br>
......@@ -187,4 +187,4 @@ This script will read the IQ data from extracted PRS dumps(chF_gnbX_Y.raw and ch
<figcaption align = "center"><b>Fig.1 - FR2 100MHz test</b></figcaption>
</td>
</tr>
</table>
\ No newline at end of file
</table>
......@@ -28,10 +28,10 @@
//#define DEBUG_CCODE 1
unsigned short glte[] = { 0133, 0171, 0165 }; // {A,B}
unsigned short glte_rev[] = { 0155, 0117, 0127 }; // {A,B}
unsigned short gdab[] = { 0133, 0171, 0145 }; // {A,B}
unsigned short gdab_rev[] = { 0155, 0117, 0123 }; // {A,B}
static const unsigned short glte[] = {0133, 0171, 0165}; // {A,B}
static const unsigned short glte_rev[] = {0155, 0117, 0127}; // {A,B}
static const unsigned short gdab[] = {0133, 0171, 0145}; // {A,B}
static const unsigned short gdab_rev[] = {0155, 0117, 0123}; // {A,B}
unsigned char ccodelte_table[128]; // for transmitter
unsigned char ccodelte_table_rev[128]; // for receiver
......
......@@ -44,18 +44,20 @@
/*ref 36-212 v8.6.0 , pp 8-9 */
/* the highest degree is set by default */
uint32_t poly24a = 0x864cfb00; // 1000 0110 0100 1100 1111 1011
// D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
uint32_t poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011
// D^24 + D^23 + D^6 + D^5 + D + 1
uint32_t poly24c = 0xb2b11700; // 1011 0010 1011 0001 0001 0111
// D^24+D^23+D^21+D^20+D^17+D^15+D^13+D^12+D^8+D^4+D^2+D+1
uint32_t poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
uint32_t poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
uint32_t poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
uint32_t poly6 = 0x84000000; // 10000100000... -> D^6+D^5+1
uint32_t poly11 = 0xc4200000; //11000100001000... -> D^11+D^10+D^9+D^5+1
static const uint32_t poly24a =
0x864cfb00; // 1000 0110 0100 1100 1111 1011
// D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
static const uint32_t poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011
// D^24 + D^23 + D^6 + D^5 + D + 1
static const uint32_t poly24c = 0xb2b11700; // 1011 0010 1011 0001 0001 0111
// D^24+D^23+D^21+D^20+D^17+D^15+D^13+D^12+D^8+D^4+D^2+D+1
static const uint32_t poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
static const uint32_t poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
static const uint32_t poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
static const uint32_t poly6 = 0x84000000; // 10000100000... -> D^6+D^5+1
static const uint32_t poly11 = 0xc4200000; // 11000100001000... -> D^11+D^10+D^9+D^5+1
/*********************************************************
......@@ -100,24 +102,20 @@ static uint32_t crc8Table[256];
static uint32_t crc6Table[256];
#if USE_INTEL_CRC
static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = {
0x64e4d700, /**< k1 */
0x2c8c9d00, /**< k2 */
0xd9fe8c00, /**< k3 */
0xf845fe24, /**< q */
0x864cfb00, /**< p */
0ULL /**< res */
static const struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq __attribute__((aligned(16))) = {
0x64e4d700, /**< k1 */
0x2c8c9d00, /**< k2 */
0xd9fe8c00, /**< k3 */
0xf845fe24, /**< q */
0x864cfb00, /**< p */
0ULL /**< res */
};
__m128i crc_xmm_be_le_swap128;
DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
const uint8_t crc_xmm_shift_tab[48]
__attribute__((aligned(16))) = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
#endif
......@@ -176,13 +174,13 @@ uint32_t crc24a(unsigned char* inptr, int bitlen)
}
#if USE_INTEL_CRC
static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = {
0x80140500, /**< k1 */
0x42000100, /**< k2 */
0x90042100, /**< k3 */
0xffff83ff, /**< q */
0x80006300, /**< p */
0ULL /**< res */
static const struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq __attribute__((aligned(16))) = {
0x80140500, /**< k1 */
0x42000100, /**< k2 */
0x90042100, /**< k3 */
0xffff83ff, /**< q */
0x80006300, /**< p */
0ULL /**< res */
};
#endif
uint32_t crc24b(unsigned char* inptr, int bitlen)
......
......@@ -33,9 +33,12 @@
//#define cmin(a,b) ((a)<(b) ? (a) : (b))
static uint32_t bitrev[32] = {0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31};
static uint32_t bitrev_x3[32] = {0,48,24,72,12,60,36,84,6,54,30,78,18,66,42,90,3,51,27,75,15,63,39,87,9,57,33,81,21,69,45,93};
static uint32_t bitrev_cc[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
static const uint32_t bitrev[32] = {0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30,
1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31};
static const uint32_t bitrev_x3[32] = {0, 48, 24, 72, 12, 60, 36, 84, 6, 54, 30, 78, 18, 66, 42, 90,
3, 51, 27, 75, 15, 63, 39, 87, 9, 57, 33, 81, 21, 69, 45, 93};
static const uint32_t bitrev_cc[32] = {1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31,
0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30};
//#define RM_DEBUG_TX 1
//#define RM_DEBUG 1
......
......@@ -22,12 +22,12 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
// ----- Old implementation ----
uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){
uint8_t crcPolynomialPattern[25] = {1,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,0,0,0,1,0,1,1,1};
// 1011 0010 1011 0001 0001 0111 D^24 + D^23 + D^21 + D^20 + D^17 + D^15 + D^13 + D^12 + D^8 + D^4 + D^2 + D + 1
uint8_t crcPolynomialSize = 24;
uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize];
const uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits)
{
uint8_t crcPolynomialPattern[25] = {1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1};
// 1011 0010 1011 0001 0001 0111 D^24 + D^23 + D^21 + D^20 + D^17 + D^15 + D^13 + D^12 + D^8 + D^4 + D^2 + D + 1
uint8_t crcPolynomialSize = 24;
uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize];
uint8_t **crc_generator_matrix = malloc(payloadSizeBits*sizeof(uint8_t *) + payloadSizeBits*crcPolynomialSize*sizeof(uint8_t));
if (crc_generator_matrix)
......@@ -52,74 +52,5 @@ uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){
crc_generator_matrix[i][j]=0;
}
}
return crc_generator_matrix;
}
uint8_t **crc11_generator_matrix(uint16_t payloadSizeBits){
uint8_t crcPolynomialPattern[12] = {1,1,1,0,0,0,1,0,0,0,0,1};
// 1110 0010 0001 D^11 + D^10 + D^9 + D^5 + 1
uint8_t crcPolynomialSize = 11;
uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize];
uint8_t **crc_generator_matrix = malloc(payloadSizeBits * sizeof(uint8_t *));
if (crc_generator_matrix)
for (int i = 0; i < payloadSizeBits; i++)
crc_generator_matrix[i] = malloc(crcPolynomialSize * sizeof(uint8_t));
for (int i = 0; i < crcPolynomialSize; i++) crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1];
for (int i = payloadSizeBits-2; i >= 0; i--){
for (int j = 0; j < crcPolynomialSize-1; j++)
temp1[j]=crc_generator_matrix[i+1][j+1];
temp1[crcPolynomialSize-1]=0;
for (int j = 0; j < crcPolynomialSize; j++)
temp2[j]=crc_generator_matrix[i+1][0]*crcPolynomialPattern[j+1];
for (int j = 0; j < crcPolynomialSize; j++){
if(temp1[j]+temp2[j] == 1)
crc_generator_matrix[i][j]=1;
else
crc_generator_matrix[i][j]=0;
}
}
return crc_generator_matrix;
}
uint8_t **crc6_generator_matrix(uint16_t payloadSizeBits){
uint8_t crcPolynomialPattern[7] = {1,1,0,0,0,0,1};
// 0110 0001 D^6 + D^5 + 1
uint8_t crcPolynomialSize = 6;
uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize];
uint8_t **crc_generator_matrix = malloc(payloadSizeBits * sizeof(uint8_t *));
if (crc_generator_matrix)
for (int i = 0; i < payloadSizeBits; i++)
crc_generator_matrix[i] = malloc(crcPolynomialSize * sizeof(uint8_t));
for (int i = 0; i < crcPolynomialSize; i++)
crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1];
for (int i = payloadSizeBits-2; i >= 0; i--){
for (int j = 0; j < crcPolynomialSize-1; j++)
temp1[j]=crc_generator_matrix[i+1][j+1];
temp1[crcPolynomialSize-1]=0;
for (int j = 0; j < crcPolynomialSize; j++)
temp2[j]=crc_generator_matrix[i+1][0]*crcPolynomialPattern[j+1];
for (int j = 0; j < crcPolynomialSize; j++){
if(temp1[j]+temp2[j] == 1)
crc_generator_matrix[i][j]=1;
else
crc_generator_matrix[i][j]=0;
}
}
return crc_generator_matrix;
return (const uint8_t **)crc_generator_matrix;
}
......@@ -366,7 +366,7 @@ void applyGtoright(const t_nrPolar_params *pp,decoder_node_t *node) {
}
}
int16_t all1[16] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
static const int16_t all1[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
void computeBeta(const t_nrPolar_params *pp,decoder_node_t *node) {
......
......@@ -109,8 +109,8 @@ struct nrPolar_params {
uint16_t *channel_interleaver_pattern;
//uint32_t crc_polynomial;
uint8_t **crc_generator_matrix; //G_P
uint8_t **G_N;
const uint8_t **crc_generator_matrix; // G_P
const uint8_t **G_N;
uint64_t **G_N_tab;
int groupsize;
int *rm_tab;
......@@ -205,7 +205,7 @@ t_nrPolar_params *nr_polar_params (int8_t messageType,
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level);
uint8_t **nr_polar_kronecker_power_matrices(uint8_t n);
const uint8_t **nr_polar_kronecker_power_matrices(uint8_t n);
const uint16_t *nr_polar_sequence_pattern(uint8_t n);
......@@ -270,11 +270,7 @@ void nr_byte2bit_uint8_32(uint8_t *in,
uint16_t arraySize,
uint32_t *out);
uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits);
uint8_t **crc11_generator_matrix(uint16_t payloadSizeBits);
uint8_t **crc6_generator_matrix(uint16_t payloadSizeBits);
const uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits);
void nr_polar_bit_insertion(uint8_t *input,
uint8_t *output,
......@@ -284,11 +280,11 @@ void nr_polar_bit_insertion(uint8_t *input,
int16_t *Q_PC_N,
uint8_t n_PC);
void nr_matrix_multiplication_uint8_1D_uint8_2D(uint8_t *matrix1,
uint8_t **matrix2,
uint8_t *output,
uint16_t row,
uint16_t col);
void nr_matrix_multiplication_uint8_1D_uint8_2D(const uint8_t *matrix1,
const uint8_t **matrix2,
uint8_t *output,
uint16_t row,
uint16_t col);
void nr_sort_asc_double_1D_array_ind(double *matrix,
uint8_t *ind,
......
......@@ -32,15 +32,18 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
void nr_matrix_multiplication_uint8_1D_uint8_2D(uint8_t *matrix1, uint8_t **matrix2,
uint8_t *output, uint16_t row, uint16_t col) {
for (uint16_t i = 0; i < col; i++) {
output[i] = 0;
for (uint16_t j = 0; j < row; j++) {
void nr_matrix_multiplication_uint8_1D_uint8_2D(const uint8_t *matrix1,
const uint8_t **matrix2,
uint8_t *output,
uint16_t row,
uint16_t col)
{
for (uint16_t i = 0; i < col; i++) {
output[i] = 0;
for (uint16_t j = 0; j < row; j++) {
output[i] += matrix1[j] * matrix2[j][i];
}
}
}
}
// Modified Bubble Sort.
......
......@@ -32,8 +32,17 @@ static const uint16_t Q_0_Nminus1_8[256] = { 0, 1, 2, 4, 8, 16, 32, 3, 5, 64, 9,
static const uint16_t Q_0_Nminus1_9[512] = { 0, 1, 2, 4, 8, 16, 32, 3, 5, 64, 9, 6, 17, 10, 18, 128, 12, 33, 65, 20, 256, 34, 24, 36, 7, 129, 66, 11, 40, 68, 130, 19, 13, 48, 14, 72, 257, 21, 132, 35, 258, 26, 80, 37, 25, 22, 136, 260, 264, 38, 96, 67, 41, 144, 28, 69, 42, 49, 74, 272, 160, 288, 192, 70, 44, 131, 81, 50, 73, 15, 320, 133, 52, 23, 134, 384, 76, 137, 82, 56, 27, 97, 39, 259, 84, 138, 145, 261, 29, 43, 98, 88, 140, 30, 146, 71, 262, 265, 161, 45, 100, 51, 148, 46, 75, 266, 273, 104, 162, 53, 193, 152, 77, 164, 268, 274, 54, 83, 57, 112, 135, 78, 289, 194, 85, 276, 58, 168, 139, 99, 86, 60, 280, 89, 290, 196, 141, 101, 147, 176, 142, 321, 31, 200, 90, 292, 322, 263, 149, 102, 105, 304, 296, 163, 92, 47, 267, 385, 324, 208, 386, 150, 153, 165, 106, 55, 328, 113, 154, 79, 269, 108, 224, 166, 195, 270, 275, 291, 59, 169, 114, 277, 156, 87, 197, 116, 170, 61, 281, 278, 177, 293, 388, 91, 198, 172, 120, 201, 336, 62, 282, 143, 103, 178, 294, 93, 202, 323, 392, 297, 107, 180, 151, 209, 284, 94, 204, 298, 400, 352, 325, 155, 210, 305, 300, 109, 184, 115, 167, 225, 326, 306, 157, 329, 110, 117, 212, 171, 330, 226, 387, 308, 216, 416, 271, 279, 158, 337, 118, 332, 389, 173, 121, 199, 179, 228, 338, 312, 390, 174, 393, 283, 122, 448, 353, 203, 63, 340, 394, 181, 295, 285, 232, 124, 205, 182, 286, 299, 354, 211, 401, 185, 396, 344, 240, 206, 95, 327, 402, 356, 307, 301, 417, 213, 186, 404, 227, 418, 302, 360, 111, 331, 214, 309, 188, 449, 217, 408, 229, 159, 420, 310, 333, 119, 339, 218, 368, 230, 391, 313, 450, 334, 233, 175, 123, 341, 220, 314, 424, 395, 355, 287, 183, 234, 125, 342, 316, 241, 345, 452, 397, 403, 207, 432, 357, 187, 236, 126, 242, 398, 346, 456, 358, 405, 303, 244, 189, 361, 215, 348, 419, 406, 464, 362, 409, 219, 311, 421, 410, 231, 248, 369, 190, 364, 335, 480, 315, 221, 370, 422, 425, 451, 235, 412, 343, 372, 317, 222, 426, 453, 237, 433, 347, 243, 454, 318, 376, 428, 238, 359, 457, 399, 434, 349, 245, 458, 363, 127, 191, 407, 436, 465, 246, 350, 460, 249, 411, 365, 440, 374, 423, 466, 250, 371, 481, 413, 366, 468, 429, 252, 373, 482, 427, 414, 223, 472, 455, 377, 435, 319, 484, 430, 488, 239, 378, 459, 437, 380, 461, 496, 351, 467, 438, 251, 462, 442, 441, 469, 247, 367, 253, 375, 444, 470, 483, 415, 485, 473, 474, 254, 379, 431, 489, 486, 476, 439, 490, 463, 381, 497, 492, 443, 382, 498, 445, 471, 500, 446, 475, 487, 504, 255, 477, 491, 478, 383, 493, 499, 502, 494, 501, 447, 505, 506, 479, 508, 495, 503, 507, 509, 510, 511 };
static const uint16_t Q_0_Nminus1_10[1024] = { 0, 1, 2, 4, 8, 16, 32, 3, 5, 64, 9, 6, 17, 10, 18, 128, 12, 33, 65, 20, 256, 34, 24, 36, 7, 129, 66, 512, 11, 40, 68, 130, 19, 13, 48, 14, 72, 257, 21, 132, 35, 258, 26, 513, 80, 37, 25, 22, 136, 260, 264, 38, 514, 96, 67, 41, 144, 28, 69, 42, 516, 49, 74, 272, 160, 520, 288, 528, 192, 544, 70, 44, 131, 81, 50, 73, 15, 320, 133, 52, 23, 134, 384, 76, 137, 82, 56, 27, 97, 39, 259, 84, 138, 145, 261, 29, 43, 98, 515, 88, 140, 30, 146, 71, 262, 265, 161, 576, 45, 100, 640, 51, 148, 46, 75, 266, 273, 517, 104, 162, 53, 193, 152, 77, 164, 768, 268, 274, 518, 54, 83, 57, 521, 112, 135, 78, 289, 194, 85, 276, 522, 58, 168, 139, 99, 86, 60, 280, 89, 290, 529, 524, 196, 141, 101, 147, 176, 142, 530, 321, 31, 200, 90, 545, 292, 322, 532, 263, 149, 102, 105, 304, 296, 163, 92, 47, 267, 385, 546, 324, 208, 386, 150, 153, 165, 106, 55, 328, 536, 577, 548, 113, 154, 79, 269, 108, 578, 224, 166, 519, 552, 195, 270, 641, 523, 275, 580, 291, 59, 169, 560, 114, 277, 156, 87, 197, 116, 170, 61, 531, 525, 642, 281, 278, 526, 177, 293, 388, 91, 584, 769, 198, 172, 120, 201, 336, 62, 282, 143, 103, 178, 294, 93, 644, 202, 592, 323, 392, 297, 770, 107, 180, 151, 209, 284, 648, 94, 204, 298, 400, 608, 352, 325, 533, 155, 210, 305, 547, 300, 109, 184, 534, 537, 115, 167, 225, 326, 306, 772, 157, 656, 329, 110, 117, 212, 171, 776, 330, 226, 549, 538, 387, 308, 216, 416, 271, 279, 158, 337, 550, 672, 118, 332, 579, 540, 389, 173, 121, 553, 199, 784, 179, 228, 338, 312, 704, 390, 174, 554, 581, 393, 283, 122, 448, 353, 561, 203, 63, 340, 394, 527, 582, 556, 181, 295, 285, 232, 124, 205, 182, 643, 562, 286, 585, 299, 354, 211, 401, 185, 396, 344, 586, 645, 593, 535, 240, 206, 95, 327, 564, 800, 402, 356, 307, 301, 417, 213, 568, 832, 588, 186, 646, 404, 227, 896, 594, 418, 302, 649, 771, 360, 539, 111, 331, 214, 309, 188, 449, 217, 408, 609, 596, 551, 650, 229, 159, 420, 310, 541, 773, 610, 657, 333, 119, 600, 339, 218, 368, 652, 230, 391, 313, 450, 542, 334, 233, 555, 774, 175, 123, 658, 612, 341, 777, 220, 314, 424, 395, 673, 583, 355, 287, 183, 234, 125, 557, 660, 616, 342, 316, 241, 778, 563, 345, 452, 397, 403, 207, 674, 558, 785, 432, 357, 187, 236, 664, 624, 587, 780, 705, 126, 242, 565, 398, 346, 456, 358, 405, 303, 569, 244, 595, 189, 566, 676, 361, 706, 589, 215, 786, 647, 348, 419, 406, 464, 680, 801, 362, 590, 409, 570, 788, 597, 572, 219, 311, 708, 598, 601, 651, 421, 792, 802, 611, 602, 410, 231, 688, 653, 248, 369, 190, 364, 654, 659, 335, 480, 315, 221, 370, 613, 422, 425, 451, 614, 543, 235, 412, 343, 372, 775, 317, 222, 426, 453, 237, 559, 833, 804, 712, 834, 661, 808, 779, 617, 604, 433, 720, 816, 836, 347, 897, 243, 662, 454, 318, 675, 618, 898, 781, 376, 428, 665, 736, 567, 840, 625, 238, 359, 457, 399, 787, 591, 678, 434, 677, 349, 245, 458, 666, 620, 363, 127, 191, 782, 407, 436, 626, 571, 465, 681, 246, 707, 350, 599, 668, 790, 460, 249, 682, 573, 411, 803, 789, 709, 365, 440, 628, 689, 374, 423, 466, 793, 250, 371, 481, 574, 413, 603, 366, 468, 655, 900, 805, 615, 684, 710, 429, 794, 252, 373, 605, 848, 690, 713, 632, 482, 806, 427, 904, 414, 223, 663, 692, 835, 619, 472, 455, 796, 809, 714, 721, 837, 716, 864, 810, 606, 912, 722, 696, 377, 435, 817, 319, 621, 812, 484, 430, 838, 667, 488, 239, 378, 459, 622, 627, 437, 380, 818, 461, 496, 669, 679, 724, 841, 629, 351, 467, 438, 737, 251, 462, 442, 441, 469, 247, 683, 842, 738, 899, 670, 783, 849, 820, 728, 928, 791, 367, 901, 630, 685, 844, 633, 711, 253, 691, 824, 902, 686, 740, 850, 375, 444, 470, 483, 415, 485, 905, 795, 473, 634, 744, 852, 960, 865, 693, 797, 906, 715, 807, 474, 636, 694, 254, 717, 575, 913, 798, 811, 379, 697, 431, 607, 489, 866, 723, 486, 908, 718, 813, 476, 856, 839, 725, 698, 914, 752, 868, 819, 814, 439, 929, 490, 623, 671, 739, 916, 463, 843, 381, 497, 930, 821, 726, 961, 872, 492, 631, 729, 700, 443, 741, 845, 920, 382, 822, 851, 730, 498, 880, 742, 445, 471, 635, 932, 687, 903, 825, 500, 846, 745, 826, 732, 446, 962, 936, 475, 853, 867, 637, 907, 487, 695, 746, 828, 753, 854, 857, 504, 799, 255, 964, 909, 719, 477, 915, 638, 748, 944, 869, 491, 699, 754, 858, 478, 968, 383, 910, 815, 976, 870, 917, 727, 493, 873, 701, 931, 756, 860, 499, 731, 823, 922, 874, 918, 502, 933, 743, 760, 881, 494, 702, 921, 501, 876, 847, 992, 447, 733, 827, 934, 882, 937, 963, 747, 505, 855, 924, 734, 829, 965, 938, 884, 506, 749, 945, 966, 755, 859, 940, 830, 911, 871, 639, 888, 479, 946, 750, 969, 508, 861, 757, 970, 919, 875, 862, 758, 948, 977, 923, 972, 761, 877, 952, 495, 703, 935, 978, 883, 762, 503, 925, 878, 735, 993, 885, 939, 994, 980, 926, 764, 941, 967, 886, 831, 947, 507, 889, 984, 751, 942, 996, 971, 890, 509, 949, 973, 1000, 892, 950, 863, 759, 1008, 510, 979, 953, 763, 974, 954, 879, 981, 982, 927, 995, 765, 956, 887, 985, 997, 986, 943, 891, 998, 766, 511, 988, 1001, 951, 1002, 893, 975, 894, 1009, 955, 1004, 1010, 957, 983, 958, 987, 1012, 999, 1016, 767, 989, 1003, 990, 1005, 959, 1011, 1013, 895, 1006, 1014, 1017, 1018, 991, 1020, 1007, 1015, 1019, 1021, 1022, 1023 };
static const uint16_t *Q_0_Nminus1[11] = { NULL, Q_0_Nminus1_1, Q_0_Nminus1_2, Q_0_Nminus1_3, Q_0_Nminus1_4,
Q_0_Nminus1_5, Q_0_Nminus1_6, Q_0_Nminus1_7, Q_0_Nminus1_8, Q_0_Nminus1_9, Q_0_Nminus1_10 };
static const uint16_t* const Q_0_Nminus1[11] = {NULL,
Q_0_Nminus1_1,
Q_0_Nminus1_2,
Q_0_Nminus1_3,
Q_0_Nminus1_4,
Q_0_Nminus1_5,
Q_0_Nminus1_6,
Q_0_Nminus1_7,
Q_0_Nminus1_8,
Q_0_Nminus1_9,
Q_0_Nminus1_10};
const uint16_t* nr_polar_sequence_pattern(uint8_t n){
return Q_0_Nminus1[n];
......
......@@ -36,15 +36,10 @@
#include <math.h>
#include "nfapi/oai_integration/vendor_ext.h"
#include <openair1/PHY/LTE_ESTIMATION/lte_estimation.h>
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
extern int32_t get_uldl_offset(int eutra_bandP);
extern uint16_t prach_root_sequence_map0_3[838];
extern uint16_t prach_root_sequence_map4[138];
uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 };
const uint8_t dmrs1_tab[8] = {0, 2, 3, 4, 6, 8, 9, 10};
int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 };
const int N_RB_DL_array[6] = {6, 15, 25, 50, 75, 100};
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
......
......@@ -35,6 +35,7 @@
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "PHY/phy_extern.h"
void init_7_5KHz(void);
uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
......@@ -360,8 +361,6 @@ void phy_config_harq_ue(module_id_t Mod_id,
phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx;
}
extern uint16_t beta_cqi[16];
void phy_config_dedicated_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated ) {
static uint8_t first_dedicated_configuration = 0;
......
......@@ -22,8 +22,8 @@
#include "phy_init.h"
#include "common/utils/LOG/log.h"
uint16_t dl_S_table_normal[10]= {3,9,10,11,12,3,9,10,11,6};
uint16_t dl_S_table_extended[10]= {3,8,9,10,3,8,9,5,0,0};
static const uint16_t dl_S_table_normal[10] = {3, 9, 10, 11, 12, 3, 9, 10, 11, 6};
static const uint16_t dl_S_table_extended[10] = {3, 8, 9, 10, 3, 8, 9, 5, 0, 0};
void set_S_config(LTE_DL_FRAME_PARMS *fp) {
int X = fp->srsX;
......
......@@ -36,9 +36,6 @@
#include "openair2/COMMON/prs_nr_paramdef.h"
#include "SCHED_NR_UE/harq_nr.h"
extern uint16_t beta_cqi[16];
void RCconfig_nrUE_prs(void *cfg)
{
int j = 0, k = 0, gNB_id = 0;
......
......@@ -24,61 +24,21 @@
#include "common/utils/LOG/log.h"
/// Subcarrier spacings in Hz indexed by numerology index
uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
static const uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
static const uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
// Table 5.4.3.3-1 38-101
int nr_ssb_table[48][3] = {
{1, 15, nr_ssb_type_A},
{2, 15, nr_ssb_type_A},
{3, 15, nr_ssb_type_A},
{5, 15, nr_ssb_type_A},
{5, 30, nr_ssb_type_B},
{7, 15, nr_ssb_type_A},
{8, 15, nr_ssb_type_A},
{12, 15, nr_ssb_type_A},
{14, 15, nr_ssb_type_A},
{18, 15, nr_ssb_type_A},
{20, 15, nr_ssb_type_A},
{25, 15, nr_ssb_type_A},
{26, 15, nr_ssb_type_A},
{28, 15, nr_ssb_type_A},
{29, 15, nr_ssb_type_A},
{30, 15, nr_ssb_type_A},
{34, 15, nr_ssb_type_A},
{34, 30, nr_ssb_type_C},
{38, 15, nr_ssb_type_A},
{38, 30, nr_ssb_type_C},
{39, 15, nr_ssb_type_A},
{39, 30, nr_ssb_type_C},
{40, 30, nr_ssb_type_C},
{41, 15, nr_ssb_type_A},
{41, 30, nr_ssb_type_C},
{46, 30, nr_ssb_type_C},
{48, 30, nr_ssb_type_C},
{50, 30, nr_ssb_type_C},
{51, 15, nr_ssb_type_A},
{53, 15, nr_ssb_type_A},
{65, 15, nr_ssb_type_A},
{66, 15, nr_ssb_type_A},
{66, 30, nr_ssb_type_B},
{70, 15, nr_ssb_type_A},
{71, 15, nr_ssb_type_A},
{74, 15, nr_ssb_type_A},
{75, 15, nr_ssb_type_A},
{76, 15, nr_ssb_type_A},
{77, 30, nr_ssb_type_C},
{78, 30, nr_ssb_type_C},
{79, 30, nr_ssb_type_C},
{90, 15, nr_ssb_type_A},
{90, 30, nr_ssb_type_C},
{91, 15, nr_ssb_type_A},
{92, 15, nr_ssb_type_A},
{93, 15, nr_ssb_type_A},
{94, 15, nr_ssb_type_A},
{96, 30, nr_ssb_type_C}
};
static const int nr_ssb_table[48][3] = {
{1, 15, nr_ssb_type_A}, {2, 15, nr_ssb_type_A}, {3, 15, nr_ssb_type_A}, {5, 15, nr_ssb_type_A}, {5, 30, nr_ssb_type_B},
{7, 15, nr_ssb_type_A}, {8, 15, nr_ssb_type_A}, {12, 15, nr_ssb_type_A}, {14, 15, nr_ssb_type_A}, {18, 15, nr_ssb_type_A},
{20, 15, nr_ssb_type_A}, {25, 15, nr_ssb_type_A}, {26, 15, nr_ssb_type_A}, {28, 15, nr_ssb_type_A}, {29, 15, nr_ssb_type_A},
{30, 15, nr_ssb_type_A}, {34, 15, nr_ssb_type_A}, {34, 30, nr_ssb_type_C}, {38, 15, nr_ssb_type_A}, {38, 30, nr_ssb_type_C},
{39, 15, nr_ssb_type_A}, {39, 30, nr_ssb_type_C}, {40, 30, nr_ssb_type_C}, {41, 15, nr_ssb_type_A}, {41, 30, nr_ssb_type_C},
{46, 30, nr_ssb_type_C}, {48, 30, nr_ssb_type_C}, {50, 30, nr_ssb_type_C}, {51, 15, nr_ssb_type_A}, {53, 15, nr_ssb_type_A},
{65, 15, nr_ssb_type_A}, {66, 15, nr_ssb_type_A}, {66, 30, nr_ssb_type_B}, {70, 15, nr_ssb_type_A}, {71, 15, nr_ssb_type_A},
{74, 15, nr_ssb_type_A}, {75, 15, nr_ssb_type_A}, {76, 15, nr_ssb_type_A}, {77, 30, nr_ssb_type_C}, {78, 30, nr_ssb_type_C},
{79, 30, nr_ssb_type_C}, {90, 15, nr_ssb_type_A}, {90, 30, nr_ssb_type_C}, {91, 15, nr_ssb_type_A}, {92, 15, nr_ssb_type_A},
{93, 15, nr_ssb_type_A}, {94, 15, nr_ssb_type_A}, {96, 30, nr_ssb_type_C}};
void set_Lmax(NR_DL_FRAME_PARMS *fp) {
// definition of Lmax according to ts 38.213 section 4.1
......
......@@ -29,9 +29,40 @@
#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h"
// round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15))
static int16_t ru_90[2*128] = {32767, 0,32766, 402,32758, 804,32746, 1206,32729, 1608,32706, 2009,32679, 2411,32647, 2811,32610, 3212,32568, 3612,32522, 4011,32470, 4410,32413, 4808,32352, 5205,32286, 5602,32214, 5998,32138, 6393,32058, 6787,31972, 7180,31881, 7571,31786, 7962,31686, 8351,31581, 8740,31471, 9127,31357, 9512,31238, 9896,31114, 10279,30986, 10660,30853, 11039,30715, 11417,30572, 11793,30425, 12167,30274, 12540,30118, 12910,29957, 13279,29792, 13646,29622, 14010,29448, 14373,29269, 14733,29086, 15091,28899, 15447,28707, 15800,28511, 16151,28311, 16500,28106, 16846,27897, 17190,27684, 17531,27467, 17869,27246, 18205,27020, 18538,26791, 18868,26557, 19195,26320, 19520,26078, 19841,25833, 20160,25583, 20475,25330, 20788,25073, 21097,24812, 21403,24548, 21706,24279, 22006,24008, 22302,23732, 22595,23453, 22884,23170, 23170,22884, 23453,22595, 23732,22302, 24008,22006, 24279,21706, 24548,21403, 24812,21097, 25073,20788, 25330,20475, 25583,20160, 25833,19841, 26078,19520, 26320,19195, 26557,18868, 26791,18538, 27020,18205, 27246,17869, 27467,17531, 27684,17190, 27897,16846, 28106,16500, 28311,16151, 28511,15800, 28707,15447, 28899,15091, 29086,14733, 29269,14373, 29448,14010, 29622,13646, 29792,13279, 29957,12910, 30118,12540, 30274,12167, 30425,11793, 30572,11417, 30715,11039, 30853,10660, 30986,10279, 31114,9896, 31238,9512, 31357,9127, 31471,8740, 31581,8351, 31686,7962, 31786,7571, 31881,7180, 31972,6787, 32058,6393, 32138,5998, 32214,5602, 32286,5205, 32352,4808, 32413,4410, 32470,4011, 32522,3612, 32568,3212, 32610,2811, 32647,2411, 32679,2009, 32706,1608, 32729,1206, 32746,804, 32758,402, 32766};
static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32729, -1608,32706, -2009,32679, -2411,32647, -2811,32610, -3212,32568, -3612,32522, -4011,32470, -4410,32413, -4808,32352, -5205,32286, -5602,32214, -5998,32138, -6393,32058, -6787,31972, -7180,31881, -7571,31786, -7962,31686, -8351,31581, -8740,31471, -9127,31357, -9512,31238, -9896,31114, -10279,30986, -10660,30853, -11039,30715, -11417,30572, -11793,30425, -12167,30274, -12540,30118, -12910,29957, -13279,29792, -13646,29622, -14010,29448, -14373,29269, -14733,29086, -15091,28899, -15447,28707, -15800,28511, -16151,28311, -16500,28106, -16846,27897, -17190,27684, -17531,27467, -17869,27246, -18205,27020, -18538,26791, -18868,26557, -19195,26320, -19520,26078, -19841,25833, -20160,25583, -20475,25330, -20788,25073, -21097,24812, -21403,24548, -21706,24279, -22006,24008, -22302,23732, -22595,23453, -22884,23170, -23170,22884, -23453,22595, -23732,22302, -24008,22006, -24279,21706, -24548,21403, -24812,21097, -25073,20788, -25330,20475, -25583,20160, -25833,19841, -26078,19520, -26320,19195, -26557,18868, -26791,18538, -27020,18205, -27246,17869, -27467,17531, -27684,17190, -27897,16846, -28106,16500, -28311,16151, -28511,15800, -28707,15447, -28899,15091, -29086,14733, -29269,14373, -29448,14010, -29622,13646, -29792,13279, -29957,12910, -30118,12540, -30274,12167, -30425,11793, -30572,11417, -30715,11039, -30853,10660, -30986,10279, -31114,9896, -31238,9512, -31357,9127, -31471,8740, -31581,8351, -31686,7962, -31786,7571, -31881,7180, -31972,6787, -32058,6393, -32138,5998, -32214,5602, -32286,5205, -32352,4808, -32413,4410, -32470,4011, -32522,3612, -32568,3212, -32610,2811, -32647,2411, -32679,2009, -32706,1608, -32729,1206, -32746,804, -32758,402, -32766};
static const int16_t ru_90[2 * 128] = {
32767, 0, 32766, 402, 32758, 804, 32746, 1206, 32729, 1608, 32706, 2009, 32679, 2411, 32647, 2811, 32610, 3212,
32568, 3612, 32522, 4011, 32470, 4410, 32413, 4808, 32352, 5205, 32286, 5602, 32214, 5998, 32138, 6393, 32058, 6787,
31972, 7180, 31881, 7571, 31786, 7962, 31686, 8351, 31581, 8740, 31471, 9127, 31357, 9512, 31238, 9896, 31114, 10279,
30986, 10660, 30853, 11039, 30715, 11417, 30572, 11793, 30425, 12167, 30274, 12540, 30118, 12910, 29957, 13279, 29792, 13646,
29622, 14010, 29448, 14373, 29269, 14733, 29086, 15091, 28899, 15447, 28707, 15800, 28511, 16151, 28311, 16500, 28106, 16846,
27897, 17190, 27684, 17531, 27467, 17869, 27246, 18205, 27020, 18538, 26791, 18868, 26557, 19195, 26320, 19520, 26078, 19841,
25833, 20160, 25583, 20475, 25330, 20788, 25073, 21097, 24812, 21403, 24548, 21706, 24279, 22006, 24008, 22302, 23732, 22595,
23453, 22884, 23170, 23170, 22884, 23453, 22595, 23732, 22302, 24008, 22006, 24279, 21706, 24548, 21403, 24812, 21097, 25073,
20788, 25330, 20475, 25583, 20160, 25833, 19841, 26078, 19520, 26320, 19195, 26557, 18868, 26791, 18538, 27020, 18205, 27246,
17869, 27467, 17531, 27684, 17190, 27897, 16846, 28106, 16500, 28311, 16151, 28511, 15800, 28707, 15447, 28899, 15091, 29086,
14733, 29269, 14373, 29448, 14010, 29622, 13646, 29792, 13279, 29957, 12910, 30118, 12540, 30274, 12167, 30425, 11793, 30572,
11417, 30715, 11039, 30853, 10660, 30986, 10279, 31114, 9896, 31238, 9512, 31357, 9127, 31471, 8740, 31581, 8351, 31686,
7962, 31786, 7571, 31881, 7180, 31972, 6787, 32058, 6393, 32138, 5998, 32214, 5602, 32286, 5205, 32352, 4808, 32413,
4410, 32470, 4011, 32522, 3612, 32568, 3212, 32610, 2811, 32647, 2411, 32679, 2009, 32706, 1608, 32729, 1206, 32746,
804, 32758, 402, 32766};
static const int16_t ru_90c[2 * 128] = {
32767, 0, 32766, -402, 32758, -804, 32746, -1206, 32729, -1608, 32706, -2009, 32679, -2411, 32647, -2811,
32610, -3212, 32568, -3612, 32522, -4011, 32470, -4410, 32413, -4808, 32352, -5205, 32286, -5602, 32214, -5998,
32138, -6393, 32058, -6787, 31972, -7180, 31881, -7571, 31786, -7962, 31686, -8351, 31581, -8740, 31471, -9127,
31357, -9512, 31238, -9896, 31114, -10279, 30986, -10660, 30853, -11039, 30715, -11417, 30572, -11793, 30425, -12167,
30274, -12540, 30118, -12910, 29957, -13279, 29792, -13646, 29622, -14010, 29448, -14373, 29269, -14733, 29086, -15091,
28899, -15447, 28707, -15800, 28511, -16151, 28311, -16500, 28106, -16846, 27897, -17190, 27684, -17531, 27467, -17869,
27246, -18205, 27020, -18538, 26791, -18868, 26557, -19195, 26320, -19520, 26078, -19841, 25833, -20160, 25583, -20475,
25330, -20788, 25073, -21097, 24812, -21403, 24548, -21706, 24279, -22006, 24008, -22302, 23732, -22595, 23453, -22884,
23170, -23170, 22884, -23453, 22595, -23732, 22302, -24008, 22006, -24279, 21706, -24548, 21403, -24812, 21097, -25073,
20788, -25330, 20475, -25583, 20160, -25833, 19841, -26078, 19520, -26320, 19195, -26557, 18868, -26791, 18538, -27020,
18205, -27246, 17869, -27467, 17531, -27684, 17190, -27897, 16846, -28106, 16500, -28311, 16151, -28511, 15800, -28707,
15447, -28899, 15091, -29086, 14733, -29269, 14373, -29448, 14010, -29622, 13646, -29792, 13279, -29957, 12910, -30118,
12540, -30274, 12167, -30425, 11793, -30572, 11417, -30715, 11039, -30853, 10660, -30986, 10279, -31114, 9896, -31238,
9512, -31357, 9127, -31471, 8740, -31581, 8351, -31686, 7962, -31786, 7571, -31881, 7180, -31972, 6787, -32058,
6393, -32138, 5998, -32214, 5602, -32286, 5205, -32352, 4808, -32413, 4410, -32470, 4011, -32522, 3612, -32568,
3212, -32610, 2811, -32647, 2411, -32679, 2009, -32706, 1608, -32729, 1206, -32746, 804, -32758, 402, -32766};
#define SCALE 0x3FFF
......@@ -51,8 +82,8 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t harq_pid;
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
const int16_t *ru1 = ru_90;
const int16_t *ru2 = ru_90;
int16_t current_phase1,current_phase2;
uint16_t aa,Msc_RS,Msc_RS_idx;
uint16_t *Msc_idx_ptr;
......@@ -67,8 +98,8 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t v=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[Ns+(subframe<<1)];
int symbol_offset,i;
//debug_msg("lte_ul_channel_estimation: cyclic shift %d\n",cyclicShift);
int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0,-16384,-28378,-32768,-28378,-16384};
const int16_t alpha_re[12] = {32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384, -1, 16383, 28377};
const int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384};
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxdataF128,*ul_ref128,*ul_ch128;
__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
......@@ -390,8 +421,8 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
int interpolate,
uint16_t rnti) {
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
const int16_t *ru1 = ru_90;
const int16_t *ru2 = ru_90;
int16_t current_phase1,current_phase2;
uint16_t aa,Msc_RS,Msc_RS_idx;
uint16_t *Msc_idx_ptr;
......@@ -403,8 +434,8 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16)));
int symbol_offset,i;
//debug_msg("lte_ul_channel_estimation_RRU: cyclic shift %d\n",cyclicShift);
int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0,-16384,-28378,-32768,-28378,-16384};
const int16_t alpha_re[12] = {32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384, -1, 16383, 28377};
const int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384};
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxdataF128,*ul_ref128,*ul_ch128;
__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
......
......@@ -28,18 +28,52 @@
#include "PHY/defs_eNB.h"
#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h"
const uint16_t ref_primes[34] = {11, 23, 31, 47, 59, 71, 89, 107, 113, 139, 179, 191, 211, 239, 283, 293, 317, 359, 383, 431, 479, 523, 571, 599, 647, 719, 761, 863, 887, 953, 971, 1069, 1151, 1193};
static const uint16_t ref_primes[34] = {11, 23, 31, 47, 59, 71, 89, 107, 113, 139, 179, 191, 211, 239, 283, 293, 317,
359, 383, 431, 479, 523, 571, 599, 647, 719, 761, 863, 887, 953, 971, 1069, 1151, 1193};
int16_t *ul_ref_sigs[30][2][34];
int16_t *ul_ref_sigs_rx[30][2][34]; //these contain the sequences in repeated format and quantized to QPSK ifdef IFFT_FPGA
/* 36.211 table 5.5.1.2-1 */
char ref12[360] = {-1,1,3,-3,3,3,1,1,3,1,-3,3,1,1,3,3,3,-1,1,-3,-3,1,-3,3,1,1,-3,-3,-3,-1,-3,-3,1,-3,1,-1,-1,1,1,1,1,-1,-3,-3,1,-3,3,-1,-1,3,1,-1,1,-1,-3,-1,1,-1,1,3,1,-3,3,-1,-1,1,1,-1,-1,3,-3,1,-1,3,-3,-3,-3,3,1,-1,3,3,-3,1,-3,-1,-1,-1,1,-3,3,-1,1,-3,3,1,1,-3,3,1,-1,-1,-1,1,1,3,-1,1,1,-3,-1,3,3,-1,-3,1,1,1,1,1,-1,3,-1,1,1,-3,-3,-1,-3,-3,3,-1,3,1,-1,-1,3,3,-3,1,3,1,3,3,1,-3,1,1,-3,1,1,1,-3,-3,-3,1,3,3,-3,3,-3,1,1,3,-1,-3,3,3,-3,1,-1,-3,-1,3,1,3,3,3,-1,1,3,-1,1,-3,-1,-1,1,1,3,1,-1,-3,1,3,1,-1,1,3,3,3,-1,-1,3,-1,-3,1,1,3,-3,3,-3,-3,3,1,3,-1,-3,3,1,1,-3,1,-3,-3,-1,-1,1,-3,-1,3,1,3,1,-1,-1,3,-3,-1,-3,-1,-1,-3,1,1,1,1,3,1,-1,1,-3,-1,-1,3,-1,1,-3,-3,-3,-3,-3,1,-1,-3,1,1,-3,-3,-3,-3,-1,3,-3,1,-3,3,1,1,-1,-3,-1,-3,1,-1,1,3,-1,1,1,1,3,1,3,3,-1,1,-1,-3,-3,1,1,-3,3,3,1,3,3,1,-3,-1,-1,3,1,3,-3,-3,3,-3,1,-1,-1,3,-1,-3,-3,-1,-3,-1,-3,3,1,-1,1,3,-3,-3,-1,3,-3,3,-1,3,3,-3,3,3,-1,-1,3,-3,-3,-1,-1,-3,-1,3,-3,3,1,-1};
static const char ref12[360] = {
-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3, 1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3, 1, 1, -3, -3, -3, -1,
-3, -3, 1, -3, 1, -1, -1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1, -1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3,
1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1, -1, 3, -3, -3, -3, 3, 1, -1, 3, 3, -3, 1, -3, -1, -1, -1, 1, -3,
3, -1, 1, -3, 3, 1, 1, -3, 3, 1, -1, -1, -1, 1, 1, 3, -1, 1, 1, -3, -1, 3, 3, -1, -3, 1, 1, 1, 1, 1,
-1, 3, -1, 1, 1, -3, -3, -1, -3, -3, 3, -1, 3, 1, -1, -1, 3, 3, -3, 1, 3, 1, 3, 3, 1, -3, 1, 1, -3, 1,
1, 1, -3, -3, -3, 1, 3, 3, -3, 3, -3, 1, 1, 3, -1, -3, 3, 3, -3, 1, -1, -3, -1, 3, 1, 3, 3, 3, -1, 1,
3, -1, 1, -3, -1, -1, 1, 1, 3, 1, -1, -3, 1, 3, 1, -1, 1, 3, 3, 3, -1, -1, 3, -1, -3, 1, 1, 3, -3, 3,
-3, -3, 3, 1, 3, -1, -3, 3, 1, 1, -3, 1, -3, -3, -1, -1, 1, -3, -1, 3, 1, 3, 1, -1, -1, 3, -3, -1, -3, -1,
-1, -3, 1, 1, 1, 1, 3, 1, -1, 1, -3, -1, -1, 3, -1, 1, -3, -3, -3, -3, -3, 1, -1, -3, 1, 1, -3, -3, -3, -3,
-1, 3, -3, 1, -3, 3, 1, 1, -1, -3, -1, -3, 1, -1, 1, 3, -1, 1, 1, 1, 3, 1, 3, 3, -1, 1, -1, -3, -3, 1,
1, -3, 3, 3, 1, 3, 3, 1, -3, -1, -1, 3, 1, 3, -3, -3, 3, -3, 1, -1, -1, 3, -1, -3, -3, -1, -3, -1, -3, 3,
1, -1, 1, 3, -3, -3, -1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1, 3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1};
/* 36.211 table 5.5.1.2-2 */
char ref24[720] = {
-1,3,1,-3,3,-1,1,3,-3,3,1,3,-3,3,1,1,-1,1,3,-3,3,-3,-1,-3,-3,3,-3,-3,-3,1,-3,-3,3,-1,1,1,1,3,1,-1,3,-3,-3,1,3,1,1,-3,3,-1,3,3,1,1,-3,3,3,3,3,1,-1,3,-1,1,1,-1,-3,-1,-1,1,3,3,-1,-3,1,1,3,-3,1,1,-3,-1,-1,1,3,1,3,1,-1,3,1,1,-3,-1,-3,-1,-1,-1,-1,-3,-3,-1,1,1,3,3,-1,3,-1,1,-1,-3,1,-1,-3,-3,1,-3,-1,-1,-3,1,1,3,-1,1,3,1,-3,1,-3,1,1,-1,-1,3,-1,-3,3,-3,-3,-3,1,1,1,1,-1,-1,3,-3,-3,3,-3,1,-1,-1,1,-1,1,1,-1,-3,-1,1,-1,3,-1,-3,-3,3,3,-1,-1,-3,-1,3,1,3,1,3,1,1,-1,3,1,-1,1,3,-3,-1,-1,1,-3,1,3,-3,1,-1,-3,3,-3,3,-1,-1,-1,-1,1,-3,-3,-3,1,-3,-3,-3,1,-3,1,1,-3,3,3,-1,-3,-1,3,-3,3,3,3,-1,1,1,-3,1,-1,1,1,-3,1,1,-1,1,-3,-3,3,-1,3,-1,-1,-3,-3,-3,-1,-3,-3,1,-1,1,3,3,-1,1,-1,3,1,3,3,-3,-3,1,3,1,-1,-3,-3,-3,3,3,-3,3,3,-1,-3,3,-1,1,-3,1,1,3,3,1,1,1,-1,-1,1,-3,3,-1,1,1,-3,3,3,-1,-3,3,-3,-1,-3,-1,3,-1,-1,-1,-1,-3,-1,3,3,1,-1,1,3,3,3,-1,1,1,-3,1,3,-1,-3,3,-3,-3,3,1,3,1,-3,3,1,3,1,1,3,3,-1,-1,-3,1,-3,-1,3,1,1,3,-1,-1,1,-3,1,3,-3,1,-1,-3,-1,3,1,3,1,-1,-3,-3,-1,-1,-3,-3,-3,-1,-1,-3,3,-1,-1,-1,-1,1,1,-3,3,1,3,3,1,-1,1,-3,1,-3,1,1,-3,-1,1,3,-1,3,3,-1,-3,1,-1,-3,3,3,3,-1,1,1,3,-1,-3,-1,3,-1,-1,-1,1,1,1,1,1,-1,3,-1,-3,1,1,3,-3,1,-3,-1,1,1,-3,-3,3,1,1,-3,1,3,3,1,-1,-3,3,-1,3,3,3,-3,1,-1,1,-1,-3,-1,1,3,-1,3,-3,-3,-1,-3,3,-3,-3,-3,-1,-1,-3,-1,-3,3,1,3,-3,-1,3,-1,1,-1,3,-3,1,-1,-3,-3,1,1,-1,1,-1,1,-1,3,1,-3,-1,1,-1,1,-1,-1,3,3,-3,-1,1,-3,-3,-1,-3,3,1,-1,-3,-1,-3,-3,3,-3,3,-3,-1,1,3,1,-3,1,3,3,-1,-3,-1,-1,-1,-1,3,3,3,1,3,3,-3,1,3,-1,3,-1,3,3,-3,3,1,-1,3,3,1,-1,3,3,-1,-3,3,-3,-1,-1,3,-1,3,-1,-1,1,1,1,1,-1,-1,-3,-1,3,1,-1,1,-1,3,-1,3,1,1,-1,-1,-3,1,1,-3,1,3,-3,1,1,-3,-3,-1,-1,-3,-1,1,3,1,1,-3,-1,-1,-3,3,-3,3,1,-3,3,-3,1,-1,1,-3,1,1,1,-1,-3,3,3,1,1,3,-1,-3,-1,-1,-1,3,1,-3,-3,-1,3,-3,-1,-3,-1,-3,-1,-1,-3,-1,-1,1,-3,-1,-1,1,-1,-3,1,1,-3,1,-3,-3,3,1,1,-1,3,-1,-1,1,1,-1,-1,-3,-1,3,-1,3,-1,1,3,1,-1,3,1,3,-3,-3,1,-1,-1,1,3
};
static const char ref24[720] = {
-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3, -3, 3, -3, -3, -3, 1, -3, -3,
3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3, 3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1,
1, -1, -3, -1, -1, 1, 3, 3, -1, -3, 1, 1, 3, -3, 1, 1, -3, -1, -1, 1, 3, 1, 3, 1, -1, 3, 1, 1, -3, -1, -3, -1,
-1, -1, -1, -3, -3, -1, 1, 1, 3, 3, -1, 3, -1, 1, -1, -3, 1, -1, -3, -3, 1, -3, -1, -1, -3, 1, 1, 3, -1, 1, 3, 1,
-3, 1, -3, 1, 1, -1, -1, 3, -1, -3, 3, -3, -3, -3, 1, 1, 1, 1, -1, -1, 3, -3, -3, 3, -3, 1, -1, -1, 1, -1, 1, 1,
-1, -3, -1, 1, -1, 3, -1, -3, -3, 3, 3, -1, -1, -3, -1, 3, 1, 3, 1, 3, 1, 1, -1, 3, 1, -1, 1, 3, -3, -1, -1, 1,
-3, 1, 3, -3, 1, -1, -3, 3, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, 1, -3, -3, -3, 1, -3, 1, 1, -3, 3, 3, -1, -3, -1,
3, -3, 3, 3, 3, -1, 1, 1, -3, 1, -1, 1, 1, -3, 1, 1, -1, 1, -3, -3, 3, -1, 3, -1, -1, -3, -3, -3, -1, -3, -3, 1,
-1, 1, 3, 3, -1, 1, -1, 3, 1, 3, 3, -3, -3, 1, 3, 1, -1, -3, -3, -3, 3, 3, -3, 3, 3, -1, -3, 3, -1, 1, -3, 1,
1, 3, 3, 1, 1, 1, -1, -1, 1, -3, 3, -1, 1, 1, -3, 3, 3, -1, -3, 3, -3, -1, -3, -1, 3, -1, -1, -1, -1, -3, -1, 3,
3, 1, -1, 1, 3, 3, 3, -1, 1, 1, -3, 1, 3, -1, -3, 3, -3, -3, 3, 1, 3, 1, -3, 3, 1, 3, 1, 1, 3, 3, -1, -1,
-3, 1, -3, -1, 3, 1, 1, 3, -1, -1, 1, -3, 1, 3, -3, 1, -1, -3, -1, 3, 1, 3, 1, -1, -3, -3, -1, -1, -3, -3, -3, -1,
-1, -3, 3, -1, -1, -1, -1, 1, 1, -3, 3, 1, 3, 3, 1, -1, 1, -3, 1, -3, 1, 1, -3, -1, 1, 3, -1, 3, 3, -1, -3, 1,
-1, -3, 3, 3, 3, -1, 1, 1, 3, -1, -3, -1, 3, -1, -1, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, 1, 1, 3, -3, 1, -3, -1,
1, 1, -3, -3, 3, 1, 1, -3, 1, 3, 3, 1, -1, -3, 3, -1, 3, 3, 3, -3, 1, -1, 1, -1, -3, -1, 1, 3, -1, 3, -3, -3,
-1, -3, 3, -3, -3, -3, -1, -1, -3, -1, -3, 3, 1, 3, -3, -1, 3, -1, 1, -1, 3, -3, 1, -1, -3, -3, 1, 1, -1, 1, -1, 1,
-1, 3, 1, -3, -1, 1, -1, 1, -1, -1, 3, 3, -3, -1, 1, -3, -3, -1, -3, 3, 1, -1, -3, -1, -3, -3, 3, -3, 3, -3, -1, 1,
3, 1, -3, 1, 3, 3, -1, -3, -1, -1, -1, -1, 3, 3, 3, 1, 3, 3, -3, 1, 3, -1, 3, -1, 3, 3, -3, 3, 1, -1, 3, 3,
1, -1, 3, 3, -1, -3, 3, -3, -1, -1, 3, -1, 3, -1, -1, 1, 1, 1, 1, -1, -1, -3, -1, 3, 1, -1, 1, -1, 3, -1, 3, 1,
1, -1, -1, -3, 1, 1, -3, 1, 3, -3, 1, 1, -3, -3, -1, -1, -3, -1, 1, 3, 1, 1, -3, -1, -1, -3, 3, -3, 3, 1, -3, 3,
-3, 1, -1, 1, -3, 1, 1, 1, -1, -3, 3, 3, 1, 1, 3, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -3, -1, -3, -1, -3, -1,
-1, -3, -1, -1, 1, -3, -1, -1, 1, -1, -3, 1, 1, -3, 1, -3, -3, 3, 1, 1, -1, 3, -1, -1, 1, 1, -1, -1, -3, -1, 3, -1,
3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3};
void generate_ul_ref_sigs(void) {
double qbar,phase;
......
......@@ -40,8 +40,7 @@
#include "transport_common_proto.h"
#include "SCHED/sched_common.h"
//#define DEBUG_HARQ
#include "openair1/PHY/LTE_TRANSPORT/dci_tools_common_extern.h"
//#define DEBUG_DCI
......@@ -98,69 +97,7 @@ uint16_t RIV2nb_rb_LUT100[6000];
uint16_t RIV2first_rb_LUT100[6000];
uint16_t RIV_max100=0;
extern uint32_t current_dlsch_cqi;
// Table 8.6.3-3 36.213
uint16_t beta_cqi[16] = {0, //reserved
0, //reserved
9, //1.125
10, //1.250
11, //1.375
13, //1.625
14, //1.750
16, //2.000
18, //2.250
20, //2.500
23, //2.875
25, //3.125
28, //3.500
32, //4.000
40, //5.000
50
}; //6.250
// Table 8.6.3-2 36.213
uint16_t beta_ri[16] = {10, //1.250
13, //1.625
16, //2.000
20, //2.500
25, //3.125
32, //4.000
40, //5.000
50, //6.250
64, //8.000
80, //10.000
101, //12.625
127, //15.875
160, //20.000
0, //reserved
0, //reserved
0
}; //reserved
// Table 8.6.3-2 36.213
uint16_t beta_ack[16] = {16, //2.000
20, //2.500
25, //3.125
32, //4.000
40, //5.000
50, //6.250
64, //8.000
80, //10.000
101, //12.625
127, //15.875
160, //20.000
248, //31.000
400, //50.000
640, //80.000
808
};//126.00
int8_t delta_PUSCH_abs[4] = {-4,-1,1,4};
int8_t delta_PUSCH_acc[4] = {-1,0,1,3};
int8_t *delta_PUCCH_lut = delta_PUSCH_acc;
const int8_t *delta_PUCCH_lut = delta_PUSCH_acc;
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi)
{
......
......@@ -84,6 +84,6 @@ extern uint16_t RIV2nb_rb_LUT100[6000];
extern uint16_t RIV2first_rb_LUT100[6000];
extern uint16_t RIV_max100;
extern int8_t *delta_PUCCH_lut;
extern int8_t delta_PUSCH_acc[4];
extern int8_t delta_PUSCH_abs[4];
extern const int8_t *delta_PUCCH_lut;
extern const int8_t delta_PUSCH_acc[4];
extern const int8_t delta_PUSCH_abs[4];
......@@ -131,8 +131,8 @@ void layer1prec2A(int32_t *antenna0_sample, int32_t *antenna1_sample, uint8_t pr
((int16_t *)antenna1_sample)[1] = (int16_t)((((int16_t *)antenna1_sample)[1]*ONE_OVER_SQRT2_Q15)>>15); */
}
uint32_t FOUR[2]={0,4};
uint32_t TWO[2]={0,2};
static const uint32_t FOUR[2] = {0, 4};
static const uint32_t TWO[2] = {0, 2};
int allocate_REs_in_RB_no_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
int **txdataF,
......
......@@ -44,11 +44,6 @@
//unsigned short phich_reg[MAX_NUM_PHICH_GROUPS][3];
int32_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3
int32_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2
// This routine generates the PHICH
void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
......
......@@ -28,10 +28,10 @@ double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0},
{ 5.0/4.0,1.0,3.0/4.0,1.0/2.0}};
*/
double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db
{ 0.96910, 0.00000, -1.24939, -3.01030}};
static const double ratioPB[2][4] = {{0.00000, -0.96910, -2.21849, -3.97940}, // in db
{0.96910, 0.00000, -1.24939, -3.01030}};
double pa_values[8]={-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; //reported by higher layers
static const double pa_values[8] = {-6.0, -4.77, -3.0, -1.77, 0.0, 1.0, 2.0, 3.0}; // reported by higher layers
double get_pa_dB(uint8_t pa)
{
......
This diff is collapsed.
......@@ -40,9 +40,9 @@
//#define PRACH_DEBUG 1
//#define PRACH_WRITE_OUTPUT_DEBUG 1
extern uint16_t NCS_unrestricted[16];
extern uint16_t NCS_restricted[15];
extern uint16_t NCS_4[7];
extern const uint16_t NCS_unrestricted[16];
extern const uint16_t NCS_restricted[15];
extern const uint16_t NCS_4[7];
extern int16_t ru[2*839]; // quantized roots of unity
extern uint32_t ZC_inv[839]; // multiplicative inverse for roots u
......
......@@ -44,26 +44,20 @@
#include "pucch_extern.h"
int16_t cfo_pucch_np[24*7] = {20787,-25330,27244,-18205,31356,-9512,32767,0,31356,9511,27244,18204,20787,25329,
27244,-18205,30272,-12540,32137,-6393,32767,0,32137,6392,30272,12539,27244,18204,
31356,-9512,32137,-6393,32609,-3212,32767,0,32609,3211,32137,6392,31356,9511,
32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,
31356,9511,32137,6392,32609,3211,32767,0,32609,-3212,32137,-6393,31356,-9512,
27244,18204,30272,12539,32137,6392,32767,0,32137,-6393,30272,-12540,27244,-18205,
20787,25329,27244,18204,31356,9511,32767,0,31356,-9512,27244,-18205,20787,-25330
};
int16_t cfo_pucch_ep[24*6] = {24278,-22005,29621,-14010,32412,-4808,32412,4807,29621,14009,24278,22004,
28897,-15447,31356,-9512,32609,-3212,32609,3211,31356,9511,28897,15446,
31785,-7962,32412,-4808,32727,-1608,32727,1607,32412,4807,31785,7961,
32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,
31785,7961,32412,4807,32727,1607,32727,-1608,32412,-4808,31785,-7962,
28897,15446,31356,9511,32609,3211,32609,-3212,31356,-9512,28897,-15447,
24278,22004,29621,14009,32412,4807,32412,-4808,29621,-14010,24278,-22005
};
static const int16_t cfo_pucch_np[24 * 7] = {
20787, -25330, 27244, -18205, 31356, -9512, 32767, 0, 31356, 9511, 27244, 18204, 20787, 25329, 27244, -18205, 30272,
-12540, 32137, -6393, 32767, 0, 32137, 6392, 30272, 12539, 27244, 18204, 31356, -9512, 32137, -6393, 32609, -3212,
32767, 0, 32609, 3211, 32137, 6392, 31356, 9511, 32767, 0, 32767, 0, 32767, 0, 32767, 0, 32767,
0, 32767, 0, 32767, 0, 31356, 9511, 32137, 6392, 32609, 3211, 32767, 0, 32609, -3212, 32137, -6393,
31356, -9512, 27244, 18204, 30272, 12539, 32137, 6392, 32767, 0, 32137, -6393, 30272, -12540, 27244, -18205, 20787,
25329, 27244, 18204, 31356, 9511, 32767, 0, 31356, -9512, 27244, -18205, 20787, -25330};
static const int16_t cfo_pucch_ep[24 * 6] = {
24278, -22005, 29621, -14010, 32412, -4808, 32412, 4807, 29621, 14009, 24278, 22004, 28897, -15447, 31356, -9512, 32609,
-3212, 32609, 3211, 31356, 9511, 28897, 15446, 31785, -7962, 32412, -4808, 32727, -1608, 32727, 1607, 32412, 4807,
31785, 7961, 32767, 0, 32767, 0, 32767, 0, 32767, 0, 32767, 0, 32767, 0, 31785, 7961, 32412,
4807, 32727, 1607, 32727, -1608, 32412, -4808, 31785, -7962, 28897, 15446, 31356, 9511, 32609, 3211, 32609, -3212,
31356, -9512, 28897, -15447, 24278, 22004, 29621, 14009, 32412, 4807, 32412, -4808, 29621, -14010, 24278, -22005};
void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
......@@ -194,10 +188,10 @@ uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[4][14][12][2]
}
#define MAXROW_TBL_SF5_OS_IDX (5) // Orthogonal sequence index
const int16_t TBL_3_SF5_GEN_N_DASH_NS[MAXROW_TBL_SF5_OS_IDX] = {0,3,6,8,10};
static const int16_t TBL_3_SF5_GEN_N_DASH_NS[MAXROW_TBL_SF5_OS_IDX] = {0, 3, 6, 8, 10};
#define MAXROW_TBL_SF4_OS_IDX (4) // Orthogonal sequence index
const int16_t TBL_3_SF4_GEN_N_DASH_NS[MAXROW_TBL_SF4_OS_IDX] = {0,3,6,9};
static const int16_t TBL_3_SF4_GEN_N_DASH_NS[MAXROW_TBL_SF4_OS_IDX] = {0, 3, 6, 9};
/* Channel estimation */
uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[4][14][12][2],
......@@ -532,12 +526,10 @@ const int16_t TBL_3_SF5[MAXROW_TBL_SF5][MAXCLM_TBL_SF5][2] = {
#define MAXROW_TBL_SF4_fmt3 4
#define MAXCLM_TBL_SF4 4
const int16_t TBL_3_SF4[MAXROW_TBL_SF4_fmt3][MAXCLM_TBL_SF4][2] = {
{ {32767,0}, {32767,0}, {32767,0}, {32767,0}},
{ {32767,0}, {-32767,0}, {32767,0}, {-32767,0}},
{ {32767,0}, {32767,0}, {-32767,0}, {-32767,0}},
{ {32767,0}, {-32767,0}, {-32767,0}, {32767,0}}
};
static const int16_t TBL_3_SF4[MAXROW_TBL_SF4_fmt3][MAXCLM_TBL_SF4][2] = {{{32767, 0}, {32767, 0}, {32767, 0}, {32767, 0}},
{{32767, 0}, {-32767, 0}, {32767, 0}, {-32767, 0}},
{{32767, 0}, {32767, 0}, {-32767, 0}, {-32767, 0}},
{{32767, 0}, {-32767, 0}, {-32767, 0}, {32767, 0}}};
/* orthogonal sequence remove */
uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[4][2][5][12][2],
......@@ -918,7 +910,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int16_t tmp_re,tmp_im,W_re=0,W_im=0;
int16_t *rxptr;
uint32_t symbol_offset;
int16_t stat0_ref_re[4],stat0_ref_im[4],stat1_ref_re[4],stat1_ref_im[4],*cfo;
int16_t stat0_ref_re[4], stat0_ref_im[4], stat1_ref_re[4], stat1_ref_im[4];
int16_t chest0_re[4][12],chest0_im[4][12];
int16_t chest1_re[4][12],chest1_im[4][12];
int32_t chest_mag;
......@@ -1214,7 +1206,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat1_re[aa]=0;
stat1_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
const int16_t *cfo = (frame_parms->Ncp == 0) ? &cfo_pucch_np[14 * phase] : &cfo_pucch_ep[12 * phase];
for (l=0; l<(nsymb>>1); l++) {
stat0_re[aa] += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
......@@ -1318,7 +1310,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat0_ref_re[aa]=0;
stat0_ref_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
const int16_t *cfo = (frame_parms->Ncp == 0) ? &cfo_pucch_np[14 * phase] : &cfo_pucch_ep[12 * phase];
for (l=0; l<(nsymb>>1); l++) {
if ((l<2)||(l>(nsymb>>1) - 3)) { //data symbols
......@@ -1398,7 +1390,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
chL = (nsymb>>1)-4;
chest_mag=0;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max];
const int16_t *cfo = (frame_parms->Ncp == 0) ? &cfo_pucch_np[14 * phase_max] : &cfo_pucch_ep[12 * phase_max];
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
for (re=0; re<12; re++) {
......
This diff is collapsed.
......@@ -47,37 +47,45 @@
#define D_NPUCCH_SF5 5
#define D_NPUCCH_SF4 4
extern int16_t W4[3][4];
extern const int16_t W4[3][4];
extern int16_t W3_re[3][6];
extern const int16_t W3_re[3][6];
extern const int16_t W3_im[3][6];
extern int16_t W3_im[3][6];
extern const int16_t alpha_re[12];
extern const int16_t alpha_im[12];
extern int16_t alpha_re[12];
extern int16_t alpha_im[12];
static char const* const pucch_format_string[] = {"format 1",
"format 1a",
"format 1b",
"pucch_format1b_csA2",
"pucch_format1b_csA3",
"pucch_format1b_csA4",
"format 2",
"format 2a",
"format 2b",
"pucch_format3"};
extern char *pucch_format_string[];
extern const uint8_t chcod_tbl[128][48];
extern uint8_t chcod_tbl[128][48];
extern const int16_t W5_fmt3_re[5][5];
extern int16_t W5_fmt3_re[5][5];
extern const int16_t W5_fmt3_im[5][5];
extern int16_t W5_fmt3_im[5][5];
extern const int16_t W4_fmt3[4][4];
extern int16_t W4_fmt3[4][4];
extern const int16_t W2[2];
extern int16_t W2[2];
extern int16_t RotTBL_re[4];
extern int16_t RotTBL_im[4];
extern const int16_t RotTBL_re[4];
extern const int16_t RotTBL_im[4];
//np4_tbl, np5_tbl
extern uint8_t Np5_TBL[5];
extern uint8_t Np4_TBL[4];
extern const uint8_t Np5_TBL[5];
extern const uint8_t Np4_TBL[4];
// alpha_TBL
extern int16_t alphaTBL_re[12];
extern int16_t alphaTBL_im[12];
extern const int16_t alphaTBL_re[12];
extern const int16_t alphaTBL_im[12];
#endif
......@@ -32,6 +32,7 @@
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include "PHY/phy_extern.h"
#include "SCHED_UE/sched_UE.h"
#ifdef DEBUG_DCI_TOOLS
#include "PHY/phy_vars.h"
......@@ -63,10 +64,6 @@
int flag_LA=0;
extern uint16_t beta_cqi[16];
extern uint16_t beta_ri[16];
extern uint16_t beta_ack[16];
static const double p_qpsk[8] = {5982.42405670359,
-21568.1135917693,
31293.9987036905,
......
......@@ -33,51 +33,31 @@
#include "PHY/phy_extern.h"
#include "common/utils/LOG/log.h"
static unsigned short msrsb_6_40[8][4] = {
{36, 12, 4, 4},
{32, 16, 8, 4},
{24, 4, 4, 4},
{20, 4, 4, 4},
{16, 4, 4, 4},
{12, 4, 4, 4},
{8, 4, 4, 4},
{4, 4, 4, 4}
};
static unsigned short msrsb_41_60[8][4] = {
{48,24,12,4},
{48,16,8,4},
{40,20,4,4},
{36,12,4,4},
{32,16,8,4},
{24,4,4,4},
{20,4,4,4},
{16,4,4,4}
};
static unsigned short msrsb_61_80[8][4] = {
{72,24,12,4},
{64,32,16,4},
{60,20,4,4},
{48,24,12,4},
{48,16,8,4},
{40,20,4,4},
{36,12,4,4},
{32,16,8,4}
};
static unsigned short msrsb_81_110[8][4] = {
{96,48,24,4},
{96,32,16,4},
{80,40,20,4},
{72,24,12,4},
{64,32,16,4},
{60,20,4,4},
{48,24,12,4},
{48,16,8,4}
};
unsigned short transmission_offset_tdd[16] = {2,6,10,18,14,22,26,30,70,74,194,326,586,210};
static const unsigned short msrsb_6_40[8][4] =
{{36, 12, 4, 4}, {32, 16, 8, 4}, {24, 4, 4, 4}, {20, 4, 4, 4}, {16, 4, 4, 4}, {12, 4, 4, 4}, {8, 4, 4, 4}, {4, 4, 4, 4}};
static const unsigned short msrsb_41_60[8][4] =
{{48, 24, 12, 4}, {48, 16, 8, 4}, {40, 20, 4, 4}, {36, 12, 4, 4}, {32, 16, 8, 4}, {24, 4, 4, 4}, {20, 4, 4, 4}, {16, 4, 4, 4}};
static const unsigned short msrsb_61_80[8][4] = {{72, 24, 12, 4},
{64, 32, 16, 4},
{60, 20, 4, 4},
{48, 24, 12, 4},
{48, 16, 8, 4},
{40, 20, 4, 4},
{36, 12, 4, 4},
{32, 16, 8, 4}};
static const unsigned short msrsb_81_110[8][4] = {{96, 48, 24, 4},
{96, 32, 16, 4},
{80, 40, 20, 4},
{72, 24, 12, 4},
{64, 32, 16, 4},
{60, 20, 4, 4},
{48, 24, 12, 4},
{48, 16, 8, 4}};
// static const unsigned short transmission_offset_tdd[16] = {2,6,10,18,14,22,26,30,70,74,194,326,586,210};
int compareints (const void * a, const void * b)
{
......
......@@ -23,98 +23,90 @@
#include "PHY/NR_REFSIG/nr_mod_table.h"
//Table 6.3.1.5-1 Precoding Matrix W 1 layer 2 antenna ports 'n' = -1 and 'o' = -j
char nr_W_1l_2p[6][2][1] = {
{{'1'}, {'0'}},//pmi 0
{{'0'}, {'1'}},
{{'1'}, {'1'}},
{{'1'}, {'n'}},
{{'1'}, {'j'}},
{{'1'}, {'o'}}//pmi 5
const char nr_W_1l_2p[6][2][1] = {
{{'1'}, {'0'}}, // pmi 0
{{'0'}, {'1'}},
{{'1'}, {'1'}},
{{'1'}, {'n'}},
{{'1'}, {'j'}},
{{'1'}, {'o'}} // pmi 5
};
//Table 6.3.1.5-3 Precoding Matrix W 1 layer 4 antenna ports 'n' = -1 and 'o' = -j
char nr_W_1l_4p[28][4][1] = {
{{'1'}, {'0'}, {'0'}, {'0'}},//pmi 0
{{'0'}, {'1'}, {'0'}, {'0'}},
{{'0'}, {'0'}, {'1'}, {'0'}},
{{'0'}, {'0'}, {'0'}, {'1'}},
{{'1'}, {'0'}, {'1'}, {'0'}},
{{'1'}, {'0'}, {'n'}, {'0'}},
{{'1'}, {'0'}, {'j'}, {'0'}},
{{'1'}, {'0'}, {'o'}, {'0'}},//pmi 7
{{'0'}, {'1'}, {'0'}, {'1'}},//pmi 8
{{'0'}, {'1'}, {'0'}, {'n'}},
{{'0'}, {'1'}, {'0'}, {'j'}},
{{'0'}, {'1'}, {'0'}, {'o'}},
{{'1'}, {'1'}, {'1'}, {'1'}},
{{'1'}, {'1'}, {'j'}, {'j'}},
{{'1'}, {'1'}, {'n'}, {'n'}},
{{'1'}, {'1'}, {'o'}, {'o'}},
{{'1'}, {'j'}, {'1'}, {'j'}},//pmi 16
{{'1'}, {'j'}, {'j'}, {'n'}},
{{'1'}, {'j'}, {'n'}, {'o'}},
{{'1'}, {'j'}, {'o'}, {'1'}},
{{'1'}, {'n'}, {'1'}, {'n'}},
{{'1'}, {'n'}, {'j'}, {'o'}},
{{'1'}, {'n'}, {'n'}, {'1'}},
{{'1'}, {'n'}, {'o'}, {'j'}},//pmi 23
{{'1'}, {'o'}, {'1'}, {'o'}},//pmi 24
{{'1'}, {'o'}, {'j'}, {'1'}},
{{'1'}, {'o'}, {'n'}, {'j'}},
{{'1'}, {'o'}, {'o'}, {'n'}}//pmi 27
const char nr_W_1l_4p[28][4][1] = {
{{'1'}, {'0'}, {'0'}, {'0'}}, // pmi 0
{{'0'}, {'1'}, {'0'}, {'0'}},
{{'0'}, {'0'}, {'1'}, {'0'}},
{{'0'}, {'0'}, {'0'}, {'1'}},
{{'1'}, {'0'}, {'1'}, {'0'}},
{{'1'}, {'0'}, {'n'}, {'0'}},
{{'1'}, {'0'}, {'j'}, {'0'}},
{{'1'}, {'0'}, {'o'}, {'0'}}, // pmi 7
{{'0'}, {'1'}, {'0'}, {'1'}}, // pmi 8
{{'0'}, {'1'}, {'0'}, {'n'}},
{{'0'}, {'1'}, {'0'}, {'j'}},
{{'0'}, {'1'}, {'0'}, {'o'}},
{{'1'}, {'1'}, {'1'}, {'1'}},
{{'1'}, {'1'}, {'j'}, {'j'}},
{{'1'}, {'1'}, {'n'}, {'n'}},
{{'1'}, {'1'}, {'o'}, {'o'}},
{{'1'}, {'j'}, {'1'}, {'j'}}, // pmi
// 16
{{'1'}, {'j'}, {'j'}, {'n'}},
{{'1'}, {'j'}, {'n'}, {'o'}},
{{'1'}, {'j'}, {'o'}, {'1'}},
{{'1'}, {'n'}, {'1'}, {'n'}},
{{'1'}, {'n'}, {'j'}, {'o'}},
{{'1'}, {'n'}, {'n'}, {'1'}},
{{'1'}, {'n'}, {'o'}, {'j'}}, // pmi 23
{{'1'}, {'o'}, {'1'}, {'o'}}, // pmi 24
{{'1'}, {'o'}, {'j'}, {'1'}},
{{'1'}, {'o'}, {'n'}, {'j'}},
{{'1'}, {'o'}, {'o'}, {'n'}} // pmi 27
};
//Table 6.3.1.5-4 Precoding Matrix W 2 antenna ports layers 2 'n' = -1 and 'o' = -j
char nr_W_2l_2p[3][2][2] = {
{{'1', '0'}, {'0', '1'}},//pmi 0
{{'1', '1'}, {'1', 'n'}},
{{'1', '1'}, {'j', 'o'}} //pmi 2
const char nr_W_2l_2p[3][2][2] = {
{{'1', '0'}, {'0', '1'}}, // pmi 0
{{'1', '1'}, {'1', 'n'}},
{{'1', '1'}, {'j', 'o'}} // pmi 2
};
//Table 6.3.1.5-5 Precoding Matrix W 2 layers 4 antenna ports 'n' = -1 and 'o' = -j
char nr_W_2l_4p[22][4][2] = {
{{'1', '0'}, {'0', '1'}, {'0', '0'}, {'0', '0'}},//pmi 0
{{'1', '0'}, {'0', '0'}, {'0', '1'}, {'0', '0'}},
{{'1', '0'}, {'0', '0'}, {'0', '0'}, {'0', '1'}},
{{'0', '0'}, {'1', '0'}, {'0', '1'}, {'0', '0'}},//pmi 3
{{'0', '0'}, {'1', '0'}, {'0', '0'}, {'0', '1'}},//pmi 4
{{'0', '0'}, {'0', '0'}, {'1', '0'}, {'0', '1'}},
{{'1', '0'}, {'0', '1'}, {'1', '0'}, {'0', 'o'}},
{{'1', '0'}, {'0', '1'}, {'1', '0'}, {'0', 'j'}},
{{'1', '0'}, {'0', '1'}, {'o', '0'}, {'0', '1'}},//pmi 8
{{'1', '0'}, {'0', '1'}, {'o', '0'}, {'0', 'n'}},
{{'1', '0'}, {'0', '1'}, {'n', '0'}, {'0', 'o'}},
{{'1', '0'}, {'0', '1'}, {'n', '0'}, {'0', 'j'}},//pmi 11
{{'1', '0'}, {'0', '1'}, {'j', '0'}, {'0', '1'}},//pmi 12
{{'1', '0'}, {'0', '1'}, {'j', '0'}, {'0', 'n'}},
{{'1', '1'}, {'1', '1'}, {'1', 'n'}, {'1', 'n'}},
{{'1', '1'}, {'1', '1'}, {'j', 'o'}, {'j', 'o'}},//pmi 15
{{'1', '1'}, {'j', 'j'}, {'1', 'n'}, {'j', 'o'}},//pmi 16
{{'1', '1'}, {'j', 'j'}, {'j', 'o'}, {'n', '1'}},
{{'1', '1'}, {'n', 'n'}, {'1', 'n'}, {'n', '1'}},
{{'1', '1'}, {'n', 'n'}, {'j', 'o'}, {'o', 'j'}},//pmi 19
{{'1', '1'}, {'o', 'o'}, {'1', 'n'}, {'o', 'j'}},
{{'1', '1'}, {'o', 'o'}, {'j', 'o'}, {'1', 'n'}}//pmi 21
const char nr_W_2l_4p[22][4][2] = {
{{'1', '0'}, {'0', '1'}, {'0', '0'}, {'0', '0'}}, // pmi 0
{{'1', '0'}, {'0', '0'}, {'0', '1'}, {'0', '0'}}, {{'1', '0'}, {'0', '0'}, {'0', '0'}, {'0', '1'}},
{{'0', '0'}, {'1', '0'}, {'0', '1'}, {'0', '0'}}, // pmi 3
{{'0', '0'}, {'1', '0'}, {'0', '0'}, {'0', '1'}}, // pmi 4
{{'0', '0'}, {'0', '0'}, {'1', '0'}, {'0', '1'}}, {{'1', '0'}, {'0', '1'}, {'1', '0'}, {'0', 'o'}},
{{'1', '0'}, {'0', '1'}, {'1', '0'}, {'0', 'j'}}, {{'1', '0'}, {'0', '1'}, {'o', '0'}, {'0', '1'}}, // pmi 8
{{'1', '0'}, {'0', '1'}, {'o', '0'}, {'0', 'n'}}, {{'1', '0'}, {'0', '1'}, {'n', '0'}, {'0', 'o'}},
{{'1', '0'}, {'0', '1'}, {'n', '0'}, {'0', 'j'}}, // pmi 11
{{'1', '0'}, {'0', '1'}, {'j', '0'}, {'0', '1'}}, // pmi 12
{{'1', '0'}, {'0', '1'}, {'j', '0'}, {'0', 'n'}}, {{'1', '1'}, {'1', '1'}, {'1', 'n'}, {'1', 'n'}},
{{'1', '1'}, {'1', '1'}, {'j', 'o'}, {'j', 'o'}}, // pmi 15
{{'1', '1'}, {'j', 'j'}, {'1', 'n'}, {'j', 'o'}}, // pmi 16
{{'1', '1'}, {'j', 'j'}, {'j', 'o'}, {'n', '1'}}, {{'1', '1'}, {'n', 'n'}, {'1', 'n'}, {'n', '1'}},
{{'1', '1'}, {'n', 'n'}, {'j', 'o'}, {'o', 'j'}}, // pmi 19
{{'1', '1'}, {'o', 'o'}, {'1', 'n'}, {'o', 'j'}}, {{'1', '1'}, {'o', 'o'}, {'j', 'o'}, {'1', 'n'}} // pmi 21
};
//Table 6.3.1.5-6 Precoding Matrix W 3 layers 4 antenna ports 'n' = -1 and 'o' = -j
char nr_W_3l_4p[7][4][3] = {
{{'1', '0', '0'}, {'0', '1', '0'}, {'0', '0', '1'},{'0', '0', '0'}},//pmi 0
{{'1', '0', '0'}, {'0', '1', '0'}, {'1', '0', '0'},{'0', '0', '1'}},
{{'1', '0', '0'}, {'0', '1', '0'}, {'n', '0', '0'},{'0', '0', '1'}},
{{'1', '1', '1'}, {'1', 'n', '1'}, {'1', '1', 'n'},{'1', 'n', 'n'}},//pmi 3
{{'1', '1', '1'}, {'1', 'n', '1'}, {'j', 'j', 'o'},{'j', 'o', 'o'}},//pmi 4
{{'1', '1', '1'}, {'n', '1', 'n'}, {'1', '1', 'n'},{'n', '1', '1'}},
{{'1', '1', '1'}, {'n', '1', 'n'}, {'j', 'j', 'o'},{'o', 'j', 'j'}}
};
const char nr_W_3l_4p[7][4][3] = {{{'1', '0', '0'}, {'0', '1', '0'}, {'0', '0', '1'}, {'0', '0', '0'}}, // pmi 0
{{'1', '0', '0'}, {'0', '1', '0'}, {'1', '0', '0'}, {'0', '0', '1'}},
{{'1', '0', '0'}, {'0', '1', '0'}, {'n', '0', '0'}, {'0', '0', '1'}},
{{'1', '1', '1'}, {'1', 'n', '1'}, {'1', '1', 'n'}, {'1', 'n', 'n'}}, // pmi 3
{{'1', '1', '1'}, {'1', 'n', '1'}, {'j', 'j', 'o'}, {'j', 'o', 'o'}}, // pmi 4
{{'1', '1', '1'}, {'n', '1', 'n'}, {'1', '1', 'n'}, {'n', '1', '1'}},
{{'1', '1', '1'}, {'n', '1', 'n'}, {'j', 'j', 'o'}, {'o', 'j', 'j'}}};
//Table 6.3.1.5-7 Precoding Matrix W 4 layers 4 antenna ports 'n' = -1 and 'o' = -j
char nr_W_4l_4p[5][4][4] = {
{{'1', '0', '0', '0'}, {'0', '1', '0', '0'}, {'0', '0', '1', '0'}, {'0', '0', '0', '1'}},//pmi 0
{{'1', '1', '0', '0'}, {'0', '0', '1', '1'}, {'1', 'n', '0', '0'}, {'0', '0', '1', 'n'}},
{{'1', '1', '0', '0'}, {'0', '0', '1', '1'}, {'j', 'o', '0', '0'}, {'0', '0', 'j', 'o'}},
{{'1', '1', '1', '1'}, {'1', 'n', '1', 'n'}, {'1', '1', 'n', 'n'}, {'1', 'n', 'n', '1'}},//pmi 3
{{'1', '1', '1', '1'}, {'1', 'n', '1', 'n'}, {'j', 'j', 'o', 'o'}, {'j', 'o', 'o', 'j'}}//pmi 4
const char nr_W_4l_4p[5][4][4] = {
{{'1', '0', '0', '0'}, {'0', '1', '0', '0'}, {'0', '0', '1', '0'}, {'0', '0', '0', '1'}}, // pmi 0
{{'1', '1', '0', '0'}, {'0', '0', '1', '1'}, {'1', 'n', '0', '0'}, {'0', '0', '1', 'n'}},
{{'1', '1', '0', '0'}, {'0', '0', '1', '1'}, {'j', 'o', '0', '0'}, {'0', '0', 'j', 'o'}},
{{'1', '1', '1', '1'}, {'1', 'n', '1', 'n'}, {'1', '1', 'n', 'n'}, {'1', 'n', 'n', '1'}}, // pmi 3
{{'1', '1', '1', '1'}, {'1', 'n', '1', 'n'}, {'j', 'j', 'o', 'o'}, {'j', 'o', 'o', 'j'}} // pmi 4
};
void nr_modulation(uint32_t *in,
......@@ -673,7 +665,7 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
}
}
int nr_layer_precoder(int16_t **datatx_F_precoding, char *prec_matrix, uint8_t n_layers, int32_t re_offset)
int nr_layer_precoder(int16_t **datatx_F_precoding, const char *prec_matrix, uint8_t n_layers, int32_t re_offset)
{
int32_t precodatatx_F = 0;
......
......@@ -29,12 +29,12 @@
#define DMRS_MOD_ORDER 2
/*Precoding matices: W[pmi][antenna_port][layer]*/
extern char nr_W_1l_2p[6][2][1];
extern char nr_W_2l_2p[3][2][2];
extern char nr_W_1l_4p[28][4][1];
extern char nr_W_2l_4p[22][4][2];
extern char nr_W_3l_4p[7][4][3];
extern char nr_W_4l_4p[5][4][4];
extern const char nr_W_1l_2p[6][2][1];
extern const char nr_W_2l_2p[3][2][2];
extern const char nr_W_1l_4p[28][4][1];
extern const char nr_W_2l_4p[22][4][2];
extern const char nr_W_3l_4p[7][4][3];
extern const char nr_W_4l_4p[5][4][4];
/*! \brief Perform NR modulation. TS 38.211 V15.4.0 subclause 5.1
@param[in] in, Pointer to input bits
@param[in] length, size of input bits
......@@ -129,10 +129,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
@param[in] prec_matrix, Pointer to precoding matrix
@param[in] n_layers, number of DLSCH layers
*/
int nr_layer_precoder(int16_t **datatx_F_precoding,
char *prec_matrix,
uint8_t n_layers,
int32_t re_offset);
int nr_layer_precoder(int16_t **datatx_F_precoding, const char *prec_matrix, uint8_t n_layers, int32_t re_offset);
int nr_layer_precoder_cm(int16_t **datatx_F_precoding,
int *prec_matrix,
......
......@@ -787,11 +787,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
} else if(subcarrier < K_TC) { // Start of OFDM symbol case
// filt8_start is {12288,8192,4096,0,0,0,0,0}
srs_estimated_channel16 = (int16_t *)&srs_est[subcarrier];
short *filter = mem_offset==0 ? filt8_start:filt8_start_shift2;
const short *filter = mem_offset == 0 ? filt8_start : filt8_start_shift2;
multadd_real_vector_complex_scalar(filter, ls_estimated, srs_estimated_channel16, 8);
} else if((subcarrier+K_TC)>=frame_parms->ofdm_symbol_size || k == (M_sc_b_SRS-1)) { // End of OFDM symbol or last subcarrier cases
// filt8_end is {4096,8192,12288,16384,0,0,0,0}
short *filter = mem_offset==0 || k == (M_sc_b_SRS-1) ? filt8_end:filt8_end_shift2;
const short *filter = mem_offset == 0 || k == (M_sc_b_SRS - 1) ? filt8_end : filt8_end_shift2;
multadd_real_vector_complex_scalar(filter, ls_estimated, srs_estimated_channel16, 8);
} else if(k%2 == 1) { // 1st middle case
// filt8_middle2 is {4096,8192,8192,8192,4096,0,0,0}
......
......@@ -40,16 +40,20 @@
#include "PHY/defs_gNB.h"
// Table 6.4.1.1.3-1/2 from TS 38.211
int delta1[8] = {0, 0, 1, 1, 0, 0, 1, 1};
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
int delta2[12] = {0, 0, 2, 2, 4, 4, 0, 0, 2, 2, 4, 4};
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
static const int delta1[8] = {0, 0, 1, 1, 0, 0, 1, 1};
static const int wf1[8][2] = {{1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}};
static const int wt1[8][2] = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, -1}, {1, -1}, {1, -1}, {1, -1}};
static const int delta2[12] = {0, 0, 2, 2, 4, 4, 0, 0, 2, 2, 4, 4};
static const int wf2[12][2] =
{{1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}, {1, 1}, {1, -1}};
static const int wt2[12][2] =
{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, -1}, {1, -1}, {1, -1}, {1, -1}, {1, -1}, {1, -1}};
// complex conjugate of mod table
short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170};
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
static const short nr_rx_mod_table[14] =
{0, 0, 23170, -23170, -23170, 23170, 23170, -23170, 23170, 23170, -23170, -23170, -23170, 23170};
static const short nr_rx_nmod_table[14] =
{0, 0, -23170, 23170, 23170, -23170, -23170, 23170, -23170, -23170, 23170, 23170, 23170, -23170};
int nr_pusch_dmrs_delta(uint8_t dmrs_config_type, unsigned short p) {
if (dmrs_config_type == pusch_dmrs_type1) {
......@@ -70,14 +74,11 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
uint8_t dmrs_type)
{
int8_t w, nb_dmrs;
short *mod_table;
unsigned char idx=0;
int k;
typedef int array_of_w[2];
array_of_w *wf;
array_of_w *wt;
wf = (dmrs_type==pusch_dmrs_type1) ? wf1 : wf2;
wt = (dmrs_type==pusch_dmrs_type1) ? wt1 : wt2;
const array_of_w *wf = (dmrs_type == pusch_dmrs_type1) ? wf1 : wf2;
const array_of_w *wt = (dmrs_type == pusch_dmrs_type1) ? wt1 : wt2;
int dmrs_offset = re_offset/((dmrs_type==pusch_dmrs_type1)?2:3);
......@@ -90,7 +91,7 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
for (int i=dmrs_offset; i<dmrs_offset+(nb_pusch_rb*nb_dmrs); i++) {
k = i-dmrs_offset;
w = (wf[p-1000][i&1])*(wt[p-1000][lp]);
mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table;
const short *mod_table = (w == 1) ? nr_rx_mod_table : nr_rx_nmod_table;
idx = ((((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1);
((int16_t*)output)[k<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
......@@ -124,15 +125,11 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
uint8_t config_type)
{
int8_t w;
short *mod_table;
unsigned char idx=0;
typedef int array_of_w[2];
array_of_w *wf;
array_of_w *wt;
wf = (config_type==NFAPI_NR_DMRS_TYPE1) ? wf1 : wf2;
wt = (config_type==NFAPI_NR_DMRS_TYPE1) ? wt1 : wt2;
const array_of_w *wf = (config_type == NFAPI_NR_DMRS_TYPE1) ? wf1 : wf2;
const array_of_w *wt = (config_type == NFAPI_NR_DMRS_TYPE1) ? wt1 : wt2;
if (config_type > 1)
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
......@@ -141,7 +138,7 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
if (ue->frame_parms.Ncp == NORMAL) {
for (int i = 0; i < nb_pdsch_rb * ((config_type == NFAPI_NR_DMRS_TYPE1) ? 6 : 4); i++) {
w = (wf[p - 1000][i & 1]) * (wt[p - 1000][lp]);
mod_table = (w == 1) ? nr_rx_mod_table : nr_rx_nmod_table;
const short *mod_table = (w == 1) ? nr_rx_mod_table : nr_rx_nmod_table;
idx = ((((nr_gold_pdsch[(i << 1) >> 5]) >> ((i << 1) & 0x1f)) & 1) << 1) ^ (((nr_gold_pdsch[((i << 1) + 1) >> 5]) >> (((i << 1) + 1) & 0x1f)) & 1);
((int16_t *)output)[i << 1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx) << 1];
......
......@@ -43,16 +43,15 @@
// TS 38.211 Table 6.4.1.2.2.1-1: The parameter kRE_ref.
// The first 4 colomns are DM-RS Configuration type 1 and the last 4 colomns are DM-RS Configuration type 2.
int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref [6][8] = {
{ 0, 2, 6, 8, 0, 1, 6, 7},
{ 2, 4, 8, 10, 1, 6, 7, 0},
{ 1, 3, 7, 9, 2, 3, 8, 9},
{ 3, 5, 9, 11, 3, 8, 9, 2},
{-1, -1, -1, -1, 4, 5, 10, 11},
{-1, -1, -1, -1, 5, 10, 11, 4},
static const int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref[6][8] = {
{0, 2, 6, 8, 0, 1, 6, 7},
{2, 4, 8, 10, 1, 6, 7, 0},
{1, 3, 7, 9, 2, 3, 8, 9},
{3, 5, 9, 11, 3, 8, 9, 2},
{-1, -1, -1, -1, 4, 5, 10, 11},
{-1, -1, -1, -1, 5, 10, 11, 4},
};
/*******************************************************************
*
* NAME : get_kRE_ref
......
......@@ -33,11 +33,7 @@
#include "PHY/defs_gNB.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
extern uint16_t prach_root_sequence_map_0_3[838];
extern uint16_t prach_root_sequence_map_abc[138];
extern uint16_t nr_du[838];
extern const char *prachfmt[];
#include "openair1/PHY/NR_TRANSPORT/nr_prach.h"
void init_prach_list(PHY_VARS_gNB *gNB)
{
......@@ -442,7 +438,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
uint16_t preamble_index0=0,n_shift_ra=0,n_shift_ra_bar;
uint16_t d_start=0;
uint16_t numshift=0;
uint16_t *prach_root_sequence_map;
const uint16_t *prach_root_sequence_map;
uint8_t not_found;
uint16_t u;
int16_t *Xu=0;
......
This diff is collapsed.
......@@ -38,8 +38,9 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "T.h"
int16_t nr_ru[2 * 839]; // quantized roots of unity
static uint32_t nr_ZC_inv[839]; // multiplicative inverse for roots u
uint16_t nr_du[838];
/*void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
......@@ -78,7 +79,7 @@
}*/
// This function computes the du
void nr_fill_du(uint16_t N_ZC,uint16_t *prach_root_sequence_map)
void nr_fill_du(uint16_t N_ZC, const uint16_t *prach_root_sequence_map)
{
uint16_t iu,u,p;
......@@ -105,7 +106,7 @@ void compute_nr_prach_seq(uint8_t short_sequence,
unsigned int k,inv_u,i;
int N_ZC;
uint16_t *prach_root_sequence_map;
const uint16_t *prach_root_sequence_map;
uint16_t u;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, VCD_FUNCTION_IN);
......
......@@ -34,27 +34,27 @@
/*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/
/*Table 6.4.1.1.3-1 is identical to Table 7.4.1.1.2-1 and Table 6.4.1.1.3-2 is identical to Table 7.4.1.1.2-2. UL DMRS can reuse these tables*/
int8_t pdsch_dmrs_1[8][7] = {{0,0,0,1,1,1,1},
{1,0,0,1,-1,1,1},
{2,1,1,1,1,1,1},
{3,1,1,1,-1,1,1},
{4,0,0,1,1,1,-1},
{5,0,0,1,-1,1,-1},
{6,1,1,1,1,1,-1},
{7,1,1,1,-1,1,-1}};
static const int8_t pdsch_dmrs_1[8][7] = {{0, 0, 0, 1, 1, 1, 1},
{1, 0, 0, 1, -1, 1, 1},
{2, 1, 1, 1, 1, 1, 1},
{3, 1, 1, 1, -1, 1, 1},
{4, 0, 0, 1, 1, 1, -1},
{5, 0, 0, 1, -1, 1, -1},
{6, 1, 1, 1, 1, 1, -1},
{7, 1, 1, 1, -1, 1, -1}};
int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1},
{1,0,0,1,-1,1,1},
{2,1,2,1,1,1,1},
{3,1,2,1,-1,1,1},
{4,2,4,1,1,1,1},
{5,2,4,1,-1,1,1},
{6,0,0,1,1,1,-1},
{7,0,0,1,-1,1,-1},
{8,1,2,1,1,1,-1},
{9,1,2,1,-1,1,-1},
{10,2,4,1,1,1,-1},
{11,2,4,1,-1,1,-1}};
static const int8_t pdsch_dmrs_2[12][7] = {{0, 0, 0, 1, 1, 1, 1},
{1, 0, 0, 1, -1, 1, 1},
{2, 1, 2, 1, 1, 1, 1},
{3, 1, 2, 1, -1, 1, 1},
{4, 2, 4, 1, 1, 1, 1},
{5, 2, 4, 1, -1, 1, 1},
{6, 0, 0, 1, 1, 1, -1},
{7, 0, 0, 1, -1, 1, -1},
{8, 1, 2, 1, 1, 1, -1},
{9, 1, 2, 1, -1, 1, -1},
{10, 2, 4, 1, 1, 1, -1},
{11, 2, 4, 1, -1, 1, -1}};
void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config) {
if (config == NFAPI_NR_DMRS_TYPE1)
......
......@@ -64,7 +64,7 @@ void compute_nr_prach_seq(uint8_t short_sequence,
uint8_t rootSequenceIndex,
uint32_t X_u[64][839]);
void nr_fill_du(uint16_t N_ZC,uint16_t *prach_root_sequence_map);
void nr_fill_du(uint16_t N_ZC, const uint16_t *prach_root_sequence_map);
void init_nr_prach_tables(int N_ZC);
......
......@@ -116,10 +116,8 @@ int get_pucch0_cs_lut_index(PHY_VARS_gNB *gNB,nfapi_nr_pucch_pdu_t* pucch_pdu) {
gNB->pucch0_lut.nb_id++;
return(gNB->pucch0_lut.nb_id-1);
}
int16_t idft12_re[12][12] = {
static const int16_t idft12_re[12][12] = {
{23170,23170,23170,23170,23170,23170,23170,23170,23170,23170,23170,23170},
{23170,20066,11585,0,-11585,-20066,-23170,-20066,-11585,0,11585,20066},
{23170,11585,-11585,-23170,-11585,11585,23170,11585,-11585,-23170,-11585,11585},
......@@ -134,7 +132,7 @@ int16_t idft12_re[12][12] = {
{23170,20066,11585,0,-11585,-20066,-23170,-20066,-11585,0,11585,20066}
};
int16_t idft12_im[12][12] = {
static const int16_t idft12_im[12][12] = {
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,11585,20066,23170,20066,11585,0,-11585,-20066,-23170,-20066,-11585},
{0,20066,20066,0,-20066,-20066,0,20066,20066,0,-20066,-20066},
......@@ -975,15 +973,8 @@ __m256i pucch2_9bit[512*2];
__m256i pucch2_10bit[1024*2];
__m256i pucch2_11bit[2048*2];
__m256i *pucch2_lut[9]={pucch2_3bit,
pucch2_4bit,
pucch2_5bit,
pucch2_6bit,
pucch2_7bit,
pucch2_8bit,
pucch2_9bit,
pucch2_10bit,
pucch2_11bit};
static __m256i *const pucch2_lut[9] =
{pucch2_3bit, pucch2_4bit, pucch2_5bit, pucch2_6bit, pucch2_7bit, pucch2_8bit, pucch2_9bit, pucch2_10bit, pucch2_11bit};
__m64 pucch2_polar_4bit[16];
__m128i pucch2_polar_llr_num_lut[256],pucch2_polar_llr_den_lut[256];
......
This diff is collapsed.
This diff is collapsed.
......@@ -81,8 +81,9 @@ int nr_prs_channel_estimation(uint8_t rsc_id,
int slot_prs = (proc->nr_slot_rx - rep_num*prs_cfg->PRSResourceTimeGap + frame_params->slots_per_frame)%frame_params->slots_per_frame;
uint32_t **nr_gold_prs = ue->nr_gold_prs[gNB_id][rsc_id][slot_prs];
int16_t *rxF, *pil, *fl, *fm, *fmm, *fml, *fmr, *fr, mod_prs[NR_MAX_PRS_LENGTH<<1];
int16_t *rxF, *pil, mod_prs[NR_MAX_PRS_LENGTH << 1];
const int16_t *fl, *fm, *fmm, *fml, *fmr, *fr;
int16_t ch[2] = {0}, noiseFig[2] = {0};
int16_t k_prime = 0, k = 0, re_offset = 0, first_half = 0, second_half = 0;
int32_t ch_pwr = 0, snr = 0;
......@@ -737,7 +738,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int pilot[200] __attribute__((aligned(16)));
unsigned short k;
unsigned int pilot_cnt;
int16_t *pil,*rxF,*dl_ch,*fl,*fm,*fr;
int16_t *pil, *rxF, *dl_ch;
const int16_t *fl, *fm, *fr;
int ch_offset,symbol_offset;
//int slot_pbch;
......@@ -1243,10 +1245,10 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
c16_t *dl_ch0 = dl_ch;
c16_t ch = {0};
int16_t *fdcl = NULL;
int16_t *fdcr = NULL;
int16_t *fdclh = NULL;
int16_t *fdcrh = NULL;
const int16_t *fdcl = NULL;
const int16_t *fdcr = NULL;
const int16_t *fdclh = NULL;
const int16_t *fdcrh = NULL;
switch (delta) {
case 0: // port 0,1
fdcl = filt8_dcl0; // left DC interpolation Filter (even RB)
......
......@@ -43,12 +43,7 @@
#include "T.h"
//#define NR_PRACH_DEBUG 1
extern uint16_t prach_root_sequence_map_0_3[838];
extern uint16_t prach_root_sequence_map_abc[138];
extern uint16_t nr_du[838];
extern int16_t nr_ru[2*839];
extern const char *prachfmt[];
#include "openair1/PHY/NR_TRANSPORT/nr_prach.h"
// Note:
// - prach_fmt_id is an ID used to map to the corresponding PRACH format value in prachfmt
......@@ -64,7 +59,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t
fapi_nr_ul_config_prach_pdu *prach_pdu = &ue->prach_vars[gNB_id]->prach_pdu;
uint8_t Mod_id, fd_occasion, preamble_index, restricted_set, not_found;
uint16_t rootSequenceIndex, prach_fmt_id, NCS, *prach_root_sequence_map, preamble_offset = 0;
uint16_t rootSequenceIndex, prach_fmt_id, NCS, preamble_offset = 0;
const uint16_t *prach_root_sequence_map;
uint16_t preamble_shift = 0, preamble_index0, n_shift_ra, n_shift_ra_bar, d_start=INT16_MAX, numshift, N_ZC, u, offset, offset2, first_nonzero_root_idx;
int16_t prach_tmp[(4688+4*24576)*4*2] __attribute__((aligned(32))) = {0};
int16_t prachF_tmp[(4688+4*24576)*4*2] __attribute__((aligned(32))) = {0};
......
......@@ -530,7 +530,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
}
else {
//get the precoding matrix weights:
char *W_prec;
const char *W_prec;
switch (frame_parms->nb_antennas_tx) {
case 1://1 antenna port
W_prec = nr_W_1l_2p[pmi][ap];
......
......@@ -52,25 +52,20 @@ void multadd_complex_vector_real_scalar(int16_t *x,
}
void multadd_real_vector_complex_scalar(int16_t *x,
int16_t *alpha,
int16_t *y,
uint32_t N)
void multadd_real_vector_complex_scalar(const int16_t *x, const int16_t *alpha, int16_t *y, uint32_t N)
{
uint32_t i;
// do 8 multiplications at a time
simd_q15_t alpha_r_128, alpha_i_128, yr, yi, *x_128 = (simd_q15_t *)x, *y_128 = (simd_q15_t *)y;
simd_q15_t *x_128 = (simd_q15_t *)x, *y_128 = (simd_q15_t *)y;
// printf("alpha = %d,%d\n",alpha[0],alpha[1]);
alpha_r_128 = set1_int16(alpha[0]);
alpha_i_128 = set1_int16(alpha[1]);
const simd_q15_t alpha_r_128 = set1_int16(alpha[0]);
const simd_q15_t alpha_i_128 = set1_int16(alpha[1]);
for (i=0; i<N>>3; i++) {
yr = mulhi_s1_int16(alpha_r_128,x_128[i]);
yi = mulhi_s1_int16(alpha_i_128,x_128[i]);
const simd_q15_t yr = mulhi_s1_int16(alpha_r_128, x_128[i]);
const simd_q15_t yi = mulhi_s1_int16(alpha_i_128, x_128[i]);
#if defined(__x86_64__) || defined(__i386__)
const simd_q15_t tmp = _mm_loadu_si128(y_128);
_mm_storeu_si128(y_128++, _mm_adds_epi16(tmp, _mm_unpacklo_epi16(yr, yi)));
......
......@@ -24,15 +24,15 @@
#include <stdio.h>
#if defined(__x86_64__) || defined(__i386__)
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
int16_t conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
static const int16_t conjug[8] __attribute__((aligned(16))) = {-1, 1, -1, 1, -1, 1, -1, 1};
static const int16_t conjug2[8] __attribute__((aligned(16))) = {1, -1, 1, -1, 1, -1, 1, -1};
#define simd_q15_t __m128i
#define simdshort_q15_t __m64
#define set1_int16(a) _mm_set1_epi16(a)
#define setr_int16(a0, a1, a2, a3, a4, a5, a6, a7) _mm_setr_epi16(a0, a1, a2, a3, a4, a5, a6, a7 )
#elif defined(__arm__) || defined(__aarch64__)
int16_t conjug[4]__attribute__((aligned(16))) = {-1,1,-1,1} ;
static const int16_t conjug[4] __attribute__((aligned(16))) = {-1, 1, -1, 1};
#define simd_q15_t int16x8_t
#define simdshort_q15_t int16x4_t
#define _mm_empty()
......
This diff is collapsed.
## xForms-based Scope
To use the scope, run the xNB or the UE with option "-d"
# xForms-based Scope
Usage in gdb
In gdb, when you break, you can refresh immediatly the scope view by calling the display function.
The first paramter is the graph context, nevertheless we keep the last value for a dirty call in gdb (so you can use '0')
## How to run and troubleshooting
To compile OAI, build with scope support:
```
./build_oai --build-lib nrscope ...
```
To use the scope, run the xNB or the UE with option `-d`. If you receive the
error
```
In fl_initialize() [flresource.c:995]: 5G-gNB-scope: Can't open display :0
In fl_bgn_form() [forms.c:347]: Missing or failed call of fl_initialize()
```
you can allow root to open X windows:
```
xhost +si:localuser:root
```
### Usage in gdb with Scope enabled
In gdb, when you break, you can refresh immediately the scope view by calling the display function.
The first parameter is the graph context, nevertheless we keep the last value for a dirty call in gdb (so you can use '0')
Example with no variable known
```
phy_scope_nrUE(0, PHY_vars_UE_g[0][0], 0, 0, 0)
```
or
```
phy_scope_gNB(0, phy_vars_gnb, phy_vars_ru, UE_id)
```
# Qt-based Scope
## Building Instuctions
For the new qt-based scopo designed for NR, please consider the following:
## Building Instructions
For the new qt-based scope designed for NR, please consider the following:
1. run the gNB or the UE with the option '--dqt'.
2. make sure to install the Qt5 packages before running the scope. Otherwise, the scope will NOT be displayed!
3. if you need only to build the new scope, then add 'nrqtscope' after the '--lib-build' option. So, the complete
command would be
2. make sure to install the Qt5 packages before running the scope. Otherwise, the scope will NOT be displayed! Note that Qt6 does NOT work.
3. To build the new scope, add 'nrqtscope' after the '--build-lib' option. So, the complete command would be
```
./build_oai --gNB -w USRP --nrUE --build-lib nrqtscope
```
## New Features
1. New KPIs for both gNB and UE, e.g., BLER, MCS, throughout, and number of scheduled RBs.
2. For each of the gNB and UE, a main widget is created with a 3x2 grid of sub-widgets, each to dispaly one KPI.
2. For each of the gNB and UE, a main widget is created with a 3x2 grid of sub-widgets, each to display one KPI.
3. Each of the sub-widgets has a drop-down list to choose the KPI to show in that sub-widget.
4. Both of the gNB and UE scopes can be resized using the mouse movement.
## Troubleshoot
Similar as with the Xforms-based scope, you should allow root to open X
windows:
```
xhost +si:localuser:root
```
Furthermore, if you get the following error (might be followed by a
segfault)
```
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
```
You have to set the XDG runtime directory like one of the following options
(try in order):
```
sudo -E XDG_RUNTIME_DIR=/run/user/0 ./nr-softmodem ...
sudo -E XDG_RUNTIME_DIR=/tmp/runtime-root ./nr-softmodem ...
sudo -E XDG_RUNTIME_DIR= ./nr-softmodem ...
```
......@@ -338,33 +338,26 @@ This function performs componentwise multiplication and accumulation of a comple
The function implemented is : \f$\mathbf{y} = y + \alpha\mathbf{x}\f$
*/
void multadd_real_vector_complex_scalar(int16_t *x,
int16_t *alpha,
int16_t *y,
uint32_t N);
__attribute__((always_inline)) inline void multadd_real_four_symbols_vector_complex_scalar(int16_t *x,
c16_t *alpha,
c16_t *y)
{
// do 8 multiplications at a time
simd_q15_t alpha_r_128,alpha_i_128,yr,yi,*x_128=(simd_q15_t*)x;
simd_q15_t y_128;
y_128 = _mm_loadu_si128((simd_q15_t*)y);
alpha_r_128 = set1_int16(alpha->r);
alpha_i_128 = set1_int16(alpha->i);
void multadd_real_vector_complex_scalar(const int16_t *x, const int16_t *alpha, int16_t *y, uint32_t N);
__attribute__((always_inline)) inline void multadd_real_four_symbols_vector_complex_scalar(const int16_t *x,
c16_t *alpha,
c16_t *y)
{
// do 8 multiplications at a time
const simd_q15_t alpha_r_128 = set1_int16(alpha->r);
const simd_q15_t alpha_i_128 = set1_int16(alpha->i);
yr = mulhi_s1_int16(alpha_r_128,x_128[0]);
yi = mulhi_s1_int16(alpha_i_128,x_128[0]);
y_128 = _mm_adds_epi16(y_128,_mm_unpacklo_epi16(yr,yi));
y_128 = _mm_adds_epi16(y_128,_mm_unpackhi_epi16(yr,yi));
const simd_q15_t *x_128 = (const simd_q15_t *)x;
const simd_q15_t yr = mulhi_s1_int16(alpha_r_128, *x_128);
const simd_q15_t yi = mulhi_s1_int16(alpha_i_128, *x_128);
_mm_storeu_si128((simd_q15_t*)y, y_128);
simd_q15_t y_128 = _mm_loadu_si128((simd_q15_t *)y);
y_128 = _mm_adds_epi16(y_128, _mm_unpacklo_epi16(yr, yi));
y_128 = _mm_adds_epi16(y_128, _mm_unpackhi_epi16(yr, yi));
}
_mm_storeu_si128((simd_q15_t *)y, y_128);
}
/*!\fn void multadd_complex_vector_real_scalar(int16_t *x,int16_t alpha,int16_t *y,uint8_t zero_flag,uint32_t N)
This function performs componentwise multiplication and accumulation of a real scalar and a complex vector.
......
......@@ -123,6 +123,64 @@ static const unsigned short Nb_81_110[8][4] = {
static const uint8_t alpha_lut[8] = {0, 40, 50, 60, 70, 80, 90, 100};
extern uint32_t current_dlsch_cqi;
// Table 8.6.3-3 36.213
static const uint16_t beta_cqi[16] = {0, // reserved
0, // reserved
9, // 1.125
10, // 1.250
11, // 1.375
13, // 1.625
14, // 1.750
16, // 2.000
18, // 2.250
20, // 2.500
23, // 2.875
25, // 3.125
28, // 3.500
32, // 4.000
40, // 5.000
50}; // 6.250
// Table 8.6.3-2 36.213
static const uint16_t beta_ri[16] = {10, // 1.250
13, // 1.625
16, // 2.000
20, // 2.500
25, // 3.125
32, // 4.000
40, // 5.000
50, // 6.250
64, // 8.000
80, // 10.000
101, // 12.625
127, // 15.875
160, // 20.000
0, // reserved
0, // reserved
0}; // reserved
// Table 8.6.3-2 36.213
static const uint16_t beta_ack[16] = {16, // 2.000
20, // 2.500
25, // 3.125
32, // 4.000
40, // 5.000
50, // 6.250
64, // 8.000
80, // 10.000
101, // 12.625
127, // 15.875
160, // 20.000
248, // 31.000
400, // 50.000
640, // 80.000
808}; // 126.00
static const int8_t delta_PUSCH_abs[4] = {-4, -1, 1, 4};
static const int8_t delta_PUSCH_acc[4] = {-1, 0, 1, 3};
extern uint8_t max_turbo_iterations;
extern double cpuf;
......
......@@ -429,7 +429,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
}
}
int16_t to_beta_offset_harqack[16]= {16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8};
static const int16_t to_beta_offset_harqack[16] = {16, 20, 25, 32, 40, 50, 64, 80, 101, 127, 160, 248, 400, 640, 1008, 8};
void handle_ulsch_harq_pdu(
PHY_VARS_eNB *eNB,
......@@ -457,8 +457,8 @@ void handle_ulsch_harq_pdu(
}
}
uint16_t to_beta_offset_ri[16]= {9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0};
uint16_t to_beta_offset_cqi[16]= {0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50};
static const uint16_t to_beta_offset_ri[16] = {9, 13, 16, 20, 25, 32, 40, 50, 64, 80, 101, 127, 160, 0, 0, 0};
static const uint16_t to_beta_offset_cqi[16] = {0, 0, 9, 10, 11, 13, 14, 16, 18, 20, 23, 25, 28, 32, 40, 50};
void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) {
nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9;
......
......@@ -680,18 +680,16 @@ uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
return get_reset_ack(frame_parms, harq_ack, subframe_tx, subframe_rx, o_ACK, pN_bundled, cw_idx, 1);
}
uint8_t Np6[4]= {0,1,3,5};
uint8_t Np15[4]= {0,3,8,13};
uint8_t Np25[4]= {0,5,13,22};
uint8_t Np50[4]= {0,11,27,44};
uint8_t Np75[4]= {0,16,41,66};
uint8_t Np100[4]= {0,22,55,88};
static const uint8_t Np6[4] = {0, 1, 3, 5};
static const uint8_t Np15[4] = {0, 3, 8, 13};
static const uint8_t Np25[4] = {0, 5, 13, 22};
static const uint8_t Np50[4] = {0, 11, 27, 44};
static const uint8_t Np75[4] = {0, 16, 41, 66};
static const uint8_t Np100[4] = {0, 22, 55, 88};
// This is part of the PUCCH allocation procedure (see Section 10.1 36.213)
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1)
{
uint8_t *Np;
const uint8_t *Np;
switch (N_RB_DL) {
case 6:
......@@ -831,16 +829,15 @@ dci_detect_mode_t dci_detect_mode_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
{
dci_detect_mode_t ret = 0;
static dci_detect_mode_t Table_8_2_3gpp_36_213[][10] = {
//subf0 , subf1 , subf2 , subf3 , subf4 , subf5 , subf6 , subf7 , subf8 , subf9
{UL_DL_DCI, UL_DL_DCI , NO_DCI , NO_DCI , NO_DCI , UL_DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , NO_DCI }, // tdd0
{DL_DCI , UL_DL_DCI , NO_DCI , NO_DCI , UL_DL_DCI , DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , UL_DL_DCI }, // tdd1
{DL_DCI , DL_DCI , NO_DCI , UL_DL_DCI , DL_DCI , DL_DCI , DL_DCI , NO_DCI, UL_DL_DCI , DL_DCI }, // tdd2
{UL_DL_DCI, DL_DCI , NO_DCI , NO_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , UL_DL_DCI }, // tdd3
{DL_DCI , DL_DCI , NO_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , UL_DL_DCI }, // tdd4
{DL_DCI , DL_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , DL_DCI }, // tdd5
{UL_DL_DCI, UL_DL_DCI , NO_DCI , NO_DCI , NO_DCI , UL_DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , UL_DL_DCI }}; // tdd6
static const dci_detect_mode_t Table_8_2_3gpp_36_213[][10] = {
// subf0 , subf1 , subf2 , subf3 , subf4 , subf5 , subf6 , subf7 , subf8 , subf9
{UL_DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, NO_DCI, UL_DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, NO_DCI}, // tdd0
{DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, UL_DL_DCI, DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, UL_DL_DCI}, // tdd1
{DL_DCI, DL_DCI, NO_DCI, UL_DL_DCI, DL_DCI, DL_DCI, DL_DCI, NO_DCI, UL_DL_DCI, DL_DCI}, // tdd2
{UL_DL_DCI, DL_DCI, NO_DCI, NO_DCI, NO_DCI, DL_DCI, DL_DCI, DL_DCI, UL_DL_DCI, UL_DL_DCI}, // tdd3
{DL_DCI, DL_DCI, NO_DCI, NO_DCI, DL_DCI, DL_DCI, DL_DCI, DL_DCI, UL_DL_DCI, UL_DL_DCI}, // tdd4
{DL_DCI, DL_DCI, NO_DCI, DL_DCI, DL_DCI, DL_DCI, DL_DCI, DL_DCI, UL_DL_DCI, DL_DCI}, // tdd5
{UL_DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, NO_DCI, UL_DL_DCI, UL_DL_DCI, NO_DCI, NO_DCI, UL_DL_DCI}}; // tdd6
DevAssert(subframe>=0 && subframe<=9);
DevAssert((frame_parms->tdd_config)>=0 && (frame_parms->tdd_config)<=6);
......
......@@ -75,7 +75,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
// setting the first subcarrier
const int scs = cfg->ssb_config.scs_common.value;
const int prb_offset = (fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA>>scs : ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA>>(scs-2);
const int sc_offset = (fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset>>scs : ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset;
const int sc_offset = (fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset >> scs
: ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset >> (scs - 2);
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset);
......
......@@ -42,8 +42,6 @@ PHY_VARS_UE *UE;
double cpuf;
extern uint16_t prach_root_sequence_map0_3[838];
void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
int main(int argc, char **argv) {
......
......@@ -54,6 +54,8 @@
#include "common/ran_context.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h"
#include "PHY/phy_extern.h"
const char *__asan_default_options()
{
/* don't do leak checking in ulsim, not finished yet */
......@@ -69,7 +71,6 @@ channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
node_desc_t *ue_data[NUMBER_OF_UE_MAX];
extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
THREAD_STRUCT thread_struct;
nfapi_ue_release_request_body_t release_rntis;
......
......@@ -67,7 +67,6 @@ PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC;
RU_t *ru;
double cpuf;
extern uint16_t prach_root_sequence_map0_3[838];
openair0_config_t openair0_cfg[MAX_CARDS];
//uint8_t nfapi_mode=0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
......
......@@ -41,33 +41,34 @@
#include "f1ap_du_paging.h"
/* Handlers matrix. Only f1 related procedure present here */
f1ap_message_processing_t f1ap_messages_processing[][3] = {
static const f1ap_message_processing_t f1ap_messages_processing[][3] = {
{ 0, 0, 0 }, /* Reset */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
{ DU_handle_UE_CONTEXT_MODIFICATION_REQUEST, CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */
{ CU_handle_UE_CONTEXT_RELEASE_REQUEST, 0, 0 }, /* UEContextReleaseRequest */
{ CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* InitialULRRCMessageTransfer */
{ DU_handle_DL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* DLRRCMessageTransfer */
{ CU_handle_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* ULRRCMessageTransfer */
{ 0, 0, 0 }, /* privateMessage */
{ 0, 0, 0 }, /* UEInactivityNotification */
{ 0, 0, 0 }, /* GNBDUResourceCoordination */
{ 0, 0, 0 }, /* SystemInformationDeliveryCommand */
{ DU_handle_Paging, 0, 0 }, /* Paging */
{ 0, 0, 0 }, /* Notify */
{ 0, 0, 0 }, /* WriteReplaceWarning */
{ 0, 0, 0 }, /* PWSCancel */
{ 0, 0, 0 }, /* PWSRestartIndication */
{ 0, 0, 0 }, /* PWSFailureIndication */
{0, 0, 0}, /* Reset */
{CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE}, /* F1Setup */
{0, 0, 0}, /* ErrorIndication */
{0, 0, 0}, /* gNBDUConfigurationUpdate */
{DU_handle_gNB_CU_CONFIGURATION_UPDATE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE}, /* gNBCUConfigurationUpdate */
{DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0}, /* UEContextSetup */
{DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0}, /* UEContextRelease */
{DU_handle_UE_CONTEXT_MODIFICATION_REQUEST, CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE, 0}, /* UEContextModification */
{0, 0, 0}, /* UEContextModificationRequired */
{0, 0, 0}, /* UEMobilityCommand */
{CU_handle_UE_CONTEXT_RELEASE_REQUEST, 0, 0}, /* UEContextReleaseRequest */
{CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER, 0, 0}, /* InitialULRRCMessageTransfer */
{DU_handle_DL_RRC_MESSAGE_TRANSFER, 0, 0}, /* DLRRCMessageTransfer */
{CU_handle_UL_RRC_MESSAGE_TRANSFER, 0, 0}, /* ULRRCMessageTransfer */
{0, 0, 0}, /* privateMessage */
{0, 0, 0}, /* UEInactivityNotification */
{0, 0, 0}, /* GNBDUResourceCoordination */
{0, 0, 0}, /* SystemInformationDeliveryCommand */
{DU_handle_Paging, 0, 0}, /* Paging */
{0, 0, 0}, /* Notify */
{0, 0, 0}, /* WriteReplaceWarning */
{0, 0, 0}, /* PWSCancel */
{0, 0, 0}, /* PWSRestartIndication */
{0, 0, 0}, /* PWSFailureIndication */
};
const char *f1ap_direction2String(int f1ap_dir) {
......
......@@ -746,7 +746,7 @@ config_dedicated_scell(int Mod_idP,
LTE_SCellToAddMod_r10_t *sCellToAddMod_r10) {
}
int rrc_mac_config_req_eNB(module_id_t Mod_idP, rrc_mac_config_req_eNB_t *param)
int rrc_mac_config_req_eNB(const module_id_t Mod_idP, const rrc_mac_config_req_eNB_t *param)
{
int i;
int UE_id = -1;
......
......@@ -58,8 +58,7 @@
extern RAN_CONTEXT_t RC;
uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
static const uint16_t pdcch_order_table[6] = {31, 31, 511, 2047, 2047, 8191};
//-----------------------------------------------------------------------------
/*
......
......@@ -56,18 +56,18 @@ extern RAN_CONTEXT_t RC;
#define size_Sj25 2
int Sj25[size_Sj25] = { 0, 3 };
static const int Sj25[size_Sj25] = {0, 3};
#define size_Sj50 6
int Sj50[size_Sj50] = { 0, 1, 2, 5, 6, 7 };
static const int Sj50[size_Sj50] = {0, 1, 2, 5, 6, 7};
#define size_Sj75 10
int Sj75[size_Sj75] = { 0, 1, 2, 3, 4, 7, 8, 9, 10, 11 };
static const int Sj75[size_Sj75] = {0, 1, 2, 3, 4, 7, 8, 9, 10, 11};
#define size_Sj100 14
int Sj100[size_Sj100] = { 0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15 };
static const int Sj100[size_Sj100] = {0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15};
int SIB1_BR_TBS_table[6] = { 208, 256, 328, 504, 712, 936 };
static const int SIB1_BR_TBS_table[6] = {208, 256, 328, 504, 712, 936};
//------------------------------------------------------------------------------
void
......@@ -87,7 +87,7 @@ schedule_SIB1_MBMS(module_id_t module_idP,
nfapi_tx_request_pdu_t *TX_req;
nfapi_dl_config_request_body_t *dl_req;
int m, i, N_S_NB;
int *Sj;
const int *Sj;
int n_NB = 0;
int TBS;
int k = 0, rvidx;
......@@ -311,7 +311,7 @@ schedule_SIB1_BR(module_id_t module_idP,
nfapi_tx_request_pdu_t *TX_req;
nfapi_dl_config_request_body_t *dl_req;
int m, i, N_S_NB;
int *Sj;
const int *Sj;
int n_NB = 0;
int TBS;
int k = 0, rvidx;
......@@ -515,10 +515,10 @@ schedule_SIB1_BR(module_id_t module_idP,
}
}
int si_WindowLength_BR_r13tab[LTE_SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_spare] = { 20, 40, 60, 80, 120, 160, 200 };
int si_TBS_r13tab[LTE_SchedulingInfo_BR_r13__si_TBS_r13_b936 + 1] = { 152, 208, 256, 328, 408, 504, 600, 712, 808, 936 };
int si_WindowLength_MBMS_r14tab[8] = { 1, 2, 5, 10, 15, 20, 40, 80 };
static const int si_WindowLength_BR_r13tab
[LTE_SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_spare] =
{20, 40, 60, 80, 120, 160, 200};
static const int si_TBS_r13tab[LTE_SchedulingInfo_BR_r13__si_TBS_r13_b936 + 1] = {152, 208, 256, 328, 408, 504, 600, 712, 808, 936};
//------------------------------------------------------------------------------
void
......
......@@ -134,7 +134,5 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
/* extern */
extern DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs];
extern int last_dlsch_ue_id[MAX_NUM_CCs];
extern int last_ulsch_ue_id[MAX_NUM_CCs];
#endif
......@@ -1847,13 +1847,11 @@ get_numnarrowbandbits(long dl_Bandwidth)
//This implements the frame/subframe condition for first subframe of MPDCCH transmission (Section 9.1.5 36.213, Rel 13/14)
//------------------------------------------------------------------------------
int
startSF_fdd_RA_times2[8] = { 2, 3, 4, 5, 8, 10, 16, 20 };
static const int startSF_fdd_RA_times2[8] = {2, 3, 4, 5, 8, 10, 16, 20};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
startSF_tdd_RA[7] = { 1, 2, 4, 5, 8, 10, 20 };
static const int startSF_tdd_RA[7] = {1, 2, 4, 5, 8, 10, 20};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
......
......@@ -941,7 +941,7 @@ typedef struct {
LTE_MBSFNAreaConfiguration_r9_t *mbms_AreaConfiguration;
} rrc_mac_config_req_eNB_t;
int rrc_mac_config_req_eNB(module_id_t module_idP, rrc_mac_config_req_eNB_t *);
int rrc_mac_config_req_eNB(const module_id_t module_idP, const rrc_mac_config_req_eNB_t *);
/** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of ue
......
......@@ -400,13 +400,11 @@ int pf_wbcqi_dl_run(module_id_t Mod_id,
return n_rbg_sched;
}
default_sched_dl_algo_t proportional_fair_wbcqi_dl = {
.name = "proportional_fair_wbcqi_dl",
.setup = pf_dl_setup,
.unset = pf_dl_unset,
.run = pf_wbcqi_dl_run,
.data = NULL
};
const default_sched_dl_algo_t proportional_fair_wbcqi_dl = {.name = "proportional_fair_wbcqi_dl",
.setup = pf_dl_setup,
.unset = pf_dl_unset,
.run = pf_wbcqi_dl_run,
.data = NULL};
void *mt_dl_setup(void) {
return NULL;
......@@ -513,13 +511,11 @@ int mt_wbcqi_dl_run(module_id_t Mod_id,
return n_rbg_sched;
}
default_sched_dl_algo_t maximum_throughput_wbcqi_dl = {
.name = "maximum_throughput_wbcqi_dl",
.setup = mt_dl_setup,
.unset = mt_dl_unset,
.run = mt_wbcqi_dl_run,
.data = NULL
};
const default_sched_dl_algo_t maximum_throughput_wbcqi_dl = {.name = "maximum_throughput_wbcqi_dl",
.setup = mt_dl_setup,
.unset = mt_dl_unset,
.run = mt_wbcqi_dl_run,
.data = NULL};
// This function stores the downlink buffer for all the logical channels
void
......
......@@ -29,9 +29,14 @@
#include <math.h>
//Table 5.1.2.2-2
uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824};
uint16_t NPRB_LBRM[7] = {32,66,107,135,162,217,273};
static const uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {
24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168,
176, 184, 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, 384, 408, 432, 456, 480,
504, 528, 552, 576, 608, 640, 672, 704, 736, 768, 808, 848, 888, 928, 984, 1032, 1064, 1128, 1160,
1192, 1224, 1256, 1288, 1320, 1352, 1416, 1480, 1544, 1608, 1672, 1736, 1800, 1864, 1928, 2024, 2088, 2152, 2216,
2280, 2408, 2472, 2536, 2600, 2664, 2728, 2792, 2856, 2976, 3104, 3240, 3368, 3496, 3624, 3752, 3824};
static const uint16_t NPRB_LBRM[7] = {32, 66, 107, 135, 162, 217, 273};
// Transport block size determination according to 6.1.4.2 of TS 38.214
// returns the TBS in bits
......
......@@ -166,9 +166,7 @@ uint8_t get_pdsch_mcs_table(long *mcs_Table, int dci_format, int rnti_type, int
int get_format0(uint8_t index, uint8_t unpaired,frequency_range_t);
int64_t *get_prach_config_info(frequency_range_t freq_range,
uint8_t index,
uint8_t unpaired);
const int64_t *get_prach_config_info(frequency_range_t freq_range, uint8_t index, uint8_t unpaired);
uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
int compute_pucch_crc_size(int O_uci);
......
This diff is collapsed.
This diff is collapsed.
......@@ -53,8 +53,7 @@
#include <errno.h>
#include <string.h>
const uint8_t nr_rv_round_map[4] = { 0, 2, 3, 1 };
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1};
void clear_nr_nfapi_information(gNB_MAC_INST *gNB,
int CC_idP,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment