Cleanup
This commit is contained in:
@@ -246,7 +246,6 @@ class RANManagement():
|
|||||||
while (count > 0) and buildOAIprocess:
|
while (count > 0) and buildOAIprocess:
|
||||||
mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6)
|
mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6)
|
||||||
result = re.search('build_oai', mySSH.getBefore())
|
result = re.search('build_oai', mySSH.getBefore())
|
||||||
print(result)
|
|
||||||
if result is None:
|
if result is None:
|
||||||
buildOAIprocess = False
|
buildOAIprocess = False
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -2204,43 +2204,26 @@ function run_test_on_vm {
|
|||||||
mkdir --parents $ARCHIVES_LOC
|
mkdir --parents $ARCHIVES_LOC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CN_CONFIG="noS1"
|
local try_cnt=0
|
||||||
S1_NOS1_CFG=0
|
NR_STATUS=0
|
||||||
|
|
||||||
######### start of RA TEST loop
|
######### start of RA TEST loop
|
||||||
# for the moment only TDD
|
while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
|
||||||
TRANS_MODES=("tdd")
|
|
||||||
for TMODE in ${TRANS_MODES[@]}
|
|
||||||
do
|
do
|
||||||
if [[ $TMODE =~ .*fdd.* ]]
|
|
||||||
then
|
|
||||||
CONF_FILE=gnb.band66.tm1.106PRB.usrpn300.conf
|
|
||||||
PRB=106
|
|
||||||
FREQUENCY=37000
|
|
||||||
else
|
|
||||||
CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf
|
|
||||||
PRB=106
|
|
||||||
FREQUENCY=3510
|
|
||||||
fi
|
|
||||||
|
|
||||||
local try_cnt=0
|
|
||||||
NR_STATUS=0
|
|
||||||
while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
|
|
||||||
|
|
||||||
do
|
|
||||||
SYNC_STATUS=0
|
SYNC_STATUS=0
|
||||||
RA_FR2_STATUS=0
|
RA_FR2_STATUS=0
|
||||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*ra_fr2_test.log
|
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*ra_fr2_test.log
|
||||||
|
|
||||||
echo "############################################################"
|
echo "############################################################"
|
||||||
echo "${CN_CONFIG} : Starting the gNB in ${TMODE} mode (RA TEST)"
|
echo "${CN_CONFIG} : Starting the gNB"
|
||||||
echo "############################################################"
|
echo "############################################################"
|
||||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_ra_fr2_test.log
|
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_ra_fr2_test.log
|
||||||
#last argument = 1 is to enable --do-ra for RA test
|
#last argument = 1 is to enable --do-ra for RA test
|
||||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1
|
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1
|
||||||
|
|
||||||
echo "############################################################"
|
echo "############################################################"
|
||||||
echo "${CN_CONFIG} : Starting the NR-UE in ${TMODE} mode (RA TEST)"
|
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||||
echo "############################################################"
|
echo "############################################################"
|
||||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_ra_fr2_test.log
|
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_ra_fr2_test.log
|
||||||
#last argument = 1 is to enable --do-ra for RA test
|
#last argument = 1 is to enable --do-ra for RA test
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
<!--
|
|
||||||
|
|
||||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
|
||||||
this work for additional information regarding copyright ownership.
|
|
||||||
The OpenAirInterface Software Alliance licenses this file to You under
|
|
||||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
|
||||||
except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.openairinterface.org/?page_id=698
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
|
||||||
contact@openairinterface.org
|
|
||||||
|
|
||||||
-->
|
|
||||||
<testCaseList>
|
|
||||||
<htmlTabRef>TEST-FR1-TM1</htmlTabRef>
|
|
||||||
<htmlTabName>FR1</htmlTabName>
|
|
||||||
<htmlTabIcon>tasks</htmlTabIcon>
|
|
||||||
<TestCaseRequestedList>
|
|
||||||
010000
|
|
||||||
030000
|
|
||||||
040000
|
|
||||||
010001
|
|
||||||
000001
|
|
||||||
050000
|
|
||||||
050001
|
|
||||||
000001
|
|
||||||
060000
|
|
||||||
060001
|
|
||||||
000001
|
|
||||||
070000
|
|
||||||
070001
|
|
||||||
010002
|
|
||||||
000001
|
|
||||||
080001
|
|
||||||
080000
|
|
||||||
010003
|
|
||||||
</TestCaseRequestedList>
|
|
||||||
<TestCaseExclusionList></TestCaseExclusionList>
|
|
||||||
|
|
||||||
<testCase id="010000">
|
|
||||||
<class>Initialize_UE</class>
|
|
||||||
<desc>Initialize UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010003">
|
|
||||||
<class>Terminate_UE</class>
|
|
||||||
<desc>Terminate UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010001">
|
|
||||||
<class>Attach_UE</class>
|
|
||||||
<desc>Attach UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010002">
|
|
||||||
<class>Detach_UE</class>
|
|
||||||
<desc>Detach UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="030000">
|
|
||||||
<class>Initialize_eNB</class>
|
|
||||||
<desc>Initialize eNB</desc>
|
|
||||||
<Initialize_eNB_args>-O ci-scripts/conf_files/benetel-4g.conf</Initialize_eNB_args>
|
|
||||||
<eNB_instance>0</eNB_instance>
|
|
||||||
<eNB_serverId>0</eNB_serverId>
|
|
||||||
<air_interface>lte</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="040000">
|
|
||||||
<class>Initialize_eNB</class>
|
|
||||||
<desc>Initialize gNB</desc>
|
|
||||||
<Initialize_eNB_args>-O ci-scripts/conf_files/benetel-5g.conf</Initialize_eNB_args>
|
|
||||||
<eNB_instance>1</eNB_instance>
|
|
||||||
<eNB_serverId>1</eNB_serverId>
|
|
||||||
<air_interface>nr</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="000001">
|
|
||||||
<class>IdleSleep</class>
|
|
||||||
<desc>Sleep</desc>
|
|
||||||
<idle_sleep_time_in_sec>20</idle_sleep_time_in_sec>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="050000">
|
|
||||||
<class>Ping</class>
|
|
||||||
<desc>Ping: 20pings in 20sec</desc>
|
|
||||||
<ping_args>-c 20</ping_args>
|
|
||||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="050001">
|
|
||||||
<class>Ping</class>
|
|
||||||
<desc>Ping: 100pings in 20sec</desc>
|
|
||||||
<ping_args>-c 100 -i 0.2</ping_args>
|
|
||||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="060000">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (DL/2.5Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 2.5M -t 60 -i 1</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="060001">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (UL/1.5Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 1.5M -t 60 -i 1 -R</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="070000">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 20M -t 20 -i 1</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="070001">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 3M -t 20 -i 1 -R</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="080000">
|
|
||||||
<class>Terminate_eNB</class>
|
|
||||||
<desc>Terminate eNB</desc>
|
|
||||||
<eNB_instance>0</eNB_instance>
|
|
||||||
<eNB_serverId>0</eNB_serverId>
|
|
||||||
<air_interface>lte</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="080001">
|
|
||||||
<class>Terminate_eNB</class>
|
|
||||||
<desc>Terminate gNB</desc>
|
|
||||||
<eNB_instance>1</eNB_instance>
|
|
||||||
<eNB_serverId>1</eNB_serverId>
|
|
||||||
<air_interface>nr</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
</testCaseList>
|
|
||||||
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
<!--
|
|
||||||
|
|
||||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
|
||||||
this work for additional information regarding copyright ownership.
|
|
||||||
The OpenAirInterface Software Alliance licenses this file to You under
|
|
||||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
|
||||||
except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.openairinterface.org/?page_id=698
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
|
||||||
contact@openairinterface.org
|
|
||||||
|
|
||||||
-->
|
|
||||||
<testCaseList>
|
|
||||||
<htmlTabRef>TEST-NSA-FR1-TM1</htmlTabRef>
|
|
||||||
<htmlTabName>NSA FULL</htmlTabName>
|
|
||||||
<htmlTabIcon>tasks</htmlTabIcon>
|
|
||||||
<TestCaseRequestedList>
|
|
||||||
010000
|
|
||||||
030000
|
|
||||||
040000
|
|
||||||
010001
|
|
||||||
000001
|
|
||||||
050000
|
|
||||||
050001
|
|
||||||
000001
|
|
||||||
060000
|
|
||||||
060001
|
|
||||||
000001
|
|
||||||
070000
|
|
||||||
010002
|
|
||||||
000001
|
|
||||||
080001
|
|
||||||
080000
|
|
||||||
010003
|
|
||||||
</TestCaseRequestedList>
|
|
||||||
<TestCaseExclusionList></TestCaseExclusionList>
|
|
||||||
|
|
||||||
<testCase id="010000">
|
|
||||||
<class>Initialize_UE</class>
|
|
||||||
<desc>Initialize UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010003">
|
|
||||||
<class>Terminate_UE</class>
|
|
||||||
<desc>Terminate UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010001">
|
|
||||||
<class>Attach_UE</class>
|
|
||||||
<desc>Attach UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="010002">
|
|
||||||
<class>Detach_UE</class>
|
|
||||||
<desc>Detach UE</desc>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="030000">
|
|
||||||
<class>Initialize_eNB</class>
|
|
||||||
<desc>Initialize eNB</desc>
|
|
||||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf</Initialize_eNB_args>
|
|
||||||
<eNB_instance>0</eNB_instance>
|
|
||||||
<eNB_serverId>0</eNB_serverId>
|
|
||||||
<air_interface>lte</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="040000">
|
|
||||||
<class>Initialize_eNB</class>
|
|
||||||
<desc>Initialize gNB</desc>
|
|
||||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E</Initialize_eNB_args>
|
|
||||||
<eNB_instance>1</eNB_instance>
|
|
||||||
<eNB_serverId>1</eNB_serverId>
|
|
||||||
<air_interface>nr</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="000001">
|
|
||||||
<class>IdleSleep</class>
|
|
||||||
<desc>Sleep</desc>
|
|
||||||
<idle_sleep_time_in_sec>20</idle_sleep_time_in_sec>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="050000">
|
|
||||||
<class>Ping</class>
|
|
||||||
<desc>Ping: 20pings in 20sec</desc>
|
|
||||||
<ping_args>-c 20</ping_args>
|
|
||||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="050001">
|
|
||||||
<class>Ping</class>
|
|
||||||
<desc>Ping: 100pings in 20sec</desc>
|
|
||||||
<ping_args>-c 100 -i 0.2</ping_args>
|
|
||||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="060000">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (DL/3Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 3M -t 20 -i 1</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="060001">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (UL/1Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 1M -t 20 -i 1 -R</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="070000">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 20M -t 20 -i 1</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="070001">
|
|
||||||
<class>Iperf</class>
|
|
||||||
<desc>iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)</desc>
|
|
||||||
<iperf_args>-u -b 3M -t 20 -i 1 -R</iperf_args>
|
|
||||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
|
||||||
<iperf_profile>single-ue</iperf_profile>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<testCase id="080000">
|
|
||||||
<class>Terminate_eNB</class>
|
|
||||||
<desc>Terminate eNB</desc>
|
|
||||||
<eNB_instance>0</eNB_instance>
|
|
||||||
<eNB_serverId>0</eNB_serverId>
|
|
||||||
<air_interface>lte</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
<testCase id="080001">
|
|
||||||
<class>Terminate_eNB</class>
|
|
||||||
<desc>Terminate gNB</desc>
|
|
||||||
<eNB_instance>1</eNB_instance>
|
|
||||||
<eNB_serverId>1</eNB_serverId>
|
|
||||||
<air_interface>nr</air_interface>
|
|
||||||
</testCase>
|
|
||||||
|
|
||||||
</testCaseList>
|
|
||||||
|
|
||||||
+5
-28
@@ -229,34 +229,9 @@ void rx_func(void *param) {
|
|||||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||||
|
|
||||||
// RX processing
|
// RX processing
|
||||||
int tx_slot_type; int rx_slot_type;
|
int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx);
|
||||||
if(NFAPI_MODE != NFAPI_MONOLITHIC) { //slot selection routines not working properly in nfapi, so temporarily hardcoding
|
int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx);
|
||||||
if ((slot_tx==8) || (slot_tx==9) || (slot_tx==18) || (slot_tx==19)) { //tx slot config
|
|
||||||
tx_slot_type = NR_UPLINK_SLOT;
|
|
||||||
}
|
|
||||||
else if ((slot_tx==7) || (slot_tx==17)) {
|
|
||||||
tx_slot_type = NR_MIXED_SLOT;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tx_slot_type = NR_DOWNLINK_SLOT;;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((slot_rx==8) || (slot_rx==9) || (slot_rx==18) || (slot_rx==19)) { // rx slot config
|
|
||||||
rx_slot_type = NR_UPLINK_SLOT;
|
|
||||||
}
|
|
||||||
else if ((slot_rx==7) || (slot_rx==17)) {
|
|
||||||
rx_slot_type = NR_MIXED_SLOT;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
rx_slot_type = NR_DOWNLINK_SLOT;;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx);
|
|
||||||
rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx);
|
|
||||||
}
|
|
||||||
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
|
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
|
||||||
// UE-specific RX processing for subframe n
|
// UE-specific RX processing for subframe n
|
||||||
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
|
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
|
||||||
@@ -281,7 +256,8 @@ void rx_func(void *param) {
|
|||||||
|
|
||||||
// Call the scheduler
|
// Call the scheduler
|
||||||
|
|
||||||
start_meas(&gNB->ul_indication_stats);
|
if (NFAPI_MODE == NFAPI_MONOLITHIC){
|
||||||
|
start_meas(&gNB->ul_indication_stats);
|
||||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||||
gNB->UL_INFO.frame = frame_rx;
|
gNB->UL_INFO.frame = frame_rx;
|
||||||
gNB->UL_INFO.slot = slot_rx;
|
gNB->UL_INFO.slot = slot_rx;
|
||||||
@@ -290,6 +266,7 @@ void rx_func(void *param) {
|
|||||||
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
||||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||||
stop_meas(&gNB->ul_indication_stats);
|
stop_meas(&gNB->ul_indication_stats);
|
||||||
|
}
|
||||||
|
|
||||||
notifiedFIFO_elt_t *res;
|
notifiedFIFO_elt_t *res;
|
||||||
|
|
||||||
|
|||||||
+2
-36
@@ -97,8 +97,6 @@ static int DEFBFW[] = {0x00007fff};
|
|||||||
|
|
||||||
extern volatile int oai_exit;
|
extern volatile int oai_exit;
|
||||||
|
|
||||||
extern struct timespec timespec_sub(struct timespec lhs, struct timespec rhs);
|
|
||||||
extern struct timespec timespec_add(struct timespec lhs, struct timespec rhs);
|
|
||||||
extern void nr_phy_free_RU(RU_t *);
|
extern void nr_phy_free_RU(RU_t *);
|
||||||
extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||||
#include "executables/thread-common.h"
|
#include "executables/thread-common.h"
|
||||||
@@ -710,8 +708,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||||
|
|
||||||
RU_proc_t *proc = &ru->proc;
|
RU_proc_t *proc = &ru->proc;
|
||||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||||
@@ -1302,35 +1299,10 @@ void *ru_thread( void *param ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
|
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
|
||||||
struct timespec slot_start;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
|
||||||
|
|
||||||
struct timespec slot_duration;
|
|
||||||
slot_duration.tv_sec = 0;
|
|
||||||
//slot_duration.tv_nsec = 0.5e6;
|
|
||||||
slot_duration.tv_nsec = 0.5e6;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
|
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
|
||||||
// They are set on the first rx/tx in the underly FH routines.
|
// They are set on the first rx/tx in the underly FH routines.
|
||||||
slot_start = timespec_add(slot_start,slot_duration);
|
|
||||||
struct timespec curr_time;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
|
||||||
|
|
||||||
struct timespec sleep_time;
|
|
||||||
|
|
||||||
if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
|
|
||||||
sleep_time = timespec_sub(slot_start,curr_time);
|
|
||||||
|
|
||||||
usleep(sleep_time.tv_nsec * 1e-3);
|
|
||||||
}
|
|
||||||
else{//continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
|
||||||
//printf("sfn:%d, slot:%d, start time %d.%d slot start %d.%d \n",frame,slot,curr_time.tv_sec,curr_time.tv_nsec,slot_start.tv_sec,slot_start.tv_nsec);
|
|
||||||
if (slot==(fp->slots_per_frame-1)) {
|
if (slot==(fp->slots_per_frame-1)) {
|
||||||
slot=0;
|
slot=0;
|
||||||
frame++;
|
frame++;
|
||||||
@@ -1359,13 +1331,7 @@ void *ru_thread( void *param ) {
|
|||||||
|
|
||||||
// do RX front-end processing (frequency-shift, dft) if needed
|
// do RX front-end processing (frequency-shift, dft) if needed
|
||||||
|
|
||||||
//int slot_type = nr_slot_select(cfg,proc->frame_rx,proc->tti_rx);
|
int slot_type = nr_slot_select(cfg,proc->frame_rx,proc->tti_rx);
|
||||||
//if (NFAPI_MODE == NFAPI_MODE_PNF)
|
|
||||||
int slot_type;
|
|
||||||
if (slot ==7)
|
|
||||||
slot_type = NR_MIXED_SLOT;
|
|
||||||
if (slot == 8)
|
|
||||||
slot_type = NR_UPLINK_SLOT;
|
|
||||||
if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||||
|
|
||||||
if (ru->feprx) {
|
if (ru->feprx) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -73,6 +73,7 @@ extern pthread_mutex_t nfapi_sync_mutex;
|
|||||||
extern int nfapi_sync_var;
|
extern int nfapi_sync_var;
|
||||||
|
|
||||||
extern int sync_var;
|
extern int sync_var;
|
||||||
|
char uecap_xer_in;
|
||||||
|
|
||||||
extern void init_eNB_afterRU(void);
|
extern void init_eNB_afterRU(void);
|
||||||
extern void init_UE_stub(int nb_inst,int,int);
|
extern void init_UE_stub(int nb_inst,int,int);
|
||||||
@@ -1242,7 +1243,6 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
|||||||
memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||||
int SFN=sfn+2;
|
int SFN=sfn+2;
|
||||||
//if(!&dl_tti_pdu->pdcch_pdu)
|
//if(!&dl_tti_pdu->pdcch_pdu)
|
||||||
printf("interleaversize = %d, coreset_type = %d. \n",dl_tti_pdu->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize,dl_tti_pdu->pdcch_pdu.pdcch_pdu_rel15.CoreSetType);
|
|
||||||
handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu);
|
handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu);
|
||||||
//dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ?
|
//dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ?
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
|
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
|
||||||
@@ -1474,7 +1474,6 @@ int pnf_phy_ul_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
|||||||
switch (ul_tti_pdu_list[i].pdu_type) {
|
switch (ul_tti_pdu_list[i].pdu_type) {
|
||||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||||
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||||
//curr_sfn = curr_sfn + 3; //Gokul
|
|
||||||
nr_fill_ulsch(gNB,curr_sfn, curr_slot, &ul_tti_pdu_list[i].pusch_pdu);
|
nr_fill_ulsch(gNB,curr_sfn, curr_slot, &ul_tti_pdu_list[i].pusch_pdu);
|
||||||
break;
|
break;
|
||||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||||
@@ -2201,7 +2200,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
|||||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||||
__FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port,
|
__FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port,
|
||||||
pnf.phys[0].local_addr,
|
pnf.phys[0].local_addr,
|
||||||
pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
|
pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
|
||||||
@@ -2252,7 +2251,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr,
|
|||||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
config->vnf_ip_addr, config->vnf_p5_port,
|
config->vnf_ip_addr, config->vnf_p5_port,
|
||||||
pnf.phys[0].local_addr,
|
pnf.phys[0].local_addr,
|
||||||
@@ -2405,3 +2404,36 @@ int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind) {
|
|||||||
//free(ind.rx_indication_body.rx_pdu_list);
|
//free(ind.rx_indication_body.rx_pdu_list);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//NR UPLINK INDICATION
|
||||||
|
|
||||||
|
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
|
||||||
|
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
|
||||||
|
return nfapi_pnf_p7_nr_rx_data_ind(p7_config_g, ind);
|
||||||
|
}
|
||||||
|
|
||||||
|
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) {
|
||||||
|
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
|
||||||
|
return nfapi_pnf_p7_nr_crc_ind(p7_config_g, ind);
|
||||||
|
}
|
||||||
|
|
||||||
|
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) {
|
||||||
|
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION;
|
||||||
|
return nfapi_pnf_p7_nr_srs_ind(p7_config_g, ind);
|
||||||
|
}
|
||||||
|
|
||||||
|
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) {
|
||||||
|
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
|
||||||
|
return nfapi_pnf_p7_nr_uci_ind(p7_config_g, ind);
|
||||||
|
}
|
||||||
|
|
||||||
|
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) {
|
||||||
|
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
|
||||||
|
return nfapi_pnf_p7_nr_rach_ind(p7_config_g, ind);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#if !defined(NFAPI_PNF_H__)
|
#if !defined(NFAPI_PNF_H__)
|
||||||
#define NFAPI_PNF_H__
|
#define NFAPI_PNF_H__
|
||||||
extern nfapi_ue_release_request_body_t release_rntis;
|
|
||||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||||
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||||
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ void oai_create_gnb(void) {
|
|||||||
RC.gNB[0] = (PHY_VARS_gNB *) calloc(1, sizeof(PHY_VARS_gNB));
|
RC.gNB[0] = (PHY_VARS_gNB *) calloc(1, sizeof(PHY_VARS_gNB));
|
||||||
LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]);
|
LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[0];
|
PHY_VARS_gNB *gNB = RC.gNB[0];
|
||||||
RC.nb_nr_CC = (int *)malloc(sizeof(int)); // TODO: find a better function to place this in
|
RC.nb_nr_CC = (int *)malloc(sizeof(int)); // TODO: find a better function to place this in
|
||||||
|
|
||||||
|
|||||||
@@ -1,76 +1,76 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Cisco Systems, Inc.
|
* Copyright 2017 Cisco Systems, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#define MAX_MSG_LENGTH 2096
|
#define MAX_MSG_LENGTH 2096
|
||||||
#define TRACE_HEADER_LENGTH 44
|
#define TRACE_HEADER_LENGTH 44
|
||||||
|
|
||||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
|
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
|
||||||
|
|
||||||
// initialize the trace function to 0
|
// initialize the trace function to 0
|
||||||
void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
|
void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
|
||||||
|
|
||||||
nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
|
nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
|
||||||
//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
|
//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
|
||||||
|
|
||||||
void nfapi_set_trace_level(nfapi_trace_level_t new_level)
|
void nfapi_set_trace_level(nfapi_trace_level_t new_level)
|
||||||
{
|
{
|
||||||
nfapi_trace_level_g = new_level;
|
nfapi_trace_level_g = new_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
|
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
|
||||||
{
|
{
|
||||||
char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
|
char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
|
||||||
uint32_t num_chars;
|
uint32_t num_chars;
|
||||||
va_list p_args;
|
va_list p_args;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
pthread_t tid = pthread_self();
|
pthread_t tid = pthread_self();
|
||||||
|
|
||||||
(void)gettimeofday(&tv, NULL);
|
(void)gettimeofday(&tv, NULL);
|
||||||
|
|
||||||
num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
|
num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
|
||||||
|
|
||||||
if (num_chars > TRACE_HEADER_LENGTH)
|
if (num_chars > TRACE_HEADER_LENGTH)
|
||||||
{
|
{
|
||||||
printf("trace_dbg: Error, num_chars is too large: %u", num_chars);
|
printf("trace_dbg: Error, num_chars is too large: %d", num_chars);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(p_args, format);
|
va_start(p_args, format);
|
||||||
if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
|
if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
|
||||||
{
|
{
|
||||||
if (level <= NFAPI_TRACE_WARN)
|
if (level <= NFAPI_TRACE_WARN)
|
||||||
{
|
{
|
||||||
printf("%s", trace_buff);
|
printf("%s", trace_buff);
|
||||||
}
|
}
|
||||||
printf("%s", trace_buff);
|
printf("%s", trace_buff);
|
||||||
}
|
}
|
||||||
va_end(p_args);
|
va_end(p_args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -972,7 +972,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
uint32_t ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
||||||
uint8_t bch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
|
uint8_t bch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
|
||||||
uint8_t scs_common;//subcarrierSpacing for common, used for initial access and broadcast message. [38.211 sec 4.2] Value:0->3
|
uint8_t scs_common;//subcarrierSpacing for common, used for initial access and broadcast message. [38.211 sec 4.2] Value:0->3
|
||||||
|
|
||||||
@@ -1058,6 +1058,12 @@ typedef struct {
|
|||||||
fapi_nr_tdd_table_t tdd_table;
|
fapi_nr_tdd_table_t tdd_table;
|
||||||
fapi_nr_prach_config_t prach_config;
|
fapi_nr_prach_config_t prach_config;
|
||||||
|
|
||||||
|
fapi_nr_dl_bwp_common_config_t dl_bwp_common;
|
||||||
|
fapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated;
|
||||||
|
|
||||||
|
fapi_nr_ul_bwp_common_config_t ul_bwp_common;
|
||||||
|
fapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated;
|
||||||
|
|
||||||
} fapi_nr_config_request_t;
|
} fapi_nr_config_request_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1474,7 +1474,7 @@ typedef enum {
|
|||||||
|
|
||||||
//section 3.4.7 rx_data_indication
|
//section 3.4.7 rx_data_indication
|
||||||
|
|
||||||
//table 3-61
|
///table 3-61
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -1492,10 +1492,11 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
nfapi_p7_message_header_t header;
|
||||||
uint16_t sfn;
|
uint16_t sfn;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
uint16_t number_of_pdus;
|
uint16_t number_of_pdus;
|
||||||
nfapi_nr_rx_data_pdu_t* pdu_list;
|
nfapi_nr_rx_data_pdu_t *pdu_list;
|
||||||
|
|
||||||
} nfapi_nr_rx_data_indication_t;
|
} nfapi_nr_rx_data_indication_t;
|
||||||
|
|
||||||
@@ -1518,6 +1519,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
nfapi_p7_message_header_t header;
|
||||||
uint16_t sfn;
|
uint16_t sfn;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
uint16_t number_crcs;
|
uint16_t number_crcs;
|
||||||
@@ -1655,6 +1657,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
nfapi_p7_message_header_t header;
|
||||||
uint16_t sfn;
|
uint16_t sfn;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
uint16_t num_ucis;
|
uint16_t num_ucis;
|
||||||
@@ -1691,6 +1694,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
nfapi_p7_message_header_t header;
|
||||||
uint16_t sfn;
|
uint16_t sfn;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
uint8_t number_of_pdus;
|
uint8_t number_of_pdus;
|
||||||
@@ -1723,6 +1727,7 @@ typedef struct{
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
nfapi_p7_message_header_t header;
|
||||||
uint16_t sfn;
|
uint16_t sfn;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
uint8_t number_of_pdus;
|
uint8_t number_of_pdus;
|
||||||
|
|||||||
+8803
-8271
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,7 @@ extern "C" {
|
|||||||
#include <openair2/PHY_INTERFACE/IF_Module.h>
|
#include <openair2/PHY_INTERFACE/IF_Module.h>
|
||||||
#include "nfapi_nr_interface.h"
|
#include "nfapi_nr_interface.h"
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "openair1/PHY/defs_gNB.h"
|
#include "openair1/PHY/defs_gNB.h"
|
||||||
|
|
||||||
|
|||||||
@@ -937,7 +937,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
|||||||
pnf_p7->slot_start_time_hr = pnf_get_current_time_hr();
|
pnf_p7->slot_start_time_hr = pnf_get_current_time_hr();
|
||||||
pnf_p7->sfn = sfn;
|
pnf_p7->sfn = sfn;
|
||||||
|
|
||||||
pnf_p7->slot = slot;
|
pnf_p7->slot = slot;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1559,6 +1559,9 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
struct timespec curr_time;
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||||
|
printf("PNF SFN:%d, PNF slot:%d, VNF SFN:%d, VNF slot:%d, Curr time;%d.%d. \n",phy->sfn,phy->slot,sfn,slot,curr_time.tv_sec,curr_time.tv_nsec);
|
||||||
if(current_sfn_slot_dec <= recv_sfn_slot_dec + timing_window){
|
if(current_sfn_slot_dec <= recv_sfn_slot_dec + timing_window){
|
||||||
in_window = 1;
|
in_window = 1;
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||||
@@ -1571,8 +1574,8 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window);
|
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window);
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window);
|
|
||||||
}//Need to add more cases
|
}//Need to add more cases
|
||||||
|
|
||||||
|
|
||||||
@@ -3202,6 +3205,8 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
|
|||||||
int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
uint16_t pnf_frame = 0;
|
||||||
|
uint8_t pnf_slot = 0;
|
||||||
// initialize the mutex lock
|
// initialize the mutex lock
|
||||||
if(pthread_mutex_init(&(pnf_p7->mutex), NULL) != 0)
|
if(pthread_mutex_init(&(pnf_p7->mutex), NULL) != 0)
|
||||||
{
|
{
|
||||||
@@ -3284,8 +3289,8 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
|||||||
FD_SET(pnf_p7->p7_sock, &rfds);
|
FD_SET(pnf_p7->p7_sock, &rfds);
|
||||||
|
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
timeout.tv_sec = 1;
|
timeout.tv_sec = 0;
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 500;
|
||||||
|
|
||||||
selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
|
selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
|
||||||
|
|
||||||
@@ -3297,7 +3302,15 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
|||||||
if(selectRetval == 0)
|
if(selectRetval == 0)
|
||||||
{
|
{
|
||||||
// timeout
|
// timeout
|
||||||
continue;
|
//continue;
|
||||||
|
if (pnf_slot == 19)
|
||||||
|
pnf_frame = (pnf_frame + 1) % 1024;
|
||||||
|
pnf_slot = (pnf_slot + 1) % 20;
|
||||||
|
pnf_p7->sfn = pnf_frame;
|
||||||
|
pnf_p7->slot = pnf_slot;
|
||||||
|
struct timespec curr_time;
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||||
|
//printf("SFN=%d, slot=%d, Curr_time=%d.%d \n",pnf_p7->sfn,pnf_p7->slot,curr_time.tv_sec,curr_time.tv_nsec);
|
||||||
}
|
}
|
||||||
else if (selectRetval == -1 && (errno == EINTR))
|
else if (selectRetval == -1 && (errno == EINTR))
|
||||||
{
|
{
|
||||||
@@ -3315,7 +3328,7 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
|||||||
if(FD_ISSET(pnf_p7->p7_sock, &rfds))
|
if(FD_ISSET(pnf_p7->p7_sock, &rfds))
|
||||||
|
|
||||||
{
|
{
|
||||||
pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
|
pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 Terminating..\n");
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 Terminating..\n");
|
||||||
|
|||||||
@@ -175,17 +175,7 @@ int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t
|
|||||||
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rach_indication_t));
|
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rach_indication_t));
|
||||||
}
|
}
|
||||||
int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind)
|
|
||||||
{
|
|
||||||
if(config == NULL || ind == NULL)
|
|
||||||
{
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
|
||||||
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_srs_indication_t));
|
|
||||||
}
|
|
||||||
int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind)
|
int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind)
|
||||||
{
|
{
|
||||||
if(config == NULL || ind == NULL)
|
if(config == NULL || ind == NULL)
|
||||||
@@ -265,3 +255,65 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re
|
|||||||
|
|
||||||
return pnf_p7_pack_and_send_p7_message(_this, &(resp->header), sizeof(nfapi_ue_release_response_t));
|
return pnf_p7_pack_and_send_p7_message(_this, &(resp->header), sizeof(nfapi_ue_release_response_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//NR UPLINK INDICATION
|
||||||
|
|
||||||
|
int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind)
|
||||||
|
{
|
||||||
|
if(config == NULL || ind == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
|
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_rx_data_indication_t));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind)
|
||||||
|
{
|
||||||
|
if(config == NULL || ind == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
|
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_crc_indication_t));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nfapi_pnf_p7_nr_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_srs_indication_t* ind)
|
||||||
|
{
|
||||||
|
if(config == NULL || ind == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
|
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_srs_indication_t));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nfapi_pnf_p7_nr_uci_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_uci_indication_t* ind)
|
||||||
|
{
|
||||||
|
if(config == NULL || ind == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
|
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_uci_indication_t));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind)
|
||||||
|
{
|
||||||
|
if(config == NULL || ind == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||||
|
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_rach_indication_t));
|
||||||
|
}
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) {
|
|||||||
|
|
||||||
if(instance->tick == 1000) {
|
if(instance->tick == 1000) {
|
||||||
if(instance->tx_byte_count > 0) {
|
if(instance->tx_byte_count > 0) {
|
||||||
printf("[FAPI] Tx rate %u bytes/sec\n", instance->tx_byte_count);
|
printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
|
||||||
instance->tx_byte_count = 0;
|
instance->tx_byte_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) {
|
|||||||
millisec = now_ts.tv_nsec / 1e6;
|
millisec = now_ts.tv_nsec / 1e6;
|
||||||
|
|
||||||
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
|
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
|
||||||
printf("*** missing millisec %u %u\n", last_millisec, millisec);
|
printf("*** missing millisec %d %d\n", last_millisec, millisec);
|
||||||
catchup = millisec - last_millisec - 1;
|
catchup = millisec - last_millisec - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#define TIMEHR_USEC(_time_hr) ((uint32_t)(_time_hr) & 0xFFFFF)
|
#define TIMEHR_USEC(_time_hr) ((uint32_t)(_time_hr) & 0xFFFFF)
|
||||||
#define TIME2TIMEHR(_time) (((uint32_t)(_time.tv_sec) & 0xFFF) << 20 | ((uint32_t)(_time.tv_usec) & 0xFFFFF))
|
#define TIME2TIMEHR(_time) (((uint32_t)(_time.tv_sec) & 0xFFF) << 20 | ((uint32_t)(_time.tv_usec) & 0xFFFFF))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t* buffer;
|
uint8_t* buffer;
|
||||||
uint16_t length;
|
uint16_t length;
|
||||||
|
|||||||
+425
-339
@@ -461,6 +461,7 @@ int vnf_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info, u
|
|||||||
{
|
{
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sendto_result %d %d\n", __FUNCTION__, sendto_result, errno);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sendto_result %d %d\n", __FUNCTION__, sendto_result, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,6 +677,7 @@ int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_inf
|
|||||||
//dl_node_sync.t1 = calculate_t1(p7_info->sfn_sf, vnf_p7->sf_start_time_hr);
|
//dl_node_sync.t1 = calculate_t1(p7_info->sfn_sf, vnf_p7->sf_start_time_hr);
|
||||||
dl_node_sync.t1 = calculate_nr_t1(p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
dl_node_sync.t1 = calculate_nr_t1(p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
||||||
dl_node_sync.delta_sfn_slot = 0;
|
dl_node_sync.delta_sfn_slot = 0;
|
||||||
|
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1451,8 +1453,102 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
|||||||
phy->previous_t1 = ind.t1;
|
phy->previous_t1 = ind.t1;
|
||||||
phy->previous_t2 = ind.t2;
|
phy->previous_t2 = ind.t2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//NR HANDLES FOR UPLINK MESSAGES
|
||||||
|
|
||||||
|
void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
|
{
|
||||||
|
// ensure it's valid
|
||||||
|
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nfapi_nr_rx_data_indication_t ind;
|
||||||
|
|
||||||
|
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
|
{
|
||||||
|
// ensure it's valid
|
||||||
|
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nfapi_nr_crc_indication_t ind;
|
||||||
|
|
||||||
|
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vnf_handle_nr_srs_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
|
{
|
||||||
|
// ensure it's valid
|
||||||
|
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nfapi_nr_srs_indication_t ind;
|
||||||
|
|
||||||
|
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vnf_handle_nr_uci_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
|
{
|
||||||
|
// ensure it's valid
|
||||||
|
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nfapi_nr_uci_indication_t ind;
|
||||||
|
|
||||||
|
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vnf_handle_nr_rach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
|
{
|
||||||
|
// ensure it's valid
|
||||||
|
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nfapi_nr_rach_indication_t ind;
|
||||||
|
|
||||||
|
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||||
|
{
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
@@ -1485,358 +1581,368 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
|||||||
// divide by 2 using shift operator
|
// divide by 2 using shift operator
|
||||||
uint32_t latency = (tx_2_rx - pnf_proc_time) >> 1;
|
uint32_t latency = (tx_2_rx - pnf_proc_time) >> 1;
|
||||||
|
|
||||||
if(!(phy->filtered_adjust))
|
if(phy->in_sync == 0)
|
||||||
{
|
{
|
||||||
phy->latency[phy->min_sync_cycle_count] = latency;
|
NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
|
||||||
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) PNF to VNF !sync phy_id:%d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d\n",
|
|
||||||
// phy->sfn, phy->slot, ind.header.phy_id, ind.t1, ind.t2, ind.t3, t4,
|
|
||||||
// tx_2_rx, pnf_proc_time, latency);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
phy->latency[phy->min_sync_cycle_count] = latency;
|
|
||||||
|
|
||||||
//if(phy->min_sync_cycle_count != SYNC_CYCLE_COUNT)
|
|
||||||
{
|
|
||||||
if (ind.t2 < phy->previous_t2 && ind.t1 > phy->previous_t1)
|
|
||||||
{
|
|
||||||
// Only t2 wrap has occurred!!!
|
|
||||||
phy->slot_offset = (NFAPI_MAX_SFNSLOTDEC + ind.t2) - ind.t1 - latency;
|
|
||||||
}
|
|
||||||
else if (ind.t2 > phy->previous_t2 && ind.t1 < phy->previous_t1)
|
|
||||||
{
|
|
||||||
// Only t1 wrap has occurred
|
|
||||||
phy->slot_offset = ind.t2 - ( ind.t1 + NFAPI_MAX_SFNSLOTDEC) - latency;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Either no wrap or both have wrapped
|
|
||||||
phy->slot_offset = ind.t2 - ind.t1 - latency;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (phy->slot_offset_filtered == 0)
|
|
||||||
{
|
|
||||||
phy->slot_offset_filtered = phy->slot_offset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int32_t oldFilteredValueShifted = phy->slot_offset_filtered << 5;
|
|
||||||
int32_t newOffsetShifted = phy->slot_offset << 5;
|
|
||||||
|
|
||||||
// 1/8 of new and 7/8 of old
|
|
||||||
phy->slot_offset_filtered = ((newOffsetShifted >> 3) + ((oldFilteredValueShifted * 7) >> 3)) >> 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(1)
|
|
||||||
{
|
|
||||||
struct timespec ts;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
||||||
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
|
|
||||||
// phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
|
|
||||||
// ind.t1, ind.t2, ind.t3, t4,
|
|
||||||
// tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
|
|
||||||
// (ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(vnf_p7->_public.sync_indication)
|
||||||
|
(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phy->filtered_adjust && (phy->slot_offset_filtered > 1e6 || phy->slot_offset_filtered < -1e6))
|
phy->in_sync = 1;
|
||||||
{
|
|
||||||
phy->filtered_adjust = 0;
|
|
||||||
phy->zero_count=0;
|
|
||||||
phy->min_sync_cycle_count = 2;
|
|
||||||
phy->in_sync = 0;
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s - ADJUST TOO BAD - go out of filtered phy->slot_offset_filtered:%d\n", __FUNCTION__, phy->slot_offset_filtered);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(phy->min_sync_cycle_count)
|
// if(!(phy->filtered_adjust))
|
||||||
phy->min_sync_cycle_count--;
|
// {
|
||||||
|
// phy->latency[phy->min_sync_cycle_count] = latency;
|
||||||
|
|
||||||
if(phy->min_sync_cycle_count == 0)
|
// //NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) PNF to VNF !sync phy_id:%d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d\n",
|
||||||
{
|
// // phy->sfn, phy->slot, ind.header.phy_id, ind.t1, ind.t2, ind.t3, t4,
|
||||||
uint32_t curr_sfn = phy->sfn;
|
// // tx_2_rx, pnf_proc_time, latency);
|
||||||
uint32_t curr_slot = phy->slot;
|
// }
|
||||||
int32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(phy->sfn,phy->slot);
|
// else
|
||||||
|
// {
|
||||||
|
// phy->latency[phy->min_sync_cycle_count] = latency;
|
||||||
|
|
||||||
if(!phy->filtered_adjust)
|
// //if(phy->min_sync_cycle_count != SYNC_CYCLE_COUNT)
|
||||||
{
|
// {
|
||||||
int i = 0;
|
// if (ind.t2 < phy->previous_t2 && ind.t1 > phy->previous_t1)
|
||||||
//phy->average_latency = 0;
|
// {
|
||||||
for(i = 0; i < SYNC_CYCLE_COUNT; ++i)
|
// // Only t2 wrap has occurred!!!
|
||||||
{
|
// phy->slot_offset = (NFAPI_MAX_SFNSLOTDEC + ind.t2) - ind.t1 - latency;
|
||||||
phy->average_latency += phy->latency[i];
|
// }
|
||||||
|
// else if (ind.t2 > phy->previous_t2 && ind.t1 < phy->previous_t1)
|
||||||
|
// {
|
||||||
|
// // Only t1 wrap has occurred
|
||||||
|
// phy->slot_offset = ind.t2 - ( ind.t1 + NFAPI_MAX_SFNSLOTDEC) - latency;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // Either no wrap or both have wrapped
|
||||||
|
// phy->slot_offset = ind.t2 - ind.t1 - latency;
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
// if (phy->slot_offset_filtered == 0)
|
||||||
phy->average_latency /= SYNC_CYCLE_COUNT;
|
// {
|
||||||
|
// phy->slot_offset_filtered = phy->slot_offset;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// int32_t oldFilteredValueShifted = phy->slot_offset_filtered << 5;
|
||||||
|
// int32_t newOffsetShifted = phy->slot_offset << 5;
|
||||||
|
|
||||||
phy->slot_offset = ind.t2 - (ind.t1 - phy->average_latency);
|
// // 1/8 of new and 7/8 of old
|
||||||
|
// phy->slot_offset_filtered = ((newOffsetShifted >> 3) + ((oldFilteredValueShifted * 7) >> 3)) >> 5;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
sfn_slot_dec += (phy->slot_offset / 500);
|
// if(1)
|
||||||
|
// {
|
||||||
|
// struct timespec ts;
|
||||||
|
// clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
|
|
||||||
|
// //NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
|
||||||
|
// // phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
|
||||||
|
// // ind.t1, ind.t2, ind.t3, t4,
|
||||||
|
// // tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
|
||||||
|
// // (ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (phy->filtered_adjust && (phy->slot_offset_filtered > 1e6 || phy->slot_offset_filtered < -1e6))
|
||||||
|
// {
|
||||||
|
// phy->filtered_adjust = 0;
|
||||||
|
// phy->zero_count=0;
|
||||||
|
// phy->min_sync_cycle_count = 2;
|
||||||
|
// phy->in_sync = 0;
|
||||||
|
// NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s - ADJUST TOO BAD - go out of filtered phy->slot_offset_filtered:%d\n", __FUNCTION__, phy->slot_offset_filtered);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(phy->min_sync_cycle_count)
|
||||||
|
// phy->min_sync_cycle_count--;
|
||||||
|
|
||||||
|
// if(phy->min_sync_cycle_count == 0)
|
||||||
|
// {
|
||||||
|
// uint32_t curr_sfn = phy->sfn;
|
||||||
|
// uint32_t curr_slot = phy->slot;
|
||||||
|
// int32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(phy->sfn,phy->slot);
|
||||||
|
|
||||||
|
// if(!phy->filtered_adjust)
|
||||||
|
// {
|
||||||
|
// int i = 0;
|
||||||
|
// //phy->average_latency = 0;
|
||||||
|
// for(i = 0; i < SYNC_CYCLE_COUNT; ++i)
|
||||||
|
// {
|
||||||
|
// phy->average_latency += phy->latency[i];
|
||||||
|
|
||||||
|
// }
|
||||||
|
// phy->average_latency /= SYNC_CYCLE_COUNT;
|
||||||
|
|
||||||
|
// phy->slot_offset = ind.t2 - (ind.t1 - phy->average_latency);
|
||||||
|
|
||||||
|
// sfn_slot_dec += (phy->slot_offset / 500);
|
||||||
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
|
// //NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
sfn_slot_dec += ((phy->slot_offset_filtered + 250) / 500); //Round up to go from microsecond to slot
|
// sfn_slot_dec += ((phy->slot_offset_filtered + 250) / 500); //Round up to go from microsecond to slot
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(sfn_slot_dec < 0)
|
// if(sfn_slot_dec < 0)
|
||||||
{
|
// {
|
||||||
sfn_slot_dec += NFAPI_MAX_SFNSLOTDEC;
|
// sfn_slot_dec += NFAPI_MAX_SFNSLOTDEC;
|
||||||
}
|
// }
|
||||||
else if( sfn_slot_dec >= NFAPI_MAX_SFNSLOTDEC)
|
// else if( sfn_slot_dec >= NFAPI_MAX_SFNSLOTDEC)
|
||||||
{
|
// {
|
||||||
sfn_slot_dec -= NFAPI_MAX_SFNSLOTDEC;
|
// sfn_slot_dec -= NFAPI_MAX_SFNSLOTDEC;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
uint16_t new_sfn = NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec);
|
// uint16_t new_sfn = NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec);
|
||||||
uint16_t new_slot = NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec);
|
// uint16_t new_slot = NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec);
|
||||||
|
|
||||||
{
|
// {
|
||||||
phy->adjustment = NFAPI_SFNSLOT2DEC(new_sfn, new_slot) - NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot);
|
// phy->adjustment = NFAPI_SFNSLOT2DEC(new_sfn, new_slot) - NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot);
|
||||||
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d phy->previous_slot_offset_filtered:%d phy->previous_slot_offset_filtered:%d phy->slot_offset_trend:%d\n", ind.header.phy_id, phy->adjustment, phy->previous_slot_offset_filtered, phy->previous_slot_offset_filtered, phy->slot_offset_trend);
|
// //NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d phy->previous_slot_offset_filtered:%d phy->previous_slot_offset_filtered:%d phy->slot_offset_trend:%d\n", ind.header.phy_id, phy->adjustment, phy->previous_slot_offset_filtered, phy->previous_slot_offset_filtered, phy->slot_offset_trend);
|
||||||
|
|
||||||
phy->previous_t1 = 0;
|
// phy->previous_t1 = 0;
|
||||||
phy->previous_t2 = 0;
|
// phy->previous_t2 = 0;
|
||||||
|
|
||||||
if(phy->previous_slot_offset_filtered > 0)
|
// if(phy->previous_slot_offset_filtered > 0)
|
||||||
{
|
// {
|
||||||
if( phy->slot_offset_filtered > phy->previous_slot_offset_filtered)
|
// if( phy->slot_offset_filtered > phy->previous_slot_offset_filtered)
|
||||||
{
|
// {
|
||||||
// pnf is getting futher ahead of vnf
|
// // pnf is getting futher ahead of vnf
|
||||||
//phy->sf_offset_trend = phy->sf_offset_filtered - phy->previous_sf_offset_filtered;
|
// //phy->sf_offset_trend = phy->sf_offset_filtered - phy->previous_sf_offset_filtered;
|
||||||
phy->slot_offset_trend = (phy->slot_offset_filtered + phy->previous_slot_offset_filtered)/2;
|
// phy->slot_offset_trend = (phy->slot_offset_filtered + phy->previous_slot_offset_filtered)/2;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
// pnf is getting back in sync
|
// // pnf is getting back in sync
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else if(phy->previous_slot_offset_filtered < 0)
|
// else if(phy->previous_slot_offset_filtered < 0)
|
||||||
{
|
// {
|
||||||
if(phy->slot_offset_filtered < phy->previous_slot_offset_filtered)
|
// if(phy->slot_offset_filtered < phy->previous_slot_offset_filtered)
|
||||||
{
|
// {
|
||||||
// vnf is getting future ahead of pnf
|
// // vnf is getting future ahead of pnf
|
||||||
//phy->sf_offset_trend = -(phy->sf_offset_filtered - phy->previous_sf_offset_filtered);
|
// //phy->sf_offset_trend = -(phy->sf_offset_filtered - phy->previous_sf_offset_filtered);
|
||||||
phy->slot_offset_trend = (-(phy->slot_offset_filtered + phy->previous_slot_offset_filtered)) /2;
|
// phy->slot_offset_trend = (-(phy->slot_offset_filtered + phy->previous_slot_offset_filtered)) /2;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
// vnf is getting back in sync
|
// // vnf is getting back in sync
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
int insync_minor_adjustment_1 = phy->slot_offset_trend / 6;
|
// int insync_minor_adjustment_1 = phy->slot_offset_trend / 6;
|
||||||
int insync_minor_adjustment_2 = phy->slot_offset_trend / 2;
|
// int insync_minor_adjustment_2 = phy->slot_offset_trend / 2;
|
||||||
|
|
||||||
|
|
||||||
if(insync_minor_adjustment_1 == 0)
|
// if(insync_minor_adjustment_1 == 0)
|
||||||
insync_minor_adjustment_1 = 2;
|
// insync_minor_adjustment_1 = 2;
|
||||||
|
|
||||||
if(insync_minor_adjustment_2 == 0)
|
// if(insync_minor_adjustment_2 == 0)
|
||||||
insync_minor_adjustment_2 = 10;
|
// insync_minor_adjustment_2 = 10;
|
||||||
|
|
||||||
if(!phy->filtered_adjust)
|
// if(!phy->filtered_adjust)
|
||||||
{
|
// {
|
||||||
if(phy->adjustment < 10)
|
// if(phy->adjustment < 10)
|
||||||
{
|
// {
|
||||||
phy->zero_count++;
|
// phy->zero_count++;
|
||||||
|
|
||||||
if(phy->zero_count >= 10)
|
// if(phy->zero_count >= 10)
|
||||||
{
|
// {
|
||||||
phy->filtered_adjust = 1;
|
// phy->filtered_adjust = 1;
|
||||||
phy->zero_count = 0;
|
// phy->zero_count = 0;
|
||||||
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF SFN/SF switching to filtered mode\n");
|
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF SFN/SF switching to filtered mode\n");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
phy->zero_count = 0;
|
// phy->zero_count = 0;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
// Fine level of adjustment
|
// // Fine level of adjustment
|
||||||
if (phy->adjustment == 0)
|
// if (phy->adjustment == 0)
|
||||||
{
|
// {
|
||||||
if (phy->zero_count >= 10)
|
// if (phy->zero_count >= 10)
|
||||||
{
|
// {
|
||||||
if(phy->in_sync == 0)
|
// if(phy->in_sync == 0)
|
||||||
{
|
// {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
|
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
|
||||||
|
|
||||||
if(vnf_p7->_public.sync_indication)
|
// if(vnf_p7->_public.sync_indication)
|
||||||
(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
|
// (vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
phy->in_sync = 1;
|
// phy->in_sync = 1;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
phy->zero_count++;
|
// phy->zero_count++;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(phy->in_sync)
|
// if(phy->in_sync)
|
||||||
{
|
// {
|
||||||
// in sync
|
// // in sync
|
||||||
if(phy->slot_offset_filtered > 250)
|
// if(phy->slot_offset_filtered > 250)
|
||||||
{
|
// {
|
||||||
// VNF is slow
|
// // VNF is slow
|
||||||
phy->insync_minor_adjustment = insync_minor_adjustment_1; //25;
|
// phy->insync_minor_adjustment = insync_minor_adjustment_1; //25;
|
||||||
phy->insync_minor_adjustment_duration = ((phy->slot_offset_filtered) / insync_minor_adjustment_1);
|
// phy->insync_minor_adjustment_duration = ((phy->slot_offset_filtered) / insync_minor_adjustment_1);
|
||||||
}
|
// }
|
||||||
else if(phy->slot_offset_filtered < -250)
|
// else if(phy->slot_offset_filtered < -250)
|
||||||
{
|
// {
|
||||||
// VNF is fast
|
// // VNF is fast
|
||||||
phy->insync_minor_adjustment = -(insync_minor_adjustment_1); //25;
|
// phy->insync_minor_adjustment = -(insync_minor_adjustment_1); //25;
|
||||||
phy->insync_minor_adjustment_duration = (((phy->slot_offset_filtered) / -(insync_minor_adjustment_1)));
|
// phy->insync_minor_adjustment_duration = (((phy->slot_offset_filtered) / -(insync_minor_adjustment_1)));
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
phy->insync_minor_adjustment = 0;
|
// phy->insync_minor_adjustment = 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(phy->insync_minor_adjustment != 0)
|
// if(phy->insync_minor_adjustment != 0)
|
||||||
{
|
// {
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n",
|
// // NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n",
|
||||||
// phy->sfn, phy->slot, ind.header.phy_id,
|
// // phy->sfn, phy->slot, ind.header.phy_id,
|
||||||
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration,
|
// // phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration,
|
||||||
// phy->slot_offset_filtered,
|
// // phy->slot_offset_filtered,
|
||||||
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
// // insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
||||||
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
// // NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
||||||
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
// // NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
||||||
// phy->adjustment);
|
// // phy->adjustment);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
if (phy->in_sync)
|
// if (phy->in_sync)
|
||||||
{
|
// {
|
||||||
if(phy->adjustment == 0)
|
// if(phy->adjustment == 0)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
else if(phy->adjustment > 0)
|
// else if(phy->adjustment > 0)
|
||||||
{
|
// {
|
||||||
// VNF is slow
|
// // VNF is slow
|
||||||
//if(phy->adjustment == 1)
|
// //if(phy->adjustment == 1)
|
||||||
{
|
// {
|
||||||
//
|
// //
|
||||||
if(phy->slot_offset_filtered > 250)
|
// if(phy->slot_offset_filtered > 250)
|
||||||
{
|
// {
|
||||||
// VNF is slow
|
// // VNF is slow
|
||||||
phy->insync_minor_adjustment = insync_minor_adjustment_2;
|
// phy->insync_minor_adjustment = insync_minor_adjustment_2;
|
||||||
phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered - 250) / insync_minor_adjustment_2);
|
// phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered - 250) / insync_minor_adjustment_2);
|
||||||
}
|
// }
|
||||||
else if(phy->slot_offset_filtered < -250)
|
// else if(phy->slot_offset_filtered < -250)
|
||||||
{
|
// {
|
||||||
// VNF is fast
|
// // VNF is fast
|
||||||
phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
|
// phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
|
||||||
phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered + 250) / -(insync_minor_adjustment_2));
|
// phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered + 250) / -(insync_minor_adjustment_2));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
//else
|
// //else
|
||||||
{
|
// {
|
||||||
// out of sync?
|
// // out of sync?
|
||||||
}
|
// }
|
||||||
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n",
|
// // NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n",
|
||||||
// phy->sfn, phy->slot, ind.header.phy_id,
|
// // phy->sfn, phy->slot, ind.header.phy_id,
|
||||||
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
|
// // phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
|
||||||
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
// // insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
||||||
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
// // NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
||||||
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
// // NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
||||||
// phy->adjustment);
|
// // phy->adjustment);
|
||||||
|
|
||||||
}
|
// }
|
||||||
else if(phy->adjustment < 0)
|
// else if(phy->adjustment < 0)
|
||||||
{
|
// {
|
||||||
// VNF is fast
|
// // VNF is fast
|
||||||
//if(phy->adjustment == -1)
|
// //if(phy->adjustment == -1)
|
||||||
{
|
// {
|
||||||
//
|
// //
|
||||||
if(phy->slot_offset_filtered > 250)
|
// if(phy->slot_offset_filtered > 250)
|
||||||
{
|
// {
|
||||||
// VNF is slow
|
// // VNF is slow
|
||||||
phy->insync_minor_adjustment = insync_minor_adjustment_2;
|
// phy->insync_minor_adjustment = insync_minor_adjustment_2;
|
||||||
phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered - 250) / insync_minor_adjustment_2);
|
// phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered - 250) / insync_minor_adjustment_2);
|
||||||
}
|
// }
|
||||||
else if(phy->slot_offset_filtered < -250)
|
// else if(phy->slot_offset_filtered < -250)
|
||||||
{
|
// {
|
||||||
// VNF is fast
|
// // VNF is fast
|
||||||
phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
|
// phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
|
||||||
phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered + 250) / -(insync_minor_adjustment_2));
|
// phy->insync_minor_adjustment_duration = 2 * ((phy->slot_offset_filtered + 250) / -(insync_minor_adjustment_2));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//else
|
// //else
|
||||||
{
|
// {
|
||||||
// out of sync?
|
// // out of sync?
|
||||||
}
|
// }
|
||||||
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d\n",
|
// // NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d\n",
|
||||||
// phy->sfn, phy->slot, ind.header.phy_id,
|
// // phy->sfn, phy->slot, ind.header.phy_id,
|
||||||
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
|
// // phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
|
||||||
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend);
|
// // insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
// /*
|
||||||
if (phy->adjustment > 10 || phy->adjustment < -10)
|
// if (phy->adjustment > 10 || phy->adjustment < -10)
|
||||||
{
|
// {
|
||||||
phy->zero_count++; // Add one to the getting out of sync counter
|
// phy->zero_count++; // Add one to the getting out of sync counter
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
phy->zero_count = 0; // Small error - zero the out of sync counter
|
// phy->zero_count = 0; // Small error - zero the out of sync counter
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (phy->zero_count >= 10) // If we have had 10 consecutive large errors - drop out of sync
|
// if (phy->zero_count >= 10) // If we have had 10 consecutive large errors - drop out of sync
|
||||||
{
|
// {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "we have fallen out of sync...\n");
|
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "we have fallen out of sync...\n");
|
||||||
//pP7SockInfo->syncAchieved = 0;
|
// //pP7SockInfo->syncAchieved = 0;
|
||||||
}
|
// }
|
||||||
*/
|
// */
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
if(phy->in_sync == 0)
|
// if(phy->in_sync == 0)
|
||||||
{
|
// {
|
||||||
/*NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF phy_id:%d SFN/SF (%s) from %d to %d (%d) mode:%s zeroCount:%u sync:%s\n",
|
// /*NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF phy_id:%d SFN/SF (%s) from %d to %d (%d) mode:%s zeroCount:%u sync:%s\n",
|
||||||
ind.header.phy_id, (phy->in_sync ? "via sfn" : "now"),
|
// ind.header.phy_id, (phy->in_sync ? "via sfn" : "now"),
|
||||||
NFAPI_SFNSF2DEC(curr_sfn_sf), NFAPI_SFNSF2DEC(new_sfn_sf), phy->adjustment,
|
// NFAPI_SFNSF2DEC(curr_sfn_sf), NFAPI_SFNSF2DEC(new_sfn_sf), phy->adjustment,
|
||||||
phy->filtered_adjust ? "FILTERED" : "ABSOLUTE",
|
// phy->filtered_adjust ? "FILTERED" : "ABSOLUTE",
|
||||||
phy->zero_count,
|
// phy->zero_count,
|
||||||
phy->in_sync ? "IN_SYNC" : "OUT_OF_SYNC");*/
|
// phy->in_sync ? "IN_SYNC" : "OUT_OF_SYNC");*/
|
||||||
|
|
||||||
phy->sfn = new_sfn;
|
// phy->sfn = new_sfn;
|
||||||
phy->slot = new_slot;
|
// phy->slot = new_slot;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// reset for next cycle
|
// // reset for next cycle
|
||||||
phy->previous_slot_offset_filtered = phy->slot_offset_filtered;
|
// phy->previous_slot_offset_filtered = phy->slot_offset_filtered;
|
||||||
phy->min_sync_cycle_count = 2;
|
// phy->min_sync_cycle_count = 2;
|
||||||
phy->slot_offset_filtered = 0;
|
// phy->slot_offset_filtered = 0;
|
||||||
phy->slot_offset = 0;
|
// phy->slot_offset = 0;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
phy->previous_t1 = ind.t1;
|
// phy->previous_t1 = ind.t1;
|
||||||
phy->previous_t2 = ind.t2;
|
// phy->previous_t2 = ind.t2;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||||
{
|
{
|
||||||
@@ -2035,46 +2141,26 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
|||||||
vnf_nr_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_nr_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_HARQ_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
|
||||||
vnf_handle_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_rx_data_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_CRC_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
|
||||||
vnf_handle_crc_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_crc_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_RX_ULSCH_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
|
||||||
vnf_handle_rx_ulsch_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_uci_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_RACH_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
||||||
vnf_handle_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_SRS_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||||
vnf_handle_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_RX_SR_INDICATION:
|
|
||||||
vnf_handle_rx_sr_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_RX_CQI_INDICATION:
|
|
||||||
vnf_handle_rx_cqi_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_LBT_DL_INDICATION:
|
|
||||||
vnf_handle_lbt_dl_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_NB_HARQ_INDICATION:
|
|
||||||
vnf_handle_nb_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_NRACH_INDICATION:
|
|
||||||
vnf_handle_nrach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_UE_RELEASE_RESPONSE:
|
case NFAPI_UE_RELEASE_RESPONSE:
|
||||||
vnf_handle_ue_release_resp(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_ue_release_resp(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -430,18 +430,6 @@ struct timespec current_time;
|
|||||||
}
|
}
|
||||||
send_mac_slot_indications(vnf_p7);
|
send_mac_slot_indications(vnf_p7);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // Call the scheduler
|
|
||||||
// struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
|
||||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
|
||||||
// gNB->UL_INFO.frame = vnf_frame;
|
|
||||||
// gNB->UL_INFO.slot = vnf_slot;
|
|
||||||
|
|
||||||
// gNB->UL_INFO.module_id = gNB->Mod_id;
|
|
||||||
// gNB->UL_INFO.CC_id = gNB->CC_id;
|
|
||||||
// gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
|
||||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
|
||||||
}
|
}
|
||||||
else if(selectRetval > 0)
|
else if(selectRetval > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
debug_ch_est = fopen("debug_ch_est.txt","w");
|
debug_ch_est = fopen("debug_ch_est.txt","w");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
|
||||||
|
|
||||||
uint8_t nushift;
|
uint8_t nushift;
|
||||||
int **ul_ch_estimates = gNB->pusch_vars[ul_id]->ul_ch_estimates;
|
int **ul_ch_estimates = gNB->pusch_vars[ul_id]->ul_ch_estimates;
|
||||||
int **rxdataF = gNB->common_vars.rxdataF;
|
int **rxdataF = gNB->common_vars.rxdataF;
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nr_dlsch.h"
|
#include "nr_dlsch.h"
|
||||||
#include "../../../nfapi/oai_integration/vendor_ext.h"
|
|
||||||
|
|
||||||
extern void set_taus_seed(unsigned int seed_type);
|
extern void set_taus_seed(unsigned int seed_type);
|
||||||
|
|
||||||
@@ -264,21 +263,13 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
|
|||||||
for (i=0; i<gNB->number_of_nr_dlsch_max; i++) {
|
for (i=0; i<gNB->number_of_nr_dlsch_max; i++) {
|
||||||
AssertFatal(gNB->dlsch[i]!=NULL,"gNB->dlsch[%d] is null\n",i);
|
AssertFatal(gNB->dlsch[i]!=NULL,"gNB->dlsch[%d] is null\n",i);
|
||||||
AssertFatal(gNB->dlsch[i][0]!=NULL,"gNB->dlsch[%d][0] is null\n",i);
|
AssertFatal(gNB->dlsch[i][0]!=NULL,"gNB->dlsch[%d][0] is null\n",i);
|
||||||
//LOG_D(PHY,"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,
|
LOG_D(PHY,"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,
|
||||||
//gNB->dlsch[i][0]->harq_mask,gNB->dlsch[i][0]->rnti,first_free_index);
|
gNB->dlsch[i][0]->harq_mask,gNB->dlsch[i][0]->rnti,first_free_index);
|
||||||
LOG_D(PHY,"searching for harq_mask %x, rnti %x, gNB->dlsch[i][0]->rnti %x\n", gNB->dlsch[i][0]->harq_mask, rnti, gNB->dlsch[i][0]->rnti);
|
|
||||||
if ((gNB->dlsch[i][0]->harq_mask >0) &&
|
if ((gNB->dlsch[i][0]->harq_mask >0) &&
|
||||||
(gNB->dlsch[i][0]->rnti==rnti)) return i;
|
(gNB->dlsch[i][0]->rnti==rnti)) return i;
|
||||||
else if ((gNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) {
|
else if ((gNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
|
||||||
//printf("gNB->dlsch[i][0]->harq_mask = %d \n", gNB->dlsch[i][0]->harq_mask);;
|
|
||||||
first_free_index=i;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (type == SEARCH_EXIST) {
|
|
||||||
printf("type = %d \n", type);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
if (type == SEARCH_EXIST) return -1;
|
||||||
if (first_free_index != -1)
|
if (first_free_index != -1)
|
||||||
gNB->dlsch[first_free_index][0]->rnti = 0;
|
gNB->dlsch[first_free_index][0]->rnti = 0;
|
||||||
return first_free_index;
|
return first_free_index;
|
||||||
@@ -293,10 +284,7 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
|
|||||||
uint8_t *sdu) {
|
uint8_t *sdu) {
|
||||||
|
|
||||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &pdsch_pdu->pdsch_pdu_rel15;
|
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &pdsch_pdu->pdsch_pdu_rel15;
|
||||||
if (NFAPI_MODE == NFAPI_MODE_PNF) {
|
|
||||||
gNB->dlsch[0][0]->harq_mask = 1;
|
|
||||||
gNB->dlsch[0][0]->rnti = 4660;
|
|
||||||
}
|
|
||||||
int dlsch_id = find_nr_dlsch(rel15->rnti,gNB,SEARCH_EXIST);
|
int dlsch_id = find_nr_dlsch(rel15->rnti,gNB,SEARCH_EXIST);
|
||||||
AssertFatal( (dlsch_id>=0) && (dlsch_id<gNB->number_of_nr_dlsch_max),
|
AssertFatal( (dlsch_id>=0) && (dlsch_id<gNB->number_of_nr_dlsch_max),
|
||||||
"illegal or no dlsch_id found!!! rnti %04x dlsch_id %d\n",rel15->rnti,dlsch_id);
|
"illegal or no dlsch_id found!!! rnti %04x dlsch_id %d\n",rel15->rnti,dlsch_id);
|
||||||
|
|||||||
@@ -430,22 +430,20 @@ void nr_processULSegment(void* arg) {
|
|||||||
p_procTime);
|
p_procTime);
|
||||||
|
|
||||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
|
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
|
||||||
// #ifdef PRINT_CRC_CHECK
|
#ifdef PRINT_CRC_CHECK
|
||||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
LOG_D(PHY, "Segment %d CRC OK\n",r);
|
||||||
// #endif
|
#endif
|
||||||
rdata->decodeIterations = no_iteration_ldpc;
|
rdata->decodeIterations = no_iteration_ldpc;
|
||||||
} else {
|
} else {
|
||||||
// #ifdef PRINT_CRC_CHECK
|
#ifdef PRINT_CRC_CHECK
|
||||||
LOG_I(PHY, "CRC NOK\n");
|
LOG_I(PHY, "CRC NOK\n");
|
||||||
// #endif
|
#endif
|
||||||
rdata->decodeIterations = max_ldpc_iterations + 1;
|
rdata->decodeIterations = max_ldpc_iterations + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int m=0; m < Kr>>3; m ++) {
|
for (int m=0; m < Kr>>3; m ++) {
|
||||||
ulsch_harq->c[r][m]= (uint8_t) llrProcBuf[m];
|
ulsch_harq->c[r][m]= (uint8_t) llrProcBuf[m];
|
||||||
//printf("%x ", ulsch_harq->c[r][m]);
|
|
||||||
}
|
}
|
||||||
//printf("\n");
|
|
||||||
|
|
||||||
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||||
}
|
}
|
||||||
@@ -512,7 +510,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
|||||||
A = (harq_process->TBS)<<3;
|
A = (harq_process->TBS)<<3;
|
||||||
|
|
||||||
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers);
|
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers);
|
||||||
//printf("ULSCH in %d.%d \n", frame, nr_tti_rx);
|
|
||||||
|
|
||||||
if (R<1024)
|
if (R<1024)
|
||||||
Coderate = (float) R /(float) 1024;
|
Coderate = (float) R /(float) 1024;
|
||||||
|
|||||||
@@ -166,15 +166,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
|||||||
int slot,
|
int slot,
|
||||||
nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu,
|
nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu,
|
||||||
nfapi_nr_pucch_pdu_t* pucch_pdu) {
|
nfapi_nr_pucch_pdu_t* pucch_pdu) {
|
||||||
printf("Inside nr_decode_pucch0. \n");
|
|
||||||
int32_t **rxdataF = gNB->common_vars.rxdataF;
|
int32_t **rxdataF = gNB->common_vars.rxdataF;
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||||
//Gokul
|
|
||||||
// printf("rxdataf buff: \n");
|
|
||||||
// for(int i = 1;i<=5*7*14*512;++i){
|
|
||||||
// if(gNB->RU_list[0]->common.rxdataF[0][i] != 0)
|
|
||||||
// printf("%d ",gNB->RU_list[0]->common.rxdataF[0][i]);
|
|
||||||
// }
|
|
||||||
int nr_sequences;
|
int nr_sequences;
|
||||||
const uint8_t *mcs;
|
const uint8_t *mcs;
|
||||||
|
|
||||||
@@ -1092,8 +1086,7 @@ void init_pucch2_luts() {
|
|||||||
void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||||
int slot,
|
int slot,
|
||||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu,
|
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu,
|
||||||
nfapi_nr_pucch_pdu_t* pucch_pdu) {
|
nfapi_nr_pucch_pdu_t* pucch_pdu) {
|
||||||
printf("Inside nr_decode_pucch2. \n");
|
|
||||||
int32_t **rxdataF = gNB->common_vars.rxdataF;
|
int32_t **rxdataF = gNB->common_vars.rxdataF;
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||||
//pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
//pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||||
|
|||||||
@@ -577,7 +577,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
|
|
||||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||||
LOG_I(PHY,"Segment %u CRC OK\n\033[0m",r);
|
LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r);
|
||||||
if (r==0) {
|
if (r==0) {
|
||||||
for (int i=0;i<10;i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]);
|
for (int i=0;i<10;i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]);
|
||||||
}
|
}
|
||||||
@@ -587,7 +587,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
ret = no_iteration_ldpc;
|
ret = no_iteration_ldpc;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_I(PHY,"CRC NOT OK\n\033[0m");
|
LOG_D(PHY,"CRC NOT OK\n\033[0m");
|
||||||
ret = 1 + dlsch->max_ldpc_iterations;
|
ret = 1 + dlsch->max_ldpc_iterations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,31 +38,6 @@
|
|||||||
|
|
||||||
//#define DEBUG_LLR_SIC
|
//#define DEBUG_LLR_SIC
|
||||||
|
|
||||||
void PrintIntrinsics(char *s, char *dtype, void *x) {
|
|
||||||
if (strcmp(dtype,"int") == 0) {
|
|
||||||
int *tempb = (int *)x;
|
|
||||||
printf("%s: [%d, %d, %d, %d]\n", s, tempb[0], tempb[1], tempb[2], tempb[3]);
|
|
||||||
}
|
|
||||||
if (strcmp(dtype,"short") == 0) {
|
|
||||||
short *tempb = (short *)x;
|
|
||||||
printf("%s: [%d, %d, %d, %d, %d, %d, %d, %d]\n", s, tempb[0], tempb[1], tempb[2], tempb[3],
|
|
||||||
tempb[4], tempb[5], tempb[6], tempb[7]);
|
|
||||||
}
|
|
||||||
if (strcmp(dtype,"char") == 0) {
|
|
||||||
char *tempb = (char *)x;
|
|
||||||
printf("%s: [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d]\n", s,
|
|
||||||
tempb[0], tempb[1], tempb[2], tempb[3], tempb[4], tempb[5], tempb[6], tempb[7],
|
|
||||||
tempb[8], tempb[9],tempb[10],tempb[11],tempb[12],tempb[13],tempb[14],tempb[15]);
|
|
||||||
}
|
|
||||||
if (strcmp(dtype,"float") == 0) {
|
|
||||||
float *tempb = (float *)x;
|
|
||||||
printf("%s: [%f, %f, %f, %f]\n", s, tempb[0], tempb[1], tempb[2], tempb[3]);
|
|
||||||
}
|
|
||||||
if (strcmp(dtype,"double") == 0) {
|
|
||||||
double *tempb = (double *)x;
|
|
||||||
printf("%s: [%f, %f]\n", s, tempb[0], tempb[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int16_t nr_zeros[8] __attribute__ ((aligned(16))) = {0,0,0,0,0,0,0,0};
|
int16_t nr_zeros[8] __attribute__ ((aligned(16))) = {0,0,0,0,0,0,0,0};
|
||||||
int16_t nr_ones[8] __attribute__ ((aligned(16))) = {0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff};
|
int16_t nr_ones[8] __attribute__ ((aligned(16))) = {0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff};
|
||||||
@@ -759,45 +734,20 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386)
|
#if defined(__x86_64__) || defined(__i386)
|
||||||
PrintIntrinsics("rxF", "short", &rxF[i]);
|
|
||||||
PrintIntrinsics("ch_mag", "short", &ch_mag[i]);
|
|
||||||
|
|
||||||
xmm0 = _mm_abs_epi16(rxF[i]);
|
xmm0 = _mm_abs_epi16(rxF[i]);
|
||||||
PrintIntrinsics("xmm0", "short", &xmm0);
|
|
||||||
|
|
||||||
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
|
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
|
||||||
PrintIntrinsics("xmm0", "short", &xmm0);
|
|
||||||
|
|
||||||
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
|
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
|
||||||
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
|
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
|
||||||
PrintIntrinsics("llr128[0]", "int", &llr128[0]);
|
|
||||||
|
|
||||||
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
|
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
|
||||||
PrintIntrinsics("llr128[1]", "int", &llr128[1]);
|
|
||||||
|
|
||||||
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
|
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
|
||||||
printf("llr32[0] = %d\n", llr32[0]);
|
|
||||||
|
|
||||||
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
|
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
|
||||||
printf("llr32[1] = %d\n", llr32[1]);
|
|
||||||
|
|
||||||
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
|
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
|
||||||
printf("llr32[2] = %d\n", llr32[2]);
|
|
||||||
|
|
||||||
llr32[3] = _mm_extract_epi32(llr128[0],3); //((uint32_t *)&llr128[0])[3];
|
llr32[3] = _mm_extract_epi32(llr128[0],3); //((uint32_t *)&llr128[0])[3];
|
||||||
printf("llr32[3] = %d\n", llr32[3]);
|
|
||||||
|
|
||||||
llr32[4] = _mm_extract_epi32(llr128[1],0); //((uint32_t *)&llr128[1])[0];
|
llr32[4] = _mm_extract_epi32(llr128[1],0); //((uint32_t *)&llr128[1])[0];
|
||||||
printf("llr32[4] = %d\n", llr32[4]);
|
|
||||||
|
|
||||||
llr32[5] = _mm_extract_epi32(llr128[1],1); //((uint32_t *)&llr128[1])[1];
|
llr32[5] = _mm_extract_epi32(llr128[1],1); //((uint32_t *)&llr128[1])[1];
|
||||||
printf("llr32[5] = %d\n", llr32[5]);
|
|
||||||
|
|
||||||
llr32[6] = _mm_extract_epi32(llr128[1],2); //((uint32_t *)&llr128[1])[2];
|
llr32[6] = _mm_extract_epi32(llr128[1],2); //((uint32_t *)&llr128[1])[2];
|
||||||
printf("llr32[6] = %d\n", llr32[6]);
|
|
||||||
|
|
||||||
llr32[7] = _mm_extract_epi32(llr128[1],3); //((uint32_t *)&llr128[1])[3];
|
llr32[7] = _mm_extract_epi32(llr128[1],3); //((uint32_t *)&llr128[1])[3];
|
||||||
printf("llr32[7] = %d\n", llr32[7]);
|
|
||||||
llr32+=8;
|
llr32+=8;
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
xmm0 = vabsq_s16(rxF[i]);
|
xmm0 = vabsq_s16(rxF[i]);
|
||||||
@@ -8739,4 +8689,4 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
//*llr16p = (short *)llr16;
|
//*llr16p = (short *)llr16;
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,13 +272,13 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
|
|
||||||
///////////////////////// a---->| add CRC |---->b /////////////////////////
|
///////////////////////// a---->| add CRC |---->b /////////////////////////
|
||||||
///////////
|
///////////
|
||||||
|
/*
|
||||||
// int i;
|
int i;
|
||||||
// printf("ulsch (tx): \n");
|
printf("ulsch (tx): \n");
|
||||||
// for (i=0;i<(A>>3);i++)
|
for (i=0;i<(A>>3);i++)
|
||||||
// printf("%x ",harq_process->a[i]);
|
printf("%02x.",a[i]);
|
||||||
// printf("\n");
|
printf("\n");
|
||||||
|
*/
|
||||||
|
|
||||||
if (A > 3824) {
|
if (A > 3824) {
|
||||||
// Add 24-bit crc (polynomial A) to payload
|
// Add 24-bit crc (polynomial A) to payload
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
|
|||||||
|
|
||||||
nr_fill_dci(gNB,frame,slot,pdcch_pdu);
|
nr_fill_dci(gNB,frame,slot,pdcch_pdu);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||||
@@ -138,7 +140,6 @@ void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
|||||||
|
|
||||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||||
|
|
||||||
//if(NFAPI_MODE == NFAPI_MODE_VNF)
|
|
||||||
PHY_VARS_gNB *gNB;
|
PHY_VARS_gNB *gNB;
|
||||||
// copy data from L2 interface into L1 structures
|
// copy data from L2 interface into L1 structures
|
||||||
module_id_t Mod_id = Sched_INFO->module_id;
|
module_id_t Mod_id = Sched_INFO->module_id;
|
||||||
@@ -185,30 +186,26 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||||
|
|
||||||
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
|
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
|
||||||
if(NFAPI_MODE != NFAPI_MODE_VNF){
|
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
|
||||||
handle_nfapi_nr_pdcch_pdu(gNB,
|
handle_nfapi_nr_pdcch_pdu(gNB,
|
||||||
frame, slot,
|
frame, slot,
|
||||||
&dl_tti_pdu->pdcch_pdu);
|
&dl_tti_pdu->pdcch_pdu);
|
||||||
}
|
|
||||||
pdcch_received = 1;
|
pdcch_received = 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
||||||
|
|
||||||
{
|
{
|
||||||
LOG_I(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdu->pdsch_pdu.pdsch_pdu_rel15;
|
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdu->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
uint16_t pduIndex = pdsch_pdu_rel15->pduIndex;
|
uint16_t pduIndex = pdsch_pdu_rel15->pduIndex;
|
||||||
AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n",
|
AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n",
|
||||||
pduIndex,TX_req->pdu_list[pduIndex].num_TLV);
|
pduIndex,TX_req->pdu_list[pduIndex].num_TLV);
|
||||||
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct;
|
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct;
|
||||||
if(NFAPI_MODE != NFAPI_MODE_VNF){
|
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
|
||||||
handle_nr_nfapi_pdsch_pdu(gNB,frame,slot,&dl_tti_pdu->pdsch_pdu, sdu);
|
handle_nr_nfapi_pdsch_pdu(gNB,frame,slot,&dl_tti_pdu->pdsch_pdu, sdu);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -255,7 +252,6 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
|||||||
{
|
{
|
||||||
Sched_INFO->DL_req->SFN = frame;
|
Sched_INFO->DL_req->SFN = frame;
|
||||||
Sched_INFO->DL_req->Slot = slot;
|
Sched_INFO->DL_req->Slot = slot;
|
||||||
//printf("DL tti Frame = %d, slot = %d. \n",frame,slot);
|
|
||||||
oai_nfapi_dl_tti_req(Sched_INFO->DL_req);
|
oai_nfapi_dl_tti_req(Sched_INFO->DL_req);
|
||||||
}
|
}
|
||||||
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
|
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
|||||||
(ulsch_harq->slot == slot_rx) &&
|
(ulsch_harq->slot == slot_rx) &&
|
||||||
(ulsch_harq->handled == 0)){
|
(ulsch_harq->handled == 0)){
|
||||||
|
|
||||||
LOG_I(PHY, "PUSCH detection started in frame %d slot %d\n",
|
LOG_D(PHY, "PUSCH detection started in frame %d slot %d\n",
|
||||||
frame_rx,slot_rx);
|
frame_rx,slot_rx);
|
||||||
|
|
||||||
#ifdef DEBUG_RXDATA
|
#ifdef DEBUG_RXDATA
|
||||||
@@ -683,10 +683,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
|||||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
|
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pucch_decode_done || pusch_decode_done) {
|
|
||||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
|||||||
dlsch0_harq->Nl=1;
|
dlsch0_harq->Nl=1;
|
||||||
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
|
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
|
||||||
dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type);
|
dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type);
|
||||||
dlsch0_harq->status = ACTIVE; //Gokul
|
dlsch0_harq->status = ACTIVE;
|
||||||
if (dlsch0_harq->status != ACTIVE) {
|
if (dlsch0_harq->status != ACTIVE) {
|
||||||
// dlsch0_harq->status not ACTIVE may be due to false retransmission. Reset the
|
// dlsch0_harq->status not ACTIVE may be due to false retransmission. Reset the
|
||||||
// following flag to skip PDSCH procedures in that case.
|
// following flag to skip PDSCH procedures in that case.
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int
|
|||||||
dl_harq->round = 0;
|
dl_harq->round = 0;
|
||||||
dl_harq->status = ACTIVE;
|
dl_harq->status = ACTIVE;
|
||||||
dl_harq->DCINdi = ndi;
|
dl_harq->DCINdi = ndi;
|
||||||
//dl_harq->first_tx = 0;
|
dl_harq->first_tx = 0;
|
||||||
|
|
||||||
result_harq = NEW_TRANSMISSION_HARQ;
|
result_harq = NEW_TRANSMISSION_HARQ;
|
||||||
|
|
||||||
|
|||||||
@@ -121,21 +121,6 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
|
||||||
const int CC_id,
|
|
||||||
const uint8_t gNB_id,
|
|
||||||
const frame_t frameP,
|
|
||||||
const rb_id_t Srb_id,
|
|
||||||
uint8_t *buffer_pP)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
rrc_data_ind(
|
rrc_data_ind(
|
||||||
const protocol_ctxt_t *const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
|||||||
@@ -324,12 +324,12 @@ bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) {
|
|||||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||||
frame_t frame,
|
frame_t frame,
|
||||||
sub_frame_t slot){
|
sub_frame_t slot){
|
||||||
gNB_MAC_INST *mac = RC.nrmac[module_idP];
|
|
||||||
nfapi_nr_config_request_scf_t *cfg = &mac->config[0];
|
|
||||||
protocol_ctxt_t ctxt;
|
protocol_ctxt_t ctxt;
|
||||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP);
|
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP);
|
||||||
|
|
||||||
const int bwp_id = 1;
|
const int bwp_id = 1;
|
||||||
|
|
||||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||||
NR_COMMON_channels_t *cc = gNB->common_channels;
|
NR_COMMON_channels_t *cc = gNB->common_channels;
|
||||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||||
@@ -374,6 +374,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
|||||||
const int last_slot = (slot + num_slots - 1) % num_slots;
|
const int last_slot = (slot + num_slots - 1) % num_slots;
|
||||||
uint16_t *vrb_map_UL = cc[CC_id].vrb_map_UL;
|
uint16_t *vrb_map_UL = cc[CC_id].vrb_map_UL;
|
||||||
memset(&vrb_map_UL[last_slot * MAX_BWP_SIZE], 0, sizeof(uint16_t) * MAX_BWP_SIZE);
|
memset(&vrb_map_UL[last_slot * MAX_BWP_SIZE], 0, sizeof(uint16_t) * MAX_BWP_SIZE);
|
||||||
|
|
||||||
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
|
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -851,15 +851,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
const int bwpid = sched_ctrl->active_bwp->bwp_Id;
|
const int bwpid = sched_ctrl->active_bwp->bwp_Id;
|
||||||
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
|
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
|
||||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
|
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
|
||||||
//nfapi_nr_dl_tti_pdcch_pdu_rel15_t temp;
|
|
||||||
// if(NFAPI_MODE == NFAPI_MODE_VNF){
|
|
||||||
// memcpy(temp,gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid],sizeof(nfapi_nr_dl_tti_pdcch_pdu_rel15_t));
|
|
||||||
// pdcch_pdu = temp;
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!pdcch_pdu) {
|
if (!pdcch_pdu) {
|
||||||
printf("creating pdcch pdu, pdcch_pdu = NULL. \n");
|
|
||||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||||
memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||||
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
|
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
|
||||||
@@ -902,14 +894,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
pdsch_pdu->mcsTable[0] = ps->mcsTableIdx;
|
pdsch_pdu->mcsTable[0] = ps->mcsTableIdx;
|
||||||
AssertFatal(harq->round<4,"%d",harq->round);
|
AssertFatal(harq->round<4,"%d",harq->round);
|
||||||
pdsch_pdu->rvIndex[0] = nr_rv_round_map[harq->round];
|
pdsch_pdu->rvIndex[0] = nr_rv_round_map[harq->round];
|
||||||
// if (NFAPI_MODE == NFAPI_MODE_VNF){ // done since uplink isnt operational yet which means harq structures dont get filled properly
|
|
||||||
// pdsch_pdu->rvIndex[0] = nr_rv_round_map[harq_rounds];
|
|
||||||
// if (harq_rounds % 5 == 0 && harq_rounds!=0){
|
|
||||||
// harq_rounds = 0;
|
|
||||||
// harq_pid = (harq_pid + 1) % 16;
|
|
||||||
// }
|
|
||||||
// harq_rounds++;
|
|
||||||
// }
|
|
||||||
pdsch_pdu->TBSize[0] = TBS;
|
pdsch_pdu->TBSize[0] = TBS;
|
||||||
|
|
||||||
pdsch_pdu->dataScramblingId = *scc->physCellId;
|
pdsch_pdu->dataScramblingId = *scc->physCellId;
|
||||||
@@ -1018,10 +1002,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
const int dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
|
const int dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
|
||||||
const int rnti_type = NR_RNTI_C;
|
const int rnti_type = NR_RNTI_C;
|
||||||
|
|
||||||
// if (NFAPI_MODE == NFAPI_MODE_VNF){
|
|
||||||
// dci_payload.harq_pid = harq_pid;
|
|
||||||
// dci_payload.tpc = 2;
|
|
||||||
// }
|
|
||||||
fill_dci_pdu_rel15(scc,
|
fill_dci_pdu_rel15(scc,
|
||||||
UE_info->secondaryCellGroup[UE_id],
|
UE_info->secondaryCellGroup[UE_id],
|
||||||
dci_pdu,
|
dci_pdu,
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
#include "common/ran_context.h"
|
#include "common/ran_context.h"
|
||||||
|
|
||||||
extern RAN_CONTEXT_t RC;
|
extern RAN_CONTEXT_t RC;
|
||||||
uint8_t count = 0; uint8_t harq_pid_ul = -1; int flag = 0;
|
|
||||||
|
|
||||||
// Note the 2 scs values in the table names represent resp. scs_common and pdcch_scs
|
// Note the 2 scs values in the table names represent resp. scs_common and pdcch_scs
|
||||||
/// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config)
|
/// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config)
|
||||||
@@ -1365,11 +1364,6 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
|||||||
case NR_UL_DCI_FORMAT_0_1:
|
case NR_UL_DCI_FORMAT_0_1:
|
||||||
switch (rnti_type) {
|
switch (rnti_type) {
|
||||||
case NR_RNTI_C:
|
case NR_RNTI_C:
|
||||||
harq_pid_ul = (harq_pid_ul + 1) % 16;
|
|
||||||
if (harq_pid_ul == 0)
|
|
||||||
flag = !flag;
|
|
||||||
dci_pdu_rel15->ndi = flag;
|
|
||||||
|
|
||||||
// Indicating a DL DCI format 1bit
|
// Indicating a DL DCI format 1bit
|
||||||
pos = 1;
|
pos = 1;
|
||||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
||||||
@@ -1402,7 +1396,6 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
|||||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->rv & 0x3) << (dci_size - pos);
|
*dci_pdu |= ((uint64_t)dci_pdu_rel15->rv & 0x3) << (dci_size - pos);
|
||||||
// HARQ process number 4bit
|
// HARQ process number 4bit
|
||||||
pos += 4;
|
pos += 4;
|
||||||
dci_pdu_rel15->harq_pid = harq_pid_ul;
|
|
||||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->harq_pid & 0xf) << (dci_size - pos);
|
*dci_pdu |= ((uint64_t)dci_pdu_rel15->harq_pid & 0xf) << (dci_size - pos);
|
||||||
// 1st Downlink assignment index
|
// 1st Downlink assignment index
|
||||||
pos += dci_pdu_rel15->dai[0].nbits;
|
pos += dci_pdu_rel15->dai[0].nbits;
|
||||||
@@ -1816,7 +1809,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
|
|||||||
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig->pdsch_ServingCellConfig->choice.setup;
|
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig->pdsch_ServingCellConfig->choice.setup;
|
||||||
const int nrofHARQ = pdsch->nrofHARQ_ProcessesForPDSCH ?
|
const int nrofHARQ = pdsch->nrofHARQ_ProcessesForPDSCH ?
|
||||||
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
||||||
printf("nrofHARQ = %d\n", nrofHARQ);
|
|
||||||
// add all available DL HARQ processes for this UE
|
// add all available DL HARQ processes for this UE
|
||||||
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||||
for (int harq = 0; harq < nrofHARQ; harq++)
|
for (int harq = 0; harq < nrofHARQ; harq++)
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
|
|||||||
|
|
||||||
nfapi_nr_ul_tti_request_t *future_ul_tti_req =
|
nfapi_nr_ul_tti_request_t *future_ul_tti_req =
|
||||||
&RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot];
|
&RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot];
|
||||||
|
if (NFAPI_MODE == NFAPI_MODE_VNF){
|
||||||
|
future_ul_tti_req->SFN = pucch->frame;
|
||||||
|
future_ul_tti_req->Slot = pucch->ul_slot;
|
||||||
|
}
|
||||||
|
|
||||||
AssertFatal(future_ul_tti_req->SFN == pucch->frame
|
AssertFatal(future_ul_tti_req->SFN == pucch->frame
|
||||||
&& future_ul_tti_req->Slot == pucch->ul_slot,
|
&& future_ul_tti_req->Slot == pucch->ul_slot,
|
||||||
"future UL_tti_req's frame.slot %d.%d does not match PUCCH %d.%d\n",
|
"future UL_tti_req's frame.slot %d.%d does not match PUCCH %d.%d\n",
|
||||||
@@ -507,9 +512,10 @@ void nr_csi_meas_reporting(int Mod_idP,
|
|||||||
|
|
||||||
// find free PUCCH that is in order with possibly existing PUCCH
|
// find free PUCCH that is in order with possibly existing PUCCH
|
||||||
// schedulings (other CSI, SR)
|
// schedulings (other CSI, SR)
|
||||||
NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[2];
|
NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[1];
|
||||||
if(NFAPI_MODE == NFAPI_MODE_VNF)
|
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||||
curr_pucch->csi_bits = 0;
|
curr_pucch->csi_bits = 0; curr_pucch->sr_flag = 0; curr_pucch->dai_c = 0;
|
||||||
|
}
|
||||||
AssertFatal(curr_pucch->csi_bits == 0
|
AssertFatal(curr_pucch->csi_bits == 0
|
||||||
&& !curr_pucch->sr_flag
|
&& !curr_pucch->sr_flag
|
||||||
&& curr_pucch->dai_c == 0,
|
&& curr_pucch->dai_c == 0,
|
||||||
@@ -1000,63 +1006,51 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
|
|||||||
frame_t frame,
|
frame_t frame,
|
||||||
sub_frame_t slot,
|
sub_frame_t slot,
|
||||||
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_01)
|
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_01)
|
||||||
{ NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
{
|
||||||
UE_info->active[0] = 1;
|
|
||||||
UE_info->rnti[0] = uci_01->rnti;
|
|
||||||
int UE_id = find_nr_UE_id(mod_id, uci_01->rnti);
|
int UE_id = find_nr_UE_id(mod_id, uci_01->rnti);
|
||||||
if (UE_id < 0) {
|
if (UE_id < 0) {
|
||||||
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_01->rnti);
|
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_01->rnti);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
||||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||||
|
|
||||||
// tpc (power control)
|
if (((uci_01->pduBitmap >> 1) & 0x01)) {
|
||||||
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10,
|
// iterate over received harq bits
|
||||||
uci_01->ul_cqi,
|
for (int harq_bit = 0; harq_bit < uci_01->harq->num_harq; harq_bit++) {
|
||||||
30);
|
const uint8_t harq_value = uci_01->harq->harq_list[harq_bit].harq_value;
|
||||||
|
const uint8_t harq_confidence = uci_01->harq->harq_confidence_level;
|
||||||
|
NR_UE_harq_t *harq = find_harq(mod_id, frame, slot, UE_id);
|
||||||
|
if (!harq)
|
||||||
|
break;
|
||||||
|
DevAssert(harq->is_waiting);
|
||||||
|
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
|
||||||
|
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
||||||
|
handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
|
// check scheduling request result, confidence_level == 0 is good
|
||||||
// const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
if (uci_01->pduBitmap & 0x1 && uci_01->sr->sr_indication && uci_01->sr->sr_confidence_level == 0 && uci_01->ul_cqi >= 148) {
|
||||||
const int num_slots = 20;
|
// SR detected with SNR >= 10dB
|
||||||
|
sched_ctrl->SR |= true;
|
||||||
// if (((uci_01->pduBitmap >> 1) & 0x01)) {
|
LOG_D(MAC, "SR UE %04x ul_cqi %d\n", uci_01->rnti, uci_01->ul_cqi);
|
||||||
// // iterate over received harq bits
|
}
|
||||||
// for (int harq_bit = 0; harq_bit < uci_01->harq->num_harq; harq_bit++) {
|
|
||||||
// const uint8_t harq_value = uci_01->harq->harq_list[harq_bit].harq_value;
|
// tpc (power control) only if we received AckNack or positive SR. For a
|
||||||
// const uint8_t harq_confidence = uci_01->harq->harq_confidence_level;
|
// negative SR, the UE won't have sent anything, and the SNR is not valid
|
||||||
// const int feedback_slot = (slot - 1 + num_slots) % num_slots;
|
if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) {
|
||||||
// /* In case of realtime problems: we can only identify a HARQ process by
|
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30);
|
||||||
// * timing. If the HARQ process's feedback_slot is not the one we
|
sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640;
|
||||||
// * expected, we assume that processing has been aborted and we need to
|
}
|
||||||
// * skip this HARQ process, which is what happens in the loop below. If
|
|
||||||
// * you don't experience real-time problems, you might simply revert the
|
|
||||||
// * commit that introduced these changes. */
|
|
||||||
// int8_t pid = sched_ctrl->feedback_dl_harq.head;
|
|
||||||
// DevAssert(pid >= 0);
|
|
||||||
// while (sched_ctrl->harq_processes[pid].feedback_slot != feedback_slot) {
|
|
||||||
// LOG_W(MAC,
|
|
||||||
// "expected feedback slot %d, but found %d instead\n",
|
|
||||||
// sched_ctrl->harq_processes[pid].feedback_slot,
|
|
||||||
// feedback_slot);
|
|
||||||
// remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
|
||||||
// handle_dl_harq(mod_id, UE_id, pid, 0);
|
|
||||||
// pid = sched_ctrl->feedback_dl_harq.head;
|
|
||||||
// DevAssert(pid >= 0);
|
|
||||||
// }
|
|
||||||
// remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
|
||||||
// NR_UE_harq_t *harq = &sched_ctrl->harq_processes[pid];
|
|
||||||
// DevAssert(harq->is_waiting);
|
|
||||||
// handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||||
frame_t frame,
|
frame_t frame,
|
||||||
sub_frame_t slot,
|
sub_frame_t slot,
|
||||||
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234)
|
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234)
|
||||||
{ int UE_id = find_nr_UE_id(mod_id, uci_234->rnti);
|
{
|
||||||
|
int UE_id = find_nr_UE_id(mod_id, uci_234->rnti);
|
||||||
if (UE_id < 0) {
|
if (UE_id < 0) {
|
||||||
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_234->rnti);
|
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_234->rnti);
|
||||||
return;
|
return;
|
||||||
@@ -1064,57 +1058,25 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
|||||||
NR_CSI_MeasConfig_t *csi_MeasConfig = RC.nrmac[mod_id]->UE_info.secondaryCellGroup[UE_id]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
NR_CSI_MeasConfig_t *csi_MeasConfig = RC.nrmac[mod_id]->UE_info.secondaryCellGroup[UE_id]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||||
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
||||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||||
if (NFAPI_MODE == NFAPI_MODE_PNF){
|
|
||||||
UE_info->active[0] = 1;
|
|
||||||
UE_info->rnti[0] = uci_234->rnti;
|
|
||||||
}
|
|
||||||
|
|
||||||
// tpc (power control)
|
// tpc (power control)
|
||||||
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10,
|
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10,
|
||||||
uci_234->ul_cqi,
|
uci_234->ul_cqi,
|
||||||
30);
|
30);
|
||||||
sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640;
|
sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640;
|
||||||
|
|
||||||
// NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
|
if ((uci_234->pduBitmap >> 1) & 0x01) {
|
||||||
// const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
// iterate over received harq bits
|
||||||
const int num_slots = 20;
|
for (int harq_bit = 0; harq_bit < uci_234->harq.harq_bit_len; harq_bit++) {
|
||||||
// if ((uci_234->pduBitmap >> 1) & 0x01) {
|
const int acknack = ((uci_234->harq.harq_payload[harq_bit >> 3]) >> harq_bit) & 0x01;
|
||||||
// // iterate over received harq bits
|
NR_UE_harq_t *harq = find_harq(mod_id, frame, slot, UE_id);
|
||||||
// for (int harq_bit = 0; harq_bit < uci_234->harq.harq_bit_len; harq_bit++) {
|
if (!harq)
|
||||||
// const int acknack = ((uci_234->harq.harq_payload[harq_bit >> 3]) >> harq_bit) & 0x01;
|
break;
|
||||||
// const int feedback_slot = (slot - 1 + num_slots) % num_slots;
|
DevAssert(harq->is_waiting);
|
||||||
// /* In case of realtime problems: we can only identify a HARQ process by
|
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
|
||||||
// * timing. If the HARQ process's feedback_slot is not the one we
|
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
||||||
// * expected, we assume that processing has been aborted and we need to
|
handle_dl_harq(mod_id, UE_id, pid, uci_234->harq.harq_crc != 1 && acknack);
|
||||||
// * skip this HARQ process, which is what happens in the loop below. If
|
}
|
||||||
// * you don't experience real-time problems, you might simply revert the
|
|
||||||
// * commit that introduced these changes. */
|
|
||||||
// int8_t pid = sched_ctrl->feedback_dl_harq.head;
|
|
||||||
// DevAssert(pid >= 0);
|
|
||||||
// while (sched_ctrl->harq_processes[pid].feedback_slot != feedback_slot) {
|
|
||||||
// LOG_W(MAC,
|
|
||||||
// "expected feedback slot %d, but found %d instead\n",
|
|
||||||
// sched_ctrl->harq_processes[pid].feedback_slot,
|
|
||||||
// feedback_slot);
|
|
||||||
// remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
|
||||||
// handle_dl_harq(mod_id, UE_id, pid, 0);
|
|
||||||
// pid = sched_ctrl->feedback_dl_harq.head;
|
|
||||||
// DevAssert(pid >= 0);
|
|
||||||
// }
|
|
||||||
// remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
|
||||||
// NR_UE_harq_t *harq = &sched_ctrl->harq_processes[pid];
|
|
||||||
// DevAssert(harq->is_waiting);
|
|
||||||
// handle_dl_harq(mod_id, UE_id, pid, uci_234->harq.harq_crc != 1 && acknack);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if ((uci_234->pduBitmap >> 2) & 0x01) {
|
|
||||||
//API to parse the csi report and store it into sched_ctrl
|
|
||||||
extract_pucch_csi_report (csi_MeasConfig, uci_234, frame, slot, UE_id, mod_id);
|
|
||||||
//TCI handling function
|
|
||||||
tci_handling(mod_id, UE_id,frame, slot);
|
|
||||||
}
|
|
||||||
if ((uci_234->pduBitmap >> 3) & 0x01) {
|
|
||||||
//@TODO:Handle CSI Report 2
|
|
||||||
}
|
}
|
||||||
if ((uci_234->pduBitmap >> 2) & 0x01) {
|
if ((uci_234->pduBitmap >> 2) & 0x01) {
|
||||||
//API to parse the csi report and store it into sched_ctrl
|
//API to parse the csi report and store it into sched_ctrl
|
||||||
@@ -1127,7 +1089,6 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// function to update pucch scheduling parameters in UE list when a USS DL is scheduled
|
// function to update pucch scheduling parameters in UE list when a USS DL is scheduled
|
||||||
// this function returns an index to NR_sched_pucch structure
|
// this function returns an index to NR_sched_pucch structure
|
||||||
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
|
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
|
||||||
@@ -1197,7 +1158,6 @@ int nr_acknack_scheduling(int mod_id,
|
|||||||
nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id);
|
nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id);
|
||||||
memset(csi_pucch, 0, sizeof(*csi_pucch));
|
memset(csi_pucch, 0, sizeof(*csi_pucch));
|
||||||
pucch->frame = s >= n_slots_frame - 2 ? (f + 1) % 1024 : f;
|
pucch->frame = s >= n_slots_frame - 2 ? (f + 1) % 1024 : f;
|
||||||
printf("pucch frame filled. \n");
|
|
||||||
pucch->ul_slot = (s + 2) % n_slots_frame;
|
pucch->ul_slot = (s + 2) % n_slots_frame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1205,6 +1165,7 @@ int nr_acknack_scheduling(int mod_id,
|
|||||||
/* if the UE's next PUCCH occasion is after the possible UL slots (within the
|
/* if the UE's next PUCCH occasion is after the possible UL slots (within the
|
||||||
* same frame) or wrapped around to the next frame, then we assume there is
|
* same frame) or wrapped around to the next frame, then we assume there is
|
||||||
* no possible PUCCH allocation anymore */
|
* no possible PUCCH allocation anymore */
|
||||||
|
if(NFAPI_MODE == NFAPI_MONOLITHIC)
|
||||||
if ((pucch->frame == frame
|
if ((pucch->frame == frame
|
||||||
&& (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots))
|
&& (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots))
|
||||||
|| (pucch->frame == frame + 1))
|
|| (pucch->frame == frame + 1))
|
||||||
@@ -1216,6 +1177,8 @@ int nr_acknack_scheduling(int mod_id,
|
|||||||
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
|
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
|
||||||
|
|
||||||
/* there is a HARQ. Check whether we can use it for this ACKNACK */
|
/* there is a HARQ. Check whether we can use it for this ACKNACK */
|
||||||
|
if(NFAPI_MODE == NFAPI_MODE_VNF)
|
||||||
|
return 0;
|
||||||
if (pucch->dai_c > 0) {
|
if (pucch->dai_c > 0) {
|
||||||
/* this UE already has a PUCCH occasion */
|
/* this UE already has a PUCCH occasion */
|
||||||
DevAssert(pucch->frame == frame);
|
DevAssert(pucch->frame == frame);
|
||||||
|
|||||||
@@ -105,10 +105,6 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UL_info->uci_ind.num_ucis = 0;
|
UL_info->uci_ind.num_ucis = 0;
|
||||||
// if(NFAPI_MODE != NFAPI_MODE_PNF)
|
|
||||||
// // mark corresponding PUCCH resources as free
|
|
||||||
// // NOTE: we just assume it is BWP ID 1, to be revised for multiple BWPs
|
|
||||||
// RC.nrmac[mod_id]->pucch_index_used[1][slot] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -139,18 +135,18 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
|
|||||||
crc->tb_crc_status);
|
crc->tb_crc_status);
|
||||||
|
|
||||||
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
||||||
//Gokul
|
|
||||||
// nr_rx_sdu(UL_info->module_id,
|
nr_rx_sdu(UL_info->module_id,
|
||||||
// UL_info->CC_id,
|
UL_info->CC_id,
|
||||||
// UL_info->rx_ind.sfn,
|
UL_info->rx_ind.sfn,
|
||||||
// UL_info->rx_ind.slot,
|
UL_info->rx_ind.slot,
|
||||||
// rx->rnti,
|
rx->rnti,
|
||||||
// crc->tb_crc_status ? NULL : rx->pdu,
|
crc->tb_crc_status ? NULL : rx->pdu,
|
||||||
// rx->pdu_length,
|
rx->pdu_length,
|
||||||
// rx->timing_advance,
|
rx->timing_advance,
|
||||||
// rx->ul_cqi,
|
rx->ul_cqi,
|
||||||
// rx->rssi);
|
rx->rssi);
|
||||||
//handle_nr_ul_harq(UL_info->module_id, UL_info->frame, UL_info->slot, crc);
|
handle_nr_ul_harq(UL_info->module_id, UL_info->frame, UL_info->slot, crc);
|
||||||
break;
|
break;
|
||||||
} // for (j=0;j<UL_info->crc_ind.number_crcs;j++)
|
} // for (j=0;j<UL_info->crc_ind.number_crcs;j++)
|
||||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
||||||
@@ -173,7 +169,6 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||||
//printf("Inside NR UL Indication. \n");
|
|
||||||
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
||||||
#ifdef DUMP_FAPI
|
#ifdef DUMP_FAPI
|
||||||
dump_ul(UL_info);
|
dump_ul(UL_info);
|
||||||
@@ -183,7 +178,6 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
|||||||
NR_Sched_Rsp_t *sched_info = &NR_Sched_INFO[module_id][CC_id];
|
NR_Sched_Rsp_t *sched_info = &NR_Sched_INFO[module_id][CC_id];
|
||||||
NR_IF_Module_t *ifi = nr_if_inst[module_id];
|
NR_IF_Module_t *ifi = nr_if_inst[module_id];
|
||||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||||
nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id];
|
|
||||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rach_pdus:%d rx_ind:%d crcs:%d]\n",
|
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rach_pdus:%d rx_ind:%d crcs:%d]\n",
|
||||||
UL_info->frame,UL_info->slot,
|
UL_info->frame,UL_info->slot,
|
||||||
module_id,CC_id, UL_info->rach_ind.number_of_pdus,
|
module_id,CC_id, UL_info->rach_ind.number_of_pdus,
|
||||||
@@ -216,7 +210,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
|||||||
(UL_info->frame+((UL_info->slot>(9-sl_ahead))?1:0)) % 1024,
|
(UL_info->frame+((UL_info->slot>(9-sl_ahead))?1:0)) % 1024,
|
||||||
(UL_info->slot+sl_ahead)%10);
|
(UL_info->slot+sl_ahead)%10);
|
||||||
*/
|
*/
|
||||||
|
nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id];
|
||||||
int spf = get_spf(cfg);
|
int spf = get_spf(cfg);
|
||||||
gNB_dlsch_ulsch_scheduler(module_id,
|
gNB_dlsch_ulsch_scheduler(module_id,
|
||||||
(UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024,
|
(UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024,
|
||||||
@@ -245,7 +239,10 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
|||||||
ifi->NR_Schedule_response(sched_info);
|
ifi->NR_Schedule_response(sched_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",
|
||||||
|
sched_info->frame,
|
||||||
|
sched_info->slot,
|
||||||
|
sched_info->DL_req->dl_tti_request_body.nPDUs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1144,7 +1144,7 @@ extern "C" {
|
|||||||
|
|
||||||
case 46080000:
|
case 46080000:
|
||||||
//openair0_cfg[0].samples_per_packet = 2048;
|
//openair0_cfg[0].samples_per_packet = 2048;
|
||||||
openair0_cfg[0].tx_sample_advance = 65;
|
openair0_cfg[0].tx_sample_advance = 15;
|
||||||
openair0_cfg[0].tx_bw = 40e6;
|
openair0_cfg[0].tx_bw = 40e6;
|
||||||
openair0_cfg[0].rx_bw = 40e6;
|
openair0_cfg[0].rx_bw = 40e6;
|
||||||
break;
|
break;
|
||||||
@@ -1159,7 +1159,7 @@ extern "C" {
|
|||||||
|
|
||||||
case 15360000:
|
case 15360000:
|
||||||
//openair0_cfg[0].samples_per_packet = 2048;
|
//openair0_cfg[0].samples_per_packet = 2048;
|
||||||
openair0_cfg[0].tx_sample_advance = 40;
|
openair0_cfg[0].tx_sample_advance = 45;
|
||||||
openair0_cfg[0].tx_bw = 10e6;
|
openair0_cfg[0].tx_bw = 10e6;
|
||||||
openair0_cfg[0].rx_bw = 10e6;
|
openair0_cfg[0].rx_bw = 10e6;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user