Commit a6f98a8b authored by Cedric Roux's avatar Cedric Roux

Merge branch 'develop_integration_w20' into 'develop'

develop_integration_w20 into develop

Summary of changes:
- bug fixes
  * UE TDD fixes
  * PDCCH size computation (at phy level, still to be corrected at mac level)
  * DAI increment
  * fix run_enb_ue_virt_noS1 and run_enb_ue_virt_s1 to use Rel14 and
     have --xforms to work
  * compilation warning removals
  * better oaisim logging (print UE security keys,
    print version (git commit ID) at runtime, print working directory)

See merge request !190
parents 430a8c4e c98339e1
...@@ -785,20 +785,19 @@ function main() { ...@@ -785,20 +785,19 @@ function main() {
build_dir=$rrh_build_dir build_dir=$rrh_build_dir
fi fi
# build RF device libraries (currently EXMIMO is not complied with the rest of HW targets) # build RF device libraries
if [ "$HW" != "None" ] ; then if [ "$HW" != "None" ] ; then
rm -f liboai_device.so rm -f liboai_device.so
rm -f $dbin/liboai_device.so rm -f $dbin/liboai_device.so
# link liboai_device.so with the selected RF device library # link liboai_device.so with the selected RF device library
if [ "$HW" == "EXMIMO" ] ; then if [ "$HW" == "EXMIMO" ] ; then
#add exmimo compilation
#TODO EXMIMO library support
compilations \ compilations \
$build_dir oai_exmimodevif \ $build_dir oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
ln -sf liboai_exmimodevif.so liboai_device.so
ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to EXMIMO device library" echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then elif [ "$HW" == "OAI_USRP" ] ; then
if [ -d "/usr/include/uhd" ] ; then if [ -d "/usr/include/uhd" ] ; then
......
...@@ -150,7 +150,7 @@ function main() ...@@ -150,7 +150,7 @@ function main()
# -u | --num-ue ) # -u | --num-ue )
-V | --vcd) -V | --vcd)
"setting gtk-wave output" echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ; shift ;
;; ;;
...@@ -164,6 +164,11 @@ function main() ...@@ -164,6 +164,11 @@ function main()
exe_arguments="$exe_arguments -n $2" exe_arguments="$exe_arguments -n $2"
shift 2; shift 2;
;; ;;
-x | --xforms)
echo "running with xforms"
exe_arguments="$exe_arguments --xforms"
shift 1;
;;
*) *)
echo "Unknown option $1" echo "Unknown option $1"
help help
...@@ -212,11 +217,11 @@ function main() ...@@ -212,11 +217,11 @@ function main()
fi fi
if [ $run_gdb -eq 0 ]; then if [ $run_gdb -eq 0 ]; then
exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
else else
touch ~/.gdb_enb_ue_nos1 touch ~/.gdb_enb_ue_nos1
chmod 777 ~/.gdb_enb_ue_nos1 chmod 777 ~/.gdb_enb_ue_nos1
echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10" > ~/.gdb_enb_ue_nos1 echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14" > ~/.gdb_enb_ue_nos1
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1 echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1
echo "run" >> ~/.gdb_enb_ue_nos1 echo "run" >> ~/.gdb_enb_ue_nos1
cat ~/.gdb_enb_ue_nos1 cat ~/.gdb_enb_ue_nos1
......
...@@ -174,7 +174,7 @@ function main() ...@@ -174,7 +174,7 @@ function main()
;; ;;
-V | --vcd) -V | --vcd)
"setting gtk-wave output" echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ; shift ;
;; ;;
...@@ -183,6 +183,11 @@ function main() ...@@ -183,6 +183,11 @@ function main()
exe_arguments="$exe_arguments -P wireshark" exe_arguments="$exe_arguments -P wireshark"
shift 2; shift 2;
;; ;;
-x | --xforms)
echo "running with xforms"
exe_arguments="$exe_arguments --xforms"
shift 1;
;;
*) *)
echo "Unknown option $1" echo "Unknown option $1"
help help
...@@ -258,11 +263,11 @@ function main() ...@@ -258,11 +263,11 @@ function main()
fi fi
if [ $run_gdb -eq 0 ]; then if [ $run_gdb -eq 0 ]; then
exec $OPENAIR_DIR/targets/bin/oaisim.Rel10 $exe_arguments | tee /tmp/enb_ue_s1.log.txt exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
else else
touch ~/.gdb_enb_ue_s1 touch ~/.gdb_enb_ue_s1
chmod 777 ~/.gdb_enb_ue_s1 chmod 777 ~/.gdb_enb_ue_s1
echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel10" > ~/.gdb_enb_ue_s1 echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel14" > ~/.gdb_enb_ue_s1
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1 echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1
echo "run" >> ~/.gdb_enb_ue_s1 echo "run" >> ~/.gdb_enb_ue_s1
cat ~/.gdb_enb_ue_s1 cat ~/.gdb_enb_ue_s1
......
...@@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK ...@@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK
ID = ENB_PHY_ULSCH_UE_DCI ID = ENB_PHY_ULSCH_UE_DCI
DESC = eNodeB uplink UE specific DCI as sent by the PHY layer DESC = eNodeB uplink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:ENB GROUP = ALL:PHY:GRAPHIC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE
ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION
DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top) DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top)
GROUP = ALL:PHY:GRAPHIC:ENB GROUP = ALL:PHY:GRAPHIC:ENB
......
File mode changed from 100755 to 100644
...@@ -1979,6 +1979,9 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, ...@@ -1979,6 +1979,9 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
uint16_t numCCE = 0; uint16_t numCCE = 0;
uint8_t i; uint8_t i;
uint8_t nCCEmin = 0; uint8_t nCCEmin = 0;
uint16_t CCE_max_used_index = 0;
uint16_t firstCCE_max = dci_alloc[0].firstCCE;
uint8_t L = dci_alloc[0].L;
// check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211) // check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211)
if (frame_parms->Ncp==1) { // extended prefix if (frame_parms->Ncp==1) { // extended prefix
...@@ -1995,16 +1998,22 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, ...@@ -1995,16 +1998,22 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
for (i=0; i<num_dci; i++) { for (i=0; i<num_dci; i++) {
// printf("dci %d => %d\n",i,dci_alloc[i].L); // printf("dci %d => %d\n",i,dci_alloc[i].L);
numCCE += (1<<(dci_alloc[i].L)); numCCE += (1<<(dci_alloc[i].L));
if(firstCCE_max < dci_alloc[i].firstCCE) {
firstCCE_max = dci_alloc[i].firstCCE;
L = dci_alloc[i].L;
}
} }
CCE_max_used_index = firstCCE_max + (1<<L) - 1;
//if ((9*numCCE) <= (frame_parms->N_RB_DL*2)) //if ((9*numCCE) <= (frame_parms->N_RB_DL*2))
if (numCCE <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) if (CCE_max_used_index < get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(1,nCCEmin)); return(cmax(1,nCCEmin));
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5))) //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5)))
else if (numCCE <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe))) else if (CCE_max_used_index < get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(2,nCCEmin)); return(cmax(2,nCCEmin));
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8))) //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8)))
else if (numCCE <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe))) else if (CCE_max_used_index < get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(3,nCCEmin)); return(cmax(3,nCCEmin));
else if (frame_parms->N_RB_DL<=10) { else if (frame_parms->N_RB_DL<=10) {
if (frame_parms->Ncp == 0) { // normal CP if (frame_parms->Ncp == 0) { // normal CP
......
...@@ -4888,7 +4888,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4888,7 +4888,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if(rballoc > RIV_max) if(rballoc > RIV_max)
{ {
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %d \n",rballoc, RIV_max); LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
// DCI false detection // DCI false detection
return(0); return(0);
} }
...@@ -5124,7 +5124,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -5124,7 +5124,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
if( (rballoc > RIV_max) && (rah == 1) ) if( (rballoc > RIV_max) && (rah == 1) )
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad rballoc %d RIV_max %d\n", rballoc, RIV_max); LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
return(0); return(0);
} }
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -135,6 +135,17 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su ...@@ -135,6 +135,17 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
break; break;
case 4:
if ( (subframe == 8) || (subframe == 9) ) {
return(subframe-8);
} else {
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
} }
return(0); return(0);
...@@ -1396,6 +1407,7 @@ void rx_phich(PHY_VARS_UE *ue, ...@@ -1396,6 +1407,7 @@ void rx_phich(PHY_VARS_UE *ue,
HI16, HI16,
nseq_PHICH, nseq_PHICH,
ngroup_PHICH, ngroup_PHICH,
ulsch->harq_processes[harq_pid]->round,
ulsch->Mlimit); ulsch->Mlimit);
//#endif //#endif
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -2510,6 +2510,8 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = { ...@@ -2510,6 +2510,8 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = {
-30273,12539,-25330,20787,-18205,27244,-9512,31356 -30273,12539,-25330,20787,-18205,27244,-9512,31356
}; };
#if 0
/* this is defined but not used, let's comment */
const static int16_t tw64rep[192] __attribute__((aligned(32))) = { const static int16_t tw64rep[192] __attribute__((aligned(32))) = {
32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, 32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512,
30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, 30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788,
...@@ -2524,6 +2526,7 @@ const static int16_t tw64rep[192] __attribute__((aligned(32))) = { ...@@ -2524,6 +2526,7 @@ const static int16_t tw64rep[192] __attribute__((aligned(32))) = {
-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, -23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,
-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 -30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356
}; };
#endif
const static int16_t tw64a[96] __attribute__((aligned(32))) = { const static int16_t tw64a[96] __attribute__((aligned(32))) = {
32767,0,32609,3212,32137,6393,31356,9512, 32767,0,32609,3212,32137,6393,31356,9512,
...@@ -2539,6 +2542,8 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = { ...@@ -2539,6 +2542,8 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = {
-23170,23170,-28898,15447,-32138,6393,-32610,-3211, -23170,23170,-28898,15447,-32138,6393,-32610,-3211,
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
}; };
#if 0
/* this is defined but not used, let's comment */
const static int16_t tw64arep[192] __attribute__((aligned(32))) = { const static int16_t tw64arep[192] __attribute__((aligned(32))) = {
32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, 32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512,
30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, 30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788,
...@@ -2553,6 +2558,7 @@ const static int16_t tw64arep[192] __attribute__((aligned(32))) = { ...@@ -2553,6 +2558,7 @@ const static int16_t tw64arep[192] __attribute__((aligned(32))) = {
-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, -23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
}; };
#endif
const static int16_t tw64b[96] __attribute__((aligned(32))) = { const static int16_t tw64b[96] __attribute__((aligned(32))) = {
0,32767,-3212,32609,-6393,32137,-9512,31356, 0,32767,-3212,32609,-6393,32137,-9512,31356,
...@@ -2569,6 +2575,8 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = { ...@@ -2569,6 +2575,8 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = {
12539,-30273,20787,-25330,27244,-18205,31356,-9512 12539,-30273,20787,-25330,27244,-18205,31356,-9512
}; };
#if 0
/* this is defined but not used, let's comment */
const static int16_t tw64brep[192] __attribute__((aligned(32))) = { const static int16_t tw64brep[192] __attribute__((aligned(32))) = {
0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, 0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356,
-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, -12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329,
...@@ -2583,6 +2591,7 @@ const static int16_t tw64brep[192] __attribute__((aligned(32))) = { ...@@ -2583,6 +2591,7 @@ const static int16_t tw64brep[192] __attribute__((aligned(32))) = {
-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, -23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,
12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512
}; };
#endif
const static int16_t tw64c[96] __attribute__((aligned(32))) = { const static int16_t tw64c[96] __attribute__((aligned(32))) = {
0,32767,3212,32609,6393,32137,9512,31356, 0,32767,3212,32609,6393,32137,9512,31356,
...@@ -2599,6 +2608,8 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = { ...@@ -2599,6 +2608,8 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = {
-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
}; };
#if 0
/* this is defined but not used, let's comment */
const static int16_t tw64crep[192] __attribute__((aligned(32))) = { const static int16_t tw64crep[192] __attribute__((aligned(32))) = {
0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, 0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356,
12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, 12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329,
...@@ -2613,6 +2624,7 @@ const static int16_t tw64crep[192] __attribute__((aligned(32))) = { ...@@ -2613,6 +2624,7 @@ const static int16_t tw64crep[192] __attribute__((aligned(32))) = {
23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, 23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,
-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
}; };
#endif
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -105,7 +105,47 @@ void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -105,7 +105,47 @@ void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms,
*frame = (current_frame+2) & 1023; *frame = (current_frame+2) & 1023;
break; break;
} }
} } else if (frame_parms->tdd_config == 4) {
switch (current_subframe) {
case 0:
case 4:
case 5:
case 6:
*subframe = 2;
*frame = (current_frame+1) & 1023;
break;
case 7:
*subframe = 3;
*frame = (current_frame+1) & 1023;
break;
case 8:
case 9:
*subframe = 2;
*frame = (current_frame+2) & 1023;
break;
}
} else if (frame_parms->tdd_config == 5) {
switch (current_subframe) {
case 0:
case 4:
case 5:
case 6:
*subframe = 2;
*frame = (current_frame+1) & 1023;
break;
case 7:
case 8:
case 9:
*subframe = 2;
*frame = (current_frame+2) & 1023;
break;
}
}
} }
} }
...@@ -137,6 +177,13 @@ void get_Msg3_alloc_ret(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -137,6 +177,13 @@ void get_Msg3_alloc_ret(LTE_DL_FRAME_PARMS *frame_parms,
// original PUSCH in 3, PHICH in 9, ret in 3 next frame // original PUSCH in 3, PHICH in 9, ret in 3 next frame
// original PUSCH in 4, PHICH in 0, ret in 4 next frame // original PUSCH in 4, PHICH in 0, ret in 4 next frame
*frame=(current_frame+1) & 1023; *frame=(current_frame+1) & 1023;
} else if (frame_parms->tdd_config == 4) {
// original PUSCH in 2, PHICH in 8, ret in 2 next frame
// original PUSCH in 3, PHICH in 9, ret in 3 next frame
*frame=(current_frame+1) & 1023;
} else if (frame_parms->tdd_config == 5) {
// original PUSCH in 2, PHICH in 8, ret in 2 next frame
*frame=(current_frame+1) & 1023;
} }
} }
} }
...@@ -253,6 +300,24 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig ...@@ -253,6 +300,24 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig
break; break;
case 4:
if (subframe == 2) { // ACK subframes 0, 4 and 5
//if (ACK_index==2)
// return(1); TBC
if (ACK_index==2)
return(0);
return(4+ACK_index);
} else if (subframe == 3) { // ACK subframes 6, 7 8 and 9
return(6+ACK_index); // To be updated
} else {
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 1: case 1:
if (subframe == 2) { // ACK subframes 5 and 6 if (subframe == 2) { // ACK subframes 5 and 6
return(5+ACK_index); return(5+ACK_index);
...@@ -297,6 +362,30 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s ...@@ -297,6 +362,30 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
break; break;
case 4:
if (subframe == 2) { // ACK subframes 0,4 and 5
return(3); // should be 4
} else if (subframe == 3) { // ACK subframes 6,7,8 and 9
return(4);
} else {
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 5:
if (subframe == 2) { // ACK subframes 0,3,4,5,6,7,8 and 9
return(8); // should be 3
} else {
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 1: case 1:
if (subframe == 2) { // ACK subframes 5 and 6 if (subframe == 2) { // ACK subframes 5 and 6
return(2); return(2);
...@@ -331,7 +420,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -331,7 +420,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
{ {
uint8_t status=0; uint8_t status=0;
uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff; uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff,subframe_dl2=0xff, subframe_dl3=0xff;
// printf("get_ack: SF %d\n",subframe); // printf("get_ack: SF %d\n",subframe);
if (frame_parms->frame_type == FDD) { if (frame_parms->frame_type == FDD) {
...@@ -485,6 +574,63 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -485,6 +574,63 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
break; break;
case 4:
if (subframe_tx == 2) { // ACK subframes 4, 5 and 0
subframe_dl0 = 4;
subframe_dl1 = 5;
subframe_dl2 = 0;
subframe_ul = 2;
//printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
} else if (subframe_tx == 3) { // ACK subframes 6, 7 8 and 9
subframe_dl0 = 6;
subframe_dl1 = 7;
subframe_dl2 = 8;
subframe_dl3 = 9;
subframe_ul = 3;
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
} else {
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
subframe_tx,frame_parms->tdd_config);
return(0);
}
// report ACK/NACK status
o_ACK[cw_idx] = 0;
if (harq_ack[subframe_dl0].send_harq_status == 1)
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
if (harq_ack[subframe_dl1].send_harq_status == 1)
o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
if (harq_ack[subframe_dl2].send_harq_status == 1)
o_ACK[cw_idx] &= harq_ack[subframe_dl2].ack;
if (harq_ack[subframe_dl3].send_harq_status == 1)
o_ACK[cw_idx] &= harq_ack[subframe_dl3].ack;
pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status + harq_ack[subframe_dl2].send_harq_status + harq_ack[subframe_dl3].send_harq_status;
LOG_I(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n",
subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack,
subframe_dl2, harq_ack[subframe_dl2].send_harq_status,harq_ack[subframe_dl2].ack,
subframe_dl3, harq_ack[subframe_dl3].send_harq_status,harq_ack[subframe_dl3].ack,subframe_rx, pN_bundled[0], status);
if (do_reset) {
// reset ACK/NACK status
harq_ack[subframe_dl0].ack = 2;
harq_ack[subframe_dl1].ack = 2;
harq_ack[subframe_dl2].ack = 2;
harq_ack[subframe_dl3].ack = 2;
harq_ack[subframe_dl0].send_harq_status = 0;
harq_ack[subframe_dl1].send_harq_status = 0;
harq_ack[subframe_dl2].send_harq_status = 0;
harq_ack[subframe_dl3].send_harq_status = 0;
}
break;
} }
} }
...@@ -609,6 +755,29 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub ...@@ -609,6 +755,29 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
return(255); return(255);
} }
case 4:
if ((subframe<1) || (subframe>=4))
return(SF_DL);
else if ((subframe>1) && (subframe < 4))
return(SF_UL);
else if (subframe==1)
return (SF_S);
else {
LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
return(255);
}
case 5:
if ((subframe<1) || (subframe>=3))
return(SF_DL);
else if ((subframe>1) && (subframe < 3))
return(SF_UL);
else if (subframe==1)
return (SF_S);
else {
LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
return(255);
}
break; break;
default: default:
...@@ -683,13 +852,13 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub ...@@ -683,13 +852,13 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
break; break;
case 4: case 4:
if ((subframe == 0) || (subframe == 8) ) if ((subframe == 8) || (subframe == 9) )
return(1); return(1);
break; break;
case 5: case 5:
if (subframe == 0) if (subframe == 8)
return(1); return(1);
break; break;
......
...@@ -906,7 +906,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC ...@@ -906,7 +906,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round), T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round),
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb), T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb),
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb), T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb),
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS)); T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS),
T_INT(dci_alloc->L),
T_INT(dci_alloc->firstCCE));
} }
void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) { void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) {
......
This diff is collapsed.
File mode changed from 100755 to 100644
...@@ -101,7 +101,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, ...@@ -101,7 +101,7 @@ void fill_channel_desc(channel_desc_t *chan_desc,
LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps);
for (i = 0; i<nb_taps; i++) { for (i = 0; i<nb_taps; i++) {
LOG_D(OCM,"tap %d (%p,%d)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex)); LOG_D(OCM,"tap %d (%p,%zu)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex));
chan_desc->a[i] = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex)); chan_desc->a[i] = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex));
} }
......
...@@ -140,10 +140,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -140,10 +140,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
rnti = UE_RNTI(module_idP, i); rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i); CC_id = UE_PCCID(module_idP, i);