git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5969 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
sh /opt/XIO2000/xio_script.sh
|
||||
cd ../USERSPACE_TOOLS/OPENAIR_RF
|
||||
./openair_rf_cbmimo1_lte 0 4 1
|
||||
rmmod -f openair_rf
|
||||
cd ../..
|
||||
make install_cbmimo1_softmodem_lte_emos_l2
|
||||
cd LAUNCH_SCRIPTS
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
echo "start setting up eNB interface"
|
||||
|
||||
cd $OPENAIR2_DIR
|
||||
sudo rmmod nasmesh
|
||||
#make nasmesh_netlink_address_fix.ko
|
||||
#make nasmesh_netlink.ko
|
||||
#make nasmesh.ko
|
||||
#make rb_tool
|
||||
#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
|
||||
cd -
|
||||
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 3
|
||||
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 11
|
||||
|
||||
echo "end setting up NAS interface"
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
echo "setting up UE NAS interface"
|
||||
|
||||
cd $OPENAIR2_DIR
|
||||
sudo rmmod nasmesh
|
||||
#make nasmesh_netlink_address_fix.ko
|
||||
#make nasmesh_netlink.ko
|
||||
#make nasmesh.ko
|
||||
#make rb_tool
|
||||
#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
|
||||
cd -
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
sudo ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 3
|
||||
|
||||
echo "end setting up NAS interface"
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
echo "setting up UE NAS interface"
|
||||
|
||||
cd $OPENAIR2_DIR
|
||||
sudo rmmod nasmesh
|
||||
#make nasmesh_netlink_address_fix.ko
|
||||
#make nasmesh_netlink.ko
|
||||
#make nasmesh.ko
|
||||
#make rb_tool
|
||||
#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
|
||||
cd -
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
sudo ifconfig oai0 10.0.1.3 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.3 -t 10.0.1.1 -r 3
|
||||
|
||||
echo "end setting up NAS interface"
|
||||
@@ -1,13 +0,0 @@
|
||||
sudo sh $OPENAIR1_DIR/xio_script.sh
|
||||
sh stop_rf.sh
|
||||
sh start_rf.sh
|
||||
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1 # dump Config
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 110 110 100 100 #Set TX gains
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 2 26 100 #Card v2_10 synched to v2_19
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #SET RX RF Mode
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 32 1 #Set DLSCH Transmission Mod
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 1 0 0 #Start Primary Clusterhead
|
||||
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/SCOPE/lte_scope_ul 0 0 &
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/SCOPE/lte_scope_ul 0 1 &
|
||||
@@ -1,10 +0,0 @@
|
||||
sudo sh $OPENAIR1_DIR/xio_script.sh
|
||||
sh stop_rf.sh
|
||||
sh start_rf.sh
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 1 1
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 110 110 100 100
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 2 26 100 #Card v2_10 synched to v2_19
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 32 2
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 1 1 0
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
cd USERSPACE_TOOLS/OPENAIR_RF
|
||||
./openair_rf_cbmimo1_lte 0 4 1
|
||||
rmmod -f openair_rf
|
||||
cd ../..
|
||||
make install_cbmimo1_softmodem_lte_emos_l2
|
||||
cd USERSPACE_TOOLS/OPENAIR_RF
|
||||
./openair_rf_cbmimo1_lte 0 0 1 1
|
||||
./openair_rf_cbmimo1_lte 0 6 137 137 140 140
|
||||
./openair_rf_cbmimo1_lte 0 14 2
|
||||
./openair_rf_cbmimo1_lte 0 32 6
|
||||
source /opt/XIO2000/xio_script.sh
|
||||
./openair_rf_cbmimo1_lte 0 1 1 0
|
||||
cd ../..
|
||||
@@ -1,10 +0,0 @@
|
||||
gpsd /dev/ttyUSB0
|
||||
cd USERSPACE_TOOLS/OPENAIR_RF
|
||||
|
||||
./openair_rf_cbmimo1_lte 0 4 1
|
||||
rmmod -f openair_rf
|
||||
cd ../..
|
||||
make install_cbmimo1_softmodem_lte_emos_l2
|
||||
cd EMOS/LTE/GUI
|
||||
./emos_gui &
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
sudo insmod $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_msg_kern.ko
|
||||
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko
|
||||
@@ -1,13 +0,0 @@
|
||||
sh $OPENAIR1_DIR/xio_script.sh
|
||||
cd ../USERSPACE_TOOLS/OPENAIR_RF
|
||||
./openair_rf_cbmimo1_lte 0 4 1
|
||||
rmmod -f openair_rf
|
||||
cd ../..
|
||||
make install_cbmimo1_softmodem
|
||||
cd USERSPACE_TOOLS/OPENAIR_RF
|
||||
./openair_rf_cbmimo1_lte 0 0 1 1
|
||||
./openair_rf_cbmimo1_lte 0 26 100
|
||||
./openair_rf_cbmimo1_lte 0 6 150 150 140 140
|
||||
./openair_rf_cbmimo1_lte 0 14 0
|
||||
./openair_rf_cbmimo1_lte 0 8 1
|
||||
cd ../../LAUNCH_SCRIPTS
|
||||
@@ -1,18 +0,0 @@
|
||||
sudo sh $OPENAIR1_DIR/xio_script.sh
|
||||
sh stop_rf.sh
|
||||
sh start_rf.sh
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1 # dump config
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 100 100 100 100 #Set TX gains
|
||||
#./openair_rf_cbmimo1_lte 0 25 0
|
||||
#./openair_rf_cbmimo1_lte 0 15 101 # Card v15 synched to card v38
|
||||
#./openair_rf_cbmimo1_lte 0 15 117 # Card v15 synched to card v5
|
||||
#./openair_rf_cbmimo1_lte 0 15 135 # Card v37 synched to card v5
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 89 # Card v42 synched to card v43
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 85 # Card v47 synched to card v43
|
||||
#./openair_rf_cbmimo1_lte 0 26 400
|
||||
#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 103 # Card v47 synched to card v42
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 110 # Card v42 synched to card v47
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #RF mode 0 = mixer low gain, lna off
|
||||
#./openair_rf_cbmimo1_lte 0 14 1 #RF mode 1 = mixer low gain, lna on
|
||||
#./openair_rf_cbmimo1_lte 0 14 2 #RF mode 2 = mixer high gain, lna on
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 3 1 0 #Start Node - param 0/1
|
||||
@@ -1,14 +0,0 @@
|
||||
sudo sh $OPENAIR1_DIR/xio_script.sh
|
||||
sh stop_rf.sh
|
||||
sh start_rf.sh
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 100 100 100 100
|
||||
#./openair_rf_cbmimo1_lte 0 25 0
|
||||
#./openair_rf_cbmimo1_lte 0 15 101 # Card v15 synched to card v38
|
||||
#./openair_rf_cbmimo1_lte 0 15 117 # Card v15 synched to card v5
|
||||
#./openair_rf_cbmimo1_lte 0 15 135 # Card v37 synched to card v5
|
||||
#./openair_rf_cbmimo1_lte 0 26 400
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #RF mode 0 = mixer low gain, lna off
|
||||
#./openair_rf_cbmimo1_lte 0 14 1 #RF mode 1 = mixer low gain, lna on
|
||||
#./openair_rf_cbmimo1_lte 0 14 2 #RF mode 2 = mixer high gain, lna on
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 3 1 1
|
||||
@@ -1,7 +0,0 @@
|
||||
killall lte_scope
|
||||
killall lte_scope_ul
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 4 1
|
||||
sudo rmmod -f nasmesh
|
||||
sudo rmmod -f openair_rf
|
||||
sudo rmmod -f asn1_msg_kern
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
# command line flags are automatically exported and thus passed down to any sub-make.
|
||||
# here we set the default flags in case on command line flags are provided
|
||||
# these flags have to be explicitely exported so that the sub-make is aware of them
|
||||
|
||||
|
||||
ifndef OPENAIR_LTE
|
||||
export OPENAIR_LTE=1
|
||||
export OPENAIR_EMU=0
|
||||
endif
|
||||
|
||||
ifndef OPENAIR1
|
||||
export OPENAIR1=0
|
||||
endif
|
||||
|
||||
ifndef OPENAIR2
|
||||
export OPENAIR2=0
|
||||
endif
|
||||
|
||||
ifndef OPENAIR3
|
||||
export OPENAIR3=0
|
||||
endif
|
||||
|
||||
ifndef EMOS
|
||||
export EMOS=0
|
||||
endif
|
||||
|
||||
ifndef rrc_cellular
|
||||
export rrc_cellular = 0
|
||||
export rrc_cellular_eNB = 0
|
||||
export rrc_cellular_UE = 0
|
||||
else
|
||||
export rrc_cellular = 1
|
||||
ifeq ($(eNB_flag),1)
|
||||
export rrc_cellular_eNB=1
|
||||
endif
|
||||
ifeq ($(UE_flag),1)
|
||||
export rrc_cellular_UE=1
|
||||
endif
|
||||
endif
|
||||
|
||||
all: openair_rf_cbmimo1_softmodem.ko asn1_msg_kern.ko nasmesh.ko rb_tool openair_rf scope
|
||||
|
||||
openair_rf_cbmimo1_softmodem.ko:
|
||||
(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C /usr/src/linux V=1 M=`pwd` RTAI=1 CBMIMO1=1 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
|
||||
|
||||
oai_user_cbmimo1.ko:
|
||||
(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C /usr/src/linux V=1 M=`pwd` RTAI=1 CBMIMO1=1 BIT8_TX=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
|
||||
|
||||
oai_user_exmimo.ko:
|
||||
(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C /usr/src/linux V=1 M=`pwd` RTAI=1 CBMIMO1=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
|
||||
|
||||
asn1_msg_kern.ko:
|
||||
(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) -C /usr/src/linux V=0 M=`pwd` RTAI=1 -j2 && mv asn1_msg_kern.ko $(CURDIR)/asn1_msg_kern.ko)
|
||||
|
||||
nasmesh.ko:
|
||||
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH && $(MAKE) V=1 -C /usr/src/linux M=`pwd` && mv nasmesh.ko $(CURDIR)/nasmesh.ko)
|
||||
|
||||
rb_tool:
|
||||
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
|
||||
|
||||
openair_rf:
|
||||
(cd $(OPENAIR1_DIR)/USERSPACE_TOOLS/OPENAIR_RF && $(MAKE) clean CBMIMO1=1 && $(MAKE) all CBMIMO1=1 && $(MAKE) clean CBMIMO1=1)
|
||||
|
||||
scope:
|
||||
(cd $(OPENAIR1_DIR)/USERSPACE_TOOLS/SCOPE && $(MAKE) clean && $(MAKE) all && $(MAKE) clean )
|
||||
|
||||
#Remove all but source files
|
||||
cleanall:
|
||||
(cd $(OPENAIR1_DIR) && $(MAKE) cleanall)
|
||||
(cd $(OPENAIR2_DIR) && $(MAKE) cleanall)
|
||||
|
||||
fifos:
|
||||
@for i in `seq 0 64`;\
|
||||
do \
|
||||
have_rtfX=`ls /dev/ |grep -c rtf$$i`;\
|
||||
if [ "$$have_rtfX" -eq 0 ] ;then \
|
||||
mknod -m 666 /dev/rtf$$i c 150 $$i; \
|
||||
fi;\
|
||||
done
|
||||
|
||||
openair0:
|
||||
mknod /dev/openair0 c 127 0
|
||||
chmod a+rw /dev/openair0
|
||||
|
||||
install_oai_user:
|
||||
make fifos
|
||||
insmod openair_rf_softmodem.ko
|
||||
|
||||
updatefw:
|
||||
$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
|
||||
|
||||
boot_exmimo:
|
||||
sudo make install_oai_user
|
||||
$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
|
||||
sleep 1
|
||||
sudo rmmod openair_rf
|
||||
sudo make install_oai_user
|
||||
|
||||
reboot_exmimo:
|
||||
$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 -b
|
||||
sudo rmmod openair_rf
|
||||
sudo make install_oai_user
|
||||
|
||||
install_softmodem:
|
||||
make fifos
|
||||
ifeq ($(OPENAIR2),1)
|
||||
insmod asn1_msg_kern.ko
|
||||
endif
|
||||
insmod openair_rf_softmodem.ko
|
||||
|
||||
remove:
|
||||
rmmod openair_rf
|
||||
ifeq ($(OPENAIR2),1)
|
||||
rmmod asn1_msg_kern
|
||||
endif
|
||||
|
||||
test:
|
||||
(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) test RTAI=1 CBMIMO1=1)
|
||||
(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) test)
|
||||
|
||||
clean:
|
||||
(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) clean RTAI=1 CBMIMO1=1)
|
||||
(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) clean)
|
||||
@@ -1,41 +0,0 @@
|
||||
sleeptest:lxrt+sem+mbx+msg+fifos:!./sleeptest;sleep 1;popall:control_c
|
||||
synctest:lxrt+sem+mbx+msg+fifos:!./synctest -V;sleep 1;popall:control_c
|
||||
condtest:lxrt+sem+mbx+msg+fifos:!sudo ./condtest;sleep 1;popall:control_c
|
||||
msg_test:lxrt+sem+mbx+msg+fifos:!sudo ./msg_test;sleep 1;popall:control_c
|
||||
msg_many:lxrt+sem+mbx+msg+fifos:!sudo ./msg_test;sleep 1;popall:control_c
|
||||
eNB:lxrt+sem+mbx+msg+fifos:!sudo ./synctest;sleep 1;popall:control_c
|
||||
eNB_test:lxrt+sem+mbx+msg+smi:!sudo ./lte-softmodem -S -F enb2tx;sleep 1;popall:control_c
|
||||
UE:lxrt+sem+mbx+msg+fifos:!sudo ./synctest -U -d -T 108;sleep 1;popall:control_c
|
||||
#UE0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907602944 -V;sleep 1;popall:control_c
|
||||
#EXMIMO2 card 1
|
||||
#UE0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600480 -V;sleep 1;popall:control_c
|
||||
UE0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600480 -V -K /tmp/itti_UE0.log;sleep 1;popall:control_c
|
||||
#EXMIMO2 card 5
|
||||
#UE0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907597240 -V;sleep 1;popall:control_c
|
||||
#EXMIMO2 card 24
|
||||
#UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907595776 -V;sleep 1;popall:control_c
|
||||
#EXMIMO2 card 5?
|
||||
UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907598252 -V;sleep 1;popall:control_c
|
||||
UE850:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 859498000 -F ex2_850;sleep 1;popall:control_c
|
||||
eNB850:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -d -C 859500000 -F ex2_850;sleep 1;popall:control_c
|
||||
UE0noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600480 --no-L2-connect;sleep 1;popall:control_c
|
||||
UE0calib:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx -70 ;sleep 1;popall:control_c
|
||||
UE0calibmed:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx-med -70 ;sleep 1;popall:control_c
|
||||
UE0calibbyp:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx-byp -70 ;sleep 1;popall:control_c
|
||||
UE0prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912606900 -F ue1 --debug-ue-prach;sleep 1;popall:control_c
|
||||
UE1:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 ;sleep 1;popall:control_c
|
||||
UE1prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 --debug-ue-prach;sleep 1;popall:control_c
|
||||
UE1noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 --no-L2-connect;sleep 1;popall:control_c
|
||||
UE2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2;sleep 1;popall:control_c
|
||||
UE2prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2 --debug-ue-prach;sleep 1;popall:control_c
|
||||
UE2noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2 --no-L2-connect;sleep 1;popall:control_c
|
||||
#eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907600000 -d -V;sleep 1;popall:control_c
|
||||
#eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907598252 -d -V;sleep 1;popall:control_c
|
||||
eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -d -O../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf -V -K /tmp/itti_eNB0.log;sleep 1;popall:control_c
|
||||
eNB1:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907600000 -F ex2_2 -d;sleep 1;popall:control_c
|
||||
eNB2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907600000 -F ue2 -d;sleep 1;popall:control_c
|
||||
dot11:lxrt+sem+mbx+msg+fifos:!sudo ./dot11 -C 1907600000 -d;sleep 1;popall:control_c
|
||||
dot11_tx_test: lxrt+sem+mbx+msg+fifos:!sudo ./dot11 -C 1907600000 -d -t;sleep 1;popall:control_c
|
||||
eNB2_750:lxrt+sem+mbx+msg+fifos:!sudo ./synctest_eNB -C 746000000 -F enb1tx_750 -d;sleep 1;popall:control_c
|
||||
eNB2_1900:lxrt+sem+mbx+msg+fifos:!sudo ./synctest_eNB -C 19076000000 -F enb1tx_1900 -d;sleep 1;popall:control_c
|
||||
emos-raw:lxrt+sem+mbx+msg+fifos:!sudo ./emos-raw -d -V;sleep 1;popall:control_c
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,395 +0,0 @@
|
||||
# Include some shared directives
|
||||
include $(OPENAIR_TARGETS)/Makerules
|
||||
|
||||
default: lte-softmodem
|
||||
all: lte-softmodem lte-enb
|
||||
|
||||
include $(OPENAIR_TARGETS)/Makefile.common
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
CFLAGS += -O2
|
||||
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
|
||||
ifdef DEBUG
|
||||
CFLAGS += -g -ggdb
|
||||
endif
|
||||
SRC = synctest.c condtest.c #lte-softmodem.c
|
||||
|
||||
ifndef RTAI
|
||||
RTAI=1
|
||||
endif
|
||||
|
||||
ifndef USRP
|
||||
USRP=0
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_RAL), 1)
|
||||
CFLAGS += -DENABLE_RAL
|
||||
endif
|
||||
|
||||
ifdef SECU
|
||||
ifeq ($(NETTLE_FOUND), 0)
|
||||
@echo "Nettle library >= 2.5 is not installed on your system, nettle-dev lib needed, continuing with security disabled"
|
||||
SECU=0
|
||||
else
|
||||
ifeq ($(OPENSSL_FOUND), 0)
|
||||
@echo "openssl library is not installed on your system, openssl lib needed, continuing with security disabled"
|
||||
SECU=0
|
||||
else
|
||||
CFLAGS += -DENABLE_SECURITY
|
||||
LIBS += $(OPENSSL_LIBS) $(NETTLE_LIBS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
CFLAGS += -DENABLE_RTAI_CLOCK
|
||||
CFLAGS += -DCONFIG_RTAI_LXRT_INLINE #remend the RTAI warning
|
||||
RTAI_OBJ = sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o rt_wrapper.o
|
||||
ifeq ($(USRP),1)
|
||||
RTAI_OBJ += lte-softmodem-usrp.o
|
||||
endif
|
||||
else #RTAI
|
||||
CFLAGS += -DENABLE_USE_CPU_EXECUTION_TIME
|
||||
OBJ += sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o rt_wrapper.o
|
||||
ifeq ($(USRP),1)
|
||||
OBJ += lte-softmodem-usrp.o
|
||||
endif
|
||||
endif
|
||||
|
||||
OBJ += $(OPENAIR1_DIR)/SIMULATION/TOOLS/taus.o $(OPENAIR_TARGETS)/SIMU/USER/init_lte.o #$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o
|
||||
|
||||
ifeq ($(USRP),1)
|
||||
include $(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/Makefile.inc
|
||||
endif
|
||||
|
||||
OBJ += $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/gain_control.o
|
||||
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
|
||||
|
||||
TOP_DIR = $(OPENAIR1_DIR)
|
||||
include $(OPENAIR1_DIR)/PHY/Makefile.inc
|
||||
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
|
||||
|
||||
OBJ += $(PHY_OBJS)
|
||||
ifeq ($(RTAI),1)
|
||||
RTAI_OBJ += $(SCHED_OBJS)
|
||||
else
|
||||
OBJ += $(SCHED_OBJS)
|
||||
endif
|
||||
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/ENB_APP/Makefile.inc
|
||||
include $(OPENAIR3_DIR)/RAL-LTE/Makefile.inc
|
||||
|
||||
OBJ += $(ENB_APP_OBJS)
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
LOG_OBJS=
|
||||
RTAI_OBJ+=$(LOG_DIR)/vcd_signal_dumper.o
|
||||
RTAI_OBJ+=$(LOG_DIR)/log.o
|
||||
endif
|
||||
|
||||
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
|
||||
|
||||
OBJ += $(LOG_OBJS)
|
||||
|
||||
ifndef OPENAIR2
|
||||
OPENAIR2=1
|
||||
endif
|
||||
ifeq ($(OPENAIR2),1)
|
||||
ASN1_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS))
|
||||
OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS) $(OSA_OBJS)
|
||||
OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
|
||||
#OBJ += $(PDCP_DIR)/pdcp_thread.o
|
||||
CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1
|
||||
endif
|
||||
|
||||
RTAI_OBJ += $(UTILS_OBJS)
|
||||
|
||||
ifdef ENABLE_ITTI
|
||||
CFLAGS += -DEXMIMO_IOT
|
||||
endif
|
||||
|
||||
ifdef MSG_PRINT
|
||||
CFLAGS += -DRRC_MSG_PRINT
|
||||
CFLAGS += -DPDCP_MSG_PRINT
|
||||
endif
|
||||
|
||||
CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl)
|
||||
|
||||
CFLAGS += -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES #-I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM
|
||||
|
||||
CFLAGS += -DNEW_FFT -DLOG_NO_THREAD
|
||||
|
||||
ifeq ($(XFORMS),1)
|
||||
CFLAGS += -DXFORMS -I/usr/include/X11
|
||||
LDFLAGS += -lforms
|
||||
OBJ += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
|
||||
OBJ += stats.o
|
||||
endif
|
||||
|
||||
OBJ_SYNC = $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o rt_wrapper.o $(OPENAIR2_DIR)/UTIL/LOG/log.o $(OPENAIR2_DIR)/UTIL/LOG/vcd_signal_dumper.o
|
||||
|
||||
ifdef SMBV
|
||||
CFLAGS += -DSMBV
|
||||
endif
|
||||
|
||||
#CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 -msse4.1
|
||||
CPUFLAGS = -mmmx -msse -msse2 -mssse3 -msse4.1
|
||||
#CFLAGS += -fno-common -mpreferred-stack-boundary=4
|
||||
CFLAGS += -Wall -fno-strict-aliasing -DPHYSIM -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -rdynamic $(CPUFLAGS) # -Wno-packed-bitfield-compat
|
||||
CFLAGS += -DOPENAIR_LTE -DENABLE_FXP -DOPENAIR1 -DDLSCH_THREAD #-DULSCH_THREAD
|
||||
|
||||
#only for CBMIMO1
|
||||
ifdef CBMIMO1
|
||||
CFLAGS += -DFW2011 -DBIT8_TX -DCBMIMO1
|
||||
else
|
||||
#only for EXPRESS MIMO
|
||||
CFLAGS += -DEXMIMO
|
||||
#CFLAGS += -DEXMIMO -DTIMING_ADVANCE_HW=138 #this is for ExpressMIMO 1
|
||||
#CFLAGS += -DEXMIMO -DTIMING_ADVANCE_HW=45 #this is for ExpressMIMO 2
|
||||
endif
|
||||
|
||||
ifeq ($(HARD_RT),1)
|
||||
CFLAGS += -DHARD_RT
|
||||
endif
|
||||
|
||||
ifeq ($(EMOS),1)
|
||||
CFLAGS += -D_FILE_OFFSET_BITS=64 -DEMOS #-DEMOS_CHANNEL
|
||||
LDFLAGS += -lgps
|
||||
endif
|
||||
|
||||
ifeq ($(NAS),1)
|
||||
CFLAGS += -DNAS_NETLINK -DLINUX
|
||||
OBJ += $(NAS_OBJS)
|
||||
endif
|
||||
|
||||
LDFLAGS += -lpthread -lm -lforms -lconfig -lrt
|
||||
ifeq ($(RTAI),1)
|
||||
RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags) -DRTAI
|
||||
LDFLAGS += $(shell rtai-config --lxrt-ldflags)
|
||||
endif
|
||||
|
||||
ifeq ($(USRP),1)
|
||||
CFLAGS += -I/opt/uhd/include -L/opt/uhd/lib -luhd -lpthread -lstdc++
|
||||
CFLAGS += -DUSRP
|
||||
endif
|
||||
#CFLAGS += -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/x86_64-linux-gnu -I/usr/include/rtai/
|
||||
|
||||
LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
|
||||
LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a
|
||||
LIBS += $(LFDS_LIB)
|
||||
SHARED_DEPENDENCIES += $(LFDS_LIB)
|
||||
|
||||
-include $(OBJ:.o=.d)
|
||||
-include $(ASN1_MSG_OBJS1:.o=.d)
|
||||
-include $(RTAI_OBJ:.o=.d)
|
||||
-include lte-softmodem.d
|
||||
-include lte-enb.d
|
||||
|
||||
$(LFDS_LIB):
|
||||
@if [ ! -d $(LFDS_OBJ_DIR)/bin ]; then mkdir -p $(LFDS_OBJ_DIR)/bin; fi;
|
||||
@if [ ! -d $(LFDS_OBJ_DIR)/obj ]; then mkdir -p $(LFDS_OBJ_DIR)/obj; fi;
|
||||
$(MAKE) -C $(LFDS_DIR) -f makefile.linux OUTDIR=$(LFDS_OBJ_DIR)
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
$(RTAI_OBJ) lte-enb.o lte-softmodem.o: %.o : %.c
|
||||
else
|
||||
$(RTAI_OBJ): %.o : %.c
|
||||
endif
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) -o $@ $<
|
||||
@$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) $< > $*.d
|
||||
@mv -f $*.d $*.d.tmp
|
||||
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
|
||||
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
|
||||
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
|
||||
@rm -f $*.d.tmp
|
||||
|
||||
ifdef ENABLE_ITTI
|
||||
$(OBJ) $(RTAI_OBJ): $(ITTI_MESSAGES_H)
|
||||
endif
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
$(OBJ) $(ASN1_MSG_OBJS1): %.o : %.c
|
||||
else
|
||||
$(OBJ) $(ASN1_MSG_OBJS1) lte-enb.o lte-softmodem.o: %.o : %.c
|
||||
endif
|
||||
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
|
||||
@$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) $< > $*.d
|
||||
@mv -f $*.d $*.d.tmp
|
||||
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
|
||||
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
|
||||
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
|
||||
@rm -f $*.d.tmp
|
||||
|
||||
OBJ_EMOS = $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/gain_control.o rt_wrapper.o $(OPENAIR2_DIR)/UTIL/LOG/log.o $(OPENAIR2_DIR)/UTIL/LOG/vcd_signal_dumper.o $(OPENAIR1_DIR)/PHY/TOOLS/signal_energy.o $(OPENAIR1_DIR)/PHY/TOOLS/dB_routines.o
|
||||
ifeq ($(XFORMS),1)
|
||||
OBJ_EMOS+=lte_scope.o
|
||||
endif
|
||||
|
||||
$(USRP_OBJ):$(USRP_FILE_OBJ)
|
||||
@echo Compiling openair_usrp.cpp
|
||||
@$(CXX) -c $(USRP_CFLAGS) $(USRP_FILE_OBJ) -o $(USRP_OBJ)
|
||||
|
||||
condtest: condtest.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) condtest.c -o condtest
|
||||
|
||||
synctest: $(OBJ_SYNC) $(SHARED_DEPENDENCIES) synctest.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) $(OBJ_SYNC) -o synctest synctest.c $(LDFLAGS) $(LIBS)
|
||||
|
||||
sleeptest: rt_wrapper.o sleeptest.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) rt_wrapper.o -o sleeptest sleeptest.c $(LDFLAGS)
|
||||
|
||||
lte-softmodem: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) lte-softmodem.o $(SHARED_DEPENDENCIES)
|
||||
@echo Linking $@
|
||||
@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) lte-softmodem.o -o lte-softmodem $(LDFLAGS) $(LIBS)
|
||||
|
||||
lte-enb: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) lte-enb.o $(SHARED_DEPENDENCIES)
|
||||
@echo Linking $@
|
||||
@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) lte-enb.o -o lte-enb $(LDFLAGS) $(LIBS)
|
||||
|
||||
lte-softmodem-usrp: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(USRP_OBJ) $(SHARED_DEPENDENCIES)
|
||||
@echo Linking $@
|
||||
@$(CC) $(USRP_OBJ) $(CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem-usrp $(LDFLAGS) $(LIBS)
|
||||
|
||||
emos-raw: $(SHARED_DEPENDENCIES) $(OBJ_EMOS) emos-raw.c
|
||||
@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) $(OBJ_EMOS) -o emos-raw emos-raw.c $(LDFLAGS) $(LIBS)
|
||||
|
||||
|
||||
synctest_eNB: synctest
|
||||
cp synctest synctest_eNB
|
||||
|
||||
synctest_UE: synctest
|
||||
cp synctest synctest_UE
|
||||
|
||||
drivers:
|
||||
cd $(OPENAIR2_DIR) && make clean && make nasmesh_netlink.ko
|
||||
cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && make clean && make
|
||||
cd $(OPENAIR_TARGETS)/ARCH/EXMIMO/DRIVER/eurecom && make clean && make
|
||||
cd $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean && make
|
||||
|
||||
run: condtest
|
||||
rtai-load condtest --verbose
|
||||
|
||||
run_eNB_test:
|
||||
rtai-load eNB_test --verbose
|
||||
|
||||
run_eNB:
|
||||
rtai-load eNB --verbose
|
||||
|
||||
run_UE:
|
||||
rtai-load UE --verbose
|
||||
|
||||
run_UE0:
|
||||
rtai-load UE0 --verbose
|
||||
|
||||
run_UE0_smbv:
|
||||
rtai-load UE0_smbv --verbose
|
||||
|
||||
run_UE850:
|
||||
rtai-load UE850 --verbose
|
||||
|
||||
run_eNB850:
|
||||
rtai-load eNB850 --verbose
|
||||
|
||||
run_UE0prach:
|
||||
rtai-load UE0prach --verbose
|
||||
|
||||
run_UE1prach:
|
||||
rtai-load UE1prach --verbose
|
||||
|
||||
run_UE2prach:
|
||||
rtai-load UE2prach --verbose
|
||||
|
||||
run_UE0noL2:
|
||||
rtai-load UE0noL2 -- verbose
|
||||
|
||||
run_UE1noL2:
|
||||
rtai-load UE1noL2 --verbose
|
||||
|
||||
run_UE2noL2:
|
||||
rtai-load UE2noL2 --verbose
|
||||
|
||||
run_UE0calib:
|
||||
rtai-load UE0calib --verbose
|
||||
|
||||
run_UE0calibmed:
|
||||
rtai-load UE0calibmed --verbose
|
||||
|
||||
run_UE0calibbyp:
|
||||
rtai-load UE0calibbyp --verbose
|
||||
|
||||
run_UE1:
|
||||
rtai-load UE1 --verbose
|
||||
|
||||
run_UE2:
|
||||
rtai-load UE2 --verbose
|
||||
|
||||
run_eNB0:
|
||||
rtai-load eNB0 --verbose
|
||||
|
||||
run_eNB1:
|
||||
rtai-load eNB1 --verbose
|
||||
|
||||
run_eNB2:
|
||||
rtai-load eNB2 --verbose
|
||||
|
||||
clean: common-clean
|
||||
@$(RM_F_V) $(OBJ) $(RTAI_OBJ) $(OBJ_EMOS) $(OBJ_SYNC)
|
||||
@$(RM_F_V) $(OBJ:.o=.d) $(RTAI_OBJ:.o=.d) $(OBJ_EMOS:.o=.d) $(OBJ_SYNC:.o=.d)
|
||||
@$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1_msg.o $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1_msg.d
|
||||
@$(RM_F_V) lte-enb.o lte-enb.d lte-softmodem.o lte-softmodem.d
|
||||
@$(RM_F_V) lte-enb.o lte-softmodem.o
|
||||
|
||||
cleanasn1:
|
||||
rm -f $(ASN1_MSG_OBJS1)
|
||||
$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ; rm -f $(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) *.o *.d )
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10
|
||||
|
||||
cleancell:
|
||||
rm -f $(OPENAIR2_DIR)/RRC/CELLULAR/*.o
|
||||
rm -f $(OPENAIR2_DIR)/RRC/CELLULAR/*.d
|
||||
rm -f $(OPENAIR2_DIR)/RRC/L2_INTERFACE/*.o
|
||||
rm -f $(OPENAIR2_DIR)/RRC/L2_INTERFACE/*.d
|
||||
rm -f $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.o
|
||||
rm -f $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.d
|
||||
|
||||
cleanalmostall: clean
|
||||
rm -f $(ASN1_MSG_OBJS1)
|
||||
rm -rf condtest synctest lte-softmodem
|
||||
rm -rf synctest_eNB synctest_UE
|
||||
|
||||
cleanall: common-cleanall clean cleanasn1
|
||||
rm -rf condtest synctest lte-softmodem lte-softmodem-usrp
|
||||
rm -rf synctest_eNB synctest_UE
|
||||
|
||||
show:
|
||||
@echo $(CFLAGS)
|
||||
@echo $(EXTRA_CFLAGS)
|
||||
@echo $(OBJ) $(RTAI_OBJ)
|
||||
@echo $(USRP_OBJ)
|
||||
@echo IS_REL8 is $(IS_REL8)
|
||||
@echo IS_REL10 is $(IS_REL10)
|
||||
@echo openssl $(OPENSSL_FOUND)
|
||||
@echo nettle $(NETTLE_FOUND)
|
||||
beautiful:
|
||||
astyle --style=gnu -s2 $(SRC)
|
||||
@@ -1,260 +0,0 @@
|
||||
include $(OPENAIR_TARGETS)/Makerules
|
||||
|
||||
include $(OPENAIR_TARGETS)/Makefile.common
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
CFLAGS += -O2
|
||||
# Debug
|
||||
CFLAGS += -g -ggdb
|
||||
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO -DEXMIMO_IOT
|
||||
|
||||
SRC = lte-enb.c
|
||||
|
||||
ifndef RTAI
|
||||
RTAI=1
|
||||
endif
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
CFLAGS += -DENABLE_RTAI_CLOCK -DRTAI
|
||||
RTAI_OBJ = sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o lte-enb.o rt_wrapper.o
|
||||
else
|
||||
OBJ = sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o lte-enb.o rt_wrapper.o
|
||||
CFLAGS += -DENABLE_USE_CPU_EXECUTION_TIME
|
||||
endif
|
||||
|
||||
OBJ += $(OPENAIR1_DIR)/SIMULATION/TOOLS/taus.o $(OPENAIR_TARGETS)/SIMU/USER/init_lte.o $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o
|
||||
|
||||
TOP_DIR = $(OPENAIR1_DIR)
|
||||
include $(OPENAIR1_DIR)/PHY/Makefile.inc
|
||||
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
|
||||
|
||||
OBJ += $(PHY_OBJS)
|
||||
ifeq ($(RTAI),1)
|
||||
RTAI_OBJ += $(SCHED_OBJS)
|
||||
else
|
||||
OBJ += $(SCHED_OBJS)
|
||||
endif
|
||||
|
||||
#ifndef rrc_cellular
|
||||
ifeq ($(rrc_cellular),0)
|
||||
rrc_cellular = 0
|
||||
rrc_cellular_eNB = 0
|
||||
rrc_cellular_UE = 0
|
||||
else
|
||||
ifeq ($(eNB_flag),1)
|
||||
rrc_cellular_eNB=1
|
||||
endif
|
||||
ifeq ($(UE_flag),1)
|
||||
rrc_cellular_UE=1
|
||||
endif
|
||||
endif
|
||||
|
||||
export rrc_cellular
|
||||
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
|
||||
|
||||
ifeq ($(RTAI),1)
|
||||
LOG_OBJS=
|
||||
RTAI_OBJ+=$(LOG_DIR)/vcd_signal_dumper.o
|
||||
RTAI_OBJ+=$(LOG_DIR)/log.o
|
||||
endif
|
||||
|
||||
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
|
||||
|
||||
OBJ += $(LOG_OBJS)
|
||||
|
||||
ifndef OPENAIR2
|
||||
OPENAIR2=1
|
||||
endif
|
||||
ifeq ($(OPENAIR2),1)
|
||||
ASN1_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS))
|
||||
OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS)
|
||||
OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
|
||||
OBJ += $(PDCP_DIR)/pdcp_thread.o
|
||||
CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1
|
||||
endif
|
||||
|
||||
CFLAGS += $(L2_incl) $(UTIL_incl) $(UTILS_incl)
|
||||
|
||||
CFLAGS += -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES #-I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM
|
||||
|
||||
CFLAGS += -DNEW_FFT -DLOG_NO_THREAD
|
||||
|
||||
ifeq ($(XFORMS),1)
|
||||
CFLAGS += -DXFORMS -I/usr/include/X11
|
||||
LDFLAGS += -lforms
|
||||
OBJ += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
|
||||
OBJ += stats.o
|
||||
endif
|
||||
|
||||
ifdef SMBV
|
||||
CFLAGS += -DSMBV
|
||||
endif
|
||||
|
||||
#CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 -msse4.1
|
||||
CPUFLAGS = -mmmx -msse -msse2 -mssse3 -msse4.1
|
||||
#CFLAGS += -fno-common -mpreferred-stack-boundary=4
|
||||
CFLAGS += -Wall -fno-strict-aliasing -DPHYSIM -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -rdynamic $(CPUFLAGS) # -Wno-packed-bitfield-compat
|
||||
CFLAGS += -DOPENAIR_LTE -DENABLE_FXP -DOPENAIR1 -DDLSCH_THREAD #-DULSCH_THREAD
|
||||
|
||||
#only for CBMIMO1
|
||||
ifdef CBMIMO1
|
||||
CFLAGS += -DFW2011 -DBIT8_TX -DCBMIMO1
|
||||
else
|
||||
#only for EXPRESS MIMO
|
||||
CFLAGS += -DEXMIMO
|
||||
#CFLAGS += -DEXMIMO -DTIMING_ADVANCE_HW=138 #this is for ExpressMIMO 1
|
||||
#CFLAGS += -DEXMIMO -DTIMING_ADVANCE_HW=45 #this is for ExpressMIMO 2
|
||||
endif
|
||||
|
||||
ifndef HARD_RT
|
||||
HARD_RT=1
|
||||
endif
|
||||
|
||||
ifeq ($(HARD_RT),1)
|
||||
CFLAGS += -DHARD_RT
|
||||
endif
|
||||
|
||||
ifeq ($(EMOS),1)
|
||||
CFLAGS += -DEMOS -DEMOS_CHANNEL
|
||||
LDFLAGS += -lgps
|
||||
endif
|
||||
|
||||
ifndef NAS
|
||||
NAS=1
|
||||
endif
|
||||
|
||||
ifeq ($(NAS),1)
|
||||
CFLAGS += -DNAS_NETLINK -DLINUX
|
||||
OBJ += $(NAS_OBJS)
|
||||
endif
|
||||
|
||||
RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags)
|
||||
CFLAGS += -I/usr/realtime/include -DRTAI
|
||||
LDFLAGS += -lpthread -lm -lforms
|
||||
ifeq ($(RTAI),1)
|
||||
LDFLAGS += $(shell rtai-config --lxrt-ldflags)
|
||||
else
|
||||
LDFLAGS += -lrt
|
||||
endif
|
||||
|
||||
#ifndef USE_MME
|
||||
# USE_MME=R8
|
||||
#endif
|
||||
|
||||
ifdef USE_MME
|
||||
include $(OPENAIR2_DIR)/S1AP/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/S1AP/MESSAGES/Makefile.inc
|
||||
CFLAGS += -DENABLE_USE_MME -DENB_MODE
|
||||
LDFLAGS += -lsctp
|
||||
CFLAGS_S1AP += -DENB_MODE -DENABLE_USE_MME -DEMIT_ASN_DEBUG=1 -DUSER_MODE
|
||||
S1AP_BUILT_OBJS += $(S1AP_OBJS) $(addprefix $(OPENAIR2_DIR)/S1AP/MESSAGES/, $(S1AP_ASN_MODULE_SOURCES))
|
||||
S1AP_BUILT_OBJS += $(OPENAIR3_DIR)/OPENAIRMME/SCTP/sctp_primitives_client.o
|
||||
endif
|
||||
|
||||
|
||||
ASN1RELDIR=R9.8
|
||||
ifeq ($(USE_MME), R8)
|
||||
ASN1RELDIR=R8.10
|
||||
else
|
||||
CFLAGS_S1AP += -DUPDATE_RELEASE_9
|
||||
endif
|
||||
S1AP_DIR=$(OPENAIR2_DIR)/S1AP
|
||||
ASN1MESSAGESDIR=$(S1AP_DIR)/MESSAGES
|
||||
ASN1DIR=$(ASN1MESSAGESDIR)/ASN1
|
||||
|
||||
all: lte-enb
|
||||
|
||||
$(LFDS_DIR)/bin/liblfds611.a:
|
||||
$(MAKE) -C $(LFDS_DIR) -f makefile.linux
|
||||
|
||||
|
||||
$(RTAI_OBJ): %.o : %.c
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) -o $@ $<
|
||||
|
||||
$(OBJ) $(ASN1_MSG_OBJS1): %.o : %.c
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
|
||||
|
||||
$(S1AP_BUILT_OBJS): %.o : %.c
|
||||
@echo Compiling $<
|
||||
@$(CC) -Wall -c $(CFLAGS_S1AP) $(S1AP_Incl) $(UTIL_incl) -o $@ $<
|
||||
|
||||
$(ASN1MESSAGESDIR)/s1ap_ieregen.stamp: $(ASN1DIR)/$(ASN1RELDIR)/S1AP-PDU-Contents.asn $(ASN1DIR)/asn1tostruct.py
|
||||
echo Timestamp > $@
|
||||
(cd $(ASN1DIR) && python $(ASN1DIR)/asn1tostruct.py -f$<)
|
||||
|
||||
$(ASN1MESSAGESDIR)/s1ap_asn1regen.stamp: $(ASN1DIR)/$(ASN1RELDIR)/S1AP-CommonDataTypes.asn $(ASN1DIR)/$(ASN1RELDIR)/S1AP-Constants.asn $(ASN1DIR)/$(ASN1RELDIR)/S1AP-IEs.asn $(ASN1DIR)/$(ASN1RELDIR)/S1AP-PDU.asn
|
||||
echo Timestamp > $@
|
||||
(cd $(ASN1MESSAGESDIR) && asn1c -gen-PER -fnative-types -fskeletons-copy $^)
|
||||
|
||||
$(S1AP_DIR)/libs1ap.a: $(ASN1MESSAGESDIR)/s1ap_ieregen.stamp $(ASN1MESSAGESDIR)/s1ap_asn1regen.stamp $(S1AP_BUILT_OBJS)
|
||||
@echo Creating $@
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
$(LFDS_DIR)/bin/liblfds611.a:
|
||||
$(MAKE) -C $(LFDS_DIR) -f makefile.linux
|
||||
|
||||
ifdef USE_MME
|
||||
lte-enb: $(OBJ) $(S1AP_DIR)/libs1ap.a $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(LFDS_DIR)/bin/liblfds611.a
|
||||
else
|
||||
lte-enb: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(LFDS_DIR)/bin/liblfds611.a
|
||||
endif
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-enb $(LDFLAGS) $(LFDS_DIR)/bin/liblfds611.a
|
||||
|
||||
|
||||
|
||||
nasmesh:
|
||||
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
|
||||
(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink.ko)
|
||||
(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
|
||||
rb_tool:
|
||||
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
|
||||
|
||||
nasmesh_install:
|
||||
(sudo rmmod nasmesh)
|
||||
(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ) $(RTAI_OBJ)
|
||||
rm -f $(S1AP_BUILT_OBJS)
|
||||
rm -f $(ASN1MESSAGESDIR)/libs1ap.a
|
||||
|
||||
cleanasn1:
|
||||
rm -f $(ASN1_MSG_OBJS1)
|
||||
$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ; rm -f $(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) *.o *.d )
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8
|
||||
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10
|
||||
|
||||
cleanall: clean cleanasn1
|
||||
rm -rf condtest synctest lte-softmodem
|
||||
rm -rf synctest_eNB synctest_UE
|
||||
|
||||
show:
|
||||
@echo $(CFLAGS)
|
||||
@echo $(EXTRA_CFLAGS)
|
||||
@echo $(OBJ) $(RTAI_OBJ)
|
||||
@echo rrc_cellular variable is $(rrc_cellular)
|
||||
@echo eNB_flag is $(eNB_flag)
|
||||
@echo UE_flag is $(UE_flag)
|
||||
@echo IS_REL8 is $(IS_REL8)
|
||||
@echo IS_REL10 is $(IS_REL10)
|
||||
|
||||
beautiful:
|
||||
astyle --style=gnu -s2 $(SRC)
|
||||
@@ -1,21 +0,0 @@
|
||||
CFLAGS = $(shell rtai-config --lxrt-cflags)
|
||||
LDFLAGS = $(shell rtai-config --lxrt-ldflags) -lpthread -llxrt -lm
|
||||
|
||||
CFLAGS += -D__IN_RTAI__ -Wall -O2 -I.
|
||||
|
||||
OBJS = msg_many.o msg_helper.o
|
||||
|
||||
all: msg_many
|
||||
|
||||
msg_many: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJS)
|
||||
|
||||
$(OBJS): msg_many.h
|
||||
|
||||
run: msg_many
|
||||
rtai-load msg_many --verbose
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f msg_many $(OBJS)
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "thread_ipc.h"
|
||||
|
||||
g_thread_ipc_t thread_ipc = {0};
|
||||
|
||||
void loop_buffer_reset(buffer_t *loop_buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BUFFERMAX; i++) {
|
||||
loop_buf[i].subframe_num = -1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void loop_buffer_init(loop_buffer_op_t *loop_buffer)
|
||||
{
|
||||
loop_buffer->packet_num = 0;
|
||||
loop_buffer->isfull = 0;
|
||||
loop_buffer->isempty = 1;
|
||||
|
||||
pthread_mutex_init(&loop_buffer->buffer_mutex, NULL);
|
||||
|
||||
pthread_cond_init(&loop_buffer->full_cond, NULL);
|
||||
pthread_cond_init(&loop_buffer->empty_cond, NULL);
|
||||
|
||||
loop_buffer_reset(loop_buffer->loop_buf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void sync_buffer_init(sync_buffer_t *sync_buffer)
|
||||
{
|
||||
sync_buffer->decoding_subframe_num = 0;
|
||||
pthread_mutex_init(&sync_buffer->buffer_mutex, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int thread_ipc_init(void)
|
||||
{
|
||||
//printf("recv %d\n", thread_ipc.sync_buffer.decoding_subframe_num);
|
||||
thread_ipc.ue_sync_state = 0;
|
||||
thread_ipc.rx_timestamp = 0;
|
||||
thread_ipc.tx_timestamp = 0;
|
||||
thread_ipc.current_subframe = 0;
|
||||
|
||||
pthread_mutex_init(&thread_ipc.dl_decode_mutex, NULL);
|
||||
pthread_mutex_lock(&thread_ipc.dl_decode_mutex);
|
||||
|
||||
pthread_mutex_init(&thread_ipc.ul_send_mutex, NULL);
|
||||
pthread_mutex_lock(&thread_ipc.ul_send_mutex);
|
||||
|
||||
pthread_mutex_init(&thread_ipc.sync_mutex, NULL);
|
||||
pthread_mutex_lock(&thread_ipc.sync_mutex);
|
||||
|
||||
loop_buffer_init(&thread_ipc.loop_buffer);
|
||||
sync_buffer_init(&thread_ipc.sync_buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int thread_ipc_deinit(void)
|
||||
{
|
||||
pthread_mutex_destroy(&thread_ipc.ul_send_mutex);
|
||||
pthread_mutex_destroy(&thread_ipc.sync_mutex);
|
||||
pthread_mutex_destroy(&thread_ipc.dl_decode_mutex);
|
||||
|
||||
pthread_mutex_destroy(&thread_ipc.loop_buffer.buffer_mutex);
|
||||
pthread_cond_destroy(&thread_ipc.loop_buffer.full_cond);
|
||||
pthread_cond_destroy(&thread_ipc.loop_buffer.empty_cond);
|
||||
|
||||
pthread_mutex_destroy(&thread_ipc.sync_buffer.buffer_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int set_thread_attr(pthread_attr_t *attr, int policy, int priority, int cpuid)
|
||||
{
|
||||
struct sched_param param;
|
||||
cpu_set_t cpu_info;
|
||||
|
||||
pthread_attr_init(attr);
|
||||
|
||||
if (pthread_attr_setschedpolicy(attr, policy) != 0) {
|
||||
perror("pthread_attr_setschedpolicy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
param.sched_priority = priority;
|
||||
if (pthread_attr_setschedparam(attr, ¶m) != 0) {
|
||||
perror("pthread_attr_setschedparam");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_ZERO(&cpu_info);
|
||||
CPU_SET(cpuid, &cpu_info);
|
||||
if (pthread_attr_setaffinity_np(attr,sizeof(cpu_set_t),&cpu_info)) {
|
||||
perror("pthread_attr_setaffinity_np");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pthread_attr_setinheritsched(attr, PTHREAD_EXPLICIT_SCHED) != 0) {
|
||||
perror("pthread_attr_setinheritsched");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int find_subframe_num(unsigned long long current_subframe_num, buffer_t *buf, int *flag)
|
||||
{
|
||||
long long tmp;
|
||||
int i;
|
||||
|
||||
tmp = current_subframe_num;
|
||||
for ( i = 0; i < HIGHBUFFER + 1; i++)
|
||||
{
|
||||
if(tmp == buf[i].subframe_num)
|
||||
{
|
||||
return i;
|
||||
} else if (tmp < buf[i].subframe_num) {
|
||||
*flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ue_unsync_thread_ipc_reset(void)
|
||||
{
|
||||
thread_ipc.ue_sync_state = 0;
|
||||
|
||||
pthread_mutex_lock(&thread_ipc.loop_buffer.buffer_mutex);
|
||||
if (thread_ipc.loop_buffer.isempty) {
|
||||
pthread_cond_signal(&thread_ipc.loop_buffer.empty_cond);
|
||||
}
|
||||
|
||||
if (thread_ipc.loop_buffer.isfull) {
|
||||
pthread_cond_signal(&thread_ipc.loop_buffer.full_cond);
|
||||
}
|
||||
|
||||
thread_ipc.loop_buffer.packet_num = 0;
|
||||
thread_ipc.loop_buffer.isfull = 0;
|
||||
thread_ipc.loop_buffer.isempty = 1;
|
||||
|
||||
loop_buffer_reset(thread_ipc.loop_buffer.loop_buf);
|
||||
pthread_mutex_unlock(&thread_ipc.loop_buffer.buffer_mutex);
|
||||
|
||||
thread_ipc.current_subframe = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
void bind_thread2kernel(int cpu_id)
|
||||
{
|
||||
cpu_set_t mask;
|
||||
cpu_set_t get;
|
||||
int i;
|
||||
int num = sysconf(_SC_NPROCESSORS_CONF);
|
||||
//printf("system has %d processor(s) by super\n", num);
|
||||
CPU_ZERO(&mask);
|
||||
CPU_SET(cpu_id, &mask);
|
||||
if (pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) < 0) {
|
||||
fprintf(stderr, "set thread affinity failed\n");
|
||||
}
|
||||
/*CPU_ZERO(&get);
|
||||
if (pthread_getaffinity_np(pthread_self(), sizeof(get), &get) < 0) {
|
||||
fprintf(stderr, "get thread affinity failed\n");
|
||||
}
|
||||
for (i = 0; i < num; i++) {
|
||||
if (CPU_ISSET(i, &get)) {
|
||||
printf("thread %d is running in processor %d\n", (int)pthread_self(), i);
|
||||
}
|
||||
}
|
||||
if (CPU_ISSET(cpu_id, &get)) {
|
||||
printf("thread %d is running in processor %d by super\n", (int)pthread_self(), cpu_id);
|
||||
}*/
|
||||
}
|
||||
void get_thread2kernel(void)
|
||||
{
|
||||
cpu_set_t get;
|
||||
int i;
|
||||
int num = sysconf(_SC_NPROCESSORS_CONF);
|
||||
printf("system has %d processor(s) by super\n", num);
|
||||
CPU_ZERO(&get);
|
||||
if (pthread_getaffinity_np(pthread_self(), sizeof(get), &get) < 0) {
|
||||
fprintf(stderr, "get thread affinity failed\n");
|
||||
}
|
||||
for (i = 0; i < num; i++) {
|
||||
if (CPU_ISSET(i, &get)) {
|
||||
printf("The thread %d is running in processor %d by super\n", (int)pthread_self(), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#ifndef __THREAD_IPC_H__
|
||||
#define __THREAD_IPC_H__
|
||||
|
||||
|
||||
#define SUB_FRAME_LENGTH 7680
|
||||
#define FRAME_LENGTH 76800
|
||||
|
||||
#define UE_UL_DELAY 6 /*设置上行组帧在同步时钟基础上的延时(子帧个数)*/
|
||||
#define UE_UL_SEND_DELAY 6 /*上行发送子帧号在接收子帧时间戳上的延时(子帧个数)*/
|
||||
|
||||
#define BUFFERMAX 5 /*环形缓冲区个数*/
|
||||
#define LOWBUFFER 3 /*环形缓冲区下限, 不能为0*/
|
||||
#define HIGHBUFFER 4 /*环形缓冲区上限*/
|
||||
|
||||
typedef struct {
|
||||
long long subframe_num; /*子帧编号*/
|
||||
int buffer[SUB_FRAME_LENGTH * 2]; /*一子帧数据*/
|
||||
}buffer_t;
|
||||
|
||||
typedef struct {
|
||||
int packet_num; /*环形缓冲区数据包计数器,表示环形缓冲区有效数据包个数*/
|
||||
int isfull; /*标记环形缓冲区有效数据包是否达到上限标志*/
|
||||
int isempty; /*标记环形缓冲区有效数据包是否达到下限标志*/
|
||||
|
||||
pthread_mutex_t buffer_mutex; /*环形缓冲区操作保护锁*/
|
||||
pthread_cond_t full_cond; /*环形缓冲区上限条件变量,配合isfull使用 */
|
||||
pthread_cond_t empty_cond; /*环形缓冲区下限条件变量,配合isempty使用*/
|
||||
|
||||
buffer_t loop_buf[BUFFERMAX]; /*环形缓冲区*/
|
||||
}loop_buffer_op_t;
|
||||
|
||||
typedef struct {
|
||||
int decoding_subframe_num; /*待解码子帧的编号*/
|
||||
pthread_mutex_t buffer_mutex; /*对sync_buffer临界区的保护锁*/
|
||||
int sync_buffer[SUB_FRAME_LENGTH * 10]; /*同步线程与下行解码线程数据共享缓冲区*/
|
||||
}sync_buffer_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int rx_timestamp; /*接收数据包第一个sample时间戳*/
|
||||
unsigned int tx_timestamp; /*待发送数据包的时间戳*/
|
||||
unsigned long long current_subframe; /*当前子帧编号*/
|
||||
|
||||
int ue_sync_state; /*表示UE是否在同步状态,0表示失同步,1表示同步*/
|
||||
pthread_mutex_t sync_mutex; /*根据ue_sync_state标志,唤醒组帧线程*/
|
||||
|
||||
pthread_mutex_t ul_send_mutex; /*用于sync线程唤醒发送线程发送数据*/
|
||||
pthread_mutex_t dl_decode_mutex;/*下行解码保护锁,用于sync线程唤醒解码线程解码*/
|
||||
|
||||
loop_buffer_op_t loop_buffer;
|
||||
sync_buffer_t sync_buffer;
|
||||
}g_thread_ipc_t;
|
||||
|
||||
void loop_buffer_reset(buffer_t *loop_buf);
|
||||
int thread_ipc_init(void);
|
||||
int thread_ipc_deinit(void);
|
||||
int set_thread_attr(pthread_attr_t *attr, int policy, int priority, int cpuid);
|
||||
int find_subframe_num(unsigned long long current_subframe_num, buffer_t *buf, int *flag);
|
||||
int ue_unsync_thread_ipc_reset(void);
|
||||
|
||||
extern g_thread_ipc_t thread_ipc;
|
||||
|
||||
#endif
|
||||
@@ -1,147 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
|
||||
|
||||
#include <rtai_lxrt.h>
|
||||
#include <rtai_sem.h>
|
||||
#include <rtai_msg.h>
|
||||
|
||||
#define PERIOD 100000000
|
||||
#define THRESHOLD 1
|
||||
|
||||
static SEM *mutex;
|
||||
static CND *cond;
|
||||
|
||||
static int thread0;
|
||||
static int thread1;
|
||||
|
||||
static int instance_cnt=-1; //0 means worker is busy, -1 means its free
|
||||
|
||||
static void *fun0(void *arg)
|
||||
{
|
||||
RT_TASK *task;
|
||||
int done1=0, cnt1=0;
|
||||
RTIME right_now;
|
||||
int ret;
|
||||
|
||||
task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
rt_make_hard_real_time();
|
||||
|
||||
while (cnt1 < THRESHOLD)
|
||||
{
|
||||
rt_sem_wait(mutex);
|
||||
rt_printk("fun0: Hello World %d, instance_cnt %d!\n",cnt1,instance_cnt);
|
||||
while (instance_cnt<0)
|
||||
{
|
||||
ret = rt_cond_wait(cond, mutex);
|
||||
if (ret != 0)
|
||||
{
|
||||
rt_printk("error in rt_cond_wait, code %d\n",ret);
|
||||
switch (ret)
|
||||
{
|
||||
case RTE_PERM:
|
||||
rt_printk("error RTE_PERM %d\n",ret);
|
||||
break;
|
||||
case RTE_UNBLKD:
|
||||
rt_printk("error RTE_UNBLKD %d\n",ret);
|
||||
break;
|
||||
case RTE_OBJREM:
|
||||
rt_printk("error RTE_OBJREM %d\n",ret);
|
||||
break;
|
||||
default:
|
||||
rt_printk("unknown error code %d\n",ret);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
rt_sem_signal(mutex);
|
||||
|
||||
// do some work here
|
||||
cnt1++;
|
||||
|
||||
rt_sem_wait(mutex);
|
||||
instance_cnt--;
|
||||
rt_sem_signal(mutex);
|
||||
|
||||
}
|
||||
// makes task soft real time
|
||||
rt_make_soft_real_time();
|
||||
|
||||
printf("Back to soft RT\n");
|
||||
// clean task
|
||||
rt_task_delete(task);
|
||||
printf("Task deleted. returning\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
RT_TASK *task;
|
||||
RTIME now;
|
||||
int cnt=0;
|
||||
|
||||
// make main thread LXRT soft realtime
|
||||
task = rt_task_init_schmod(nam2num("MYTASK"), 9, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
// start realtime timer and scheduler
|
||||
//rt_set_oneshot_mode();
|
||||
rt_set_periodic_mode();
|
||||
start_rt_timer(0);
|
||||
|
||||
now = rt_get_time() + 10*PERIOD;
|
||||
rt_task_make_periodic(task, now, PERIOD);
|
||||
|
||||
printf("Init mutex and cond.\n");
|
||||
mutex = rt_sem_init(nam2num("MUTEX"), 1);
|
||||
if (mutex==0)
|
||||
printf("Error init mutex\n");
|
||||
|
||||
cond = rt_cond_init(nam2num("CONDITION"));
|
||||
if (cond==0)
|
||||
printf("Error init cond\n");
|
||||
|
||||
thread0 = rt_thread_create(fun0, NULL, 10000);
|
||||
//thread1 = rt_thread_create(fun1, NULL, 20000);
|
||||
|
||||
//rt_sleep(PERIOD);
|
||||
|
||||
while (cnt < THRESHOLD)
|
||||
{
|
||||
rt_task_wait_period();
|
||||
rt_printk("main: Hello World %d!\n",cnt);
|
||||
rt_sem_wait(mutex); //now the mutex should have value 0
|
||||
if (instance_cnt==0)
|
||||
{
|
||||
rt_sem_signal(mutex); //now the mutex should have vaule 1
|
||||
rt_printk("worker thread busy!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
instance_cnt++;
|
||||
rt_cond_signal(cond);
|
||||
rt_sem_signal(mutex); //now the mutex should have vaule 1
|
||||
rt_printk("signaling worker thread to start!\n");
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <ENTER> TO TERMINATE\n");
|
||||
getchar();
|
||||
|
||||
// cleanup
|
||||
stop_rt_timer();
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
8254992 8254992 8257340 8257340
|
||||
@@ -1 +0,0 @@
|
||||
8254744 8255063 8257340 8257340
|
||||
@@ -1,9 +0,0 @@
|
||||
# this file contains the calibration values to compute the RSSI
|
||||
# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
|
||||
# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB
|
||||
# high gain
|
||||
138 138 138 138
|
||||
# med gain
|
||||
129 129 129 129
|
||||
# low gain
|
||||
120 120 120 120
|
||||
@@ -1,5 +0,0 @@
|
||||
# For the TX, we need to set the tx gain values such that the transmitted power on all antennas is the same
|
||||
# tx gain (dB)
|
||||
25 19 25 25
|
||||
# total tx power (dBm)
|
||||
17
|
||||
@@ -1 +0,0 @@
|
||||
8255067 8254810 8257340 8257340
|
||||
@@ -1,3 +0,0 @@
|
||||
133 133 133 133
|
||||
127 127 127 127
|
||||
120 120 120 120
|
||||
@@ -1 +0,0 @@
|
||||
34689 34756 36300 36999
|
||||
@@ -1 +0,0 @@
|
||||
8256036 8256804 8257340 8257340
|
||||
@@ -1,10 +0,0 @@
|
||||
# this file contains the calibration values to compute the RSSI
|
||||
# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
|
||||
# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB
|
||||
# this is for Express MIMO2 without any additional RF frontend
|
||||
# high gain
|
||||
124 124 124 124
|
||||
# med gain
|
||||
118 118 118 118
|
||||
# low gain (byp)
|
||||
109 109 109 109
|
||||
@@ -1,6 +0,0 @@
|
||||
# For the TX, we need to set the tx gain values such that the transmitted power on all antennas is the same
|
||||
# tx gain (dB)
|
||||
# 25 19 25 25
|
||||
10 10 10 10
|
||||
# total tx power (dBm)
|
||||
17
|
||||
@@ -1,2 +0,0 @@
|
||||
33421 36226 34957 37000
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
8254212 8256991 8257340 8257340
|
||||
@@ -1,10 +0,0 @@
|
||||
# this file contains the calibration values to compute the RSSI
|
||||
# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
|
||||
# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB
|
||||
# this is for Express MIMO2 without any additional RF frontend
|
||||
# high gain
|
||||
124 124 124 124
|
||||
# med gain
|
||||
118 118 118 118
|
||||
# low gain (byp)
|
||||
109 109 109 109
|
||||
@@ -1,6 +0,0 @@
|
||||
# For the TX, we need to set the tx gain values such that the transmitted power on all antennas is the same
|
||||
# tx gain (dB)
|
||||
# 25 19 25 25
|
||||
0 0 0 0
|
||||
# total tx power (dBm)
|
||||
17
|
||||
@@ -1,184 +0,0 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) EURECOM / Thales Communications & Security
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in the
|
||||
* file called LICENSE.
|
||||
*
|
||||
* Contact Information:
|
||||
* Thales Communications & Security <philippe.agostini@thalesgroup.com>
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Includes
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "ieee80211p-netlinkapi.h"
|
||||
#include "phy/DOT11/defs.h"
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <rtai_lxrt.h>
|
||||
#include <rtai_sem.h>
|
||||
#include <rtai_msg.h>
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
enum nl80211_band {
|
||||
NL80211_BAND_2GHZ,
|
||||
NL80211_BAND_5GHZ,
|
||||
NL80211_BAND_5_9GHZ,
|
||||
NL80211_BAND_0_8GHZ,
|
||||
};
|
||||
|
||||
enum ieee80211_band {
|
||||
IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
|
||||
IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
|
||||
IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ,
|
||||
IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ,
|
||||
};
|
||||
|
||||
struct ieee80211p_rx_status {
|
||||
short data_len; //frame data length in bytes
|
||||
char rssi; //received power in dBm
|
||||
char rate; //reveived data rate in units of 100 kbps
|
||||
enum ieee80211_band band;
|
||||
char flags; //RX flags
|
||||
}; /* struct ieee80211p_rx_status */
|
||||
|
||||
extern uint32_t *txdata[2],*rxdata[2];
|
||||
//CHANNEL_STATUS_t dot11_state = IDLE;
|
||||
extern int oai_exit;
|
||||
|
||||
extern unsigned int *DAQ_MBOX;
|
||||
|
||||
extern int Ndbps[8];
|
||||
|
||||
extern int32_t rxDATA_F_comp_aggreg2[48*1024];
|
||||
extern int32_t rxDATA_F_comp_aggreg3[48*1024];
|
||||
|
||||
extern uint32_t rxgain[4];
|
||||
extern uint32_t rxg_max[4], rxg_med[4], rxg_byp[4];
|
||||
|
||||
#define FRAME_LENGTH_SAMPLES 76800
|
||||
#define RX_THRES 60
|
||||
|
||||
#define SLOT_DURATION_5MHz 105
|
||||
#define RX_THRES_dB 40
|
||||
|
||||
int tx_sdu_active = 0;
|
||||
int tx_sdu_length = 0;
|
||||
char rxsdu[2000];
|
||||
|
||||
void *tx_thread(void *arg) {
|
||||
|
||||
int fd=*((int*)arg);
|
||||
RT_TASK *task;
|
||||
int ret;
|
||||
int i;
|
||||
char dummy_data[10];
|
||||
|
||||
|
||||
if (fd > 0) {
|
||||
|
||||
ret = netlink_send(fd,NLCMD_INIT,10,&dummy_data[0]);
|
||||
|
||||
printf("tx_thread starting, fd %d\n",fd);
|
||||
|
||||
task = rt_task_init_schmod(nam2num("TASK1"), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
// rt_make_hard_real_time();
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (tx_sdu_active == 1)
|
||||
printf("tx_thread: waiting (MBOX %d)\n",((unsigned int*)DAQ_MBOX)[0]);
|
||||
|
||||
while(((volatile int)tx_sdu_active) != 0) {
|
||||
rt_sleep(nano2count(66666));
|
||||
}
|
||||
printf("tx_thread: calling netlink\n");
|
||||
ret = netlink_recv(fd,rxsdu);
|
||||
tx_sdu_active = 1;
|
||||
tx_sdu_length = ret;
|
||||
|
||||
/*
|
||||
if (ret > 0) {
|
||||
|
||||
printf("received TX SDU: ");
|
||||
for (i=0;i<ret;i++) {
|
||||
printf("%02hhx ",rxsdu[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("tx_thread: no netlink\n");
|
||||
}
|
||||
|
||||
printf("tx_thread exiting\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Main
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
int dot11_netlink_init() {
|
||||
|
||||
int fd;
|
||||
int ret;
|
||||
int i;
|
||||
char txdata[10];
|
||||
|
||||
fd = netlink_init();
|
||||
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = netlink_send(fd,NLCMD_INIT,10,&txdata[0]);
|
||||
|
||||
|
||||
|
||||
return(fd);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
sudo rmmod openair_rf
|
||||
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko
|
||||
sudo mknod /dev/openair0 c 127 0
|
||||
sudo chmod a+rw /dev/openair0
|
||||
|
||||
$OPENAIR1_DIR/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $OPENAIR1_DIR/USERSPACE_TOOLS/OAI_FW_INIT/main -s 0x43fffff0
|
||||
sudo rmmod openair_rf
|
||||
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko
|
||||
|
||||
sudo rmmod nasmesh
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
PCI=`lspci -m | grep Xilinx`
|
||||
if [ -z "$PCI" ]; then
|
||||
echo "No card found. Stopping!"
|
||||
return
|
||||
fi
|
||||
|
||||
## This part corrects the wrong configuration of the endpoint done by the bios in some machines
|
||||
echo "$PCI" | while read config_reg; do
|
||||
SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'`
|
||||
sudo setpci -s $SLOT_NUMBER 60.b=10
|
||||
done
|
||||
|
||||
sudo rmmod openair_rf
|
||||
sudo insmod $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom/openair_rf.ko
|
||||
sleep 1
|
||||
|
||||
if [ ! -e /dev/openair0 ]; then
|
||||
sudo mknod /dev/openair0 c 127 0
|
||||
sudo chmod a+rw /dev/openair0
|
||||
fi
|
||||
|
||||
DEVICE=`echo $PCI | awk -F\" '{print $(NF-1)}' | awk '{print $2}'`
|
||||
if [ $DEVICE == '2208' ]; then
|
||||
echo "Using firmware version 8"
|
||||
$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2
|
||||
else
|
||||
if [ $DEVICE == '2209' ]; then
|
||||
echo "Using firmware version 9"
|
||||
#$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR0_DIR/express-mimo/software/sdr/exmimo2/sdr_expressmimo2
|
||||
$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v9
|
||||
else
|
||||
if [ $DEVICE == '220a' ]; then
|
||||
echo "Using firware version 10"
|
||||
$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
|
||||
else
|
||||
echo 'No corresponding firmware found'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
sudo rmmod nasmesh
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
if [ "$1" = "eNB" ]; then
|
||||
echo "bring up oai0 interface for enb"
|
||||
sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.9 -r 1
|
||||
else
|
||||
if [ "$1" = "UE" ]; then
|
||||
echo "bring up oai0 interface for UE"
|
||||
sudo ifconfig oai0 10.0.1.9 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.9 -t 10.0.1.1 -r 1
|
||||
fi
|
||||
fi
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,96 +0,0 @@
|
||||
/* Form definition file generated by fdesign */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "lte_scope.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
***************************************/
|
||||
|
||||
FD_lte_scope *
|
||||
create_form_lte_scope( void )
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_scope *fdui = fl_malloc( sizeof *fdui );
|
||||
|
||||
fdui->vdata = fdui->cdata = NULL;
|
||||
fdui->ldata = 0;
|
||||
|
||||
fdui->lte_scope = fl_bgn_form( FL_NO_BOX, 780, 723 );
|
||||
|
||||
obj = fl_add_box( FL_ROUNDED_BOX, 0, 0, 780, 723, "" );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLUE );
|
||||
|
||||
fdui->channel_t_re[0] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 20, 280, 100, "Real(RX0)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLUE );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_im[0] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 310, 20, 280, 100, "Imag(RX0)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLUE );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_re[1] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 140, 280, 100, "Real(RX1)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_im[1] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 310, 140, 280, 100, "Imag(RX1)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_re[2] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 260, 280, 100, "Real(RX2)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_im[2] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 310, 260, 280, 100, "Imag(RX2)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_re[3] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 380, 280, 100, "Real(RX3)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->channel_t_im[3] = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 310, 380, 280, 100, "Imag(RX3)" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
/*
|
||||
fdui->scatter_plot = obj = fl_add_xyplot( FL_POINTS_XYPLOT, 600, 230, 160, 190, "PBCH Scatter Plot" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->scatter_plot2 = obj = fl_add_xyplot( FL_POINTS_XYPLOT, 600, 440, 160, 190, "PDSCH/PUSCH Scatter Plot" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->scatter_plot1 = obj = fl_add_xyplot( FL_POINTS_XYPLOT, 600, 20, 160, 190, "PDCCH Scatter Plot" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_CYAN );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
|
||||
fdui->ia_receiver_button = obj = fl_add_button( FL_PUSH_BUTTON, 620, 660, 130, 40, "IA receiver OFF" );
|
||||
fl_set_object_lalign( obj, FL_ALIGN_CENTER );
|
||||
fl_set_object_color( obj, FL_RED, FL_RED);
|
||||
fl_set_object_callback( obj, ia_receiver_on_off, 0 );
|
||||
|
||||
fdui->tput = obj = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 560, 570, 140, "Throughput [kbits/s]" );
|
||||
fl_set_object_boxtype( obj, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_WHITE );
|
||||
fl_set_object_lcolor( obj, FL_WHITE );
|
||||
*/
|
||||
|
||||
fl_end_form( );
|
||||
|
||||
fdui->lte_scope->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
Magic: 14000
|
||||
|
||||
Internal Form Definition File
|
||||
(do not change)
|
||||
|
||||
Number of forms: 1
|
||||
Unit of measure: FL_COORD_PIXEL
|
||||
|
||||
=============== FORM ===============
|
||||
Name: lte_scope
|
||||
Width: 780
|
||||
Height: 723
|
||||
Number of Objects: 11
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
type: ROUNDED_BOX
|
||||
box: 0 0 780 723
|
||||
boxtype: FL_ROUNDED_BOX
|
||||
colors: FL_BLACK FL_BLUE
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: NORMAL_XYPLOT
|
||||
box: 20 20 280 100
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_BLUE
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: Received Signal (Time-Domain, dB)
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: channel_t_re
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: POINTS_XYPLOT
|
||||
box: 600 230 160 190
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_GREEN
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: PBCH Scatter Plot
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: scatter_plot
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: IMPULSE_XYPLOT
|
||||
box: 20 140 570 90
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_RED
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: Frequency Domain Channel Estimate
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: channel_f
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: NORMAL_XYPLOT
|
||||
box: 310 20 280 100
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_BLUE
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: Time-Domain Channel Estimate
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: channel_t_im
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: POINTS_XYPLOT
|
||||
box: 20 250 570 130
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_GREEN
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: PBCH Decoder Input
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: decoder_input
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: POINTS_XYPLOT
|
||||
box: 600 440 160 190
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_YELLOW
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: PDSCH/PUSCH Scatter Plot
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: scatter_plot2
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: POINTS_XYPLOT
|
||||
box: 600 20 160 190
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_CYAN
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: PDCCH Scatter Plot
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: scatter_plot1
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: PUSH_BUTTON
|
||||
box: 620 660 130 40
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: IA receiver OFF
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: ia_receiver_button
|
||||
callback: ia_receiver_on_off
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: POINTS_XYPLOT
|
||||
box: 20 400 570 140
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_YELLOW
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: PDSCH/PUSCH Decoder Input
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: demod_out
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_XYPLOT
|
||||
type: NORMAL_XYPLOT
|
||||
box: 20 560 570 140
|
||||
boxtype: FL_EMBOSSED_BOX
|
||||
colors: FL_BLACK FL_WHITE
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_WHITE
|
||||
label: Throughput [kbits/s]
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: tput
|
||||
callback:
|
||||
argument:
|
||||
|
||||
==============================
|
||||
create_the_forms
|
||||
@@ -1,36 +0,0 @@
|
||||
/* Header file generated by fdesign on Tue Nov 13 09:42:50 2012 */
|
||||
|
||||
#ifndef FD_lte_scope_h_
|
||||
#define FD_lte_scope_h_
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
extern void ia_receiver_on_off( FL_OBJECT *, long );
|
||||
|
||||
|
||||
/* Forms and Objects */
|
||||
|
||||
typedef struct {
|
||||
FL_FORM * lte_scope;
|
||||
void * vdata;
|
||||
char * cdata;
|
||||
long ldata;
|
||||
FL_OBJECT * channel_t_re[4];
|
||||
FL_OBJECT * channel_t_im[4];
|
||||
/*
|
||||
FL_OBJECT * scatter_plot;
|
||||
FL_OBJECT * channel_f;
|
||||
FL_OBJECT * decoder_input;
|
||||
FL_OBJECT * scatter_plot2;
|
||||
FL_OBJECT * scatter_plot1;
|
||||
FL_OBJECT * ia_receiver_button;
|
||||
FL_OBJECT * demod_out;
|
||||
FL_OBJECT * tput;
|
||||
*/
|
||||
} FD_lte_scope;
|
||||
|
||||
extern FD_lte_scope * create_form_lte_scope( void );
|
||||
|
||||
#endif /* FD_lte_scope_h_ */
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
############### make nasmesh.ko ###############
|
||||
sudo rmmod nasmesh
|
||||
#cd ${OPENAIR2_DIR} && make nasmesh_netlink.ko
|
||||
#cd ${OPENAIR2_DIR}/NAS/DRIVER/MESH/RB_TOOL/ && make
|
||||
#make all
|
||||
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
|
||||
|
||||
############## Ethernet config ####################
|
||||
sudo ifconfig eth0 mtu 4000
|
||||
sudo sysctl -w net.core.wmem_max=1048576
|
||||
sudo sysctl -w net.core.rmem_max=50000000
|
||||
|
||||
############## rtai modules ###################
|
||||
if test \! -c /dev/rtai_shm; then
|
||||
sudo mknod -m 666 /dev/rtai_shm c 10 254
|
||||
fi
|
||||
for n in `seq 0 9`; do
|
||||
f=/dev/rtf$n
|
||||
if test \! -c $f; then
|
||||
sudo mknod -m 666 $f c 150 $n
|
||||
fi
|
||||
done
|
||||
sudo modprobe rtai_hal
|
||||
sudo modprobe rtai_sched
|
||||
sudo modprobe rtai_fifos
|
||||
sudo modprobe rtai_sem
|
||||
sudo modprobe rtai_mbx
|
||||
sudo modprobe rtai_msg
|
||||
|
||||
############## make ###################
|
||||
make lte-softmodem-usrp NAS=1 USRP=1 XFORMS=1 RTAI=1 HARD_RT=1 #DRIVER2013=1
|
||||
#make lte-softmodem NAS=1 XFORMS=1 USRP=0 RTAI=1 DRIVER2013=1
|
||||
echo DONE!
|
||||
exit 0
|
||||
@@ -1,66 +0,0 @@
|
||||
#include <rtai_sem.h>
|
||||
|
||||
#include "msg_many.h"
|
||||
|
||||
/*
|
||||
* Add a task task to ri->worker.
|
||||
* Return the used index in ri->worker on success
|
||||
* Return -TM_WORKER_FULL_ERROR if ri->worker full
|
||||
* Return -TM_WORKER_ERROR else
|
||||
*/
|
||||
int tm_add_task(RT_TASK *task, run_info_t *ri)
|
||||
{
|
||||
if(ri->used >= NUM_THREADS)
|
||||
return -TM_WORKER_FULL_ERROR;
|
||||
|
||||
rt_sem_wait(ri->update_sem);
|
||||
(*ri->worker)[ri->used] = task;
|
||||
ri->used++;
|
||||
rt_sem_signal(ri->update_sem);
|
||||
|
||||
return ri->used - 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the a hole in worker at index index by
|
||||
* shift the next slots by one.
|
||||
* This function assume that update_sem are locked.
|
||||
* Return the new used counter.
|
||||
*/
|
||||
int _tm_clean_worker(RT_TASK *(*worker)[], int index, int used)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = index; i < used; i++)
|
||||
(*worker)[i] = (*worker)[i + 1];
|
||||
|
||||
return used - 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a task from ri->worker a index task_index
|
||||
* Return 0 on success
|
||||
* Return -TM_WORKER_ERROR else
|
||||
*/
|
||||
int tm_del_task(int task_index, run_info_t *ri)
|
||||
{
|
||||
rt_sem_wait(ri->update_sem);
|
||||
ri->used = _tm_clean_worker(ri->worker, task_index, ri->used);
|
||||
rt_sem_signal(ri->update_sem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return next index to use on ri->worker.
|
||||
* It depends on the old_index and ri->used.
|
||||
* Return -TM_WORKER_ERROR if ri->used == 0.
|
||||
*/
|
||||
inline int tm_get_next_task_index(int old_index, run_info_t *ri)
|
||||
{
|
||||
if(ri->used == 0)
|
||||
return -TM_WORKER_ERROR;
|
||||
|
||||
return (old_index + 1) % ri->used;
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <rtai_lxrt.h>
|
||||
#include <rtai_sem.h>
|
||||
#include <rtai_msg.h>
|
||||
|
||||
#include "msg_many.h"
|
||||
|
||||
static void *msg_test_thread(void *arg)
|
||||
{
|
||||
RT_TASK *self;
|
||||
RT_TASK *sender_task;
|
||||
thread_info_t *ti = (thread_info_t *)arg;
|
||||
run_info_t *ri = ti->ri;
|
||||
unsigned int msg;
|
||||
int counter = 0;
|
||||
char name[6];
|
||||
int task_index;
|
||||
|
||||
/* Build custom task name for each thread */
|
||||
snprintf(name, 6, "%s%03i", THREAD_NAME_PREFIX, ti->thread_num);
|
||||
|
||||
self = rt_task_init_schmod(nam2num(name), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
rt_make_hard_real_time();
|
||||
|
||||
task_index = tm_add_task(self, ri);
|
||||
if(task_index != -TM_WORKER_FULL_ERROR)
|
||||
{
|
||||
while (*(ri->exit_condition) == 0)
|
||||
{
|
||||
// wait only one PERIOD to avoid wait for ever
|
||||
sender_task = rt_receive_timed(ri->sender, &msg, ri->period);
|
||||
//sender_task = rt_receive(0, &msg);
|
||||
if(sender_task == ri->sender)
|
||||
counter++;
|
||||
}
|
||||
rt_printk("%s: counter == %i\n", name, counter);
|
||||
tm_del_task(task_index, ri);
|
||||
} else {
|
||||
rt_printk("%s: Worker array full!\n", name);
|
||||
}
|
||||
|
||||
rt_make_soft_real_time();
|
||||
|
||||
rt_task_delete(self);
|
||||
|
||||
free((void *) ti);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
RT_TASK *self;
|
||||
RT_TASK *tmp_worker_task;
|
||||
RT_TASK *worker_tasks[NUM_THREADS];
|
||||
int worker_threads[NUM_THREADS];
|
||||
RTIME now;
|
||||
unsigned int i, ii;
|
||||
run_info_t ri;
|
||||
thread_info_t *ti;
|
||||
uint8_t exit_condition = 0;
|
||||
int fail_count = 0;
|
||||
int old_index = 0;
|
||||
uint8_t lost;
|
||||
|
||||
// make main thread LXRT soft realtime
|
||||
self = rt_task_init_schmod(nam2num("MAINTK"), 10, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
rt_make_hard_real_time();
|
||||
rt_set_periodic_mode();
|
||||
start_rt_timer(0);
|
||||
|
||||
/* Build all information need to run in main and the thread */
|
||||
ri.sender = self;
|
||||
ri.exit_condition = &exit_condition;
|
||||
ri.period = nano2count(PERIOD);
|
||||
ri.update_sem = rt_sem_init(nam2num("MUTEX"), 1);
|
||||
if(ri.update_sem == 0)
|
||||
exit(-1);
|
||||
ri.used = 0;
|
||||
ri.worker = &worker_tasks;
|
||||
|
||||
now = rt_get_time() + ri.period;
|
||||
rt_task_make_periodic(self, now, ri.period);
|
||||
|
||||
/* start all threads */
|
||||
for(i = 0; i < NUM_THREADS; i++)
|
||||
{
|
||||
ti = (thread_info_t *)malloc(sizeof(thread_info_t));
|
||||
if(ti == NULL)
|
||||
{
|
||||
rt_printk("MAINTK: can't get memory!\n");
|
||||
exit(-1);
|
||||
}
|
||||
ti->ri = &ri;
|
||||
ti->thread_num = i;
|
||||
worker_threads[i] = rt_thread_create(msg_test_thread, ti , 10000);
|
||||
}
|
||||
|
||||
rt_sleep(NUM_THREADS * ri.period);
|
||||
|
||||
rt_printk("start\n");
|
||||
for(i = 0; i < THRESHOLD; i++)
|
||||
{
|
||||
rt_task_wait_period();
|
||||
lost = 1;
|
||||
for(ii = 0; ii < ri.used; ii++)
|
||||
{
|
||||
old_index = tm_get_next_task_index(old_index, &ri);
|
||||
if(old_index == -TM_WORKER_ERROR)
|
||||
{
|
||||
rt_printk("MAINTK: No Tasks!\n");
|
||||
break;
|
||||
}
|
||||
tmp_worker_task = rt_send_if(worker_tasks[old_index], i);
|
||||
if(tmp_worker_task == worker_tasks[old_index])
|
||||
{
|
||||
lost = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(lost)
|
||||
fail_count++;
|
||||
}
|
||||
rt_printk("fail_count == %i\n", fail_count);
|
||||
|
||||
// cleanup
|
||||
exit_condition = 1;
|
||||
rt_make_soft_real_time();
|
||||
|
||||
rt_task_delete(self);
|
||||
/* wait for the worker threadss */
|
||||
for(ii = 0; ii < ri.used; ii++)
|
||||
{
|
||||
rt_thread_join(worker_threads[ii]);
|
||||
}
|
||||
stop_rt_timer();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
|
||||
#ifndef __MSG_MANY_H__
|
||||
#define __MSG_MANY_H__
|
||||
#include <stdint.h>
|
||||
|
||||
#define PERIOD 500000 /* in nano seconds */
|
||||
#define THRESHOLD 1000000
|
||||
#define THREAD_NAME_PREFIX "TK"
|
||||
#define NUM_THREADS 10
|
||||
|
||||
#define TM_WORKER_FULL_ERROR 1
|
||||
#define TM_WORKER_ERROR 2
|
||||
|
||||
typedef struct run_info {
|
||||
RT_TASK *sender;
|
||||
uint8_t *exit_condition;
|
||||
long long period;
|
||||
SEM *update_sem; /* protect the task array */
|
||||
int used; /* counter of used slots in worker */
|
||||
RT_TASK *(*worker)[]; /* declare worker as pointer to array of pointer to RT_TASK */
|
||||
} run_info_t;
|
||||
|
||||
typedef struct thread_info {
|
||||
run_info_t *ri;
|
||||
uint8_t thread_num;
|
||||
} thread_info_t;
|
||||
|
||||
int tm_add_task(RT_TASK *task, run_info_t *ri);
|
||||
int tm_del_task(int task_index, run_info_t *ri);
|
||||
inline int tm_get_next_task_index(int old_index, run_info_t *ri);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file rt_wrapper.h
|
||||
* \brief provides a wrapper for the timing function for real-time opeartions depending on weather RTAI is used or not
|
||||
* \author F. Kaltenberger
|
||||
* \date 2013
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#ifndef RTAI
|
||||
|
||||
struct timespec interval, next, now, res;
|
||||
clockid_t clock_id = CLOCK_REALTIME; //other options are CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID
|
||||
RTIME rt_get_time_ns (void) {
|
||||
clock_gettime(clock_id, &now);
|
||||
return(now.tv_sec*1e9+now.tv_nsec);
|
||||
}
|
||||
|
||||
int rt_sleep_ns (RTIME x) {
|
||||
int ret;
|
||||
clock_gettime(clock_id, &now);
|
||||
interval.tv_sec = x/((RTIME)1000000000);
|
||||
interval.tv_nsec = x%((RTIME)1000000000);
|
||||
//rt_printk("sleeping for %d sec and %d ns\n",interval.tv_sec,interval.tv_nsec);
|
||||
next = now;
|
||||
next.tv_sec += interval.tv_sec;
|
||||
next.tv_nsec += interval.tv_nsec;
|
||||
|
||||
if (next.tv_nsec>=1000000000) {
|
||||
next.tv_nsec -= 1000000000;
|
||||
next.tv_sec++;
|
||||
}
|
||||
|
||||
ret = clock_nanosleep(clock_id, TIMER_ABSTIME, &next, NULL);
|
||||
|
||||
/*
|
||||
if (ret==EFAULT)
|
||||
rt_printk("rt_sleep_ns returned EFAULT (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec);
|
||||
if (ret==EINVAL)
|
||||
rt_printk("rt_sleep_ns returned EINVAL (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec);
|
||||
if (ret==EINTR)
|
||||
rt_printk("rt_sleep_ns returned EINTR (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec);
|
||||
*/
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void check_clock(void) {
|
||||
if (clock_getres(clock_id, &res)) {
|
||||
printf("clock_getres failed");
|
||||
} else {
|
||||
printf("reported resolution = %llu ns\n", (long long int) ((int) 1e9 * res.tv_sec) + (long long int) res.tv_nsec);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int rt_sleep_ns(RTIME x) {
|
||||
rt_sleep(nano2count(x));
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,64 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file rt_wrapper.h
|
||||
* \brief provides a wrapper for the timing function for real-time opeartions depending on weather RTAI is used or not
|
||||
* \author F. Kaltenberger
|
||||
* \date 2013
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef RTAI
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define RTIME long long int
|
||||
|
||||
#define rt_printk printf
|
||||
|
||||
RTIME rt_get_time_ns (void);
|
||||
|
||||
int rt_sleep_ns (RTIME x);
|
||||
|
||||
void check_clock(void);
|
||||
|
||||
#else
|
||||
#include <rtai_lxrt.h>
|
||||
#include <rtai_sem.h>
|
||||
#include <rtai_msg.h>
|
||||
|
||||
int rt_sleep_ns(RTIME x);
|
||||
|
||||
#endif
|
||||
@@ -1,347 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file sched_dlsch.c
|
||||
* \brief DLSCH decoding thread (RTAI)
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#ifdef CBMIMO1
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#endif // CBMIMO1
|
||||
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
/// Mutex for instance count on dlsch scheduling
|
||||
pthread_mutex_t dlsch_mutex[8];
|
||||
/// Condition variable for dlsch thread
|
||||
pthread_cond_t dlsch_cond[8];
|
||||
|
||||
pthread_t dlsch_threads[8];
|
||||
pthread_attr_t attr_dlsch_threads;
|
||||
unsigned char dlsch_thread_indices[8];
|
||||
|
||||
// activity indicators for harq_pid's
|
||||
int dlsch_instance_cnt[8];
|
||||
// process ids for cpu
|
||||
int dlsch_cpuid[8];
|
||||
// subframe number for each harq_pid (needed to store ack in right place for UL)
|
||||
int dlsch_subframe[8];
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
/*
|
||||
extern int dlsch_errors;
|
||||
extern int dlsch_received;
|
||||
extern int dlsch_errors_last;
|
||||
extern int dlsch_received_last;
|
||||
extern int dlsch_fer;
|
||||
extern int current_dlsch_cqi;
|
||||
*/
|
||||
|
||||
/** DLSCH Decoding Thread */
|
||||
static void * dlsch_thread(void *param) {
|
||||
|
||||
//unsigned long cpuid;
|
||||
unsigned char dlsch_thread_index = *((unsigned char *)param);
|
||||
unsigned int ret;
|
||||
uint8_t harq_pid;
|
||||
|
||||
RTIME time_in,time_out;
|
||||
#ifdef RTAI
|
||||
RT_TASK *task;
|
||||
char task_name[8];
|
||||
#endif
|
||||
|
||||
int eNB_id = 0, UE_id = 0;
|
||||
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[UE_id];
|
||||
|
||||
if ((dlsch_thread_index <0) || (dlsch_thread_index>7)) {
|
||||
LOG_E(PHY,"[SCHED][DLSCH] Illegal dlsch_thread_index %d (%p)!!!!\n",dlsch_thread_index,param);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef RTAI
|
||||
sprintf(task_name,"DLSCH%d",dlsch_thread_index);
|
||||
task = rt_task_init_schmod(nam2num(task_name), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
|
||||
if (task==NULL) {
|
||||
LOG_E(PHY,"[SCHED][DLSCH] Problem starting dlsch_thread_index %d (%s)!!!!\n",dlsch_thread_index,task_name);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"[SCHED][DLSCH] dlsch_thread for process %d started with id %p\n",
|
||||
dlsch_thread_index,
|
||||
task);
|
||||
}
|
||||
#endif
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
//rt_set_runnable_on_cpuid(task,1);
|
||||
//cpuid = rtai_cpuid();
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_hard_real_time();
|
||||
#endif
|
||||
|
||||
//dlsch_cpuid[dlsch_thread_index] = cpuid;
|
||||
|
||||
while (!oai_exit){
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_THREAD0+dlsch_thread_index,0);
|
||||
if (pthread_mutex_lock(&dlsch_mutex[dlsch_thread_index]) != 0) {
|
||||
LOG_E(PHY,"[SCHED][DLSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
|
||||
while (dlsch_instance_cnt[dlsch_thread_index] < 0) {
|
||||
pthread_cond_wait(&dlsch_cond[dlsch_thread_index],&dlsch_mutex[dlsch_thread_index]);
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&dlsch_mutex[dlsch_thread_index]) != 0) {
|
||||
LOG_E(PHY,"[SCHED][DLSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_THREAD0+dlsch_thread_index,1);
|
||||
if (oai_exit) break;
|
||||
|
||||
LOG_I(PHY,"[SCHED][DLSCH] Frame %d: Calling dlsch_decoding with dlsch_thread_index = %d\n",phy_vars_ue->frame,dlsch_thread_index);
|
||||
|
||||
time_in = rt_get_time_ns();
|
||||
|
||||
if (phy_vars_ue->frame < phy_vars_ue->dlsch_errors[eNB_id]) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_received[eNB_id] = 0;
|
||||
}
|
||||
|
||||
harq_pid = dlsch_thread_index;
|
||||
|
||||
if (phy_vars_ue->dlsch_ue[eNB_id][0]) {
|
||||
|
||||
// rt_printk("[SCHED][DLSCH] Frame %d, slot %d, start %llu, end %llu, proc time: %llu ns\n",phy_vars_ue->frame,last_slot,time0,time1,(time1-time0));
|
||||
|
||||
dlsch_unscrambling(&phy_vars_ue->lte_frame_parms,
|
||||
0,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0],
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->G,
|
||||
phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[0],
|
||||
0,
|
||||
dlsch_subframe[dlsch_thread_index]<<1);
|
||||
|
||||
LOG_I(PHY,"[UE %d] PDSCH Calling dlsch_decoding for subframe %d, harq_pid %d, G%d\n", phy_vars_ue->Mod_id,dlsch_subframe[dlsch_thread_index], harq_pid,phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->G);
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0+dlsch_thread_index,1);
|
||||
ret = dlsch_decoding(phy_vars_ue,
|
||||
phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[0],
|
||||
&phy_vars_ue->lte_frame_parms,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0],
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid],
|
||||
dlsch_subframe[dlsch_thread_index],
|
||||
harq_pid,
|
||||
1, // is_crnti
|
||||
0); // llr8_flag
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0+dlsch_thread_index,0);
|
||||
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (mcs %d, rv %d, TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,harq_pid,
|
||||
phy_vars_ue->frame,dlsch_subframe[dlsch_thread_index],ret,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
|
||||
|
||||
if (ret == (1+MAX_TURBO_ITERATIONS)) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]++;
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,phy_vars_ue->frame,dlsch_subframe[dlsch_thread_index],
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: Received DLSCH (rv %d,mcs %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,phy_vars_ue->frame,dlsch_subframe[dlsch_thread_index],
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->frame,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->b,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS>>3,
|
||||
eNB_id);
|
||||
#endif
|
||||
phy_vars_ue->total_TBS[eNB_id] = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS + phy_vars_ue->total_TBS[eNB_id];
|
||||
phy_vars_ue->total_received_bits[eNB_id] = phy_vars_ue->total_received_bits[eNB_id] + phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS;
|
||||
}
|
||||
}
|
||||
|
||||
// this is done in main thread
|
||||
/*
|
||||
if (phy_vars_ue->frame % 100 == 0) {
|
||||
if ((phy_vars_ue->dlsch_received[eNB_id] - phy_vars_ue->dlsch_received_last[eNB_id]) != 0)
|
||||
phy_vars_ue->dlsch_fer[eNB_id] = (100*(phy_vars_ue->dlsch_errors[eNB_id] - phy_vars_ue->dlsch_errors_last[eNB_id]))/(phy_vars_ue->dlsch_received[eNB_id] - phy_vars_ue->dlsch_received_last[eNB_id]);
|
||||
phy_vars_ue->dlsch_errors_last[eNB_id] = phy_vars_ue->dlsch_errors[eNB_id];
|
||||
phy_vars_ue->dlsch_received_last[eNB_id] = phy_vars_ue->dlsch_received[eNB_id];
|
||||
}
|
||||
*/
|
||||
|
||||
time_out = rt_get_time_ns();
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (mcs %d, rv %d, TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,harq_pid,
|
||||
phy_vars_ue->frame,dlsch_subframe[dlsch_thread_index],ret,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
if (phy_vars_ue->frame%100==0) {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d dlsch_errors %d, dlsch_received %d, dlsch_fer %d, current_dlsch_cqi %d\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
phy_vars_ue->frame,dlsch_subframe[dlsch_thread_index],
|
||||
phy_vars_ue->dlsch_errors[eNB_id],
|
||||
phy_vars_ue->dlsch_received[eNB_id],
|
||||
phy_vars_ue->dlsch_fer[eNB_id],
|
||||
phy_vars_ue->PHY_measurements.wideband_cqi_tot[eNB_id]);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pthread_mutex_lock(&dlsch_mutex[dlsch_thread_index]) != 0) {
|
||||
msg("[openair][SCHED][DLSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
dlsch_instance_cnt[dlsch_thread_index]--;
|
||||
|
||||
if (pthread_mutex_unlock(&dlsch_mutex[dlsch_thread_index]) != 0) {
|
||||
msg("[openair][SCHED][DLSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_soft_real_time();
|
||||
#endif
|
||||
|
||||
msg("[openair][SCHED][DLSCH] DLSCH thread %d exiting\n",dlsch_thread_index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_dlsch_threads(void) {
|
||||
|
||||
int error_code;
|
||||
struct sched_param p;
|
||||
unsigned char dlsch_thread_index;
|
||||
|
||||
pthread_attr_init (&attr_dlsch_threads);
|
||||
pthread_attr_setstacksize(&attr_dlsch_threads,OPENAIR_THREAD_STACK_SIZE);
|
||||
//attr_dlsch_threads.priority = 1;
|
||||
|
||||
p.sched_priority = OPENAIR_THREAD_PRIORITY;
|
||||
pthread_attr_setschedparam (&attr_dlsch_threads, &p);
|
||||
#ifndef RTAI_ISNT_POSIX
|
||||
pthread_attr_setschedpolicy (&attr_dlsch_threads, SCHED_FIFO);
|
||||
#endif
|
||||
|
||||
for(dlsch_thread_index=0;dlsch_thread_index<8;dlsch_thread_index++) {
|
||||
|
||||
pthread_mutex_init(&dlsch_mutex[dlsch_thread_index],NULL);
|
||||
pthread_cond_init(&dlsch_cond[dlsch_thread_index],NULL);
|
||||
|
||||
dlsch_instance_cnt[dlsch_thread_index] = -1;
|
||||
dlsch_thread_indices[dlsch_thread_index] = dlsch_thread_index;
|
||||
rt_printk("[openair][SCHED][DLSCH][INIT] Allocating DLSCH thread for dlsch_thread_index %d (%p)\n",dlsch_thread_index,&dlsch_thread_indices[dlsch_thread_index]);
|
||||
error_code = pthread_create(&dlsch_threads[dlsch_thread_index],
|
||||
&attr_dlsch_threads,
|
||||
dlsch_thread,
|
||||
(void *)&dlsch_thread_indices[dlsch_thread_index]);
|
||||
|
||||
if (error_code!= 0) {
|
||||
rt_printk("[openair][SCHED][DLSCH][INIT] Could not allocate dlsch_thread %d, error %d\n",dlsch_thread_index,error_code);
|
||||
return(error_code);
|
||||
}
|
||||
else {
|
||||
rt_printk("[openair][SCHED][DLSCH][INIT] Allocate dlsch_thread %d successful\n",dlsch_thread_index);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void cleanup_dlsch_threads(void) {
|
||||
|
||||
unsigned char dlsch_thread_index;
|
||||
|
||||
for(dlsch_thread_index=0;dlsch_thread_index<8;dlsch_thread_index++) {
|
||||
// pthread_exit(&dlsch_threads[dlsch_thread_index]);
|
||||
rt_printk("[openair][SCHED][DLSCH] Scheduling dlsch_thread %d to exit\n",dlsch_thread_index);
|
||||
|
||||
dlsch_instance_cnt[dlsch_thread_index] = 0;
|
||||
if (pthread_cond_signal(&dlsch_cond[dlsch_thread_index]) != 0)
|
||||
rt_printk("[openair][SCHED][DLSCH] ERROR pthread_cond_signal\n");
|
||||
else
|
||||
rt_printk("[openair][SCHED][DLSCH] Signalled dlsch_thread %d to exit\n",dlsch_thread_index);
|
||||
|
||||
rt_printk("[openair][SCHED][DLSCH] Exiting ...\n");
|
||||
pthread_cond_destroy(&dlsch_cond[dlsch_thread_index]);
|
||||
pthread_mutex_destroy(&dlsch_mutex[dlsch_thread_index]);
|
||||
}
|
||||
}
|
||||
@@ -1,334 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file sched_dlsch.c
|
||||
* \brief DLSCH decoding thread (RTAI)
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#ifdef CBMIMO1
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#endif // CBMIMO1
|
||||
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
RTIME time0,time1;
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
/// Mutex for instance count on rx_pdsch scheduling
|
||||
pthread_mutex_t rx_pdsch_mutex;
|
||||
/// Condition variable for rx_pdsch thread
|
||||
pthread_cond_t rx_pdsch_cond;
|
||||
|
||||
pthread_t rx_pdsch_thread_var;
|
||||
pthread_attr_t attr_rx_pdsch_thread;
|
||||
|
||||
// activity indicators for harq_pid's
|
||||
int rx_pdsch_instance_cnt;
|
||||
// process ids for cpu
|
||||
int rx_pdsch_cpuid;
|
||||
// subframe number for each harq_pid (needed to store ack in right place for UL)
|
||||
int rx_pdsch_slot;
|
||||
|
||||
extern int oai_exit;
|
||||
extern pthread_mutex_t dlsch_mutex[8];
|
||||
extern int dlsch_instance_cnt[8];
|
||||
extern int dlsch_subframe[8];
|
||||
extern pthread_cond_t dlsch_cond[8];
|
||||
|
||||
/** RX_PDSCH Decoding Thread */
|
||||
static void * rx_pdsch_thread(void *param) {
|
||||
|
||||
//unsigned long cpuid;
|
||||
uint8_t rx_pdsch_thread_index = 0;
|
||||
uint8_t dlsch_thread_index = 0;
|
||||
uint8_t pilot1,pilot2,pilot3,harq_pid,subframe;
|
||||
uint8_t last_slot;
|
||||
|
||||
uint8_t dual_stream_UE = 0;
|
||||
uint8_t i_mod = 0;
|
||||
|
||||
RTIME time_in,time_out;
|
||||
#ifdef RTAI
|
||||
RT_TASK *task;
|
||||
#endif
|
||||
|
||||
int m,eNB_id = 0;
|
||||
int eNB_id_i = 1;
|
||||
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[0];
|
||||
|
||||
#ifdef RTAI
|
||||
task = rt_task_init_schmod(nam2num("RX_PDSCH_THREAD"), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
|
||||
if (task==NULL) {
|
||||
LOG_E(PHY,"[SCHED][RX_PDSCH] Problem starting rx_pdsch thread!!!!\n");
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"[SCHED][RX_PDSCH] rx_pdsch_thread started for with id %p\n",task);
|
||||
}
|
||||
#endif
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
//rt_set_runnable_on_cpuid(task,1);
|
||||
//cpuid = rtai_cpuid();
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_hard_real_time();
|
||||
#endif
|
||||
|
||||
if (phy_vars_ue->lte_frame_parms.Ncp == 0) { // normal prefix
|
||||
pilot1 = 4;
|
||||
pilot2 = 7;
|
||||
pilot3 = 11;
|
||||
}
|
||||
else { // extended prefix
|
||||
pilot1 = 3;
|
||||
pilot2 = 6;
|
||||
pilot3 = 9;
|
||||
}
|
||||
|
||||
|
||||
while (!oai_exit){
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_THREAD, 0);
|
||||
if (pthread_mutex_lock(&rx_pdsch_mutex) != 0) {
|
||||
LOG_E(PHY,"[SCHED][RX_PDSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
while (rx_pdsch_instance_cnt < 0) {
|
||||
pthread_cond_wait(&rx_pdsch_cond,&rx_pdsch_mutex);
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&rx_pdsch_mutex) != 0) {
|
||||
LOG_E(PHY,"[SCHED][RX_PDSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_THREAD, 1);
|
||||
|
||||
last_slot = rx_pdsch_slot;
|
||||
subframe = last_slot>>1;
|
||||
// Important! assumption that PDCCH procedure of next SF is not called yet
|
||||
harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid;
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->G = get_G(&phy_vars_ue->lte_frame_parms,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
|
||||
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
|
||||
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
|
||||
phy_vars_ue->frame,subframe);
|
||||
|
||||
if ((phy_vars_ue->transmission_mode[eNB_id] == 5) &&
|
||||
(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off==0) &&
|
||||
(openair_daq_vars.use_ia_receiver > 0)) {
|
||||
dual_stream_UE = 1;
|
||||
eNB_id_i = phy_vars_ue->n_connected_eNB;
|
||||
if (openair_daq_vars.use_ia_receiver == 2) {
|
||||
i_mod = get_Qm(((phy_vars_ue->frame%1024)/3)%28);
|
||||
} else {
|
||||
i_mod = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dual_stream_UE = 0;
|
||||
eNB_id_i = eNB_id+1;
|
||||
i_mod = 0;
|
||||
}
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
LOG_D(PHY,"[SCHED][RX_PDSCH] Frame %d, slot %d: Calling rx_pdsch_decoding with harq_pid %d\n",phy_vars_ue->frame,last_slot,harq_pid);
|
||||
|
||||
time_in = rt_get_time_ns();
|
||||
|
||||
// Check if we are in even or odd slot
|
||||
if (last_slot%2) { // odd slots
|
||||
|
||||
// measure time
|
||||
//time0 = rt_get_time_ns();
|
||||
// rt_printk("[SCHED][RX_PDSCH][before rx_pdsch] Frame %d, slot %d, time %llu\n",phy_vars_ue->frame,last_slot,rt_get_time_ns());
|
||||
for (m=pilot2;m<phy_vars_ue->lte_frame_parms.symbols_per_tti;m++) {
|
||||
|
||||
rx_pdsch(phy_vars_ue,
|
||||
PDSCH,
|
||||
eNB_id,
|
||||
eNB_id_i,
|
||||
subframe,
|
||||
m,
|
||||
0,
|
||||
dual_stream_UE,
|
||||
i_mod,
|
||||
harq_pid);
|
||||
|
||||
}
|
||||
// time1 = rt_get_time_ns();
|
||||
// rt_printk("[SCHED][RX_PDSCH] Frame %d, slot %d, start %llu, end %llu, proc time: %llu ns\n",phy_vars_ue->frame,last_slot,time0,time1,(time1-time0));
|
||||
|
||||
dlsch_thread_index = harq_pid;
|
||||
|
||||
if (pthread_mutex_lock (&dlsch_mutex[dlsch_thread_index]) != 0) { // Signal MAC_PHY Scheduler
|
||||
LOG_E(PHY,"[UE %d] ERROR pthread_mutex_lock\n",phy_vars_ue->Mod_id); // lock before accessing shared resource
|
||||
// vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
|
||||
//return(-1);
|
||||
}
|
||||
dlsch_instance_cnt[dlsch_thread_index]++;
|
||||
dlsch_subframe[dlsch_thread_index] = subframe;
|
||||
pthread_mutex_unlock (&dlsch_mutex[dlsch_thread_index]);
|
||||
|
||||
if (dlsch_instance_cnt[dlsch_thread_index] == 0) {
|
||||
if (pthread_cond_signal(&dlsch_cond[dlsch_thread_index]) != 0) {
|
||||
LOG_E(PHY,"[UE %d] ERROR pthread_cond_signal for dlsch_cond[%d]\n",phy_vars_ue->Mod_id,dlsch_thread_index);
|
||||
// vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
|
||||
//return(-1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_W(PHY,"[UE %d] DLSCH thread for dlsch_thread_index %d busy!!!\n",phy_vars_ue->Mod_id,dlsch_thread_index);
|
||||
// vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
|
||||
//return(-1);
|
||||
}
|
||||
|
||||
} else { // even slots
|
||||
|
||||
for (m=phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols;m<pilot2;m++) {
|
||||
|
||||
rx_pdsch(phy_vars_ue,
|
||||
PDSCH,
|
||||
eNB_id,
|
||||
eNB_id_i,
|
||||
subframe,
|
||||
m,
|
||||
(m==phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols)?1:0, // first_symbol_flag
|
||||
dual_stream_UE,
|
||||
i_mod,
|
||||
harq_pid);
|
||||
}
|
||||
}
|
||||
|
||||
time_out = rt_get_time_ns();
|
||||
|
||||
if (pthread_mutex_lock(&rx_pdsch_mutex) != 0) {
|
||||
msg("[openair][SCHED][RX_PDSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
rx_pdsch_instance_cnt--;
|
||||
|
||||
if (pthread_mutex_unlock(&rx_pdsch_mutex) != 0) {
|
||||
msg("[openair][SCHED][RX_PDSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_soft_real_time();
|
||||
#endif
|
||||
|
||||
LOG_D(PHY,"[openair][SCHED][RX_PDSCH] RX_PDSCH thread exiting\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_rx_pdsch_thread(void) {
|
||||
|
||||
int error_code;
|
||||
struct sched_param p;
|
||||
|
||||
pthread_mutex_init(&rx_pdsch_mutex,NULL);
|
||||
|
||||
pthread_cond_init(&rx_pdsch_cond,NULL);
|
||||
|
||||
pthread_attr_init (&attr_rx_pdsch_thread);
|
||||
pthread_attr_setstacksize(&attr_rx_pdsch_thread,OPENAIR_THREAD_STACK_SIZE);
|
||||
|
||||
//attr_rx_pdsch_thread.priority = 1;
|
||||
|
||||
p.sched_priority = OPENAIR_THREAD_PRIORITY;
|
||||
pthread_attr_setschedparam (&attr_rx_pdsch_thread, &p);
|
||||
#ifndef RTAI_ISNT_POSIX
|
||||
pthread_attr_setschedpolicy (&attr_rx_pdsch_thread, SCHED_FIFO);
|
||||
#endif
|
||||
|
||||
rx_pdsch_instance_cnt = -1;
|
||||
rt_printk("[openair][SCHED][RX_PDSCH][INIT] Allocating RX_PDSCH thread\n");
|
||||
error_code = pthread_create(&rx_pdsch_thread_var,
|
||||
&attr_rx_pdsch_thread,
|
||||
rx_pdsch_thread,
|
||||
0);
|
||||
|
||||
if (error_code!= 0) {
|
||||
rt_printk("[openair][SCHED][RX_PDSCH][INIT] Could not allocate rx_pdsch_thread, error %d\n",error_code);
|
||||
return(error_code);
|
||||
}
|
||||
else {
|
||||
rt_printk("[openair][SCHED][RX_PDSCH][INIT] Allocate rx_pdsch_thread successful\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void cleanup_rx_pdsch_thread(void) {
|
||||
|
||||
rt_printk("[openair][SCHED][RX_PDSCH] Scheduling rx_pdsch_thread to exit\n");
|
||||
|
||||
rx_pdsch_instance_cnt = 0;
|
||||
if (pthread_cond_signal(&rx_pdsch_cond) != 0)
|
||||
rt_printk("[openair][SCHED][RX_PDSCH] ERROR pthread_cond_signal\n");
|
||||
else
|
||||
rt_printk("[openair][SCHED][RX_PDSCH] Signalled rx_pdsch_thread to exit\n");
|
||||
|
||||
rt_printk("[openair][SCHED][RX_PDSCH] Exiting ...\n");
|
||||
pthread_cond_destroy(&rx_pdsch_cond);
|
||||
pthread_mutex_destroy(&rx_pdsch_mutex);
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file sched_ulsch.c
|
||||
* \brief ULSCH decoding thread (RTAI)
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#ifdef CBMIMO1
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#endif // CBMIMO1
|
||||
|
||||
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
/// Mutex for instance count on ulsch scheduling
|
||||
pthread_mutex_t ulsch_mutex[NUMBER_OF_UE_MAX];
|
||||
/// Condition variable for ulsch thread
|
||||
pthread_cond_t ulsch_cond[NUMBER_OF_UE_MAX];
|
||||
|
||||
pthread_t ulsch_threads[NUMBER_OF_UE_MAX];
|
||||
pthread_attr_t attr_ulsch_threads;
|
||||
|
||||
// activity indicators for harq_pid's
|
||||
int ulsch_instance_cnt[NUMBER_OF_UE_MAX];
|
||||
// process ids for cpu
|
||||
int ulsch_cpuid[NUMBER_OF_UE_MAX];
|
||||
// subframe number for each harq_pid (needed to store ack in right place for UL)
|
||||
int ulsch_subframe[NUMBER_OF_UE_MAX];
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
/*
|
||||
extern int ulsch_errors;
|
||||
extern int ulsch_received;
|
||||
extern int ulsch_errors_last;
|
||||
extern int ulsch_received_last;
|
||||
extern int ulsch_fer;
|
||||
extern int current_ulsch_cqi;
|
||||
*/
|
||||
|
||||
/** ULSCH Decoding Thread */
|
||||
static void * ulsch_thread(void *param) {
|
||||
|
||||
//unsigned long cpuid;
|
||||
unsigned int ulsch_thread_index = (unsigned int)param;
|
||||
|
||||
RTIME time_in,time_out;
|
||||
#ifdef RTAI
|
||||
RT_TASK *task;
|
||||
char ulsch_thread_name[64];
|
||||
#endif
|
||||
|
||||
int eNB_id = 0, UE_id = 0;
|
||||
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[eNB_id];
|
||||
|
||||
if ((ulsch_thread_index <0) || (ulsch_thread_index>NUMBER_OF_UE_MAX)) {
|
||||
LOG_E(PHY,"[SCHED][ULSCH] Illegal ulsch_thread_index %d!!!!\n",ulsch_thread_index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef RTAI
|
||||
sprintf(ulsch_thread_name,"ULSCH_THREAD%d",ulsch_thread_index);
|
||||
|
||||
LOG_I(PHY,"[SCHED][ULSCH] starting ulsch_thread %s for process %d\n",
|
||||
ulsch_thread_name,
|
||||
ulsch_thread_index);
|
||||
|
||||
task = rt_task_init_schmod(nam2num(ulsch_thread_name), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
|
||||
if (task==NULL) {
|
||||
LOG_E(PHY,"[SCHED][ULSCH] Problem starting ulsch_thread_index %d!!!!\n",ulsch_thread_index);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"[SCHED][ULSCH] ulsch_thread for process %d started with id %p\n",
|
||||
ulsch_thread_index,
|
||||
task);
|
||||
}
|
||||
#endif
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
//rt_set_runnable_on_cpuid(task,1);
|
||||
//cpuid = rtai_cpuid();
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_hard_real_time();
|
||||
#endif
|
||||
|
||||
//ulsch_cpuid[ulsch_thread_index] = cpuid;
|
||||
|
||||
while (!oai_exit){
|
||||
|
||||
if (pthread_mutex_lock(&ulsch_mutex[ulsch_thread_index]) != 0) {
|
||||
LOG_E(PHY,"[SCHED][ULSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
|
||||
while (ulsch_instance_cnt[ulsch_thread_index] < 0) {
|
||||
pthread_cond_wait(&ulsch_cond[ulsch_thread_index],&ulsch_mutex[ulsch_thread_index]);
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ulsch_mutex[ulsch_thread_index]) != 0) {
|
||||
LOG_E(PHY,"[SCHED][ULSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
LOG_D(PHY,"[SCHED][ULSCH] Frame %d: Calling ulsch_decoding with ulsch_thread_index = %d\n",phy_vars_eNB->frame,ulsch_thread_index);
|
||||
|
||||
time_in = rt_get_time_ns();
|
||||
|
||||
ulsch_decoding_procedures(ulsch_subframe[ulsch_thread_index]<<1,ulsch_thread_index,phy_vars_eNB,0);
|
||||
|
||||
time_out = rt_get_time_ns();
|
||||
|
||||
if (pthread_mutex_lock(&ulsch_mutex[ulsch_thread_index]) != 0) {
|
||||
msg("[openair][SCHED][ULSCH] error locking mutex.\n");
|
||||
}
|
||||
else {
|
||||
ulsch_instance_cnt[ulsch_thread_index]--;
|
||||
|
||||
if (pthread_mutex_unlock(&ulsch_mutex[ulsch_thread_index]) != 0) {
|
||||
msg("[openair][SCHED][ULSCH] error unlocking mutex.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_soft_real_time();
|
||||
#endif
|
||||
|
||||
msg("[openair][SCHED][ULSCH] ULSCH thread %d exiting\n",ulsch_thread_index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_ulsch_threads(void) {
|
||||
|
||||
int error_code, return_code=0;
|
||||
struct sched_param p;
|
||||
int ulsch_thread_index;
|
||||
|
||||
// later loop on all harq_pids, do 0 for now
|
||||
for (ulsch_thread_index=0;ulsch_thread_index<NUMBER_OF_UE_MAX;ulsch_thread_index++) {
|
||||
|
||||
pthread_mutex_init(&ulsch_mutex[ulsch_thread_index],NULL);
|
||||
|
||||
pthread_cond_init(&ulsch_cond[ulsch_thread_index],NULL);
|
||||
|
||||
pthread_attr_init (&attr_ulsch_threads);
|
||||
pthread_attr_setstacksize(&attr_ulsch_threads,OPENAIR_THREAD_STACK_SIZE);
|
||||
|
||||
//attr_ulsch_threads.priority = 1;
|
||||
|
||||
p.sched_priority = OPENAIR_THREAD_PRIORITY;
|
||||
pthread_attr_setschedparam (&attr_ulsch_threads, &p);
|
||||
#ifndef RTAI_ISNT_POSIX
|
||||
pthread_attr_setschedpolicy (&attr_ulsch_threads, SCHED_FIFO);
|
||||
#endif
|
||||
|
||||
ulsch_instance_cnt[ulsch_thread_index] = -1;
|
||||
rt_printk("[openair][SCHED][ULSCH][INIT] Allocating ULSCH thread for ulsch_thread_index %d\n",ulsch_thread_index);
|
||||
error_code = pthread_create(&ulsch_threads[ulsch_thread_index],
|
||||
&attr_ulsch_threads,
|
||||
ulsch_thread,
|
||||
(void *)ulsch_thread_index);
|
||||
|
||||
if (error_code!= 0) {
|
||||
rt_printk("[openair][SCHED][ULSCH][INIT] Could not allocate ulsch_thread %d, error %d\n",ulsch_thread_index,error_code);
|
||||
return_code+=error_code;
|
||||
//return(error_code);
|
||||
}
|
||||
else {
|
||||
rt_printk("[openair][SCHED][ULSCH][INIT] Allocate ulsch_thread %d successful\n",ulsch_thread_index);
|
||||
//return(0);
|
||||
}
|
||||
}
|
||||
return(return_code);
|
||||
}
|
||||
|
||||
void cleanup_ulsch_threads(void) {
|
||||
|
||||
int ulsch_thread_index;
|
||||
|
||||
for (ulsch_thread_index=0;ulsch_thread_index<NUMBER_OF_UE_MAX;ulsch_thread_index++) {
|
||||
|
||||
// pthread_exit(&ulsch_threads[ulsch_thread_index]);
|
||||
rt_printk("[openair][SCHED][ULSCH] Scheduling ulsch_thread %d to exit\n",ulsch_thread_index);
|
||||
|
||||
ulsch_instance_cnt[ulsch_thread_index] = 0;
|
||||
if (pthread_cond_signal(&ulsch_cond[ulsch_thread_index]) != 0)
|
||||
rt_printk("[openair][SCHED][ULSCH] ERROR pthread_cond_signal\n");
|
||||
else
|
||||
rt_printk("[openair][SCHED][ULSCH] Signalled ulsch_thread %d to exit\n",ulsch_thread_index);
|
||||
|
||||
rt_printk("[openair][SCHED][ULSCH] Exiting ...\n");
|
||||
pthread_cond_destroy(&ulsch_cond[ulsch_thread_index]);
|
||||
pthread_mutex_destroy(&ulsch_mutex[ulsch_thread_index]);
|
||||
}
|
||||
}
|
||||
@@ -1,299 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Eurecom OpenAirInterface
|
||||
Copyright(c) 1999 - 2011 Eurecom
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information
|
||||
Openair Admin: openair_admin@eurecom.fr
|
||||
Openair Tech : openair_tech@eurecom.fr
|
||||
Forums : http://forums.eurecom.fsr/openairinterface
|
||||
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file lte-softmodem.c
|
||||
* \brief main program to control HW and scheduling
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2012
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#define TIMER_ONESHOT_MODE
|
||||
#define FRAME_PERIOD 10000000ULL
|
||||
#define DAQ_PERIOD 500000ULL
|
||||
#define LTE_SLOTS_PER_FRAME 20
|
||||
|
||||
#ifdef RTAI
|
||||
static SEM *mutex;
|
||||
//static CND *cond;
|
||||
|
||||
static long int thread0;
|
||||
static long int thread1;
|
||||
//static long int sync_thread;
|
||||
#else
|
||||
#define OPENAIR_THREAD_STACK_SIZE 8192
|
||||
#define OPENAIR_THREAD_PRIORITY 255
|
||||
pthread_t thread0;
|
||||
//pthread_t thread1;
|
||||
pthread_attr_t attr_dlsch_threads;
|
||||
struct sched_param sched_param_dlsch;
|
||||
#endif
|
||||
|
||||
int oai_exit = 0;
|
||||
|
||||
struct timing_info_t {
|
||||
//unsigned int frame, hw_slot, last_slot, next_slot;
|
||||
RTIME time_min, time_max, time_avg, time_last, time_now;
|
||||
//unsigned int mbox0, mbox1, mbox2, mbox_target;
|
||||
unsigned int n_samples;
|
||||
} timing_info;
|
||||
|
||||
void signal_handler(int sig)
|
||||
{
|
||||
void *array[10];
|
||||
size_t size;
|
||||
|
||||
if (sig==SIGSEGV) {
|
||||
// get void*'s for all entries on the stack
|
||||
size = backtrace(array, 10);
|
||||
|
||||
// print out all the frames to stderr
|
||||
fprintf(stderr, "Error: signal %d:\n", sig);
|
||||
backtrace_symbols_fd(array, size, 2);
|
||||
exit(-1);
|
||||
}
|
||||
else {
|
||||
oai_exit=1;
|
||||
}
|
||||
}
|
||||
|
||||
void exit_fun(const char* s)
|
||||
{
|
||||
void *array[10];
|
||||
size_t size;
|
||||
|
||||
printf("Exiting: %s\n",s);
|
||||
|
||||
oai_exit=1;
|
||||
//rt_sleep_ns(FRAME_PERIOD);
|
||||
|
||||
//exit (-1);
|
||||
}
|
||||
|
||||
int frame=0,slot=0;
|
||||
|
||||
/* This is the main eNB thread. It gets woken up by the kernel driver using the RTAI message mechanism (rt_send and rt_receive). */
|
||||
static void *eNB_thread(void *arg)
|
||||
{
|
||||
#ifdef RTAI
|
||||
RT_TASK *task;
|
||||
RTIME now;
|
||||
#endif
|
||||
unsigned char last_slot, next_slot;
|
||||
RTIME time_in, time_diff;
|
||||
int ret;
|
||||
|
||||
#ifdef RTAI
|
||||
task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
printf("Started eNB thread (id %p)\n",task);
|
||||
#ifndef TIMER_ONESHOT_MODE
|
||||
now = rt_get_time();
|
||||
ret = rt_task_make_periodic(task, now, nano2count(DAQ_PERIOD));
|
||||
if (ret!=0)
|
||||
printf("Problem with periodic timer\n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_hard_real_time();
|
||||
#endif
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
timing_info.time_min = 100000000ULL;
|
||||
timing_info.time_max = 0;
|
||||
timing_info.time_avg = 0;
|
||||
timing_info.n_samples = 0;
|
||||
|
||||
while (!oai_exit)
|
||||
{
|
||||
time_in = rt_get_time_ns();
|
||||
#ifdef TIMER_ONESHOT_MODE
|
||||
ret = rt_sleep_ns(DAQ_PERIOD);
|
||||
if (ret)
|
||||
printf("eNB Frame %d, time %llu: rt_sleep_ns returned %d\n",frame,time_in,ret);
|
||||
#else
|
||||
rt_task_wait_period();
|
||||
#endif
|
||||
time_diff = rt_get_time_ns() - time_in;
|
||||
|
||||
if (time_diff > timing_info.time_max)
|
||||
timing_info.time_max = time_diff;
|
||||
if (time_diff < timing_info.time_min)
|
||||
timing_info.time_min = time_diff;
|
||||
timing_info.time_avg = (timing_info.time_avg*timing_info.n_samples + time_diff)/(timing_info.n_samples+1);
|
||||
timing_info.n_samples++;
|
||||
|
||||
last_slot = (slot)%LTE_SLOTS_PER_FRAME;
|
||||
if (last_slot <0)
|
||||
last_slot+=20;
|
||||
next_slot = (slot+3)%LTE_SLOTS_PER_FRAME;
|
||||
|
||||
slot++;
|
||||
if (slot==20) {
|
||||
slot=0;
|
||||
frame++;
|
||||
}
|
||||
}
|
||||
|
||||
printf("eNB_thread: finished, ran %d times.\n",frame);
|
||||
|
||||
#ifdef HARD_RT
|
||||
rt_make_soft_real_time();
|
||||
#endif
|
||||
|
||||
// clean task
|
||||
#ifdef RTAI
|
||||
rt_task_delete(task);
|
||||
#endif
|
||||
printf("Task deleted. returning\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
#ifdef RTAI
|
||||
RT_TASK *task;
|
||||
RTIME period;
|
||||
#else
|
||||
int error_code;
|
||||
#endif
|
||||
int i,j,aa;
|
||||
void *status;
|
||||
|
||||
// to make a graceful exit when ctrl-c is pressed
|
||||
signal(SIGSEGV, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
#ifndef RTAI
|
||||
check_clock();
|
||||
#endif
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
#ifdef RTAI
|
||||
// make main thread LXRT soft realtime
|
||||
task = rt_task_init_schmod(nam2num("MYTASK"), 9, 0, 0, SCHED_FIFO, 0xF);
|
||||
|
||||
// start realtime timer and scheduler
|
||||
#ifdef TIMER_ONESHOT_MODE
|
||||
rt_set_oneshot_mode();
|
||||
start_rt_timer(0);
|
||||
printf("started RTAI timer in oneshot mode\n");
|
||||
#else
|
||||
rt_set_periodic_mode();
|
||||
period = start_rt_timer(nano2count(500000));
|
||||
printf("started RTAI timer with period %llu ns\n",count2nano(period));
|
||||
#endif
|
||||
|
||||
printf("Init mutex\n");
|
||||
//mutex = rt_get_adr(nam2num("MUTEX"));
|
||||
mutex = rt_sem_init(nam2num("MUTEX"), 1);
|
||||
if (mutex==0)
|
||||
{
|
||||
printf("Error init mutex\n");
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
printf("mutex=%p\n",mutex);
|
||||
#endif
|
||||
|
||||
rt_sleep_ns(10*FRAME_PERIOD);
|
||||
|
||||
#ifndef RTAI
|
||||
pthread_attr_init (&attr_dlsch_threads);
|
||||
pthread_attr_setstacksize(&attr_dlsch_threads,OPENAIR_THREAD_STACK_SIZE);
|
||||
//attr_dlsch_threads.priority = 1;
|
||||
sched_param_dlsch.sched_priority = sched_get_priority_max(SCHED_FIFO); //OPENAIR_THREAD_PRIORITY;
|
||||
pthread_attr_setschedparam (&attr_dlsch_threads, &sched_param_dlsch);
|
||||
pthread_attr_setschedpolicy (&attr_dlsch_threads, SCHED_FIFO);
|
||||
#endif
|
||||
|
||||
#ifdef RTAI
|
||||
thread0 = rt_thread_create(eNB_thread, NULL, 100000000);
|
||||
#else
|
||||
error_code = pthread_create(&thread0, &attr_dlsch_threads, eNB_thread, NULL);
|
||||
if (error_code!= 0) {
|
||||
printf("[lte-softmodem.c] Could not allocate eNB_thread, error %d\n",error_code);
|
||||
return(error_code);
|
||||
}
|
||||
else {
|
||||
printf("[lte-softmodem.c] Allocate eNB_thread successful\n");
|
||||
}
|
||||
#endif
|
||||
printf("eNB threads created\n");
|
||||
|
||||
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
//getchar();
|
||||
while (oai_exit==0) {
|
||||
|
||||
printf("eNB Frame %d, hw_slot %d (time %llu): period %llu, sleep time (avg/min/max/samples) %llu / %llu / %llu / %d, ratio %f\n",frame,slot,rt_get_time_ns(),DAQ_PERIOD,timing_info.time_avg,timing_info.time_min,timing_info.time_max,timing_info.n_samples,(double)timing_info.time_avg/DAQ_PERIOD);
|
||||
|
||||
|
||||
rt_sleep_ns(100*FRAME_PERIOD);
|
||||
}
|
||||
|
||||
// stop threads
|
||||
#ifdef RTAI
|
||||
rt_thread_join(thread0);
|
||||
#else
|
||||
pthread_join(thread0,&status);
|
||||
#endif
|
||||
|
||||
#ifdef RTAI
|
||||
stop_rt_timer();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/* Form definition file generated by fdesign */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "stats.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
***************************************/
|
||||
|
||||
FD_stats_form *
|
||||
create_form_stats_form( void )
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_stats_form *fdui = fl_malloc( sizeof *fdui );
|
||||
|
||||
fdui->vdata = fdui->cdata = NULL;
|
||||
fdui->ldata = 0;
|
||||
|
||||
fdui->stats_form = fl_bgn_form( FL_NO_BOX, 1115, 659 );
|
||||
|
||||
obj = fl_add_box( FL_UP_BOX, 0, 0, 1115, 659, "" );
|
||||
|
||||
fdui->stats_text = obj = fl_add_text( FL_NORMAL_TEXT, 60, 50, 1000, 580, "test" );
|
||||
fl_set_object_lsize( obj, FL_TINY_SIZE );
|
||||
|
||||
fl_end_form( );
|
||||
|
||||
fdui->stats_form->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
Magic: 14000
|
||||
|
||||
Internal Form Definition File
|
||||
(do not change)
|
||||
|
||||
Number of forms: 1
|
||||
Unit of measure: FL_COORD_PIXEL
|
||||
|
||||
=============== FORM ===============
|
||||
Name: stats_form
|
||||
Width: 1115
|
||||
Height: 659
|
||||
Number of Objects: 2
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
type: UP_BOX
|
||||
box: 0 0 1115 659
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_TEXT
|
||||
type: NORMAL_TEXT
|
||||
box: 60 50 1000 580
|
||||
boxtype: FL_FLAT_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_TINY_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: test
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: stats_text
|
||||
callback:
|
||||
argument:
|
||||
|
||||
==============================
|
||||
create_the_forms
|
||||
@@ -1,24 +0,0 @@
|
||||
/* Header file generated by fdesign on Thu Jun 14 17:53:15 2012 */
|
||||
|
||||
#ifndef FD_stats_form_h_
|
||||
#define FD_stats_form_h_
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
|
||||
|
||||
/* Forms and Objects */
|
||||
|
||||
typedef struct {
|
||||
FL_FORM * stats_form;
|
||||
void * vdata;
|
||||
char * cdata;
|
||||
long ldata;
|
||||
FL_OBJECT * stats_text;
|
||||
} FD_stats_form;
|
||||
|
||||
extern FD_stats_form * create_form_stats_form( void );
|
||||
|
||||
#endif /* FD_stats_form_h_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
8254752 8254752 8254752 8254752
|
||||
@@ -1,10 +0,0 @@
|
||||
# this file contains the calibration values to compute the RSSI
|
||||
# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
|
||||
# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to max 30dB
|
||||
# high gain
|
||||
128 128 128 128
|
||||
# med gain
|
||||
127 127 127 127
|
||||
# low gain
|
||||
120 120 120 120
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# For the TX, we need to set the tx gain values such that the transmitted power on all antennas is the same
|
||||
# don't put any blank lines in this file
|
||||
# tx gain (dB)
|
||||
25 25 25 25
|
||||
# total tx power (dBm)
|
||||
5
|
||||
@@ -1 +0,0 @@
|
||||
8254871 8255752 8257340 8257340
|
||||
@@ -1,10 +0,0 @@
|
||||
# this file contains the calibration values to compute the RSSI
|
||||
# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
|
||||
# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB
|
||||
# high gain
|
||||
108 108 108 108
|
||||
# med gain
|
||||
127 127 127 127
|
||||
# low gain
|
||||
120 120 120 120
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# For the TX, we need to set the tx gain values such that the transmitted power on all antennas is the same
|
||||
# don't put any blank lines in this file
|
||||
# tx gain (dB)
|
||||
25 25 25 25
|
||||
# total tx power (dBm)
|
||||
4
|
||||
@@ -1 +0,0 @@
|
||||
8255000 8255000 8255000 8255000
|
||||
@@ -1,3 +0,0 @@
|
||||
133 133 133 133
|
||||
127 127 127 127
|
||||
120 120 120 120
|
||||
Reference in New Issue
Block a user