merge with master

This commit is contained in:
lukashov
2015-11-23 17:48:59 +01:00
5371 changed files with 1239495 additions and 2138470 deletions
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -41,15 +41,15 @@
//#include "openair_defs.h"
typedef enum emu_transport_info_e {
EMU_TRANSPORT_INFO_ERROR = 0x0,
EMU_TRANSPORT_INFO_WAIT_PM,
EMU_TRANSPORT_INFO_WAIT_SM,
EMU_TRANSPORT_INFO_SYNC,
EMU_TRANSPORT_INFO_ENB,
EMU_TRANSPORT_INFO_UE,
EMU_TRANSPORT_INFO_RELEASE
EMU_TRANSPORT_INFO_ERROR = 0x0,
EMU_TRANSPORT_INFO_WAIT_PM,
EMU_TRANSPORT_INFO_WAIT_SM,
EMU_TRANSPORT_INFO_SYNC,
EMU_TRANSPORT_INFO_ENB,
EMU_TRANSPORT_INFO_UE,
EMU_TRANSPORT_INFO_RELEASE
#if defined(ENABLE_PGM_TRANSPORT)
,EMU_TRANSPORT_NACK
,EMU_TRANSPORT_NACK
#endif
} emu_transport_info_t;
+367 -339
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -60,65 +60,71 @@ extern unsigned int pgm_would_block;
void emu_transport_sync(void)
{
LOG_D(EMU, "Entering EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Entering EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
#if defined(ENABLE_PGM_TRANSPORT)
if (oai_emulation.info.is_primary_master == 0) {
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
// just wait to recieve the master 0 msg
Master_list_rx = oai_emulation.info.master_list - 1;
bypass_rx_data(0,0,0,1);
} else {
bypass_rx_data(0,0,0,0);
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
if (oai_emulation.info.is_primary_master == 0) {
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
// just wait to recieve the master 0 msg
Master_list_rx = oai_emulation.info.master_list - 1;
bypass_rx_data(0,0,0,1);
} else {
bypass_rx_data(0,0,0,0);
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
}
if (oai_emulation.info.master_list != 0) {
bypass_tx_data(SYNC_TRANSPORT,0,0);
bypass_rx_data(0,0,0,0);
// i received the sync from all secondary masters
if (emu_rx_status == SYNCED_TRANSPORT) {
emu_tx_status = SYNCED_TRANSPORT;
}
if (oai_emulation.info.master_list != 0) {
bypass_tx_data(SYNC_TRANSPORT,0,0);
bypass_rx_data(0,0,0,0);
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
}
// i received the sync from all secondary masters
if (emu_rx_status == SYNCED_TRANSPORT) {
emu_tx_status = SYNCED_TRANSPORT;
}
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
}
#else
if (oai_emulation.info.is_primary_master == 0) {
if (oai_emulation.info.is_primary_master == 0) {
retry:
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
// just wait to recieve the master 0 msg
Master_list_rx = oai_emulation.info.master_list - 1;
if (bypass_rx_data(0,0,0,1) == -1) {
/* In case the master is not ready at time we send the first message */
sleep(1);
goto retry;
}
} else {
bypass_rx_data(0,0,0,0);
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
}
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
// just wait to recieve the master 0 msg
Master_list_rx = oai_emulation.info.master_list - 1;
if (oai_emulation.info.master_list!=0) {
if (bypass_rx_data(0,0,0,1) == -1) {
/* In case the master is not ready at time we send the first message */
sleep(1);
goto retry;
}
} else {
bypass_rx_data(0,0,0,0);
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
}
if (oai_emulation.info.master_list!=0) {
retry2:
bypass_tx_data(SYNC_TRANSPORT,0,0);
if (bypass_rx_data(0,0,0,0) == -1) {
goto retry2;
}
bypass_tx_data(SYNC_TRANSPORT,0,0);
// i received the sync from all secondary masters
if (emu_rx_status == SYNCED_TRANSPORT) {
emu_tx_status = SYNCED_TRANSPORT;
}
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
if (bypass_rx_data(0,0,0,0) == -1) {
goto retry2;
}
// i received the sync from all secondary masters
if (emu_rx_status == SYNCED_TRANSPORT) {
emu_tx_status = SYNCED_TRANSPORT;
}
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
}
#endif
LOG_D(EMU, "Leaving EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Leaving EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
}
void emu_transport(unsigned int frame, unsigned int last_slot,
@@ -126,135 +132,139 @@ void emu_transport(unsigned int frame, unsigned int last_slot,
unsigned char frame_type,
int ethernet_flag )
{
if (ethernet_flag == 0) {
return;
}
if (ethernet_flag == 0) {
return;
}
vcd_signal_dumper_dump_function_by_name(
VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_IN);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(
VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_IN);
if ((frame_type == 1) && (direction == SF_S)) {
if ((next_slot % 2) == 0) {
emu_transport_DL(frame, last_slot, next_slot);
} else {
emu_transport_UL(frame, last_slot , next_slot);
}
//DL
if ((frame_type == 1) && (direction == SF_S)) {
if ((next_slot % 2) == 0) {
emu_transport_DL(frame, last_slot, next_slot);
} else {
if ((next_slot % 2) == 0) {
if (((frame_type == 1) && (direction == SF_DL )) || (frame_type == 0) ) {
emu_transport_DL(frame, last_slot, next_slot);
}
}
// UL
if (((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ) {
emu_transport_UL(frame, last_slot, next_slot);
}
emu_transport_UL(frame, last_slot , next_slot);
}
//DL
} else {
if ((next_slot % 2) == 0) {
if (((frame_type == 1) && (direction == SF_DL )) || (frame_type == 0) ) {
emu_transport_DL(frame, last_slot, next_slot);
}
}
// UL
if (((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ) {
emu_transport_UL(frame, last_slot, next_slot);
}
}
#if defined(ENABLE_PGM_TRANSPORT)
pgm_would_block = 0;
pgm_would_block = 0;
#endif
vcd_signal_dumper_dump_function_by_name(
VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(
VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_OUT);
}
void emu_transport_DL(unsigned int frame, unsigned int last_slot,
unsigned int next_slot)
{
LOG_D(EMU, "Entering EMU transport DL, is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Entering EMU transport DL, is primary master %d\n",
oai_emulation.info.is_primary_master);
if (oai_emulation.info.is_primary_master == 0) {
if (oai_emulation.info.nb_enb_local > 0) { // send in DL if
bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
bypass_rx_data(frame, last_slot, next_slot, 1);
} else {
bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
bypass_rx_data(frame, last_slot, next_slot, 0);
}
} else { // PM
if (oai_emulation.info.nb_enb_local>0) { // send in DL if
bypass_rx_data(frame, last_slot, next_slot, 1);
bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
} else {
bypass_rx_data(frame, last_slot, next_slot, 0);
bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
}
if (oai_emulation.info.is_primary_master == 0) {
if (oai_emulation.info.nb_enb_local > 0) { // send in DL if
bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
bypass_rx_data(frame, last_slot, next_slot, 1);
} else {
bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
bypass_rx_data(frame, last_slot, next_slot, 0);
}
} else { // PM
if (oai_emulation.info.nb_enb_local>0) { // send in DL if
bypass_rx_data(frame, last_slot, next_slot, 1);
bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
} else {
bypass_rx_data(frame, last_slot, next_slot, 0);
bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
}
}
LOG_D(EMU, "Leaving EMU transport DL, is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Leaving EMU transport DL, is primary master %d\n",
oai_emulation.info.is_primary_master);
}
void emu_transport_UL(unsigned int frame, unsigned int last_slot,
unsigned int next_slot)
{
LOG_D(EMU, "Entering EMU transport UL, is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Entering EMU transport UL, is primary master %d\n",
oai_emulation.info.is_primary_master);
if (oai_emulation.info.is_primary_master == 0) {
if (oai_emulation.info.nb_ue_local > 0) {
bypass_tx_data(UE_TRANSPORT, frame, next_slot);
bypass_rx_data(frame, last_slot, next_slot, 1);
} else {
bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
bypass_rx_data(frame,last_slot, next_slot, 0);
}
if (oai_emulation.info.is_primary_master == 0) {
if (oai_emulation.info.nb_ue_local > 0) {
bypass_tx_data(UE_TRANSPORT, frame, next_slot);
bypass_rx_data(frame, last_slot, next_slot, 1);
} else {
if (oai_emulation.info.nb_ue_local > 0) {
bypass_rx_data(frame, last_slot, next_slot, 1);
bypass_tx_data(UE_TRANSPORT, frame, next_slot);
} else {
bypass_rx_data(frame,last_slot, next_slot, 0);
bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
}
bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
bypass_rx_data(frame,last_slot, next_slot, 0);
}
} else {
if (oai_emulation.info.nb_ue_local > 0) {
bypass_rx_data(frame, last_slot, next_slot, 1);
bypass_tx_data(UE_TRANSPORT, frame, next_slot);
} else {
bypass_rx_data(frame,last_slot, next_slot, 0);
bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
}
}
LOG_D(EMU, "Leaving EMU transport UL, is primary master %d\n",
oai_emulation.info.is_primary_master);
LOG_D(EMU, "Leaving EMU transport UL, is primary master %d\n",
oai_emulation.info.is_primary_master);
}
void emu_transport_release(void)
{
bypass_tx_data(RELEASE_TRANSPORT,0,0);
LOG_E(EMU," tx RELEASE_TRANSPORT \n");
bypass_tx_data(RELEASE_TRANSPORT,0,0);
LOG_E(EMU," tx RELEASE_TRANSPORT \n");
}
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,
unsigned int *Nbytes,unsigned int *Nb_flows)
{
return *Nbytes;
return *Nbytes;
}
unsigned int emul_rx_data(void)
{
return(0);
return(0);
}
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer,
unsigned int Nbytes)
{
unsigned short Rx_size=0;
return (Rx_size+2);
unsigned short Rx_size=0;
return (Rx_size+2);
}
void clear_eNB_transport_info(uint8_t nb_eNB)
{
uint8_t eNB_id;
uint8_t CC_id;
uint8_t eNB_id;
uint8_t CC_id;
for (eNB_id=0; eNB_id<nb_eNB; eNB_id++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
eNB_transport_info_TB_index[eNB_id][CC_id]=0;
memset((void *)&eNB_transport_info[eNB_id][CC_id].cntl,0,sizeof(eNB_cntl));
eNB_transport_info[eNB_id][CC_id].num_common_dci=0;
eNB_transport_info[eNB_id][CC_id].num_ue_spec_dci=0;
}
for (eNB_id=0; eNB_id<nb_eNB; eNB_id++) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
eNB_transport_info_TB_index[eNB_id][CC_id]=0;
memset((void *)&eNB_transport_info[eNB_id][CC_id].cntl,0,sizeof(eNB_cntl));
eNB_transport_info[eNB_id][CC_id].num_common_dci=0;
eNB_transport_info[eNB_id][CC_id].num_ue_spec_dci=0;
}
}
#ifdef DEBUG_EMU
LOG_D(EMU, "EMUL clear_eNB_transport_info\n");
LOG_D(EMU, "EMUL clear_eNB_transport_info\n");
#endif
}
@@ -262,260 +272,278 @@ void clear_UE_transport_info(uint8_t nb_UE)
{
uint8_t UE_id,CC_id;
for (UE_id=0; UE_id<nb_UE; UE_id++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++){
UE_transport_info_TB_index[UE_id][CC_id]=0;
memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl));
for (UE_id=0; UE_id<nb_UE; UE_id++)
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
UE_transport_info_TB_index[UE_id][CC_id]=0;
memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl));
}
#ifdef DEBUG_EMU
LOG_D(EMU, "EMUL clear_UE_transport_info\n");
#endif
LOG_D(EMU, "EMUL clear_UE_transport_info\n");
#endif
}
void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot)
{
int n_dci = 0, n_dci_dl;
int payload_offset = 0;
unsigned int harq_pid;
LTE_eNB_DLSCH_t *dlsch_eNB;
unsigned short ue_id;
uint8_t nb_total_dci;
int i;
int n_dci = 0, n_dci_dl;
int payload_offset = 0;
unsigned int harq_pid;
LTE_eNB_DLSCH_t *dlsch_eNB;
unsigned short ue_id;
uint8_t nb_total_dci;
int i;
// eNB
// PBCH : copy payload
// eNB
// PBCH : copy payload
*(uint32_t *)PHY_vars_eNB_g[enb_id][CC_id]->pbch_pdu =
eNB_transport_info[enb_id][CC_id].cntl.pbch_payload;
/* LOG_I(EMU," RX slot %d ENB TRANSPORT pbch payload %d pdu[0] %d pdu[0] %d \n",
next_slot ,
eNB_transport_info[enb_id][CC_id].cntl.pbch_payload,
((uint8_t*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[0],
((uint8_t*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[1]);
*/
// }
//CFI
// not needed yet
*(uint32_t *)PHY_vars_eNB_g[enb_id][CC_id]->pbch_pdu =
eNB_transport_info[enb_id][CC_id].cntl.pbch_payload;
/* LOG_I(EMU," RX slot %d ENB TRANSPORT pbch payload %d pdu[0] %d pdu[0] %d \n",
next_slot ,
eNB_transport_info[enb_id][CC_id].cntl.pbch_payload,
((uint8_t*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[0],
((uint8_t*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[1]);
*/
// }
//CFI
// not needed yet
//PHICH
// to be added later
//PHICH
// to be added later
//DCI
nb_total_dci= eNB_transport_info[enb_id][CC_id].num_pmch +
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci +
eNB_transport_info[enb_id][CC_id].num_common_dci;
//DCI
nb_total_dci= eNB_transport_info[enb_id][CC_id].num_pmch +
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci +
eNB_transport_info[enb_id][CC_id].num_common_dci;
PHY_vars_eNB_g[enb_id][CC_id]->num_ue_spec_dci[(next_slot>>1)&1] =
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci;
PHY_vars_eNB_g[enb_id][CC_id]->num_common_dci[(next_slot>>1)&1] =
eNB_transport_info[enb_id][CC_id].num_common_dci;
PHY_vars_eNB_g[enb_id][CC_id]->num_ue_spec_dci[(next_slot>>1)&1] =
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci;
PHY_vars_eNB_g[enb_id][CC_id]->num_common_dci[(next_slot>>1)&1] =
eNB_transport_info[enb_id][CC_id].num_common_dci;
#ifdef DEBUG_EMU
LOG_D(EMU, "Fill phy vars eNB %d for slot %d, DCI found %d \n",
enb_id, next_slot, nb_total_dci);
LOG_D(EMU, "Fill phy vars eNB %d for slot %d, DCI found %d \n",
enb_id, next_slot, nb_total_dci);
#endif
if (nb_total_dci >0) {
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dci_alloc[(next_slot>>1)&1],
eNB_transport_info[enb_id][CC_id].dci_alloc,
(nb_total_dci) * sizeof(DCI_ALLOC_t));
if (nb_total_dci >0) {
n_dci_dl=0;
// fill dlsch_eNB structure from DCI
for (n_dci = 0; n_dci < nb_total_dci; n_dci++) {
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dci_alloc[(next_slot>>1)&1],
eNB_transport_info[enb_id][CC_id].dci_alloc,
(nb_total_dci) * sizeof(DCI_ALLOC_t));
//exclude ul dci
if ((eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].format > 0) || (eNB_transport_info[enb_id][CC_id].num_pmch > 0 )) {
n_dci_dl=0;
// fill dlsch_eNB structure from DCI
for (n_dci = 0; n_dci < nb_total_dci; n_dci++) {
//exclude ul dci
if ((eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].format > 0) || (eNB_transport_info[enb_id][CC_id].num_pmch > 0 )) {
#ifdef DEBUG_EMU
LOG_D(EMU, "dci spec %d common %d pmch %d tbs is %d payload offset %d\n",
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci,
eNB_transport_info[enb_id][CC_id].num_common_dci,
eNB_transport_info[enb_id][CC_id].num_pmch,
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl],
payload_offset);
LOG_D(EMU, "dci spec %d common %d pmch %d tbs is %d payload offset %d\n",
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci,
eNB_transport_info[enb_id][CC_id].num_common_dci,
eNB_transport_info[enb_id][CC_id].num_pmch,
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl],
payload_offset);
#endif
switch (eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]) {
case 0: //SI:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_SI->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU
LOG_D(EMU, "SI eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
case 1: //RA:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_ra->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU
LOG_D(EMU, "RA eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
case 2://TB0:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0];
#ifdef DEBUG_EMU
LOG_D(EMU,
" enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n",
enb_id, ue_id, eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti,
n_dci_dl, harq_pid, eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
for (i=0; i<eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]; i++) {
LOG_T(EMU, "%x.",
(unsigned char) eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset+i]);
}
#endif
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
break;
case 3://TB1:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1];
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
break;
case 5:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_MCH->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
switch (eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]) {
case 0: //SI:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_SI->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU
LOG_D(EMU, "PMCH eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl] %d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
LOG_D(EMU, "SI eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
default:
LOG_W(EMU,"not supported dlsch type %d \n", eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]);
break;
}
payload_offset += eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl];
}
n_dci_dl++;
case 1: //RA:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_ra->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU
LOG_D(EMU, "RA eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
case 2://TB0:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0];
#ifdef DEBUG_EMU
LOG_D(EMU,
" enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n",
enb_id, ue_id, eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti,
n_dci_dl, harq_pid, eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
for (i=0; i<eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]; i++) {
LOG_T(EMU, "%x.",
(unsigned char) eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset+i]);
}
#endif
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
break;
case 3://TB1:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1];
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
break;
case 5:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_MCH->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU
LOG_D(EMU, "PMCH eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl] %d \n",
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#endif
break;
default:
LOG_W(EMU,"not supported dlsch type %d \n", eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]);
break;
}
#ifdef DEBUG_EMU
LOG_D(EMU, "Fill phy eNB vars done next slot %d !\n", next_slot);
#endif
payload_offset += eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl];
}
n_dci_dl++;
}
#ifdef DEBUG_EMU
LOG_D(EMU, "Fill phy eNB vars done next slot %d !\n", next_slot);
#endif
}
}
void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
{
int n_enb;//index
int enb_id;
// int harq_id;
// int payload_offset = 0;
unsigned short rnti;
unsigned int harq_pid;
LTE_UE_ULSCH_t *ulsch;
PUCCH_FMT_t pucch_format;
// uint8_t ue_transport_info_index[NUMBER_OF_eNB_MAX];
uint8_t subframe = (last_slot+1)>>1;
int n_enb;//index
int enb_id;
// int harq_id;
// int payload_offset = 0;
unsigned short rnti;
unsigned int harq_pid;
LTE_UE_ULSCH_t *ulsch;
PUCCH_FMT_t pucch_format;
// uint8_t ue_transport_info_index[NUMBER_OF_eNB_MAX];
uint8_t subframe = (last_slot+1)>>1;
memcpy(&ue_cntl_delay[ue_id][CC_id][(last_slot+1)%2], &UE_transport_info[ue_id][CC_id].cntl,
sizeof(UE_cntl));
memcpy(&ue_cntl_delay[ue_id][CC_id][(last_slot+1)%2], &UE_transport_info[ue_id][CC_id].cntl,
sizeof(UE_cntl));
#ifdef DEBUG_EMU
LOG_D(EMU,
"Last slot %d subframe %d CC_id %d: Fill phy vars UE %d : PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
LOG_D(EMU,
"Last slot %d subframe %d CC_id %d: Fill phy vars UE %d : PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
last_slot,subframe,CC_id, ue_id,
UE_transport_info[ue_id][CC_id].cntl.prach_flag,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag,
UE_transport_info[ue_id][CC_id].cntl.prach_id,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id,
UE_transport_info[ue_id][CC_id].cntl.sr,
ue_cntl_delay[ue_id][CC_id][last_slot%2].sr,
UE_transport_info[ue_id][CC_id].cntl.pucch_sel,
ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel);
last_slot,subframe,CC_id, ue_id,
UE_transport_info[ue_id][CC_id].cntl.prach_flag,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag,
UE_transport_info[ue_id][CC_id].cntl.prach_id,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id,
UE_transport_info[ue_id][CC_id].cntl.sr,
ue_cntl_delay[ue_id][CC_id][last_slot%2].sr,
UE_transport_info[ue_id][CC_id].cntl.pucch_sel,
ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel);
#endif
//ue_cntl_delay[subframe%2].prach_flag ;
PHY_vars_UE_g[ue_id][CC_id]->generate_prach = ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag;//UE_transport_info[ue_id][CC_id].cntl.prach_flag;
if (PHY_vars_UE_g[ue_id][CC_id]->generate_prach == 1) {
// if (PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] == NULL)
// PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] = malloc(sizeof(PRACH_RESOURCES_t));
//ue_cntl_delay[subframe%2].prach_id;
PHY_vars_UE_g[ue_id][CC_id]->prach_PreambleIndex =
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id;
//ue_cntl_delay[subframe%2].prach_flag ;
PHY_vars_UE_g[ue_id][CC_id]->generate_prach = ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag;//UE_transport_info[ue_id][CC_id].cntl.prach_flag;
if (PHY_vars_UE_g[ue_id][CC_id]->generate_prach == 1) {
// if (PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] == NULL)
// PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] = malloc(sizeof(PRACH_RESOURCES_t));
//ue_cntl_delay[subframe%2].prach_id;
PHY_vars_UE_g[ue_id][CC_id]->prach_PreambleIndex =
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id;
}
pucch_format= ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_flag;// UE_transport_info[ue_id][CC_id].cntl.pucch_flag;
if ((last_slot + 1) % 2 == 0) {
if (pucch_format == pucch_format1) { // UE_transport_info[ue_id][CC_id].cntl.sr;
PHY_vars_UE_g[ue_id][CC_id]->sr[subframe] = ue_cntl_delay[ue_id][CC_id][last_slot%2].sr;
} else if ((pucch_format == pucch_format1a) ||
(pucch_format == pucch_format1b)) {
PHY_vars_UE_g[ue_id][CC_id]->pucch_payload[0] = ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_payload;
//UE_transport_info[ue_id][CC_id].cntl.pucch_payload;
}
pucch_format= ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_flag;// UE_transport_info[ue_id][CC_id].cntl.pucch_flag;
if ((last_slot + 1) % 2 == 0) {
if (pucch_format == pucch_format1) { // UE_transport_info[ue_id][CC_id].cntl.sr;
PHY_vars_UE_g[ue_id][CC_id]->sr[subframe] = ue_cntl_delay[ue_id][CC_id][last_slot%2].sr;
} else if ((pucch_format == pucch_format1a) ||
(pucch_format == pucch_format1b)) {
PHY_vars_UE_g[ue_id][CC_id]->pucch_payload[0] = ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_payload;
//UE_transport_info[ue_id][CC_id].cntl.pucch_payload;
}
PHY_vars_UE_g[ue_id][CC_id]->pucch_sel[subframe] =
ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel;
}
PHY_vars_UE_g[ue_id][CC_id]->pucch_sel[subframe] =
ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel;
}
#ifdef DEBUG_EMU
LOG_D(EMU,"subframe %d trying to copy the payload from num eNB %d to UE %d \n",
subframe, UE_transport_info[ue_id][CC_id].num_eNB, ue_id);
LOG_D(EMU,"subframe %d trying to copy the payload from num eNB %d to UE %d \n",
subframe, UE_transport_info[ue_id][CC_id].num_eNB, ue_id);
#endif
for (n_enb = 0; n_enb < UE_transport_info[ue_id][CC_id].num_eNB; n_enb++) {
for (n_enb = 0; n_enb < UE_transport_info[ue_id][CC_id].num_eNB; n_enb++) {
#ifdef DEBUG_EMU
/* LOG_D(EMU,"Setting ulsch vars for ue %d rnti %x harq pid is %d \n",
ue_id, UE_transport_info[ue_id][CC_id].rnti[n_enb],
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]);
*/
/* LOG_D(EMU,"Setting ulsch vars for ue %d rnti %x harq pid is %d \n",
ue_id, UE_transport_info[ue_id][CC_id].rnti[n_enb],
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]);
*/
#endif
rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb];
enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb];
rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb];
enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb];
PHY_vars_UE_g[ue_id][CC_id]->lte_ue_pdcch_vars[enb_id]->crnti=rnti;
PHY_vars_UE_g[ue_id][CC_id]->lte_ue_pdcch_vars[enb_id]->crnti=rnti;
harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb];
harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb];
//ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id];
//ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id];
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[0] =
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[1] =
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri>>1) & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[0] =
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[1] =
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri>>1) & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[0]=
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[1]=
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack>>1) & 0x1;
//*(uint32_t *)ulsch->o = ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[0]=
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[1]=
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack>>1) & 0x1;
//*(uint32_t *)ulsch->o = ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci;
if ((last_slot % 2) == 1) {
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O =
ue_cntl_delay[ue_id][CC_id][last_slot%2].length_uci;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->uci_format =
ue_cntl_delay[ue_id][CC_id][last_slot%2].uci_format;
if ((last_slot % 2) == 1) {
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O =
ue_cntl_delay[ue_id][CC_id][last_slot%2].length_uci;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->uci_format =
ue_cntl_delay[ue_id][CC_id][last_slot%2].uci_format;
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o,
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci,
MAX_CQI_BYTES);
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o,
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci,
MAX_CQI_BYTES);
ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id];
// if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1)
LOG_D(EMU,
"[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n",
ue_id, subframe, last_slot, enb_id, ue_id, harq_pid,
((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1,
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O);
}
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->harq_processes[harq_pid]->b,
UE_transport_info[ue_id][CC_id].transport_blocks,
UE_transport_info[ue_id][CC_id].tbs[enb_id]);
//ue_transport_info_index[enb_id]+=UE_transport_info[ue_id][CC_id].tbs[enb_id];
//UE_transport_info[ue_id][CC_id].transport_blocks+=ue_transport_info_index[enb_id];
//LOG_T(EMU,"ulsch tbs is %d\n", UE_transport_info[ue_id][CC_id].tbs[enb_id]);
ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id];
// if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1)
LOG_D(EMU,
"[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n",
ue_id, subframe, last_slot, enb_id, ue_id, harq_pid,
((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1,
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O);
}
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->harq_processes[harq_pid]->b,
UE_transport_info[ue_id][CC_id].transport_blocks,
UE_transport_info[ue_id][CC_id].tbs[enb_id]);
//ue_transport_info_index[enb_id]+=UE_transport_info[ue_id][CC_id].tbs[enb_id];
//UE_transport_info[ue_id][CC_id].transport_blocks+=ue_transport_info_index[enb_id];
//LOG_T(EMU,"ulsch tbs is %d\n", UE_transport_info[ue_id][CC_id].tbs[enb_id]);
}
}
+5 -5
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
+194 -183
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -68,10 +68,10 @@
extern unsigned short Master_id;
const char *multicast_group_list[MULTICAST_LINK_NUM_GROUPS] = {
"239.0.0.161",
"239.0.0.162",
"239.0.0.163",
"239.0.0.164"
"239.0.0.161",
"239.0.0.162",
"239.0.0.163",
"239.0.0.164"
};
static multicast_group_t group_list[MULTICAST_LINK_NUM_GROUPS];
@@ -91,242 +91,253 @@ static char *multicast_if;
void
multicast_link_init(void)
{
//------------------------------------------------------------------------------
int group;
int multicast_loop;
int reuse_addr = 1;
static struct ip_mreq command;
struct sockaddr_in sin;
// struct ifreq ifr;
//------------------------------------------------------------------------------
int group;
int multicast_loop;
int reuse_addr = 1;
static struct ip_mreq command;
struct sockaddr_in sin;
// struct ifreq ifr;
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
//strcpy (group_list[group].host_addr, multicast_group_list[group]);
strncpy (group_list[group].host_addr, multicast_group_list[group], sizeof(group_list[group].host_addr));
group_list[group].host_addr[sizeof(group_list[group].host_addr) - 1] = 0; // terminate string
group_list[group].port = 46014 + group;
group_list[group].socket = make_socket_inet(
SOCK_DGRAM,
&group_list[group].port, &sin);
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
group_list[group].socket,group,group_list[group].port);
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
//strcpy (group_list[group].host_addr, multicast_group_list[group]);
strncpy (group_list[group].host_addr, multicast_group_list[group], sizeof(group_list[group].host_addr));
group_list[group].host_addr[sizeof(group_list[group].host_addr) - 1] = 0; // terminate string
group_list[group].port = 46014 + group;
group_list[group].socket = make_socket_inet(
SOCK_DGRAM,
&group_list[group].port, &sin);
/* Used so we can re-bind to our port while a previous connection is still
* in TIME_WAIT state.
*/
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
&reuse_addr, sizeof (reuse_addr)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
exit (EXIT_FAILURE);
}
if (multicast_if != NULL) {
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
multicast_if, 4) < 0) {
LOG_E(EMU,
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
multicast_if);
LOG_E(EMU,
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
exit (EXIT_FAILURE);
}
}
#if !defined(ENABLE_NEW_MULTICAST)
/* Make the socket blocking */
socket_setnonblocking(group_list[group].socket);
#endif
multicast_loop = 0;
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
&multicast_loop, sizeof (multicast_loop)) < 0) {
LOG_E(EMU,
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
__FILE__, __LINE__);
exit (EXIT_FAILURE);
}
// Join the broadcast group:
command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
command.imr_interface.s_addr = htonl (INADDR_ANY);
if (command.imr_multiaddr.s_addr == -1) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
exit (EXIT_FAILURE);
}
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&command, sizeof (command)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
__LINE__);
exit (EXIT_FAILURE);
}
memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
group_list[group].sock_remote_addr.sin_family = AF_INET;
group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (multicast_group_list[group]);
group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
group_list[group].socket,group,group_list[group].port);
/* Used so we can re-bind to our port while a previous connection is still
* in TIME_WAIT state.
*/
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
&reuse_addr, sizeof (reuse_addr)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
exit (EXIT_FAILURE);
}
if (multicast_if != NULL) {
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
multicast_if, 4) < 0) {
LOG_E(EMU,
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
multicast_if);
LOG_E(EMU,
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
exit (EXIT_FAILURE);
}
}
#if !defined(ENABLE_NEW_MULTICAST)
/* Make the socket blocking */
socket_setnonblocking(group_list[group].socket);
#endif
multicast_loop = 0;
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
&multicast_loop, sizeof (multicast_loop)) < 0) {
LOG_E(EMU,
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
__FILE__, __LINE__);
exit (EXIT_FAILURE);
}
// Join the broadcast group:
command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
command.imr_interface.s_addr = htonl (INADDR_ANY);
if (command.imr_multiaddr.s_addr == -1) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
exit (EXIT_FAILURE);
}
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&command, sizeof (command)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
__LINE__);
exit (EXIT_FAILURE);
}
memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
group_list[group].sock_remote_addr.sin_family = AF_INET;
group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (multicast_group_list[group]);
group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
}
}
//------------------------------------------------------------------------------
void
multicast_link_build_select_list ()
multicast_link_build_select_list (void)
{
//------------------------------------------------------------------------------
int group;
//------------------------------------------------------------------------------
int group;
/* First put together fd_set for select(), which will
consist of the sock veriable in case a new connection
is coming in, plus all the sockets we have already
accepted. */
/* First put together fd_set for select(), which will
consist of the sock veriable in case a new connection
is coming in, plus all the sockets we have already
accepted. */
/* FD_ZERO() clears out the fd_set called socks, so that
it doesn't contain any file descriptors. */
/* FD_ZERO() clears out the fd_set called socks, so that
it doesn't contain any file descriptors. */
FD_ZERO (&socks);
FD_ZERO (&socks);
/* Loops through all the possible connections and adds
those sockets to the fd_set */
/* Loops through all the possible connections and adds
those sockets to the fd_set */
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
if (group_list[group].socket != 0) {
FD_SET (group_list[group].socket, &socks);
if (group_list[group].socket > highsock) {
highsock = group_list[group].socket;
}
}
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
if (group_list[group].socket != 0) {
FD_SET (group_list[group].socket, &socks);
if (group_list[group].socket > highsock) {
highsock = group_list[group].socket;
}
}
}
}
void
multicast_link_read_data (int groupP)
{
int num_bytes;
int num_bytes;
if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
if ((num_bytes = recvfrom (group_list[groupP].socket,
group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
LOG_E(EMU, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno), __FILE__, __LINE__);
} else {
rx_handler(num_bytes,group_list[groupP].rx_buffer);
}
if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
if ((num_bytes = recvfrom (group_list[groupP].socket,
group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
LOG_E(EMU, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno), __FILE__, __LINE__);
} else {
LOG_E(EMU, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
rx_handler(num_bytes,group_list[groupP].rx_buffer);
}
} else {
LOG_E(EMU, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
}
}
//------------------------------------------------------------------------------
void
multicast_link_read ()
multicast_link_read (void)
{
//------------------------------------------------------------------------------
int group; /* Current item in connectlist for for loops */
//------------------------------------------------------------------------------
int group; /* Current item in connectlist for for loops */
/* Now check connectlist for available data */
/* Now check connectlist for available data */
/* Run through our sockets and check to see if anything
happened with them, if so 'service' them. */
/* Run through our sockets and check to see if anything
happened with them, if so 'service' them. */
for (group = multicast_group; group < MULTICAST_LINK_NUM_GROUPS ; group++) {
if (FD_ISSET (group_list[group].socket, &socks)) {
multicast_link_read_data (group);
break;
}
} /* for (all entries in queue) */
for (group = multicast_group; group < MULTICAST_LINK_NUM_GROUPS ; group++) {
if (FD_ISSET (group_list[group].socket, &socks)) {
multicast_link_read_data (group);
break;
}
} /* for (all entries in queue) */
}
//------------------------------------------------------------------------------
int
multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
{
//------------------------------------------------------------------------------
int num;
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
LOG_E(EMU, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno),
__FILE__, __LINE__);
}
return num;
//------------------------------------------------------------------------------
int num;
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
LOG_E(EMU, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno),
__FILE__, __LINE__);
}
return num;
}
int multicast_link_read_data_from_sock(uint8_t is_master)
{
struct timeval timeout, *timeout_p;
int readsocks; /* Number of sockets ready for reading */
struct timeval timeout, *timeout_p;
int readsocks; /* Number of sockets ready for reading */
timeout.tv_sec = 0;
timeout.tv_usec = 15000;
timeout.tv_sec = 0;
timeout.tv_usec = 15000;
if (is_master == 0) {
/* UE will block indefinetely if no data is sent from eNB
* NOTE: a NULL timeout for select will block indefinetely
*/
timeout_p = NULL;
} else {
/* In case of eNB set the timeout to 500 usecs after which we consider
* the packets as dropped.
*/
timeout_p = &timeout;
}
if (is_master == 0) {
/* UE will block indefinetely if no data is sent from eNB
* NOTE: a NULL timeout for select will block indefinetely
*/
timeout_p = NULL;
} else {
/* In case of eNB set the timeout to 500 usecs after which we consider
* the packets as dropped.
*/
timeout_p = &timeout;
}
highsock = -1;
highsock = -1;
multicast_link_build_select_list ();
multicast_link_build_select_list ();
LOG_D(EMU, "Stuck on select with timeout %s\n",
timeout_p == NULL ? "infinite" : "15000 usecs");
LOG_D(EMU, "Stuck on select with timeout %s\n",
timeout_p == NULL ? "infinite" : "15000 usecs");
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
if (readsocks < 0) {
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
exit(EXIT_FAILURE);
} else if (readsocks > 0) {
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
if (readsocks < 0) {
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
exit(EXIT_FAILURE);
} else if (readsocks > 0) {
#ifdef DEBUG_EMU
LOG_D(EMU, "Multicast Normal read\n");
LOG_D(EMU, "Multicast Normal read\n");
#endif
multicast_link_read();
} else {
/* Timeout */
LOG_I(EMU, "Multicast select time-out\n");
return 1;
}
return 0;
multicast_link_read();
} else {
/* Timeout */
LOG_I(EMU, "Multicast select time-out\n");
return 1;
}
return 0;
}
void* multicast_link_main_loop (void *param)
{
while (1) {
multicast_link_read_data_from_sock(0);
}
while (1) {
multicast_link_read_data_from_sock(0);
}
return NULL;
return NULL;
}
void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
unsigned char multicast_group, char *multicast_ifname)
{
rx_handler = rx_handlerP;
multicast_group = multicast_group;
multicast_if = multicast_ifname;
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
rx_handler);
rx_handler = rx_handlerP;
multicast_group = multicast_group;
multicast_if = multicast_ifname;
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
rx_handler);
#if !defined(ENABLE_PGM_TRANSPORT)
multicast_link_init ();
multicast_link_init ();
#endif
#if ! defined(ENABLE_NEW_MULTICAST)
LOG_D(EMU, "[MULTICAST] multicast link start thread\n");
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
NULL) != 0) {
LOG_E(EMU, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
errno, strerror(errno));
exit(EXIT_FAILURE);
} else {
pthread_detach(main_loop_thread); // disassociate from parent
LOG_I(EMU, "[MULTICAST LINK] Thread detached\n");
}
LOG_D(EMU, "[MULTICAST] multicast link start thread\n");
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
NULL) != 0) {
LOG_E(EMU, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
errno, strerror(errno));
exit(EXIT_FAILURE);
} else {
pthread_detach(main_loop_thread); // disassociate from parent
LOG_I(EMU, "[MULTICAST LINK] Thread detached\n");
}
#endif
}
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,21 +14,21 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file multicast.h
* \brief
* \author Lionel Gauthier and Navid Nikaein
* \author Lionel Gauthier and Navid Nikaein
* \date 2011
* \version 1.1
* \company Eurecom
@@ -58,9 +58,9 @@ private_multicast_link (typedef struct multicast_group_t {
extern const char *multicast_group_list[MULTICAST_LINK_NUM_GROUPS];
private_multicast_link(void multicast_link_init ());
private_multicast_link(void multicast_link_init (void));
private_multicast_link(void multicast_link_read_data (int groupP));
private_multicast_link(void multicast_link_read ());
private_multicast_link(void multicast_link_read (void));
private_multicast_link(void *multicast_link_main_loop (void *param));
public_multicast_link(int multicast_link_write_sock (int groupP, char *dataP, uint32_t sizeP));
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -62,59 +62,67 @@ struct msghdr nas_msg_rx;
int netlink_init(void)
{
int ret;
int ret;
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
// exit(1);
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
#if !defined(PDCP_USE_NETLINK_QUEUES)
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
}
#if !defined(ENABLE_PDCP_NETLINK_FIFO)
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
// exit(1);
}
#endif
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
return(nas_sock_fd);
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
return(nas_sock_fd);
}
+298 -285
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,22 +14,22 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file pgm_link.c
* \brief implementation a warpper for openpgm for reliable multicast transmission
* \author Navid Nikaein and S. Roux
* \date 2013 - 2014
* \date 2013 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
@@ -60,9 +60,9 @@
// #define ENABLE_PGM_DEBUG
typedef struct {
pgm_sock_t *sock;
uint16_t port;
uint8_t rx_buffer[40000];
pgm_sock_t *sock;
uint16_t port;
uint8_t rx_buffer[40000];
} pgm_multicast_group_t;
pgm_multicast_group_t pgm_multicast_group[MULTICAST_LINK_NUM_GROUPS];
@@ -75,337 +75,350 @@ unsigned int pgm_would_block = 1;
#if defined(ENABLE_PGM_DEBUG)
static void
log_handler (
const int log_level,
const char* message,
void* closure
const int log_level,
const char* message,
void* closure
)
{
printf("%s\n", message);
printf("%s\n", message);
}
#endif
int pgm_oai_init(char *if_addr)
{
pgm_error_t* pgm_err = NULL;
pgm_error_t* pgm_err = NULL;
memset(pgm_multicast_group, 0,
MULTICAST_LINK_NUM_GROUPS * sizeof(pgm_multicast_group_t));
memset(pgm_multicast_group, 0,
MULTICAST_LINK_NUM_GROUPS * sizeof(pgm_multicast_group_t));
#if defined(ENABLE_PGM_DEBUG)
pgm_messages_init();
pgm_min_log_level = PGM_LOG_LEVEL_DEBUG;
pgm_log_mask = 0xFFF;
pgm_messages_init();
pgm_min_log_level = PGM_LOG_LEVEL_DEBUG;
pgm_log_mask = 0xFFF;
pgm_log_set_handler(log_handler, NULL);
pgm_log_set_handler(log_handler, NULL);
#endif
if (!pgm_init(&pgm_err)) {
LOG_E(EMU, "Unable to start PGM engine: %s\n", pgm_err->message);
pgm_error_free (pgm_err);
exit(EXIT_FAILURE);
}
if (!pgm_init(&pgm_err)) {
LOG_E(EMU, "Unable to start PGM engine: %s\n", pgm_err->message);
pgm_error_free (pgm_err);
exit(EXIT_FAILURE);
}
return pgm_create_socket(oai_emulation.info.multicast_group, if_addr);
return pgm_create_socket(oai_emulation.info.multicast_group, if_addr);
}
int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
unsigned int frame, unsigned int next_slot)
{
size_t num_bytes = 0;
int status = 0;
pgm_error_t* pgm_err = NULL;
struct pgm_sockaddr_t from;
socklen_t fromlen = sizeof(from);
uint32_t timeout = 0;
int flags = 0;
size_t num_bytes = 0;
int status = 0;
pgm_error_t* pgm_err = NULL;
struct pgm_sockaddr_t from;
socklen_t fromlen = sizeof(from);
uint32_t timeout = 0;
int flags = 0;
if (pgm_would_block == 0) {
flags = MSG_DONTWAIT;
}
if (pgm_would_block == 0) {
flags = MSG_DONTWAIT;
}
DevCheck((group <= MULTICAST_LINK_NUM_GROUPS) && (group >= 0),
group, MULTICAST_LINK_NUM_GROUPS, 0);
DevCheck((group <= MULTICAST_LINK_NUM_GROUPS) && (group >= 0),
group, MULTICAST_LINK_NUM_GROUPS, 0);
#ifdef DEBUG_EMU
LOG_I(EMU, "[PGM] Entering recv function for group %d\n", group);
LOG_I(EMU, "[PGM] Entering recv function for group %d\n", group);
#endif
do {
status = pgm_recvfrom(pgm_multicast_group[group].sock,
buffer,
length,
flags,
&num_bytes,
&from,
&fromlen,
&pgm_err);
if (PGM_IO_STATUS_NORMAL == status) {
do {
status = pgm_recvfrom(pgm_multicast_group[group].sock,
buffer,
length,
flags,
&num_bytes,
&from,
&fromlen,
&pgm_err);
if (PGM_IO_STATUS_NORMAL == status) {
#ifdef DEBUG_EMU
LOG_D(EMU, "[PGM] Received %d bytes for group %d\n", num_bytes, group);
LOG_D(EMU, "[PGM] Received %d bytes for group %d\n", num_bytes, group);
#endif
return num_bytes;
} else if (PGM_IO_STATUS_TIMER_PENDING == status) {
if (pgm_would_block == 0) {
/* We sleep for 50 usec */
usleep(50);
return num_bytes;
} else if (PGM_IO_STATUS_TIMER_PENDING == status) {
if (pgm_would_block == 0) {
/* We sleep for 50 usec */
usleep(50);
timeout ++;
timeout ++;
if (timeout == (1000000 / 50))
{
LOG_W(EMU, "[PGM] A packet has been lost -> ask for retransmit\n");
/* If we do not receive a packet after 10000usec
* -> send a NACK */
bypass_tx_nack(frame, next_slot);
timeout = 0;
}
}
} else if (PGM_IO_STATUS_RESET == status) {
LOG_W(EMU, "[PGM] Got session reset\n");
} else {
#ifdef DEBUG_EMU
LOG_D(EMU, "[PGM] Got status %d\n", status);
#endif
if (pgm_err) {
LOG_E(EMU, "[PGM] recvform failed: %s", pgm_err->message);
pgm_error_free (pgm_err);
pgm_err = NULL;
}
if (timeout == (1000000 / 50)) {
LOG_W(EMU, "[PGM] A packet has been lost -> ask for retransmit\n");
/* If we do not receive a packet after 10000usec
* -> send a NACK */
bypass_tx_nack(frame, next_slot);
timeout = 0;
}
} while(status != PGM_IO_STATUS_NORMAL);
return -1;
}
} else if (PGM_IO_STATUS_RESET == status) {
LOG_W(EMU, "[PGM] Got session reset\n");
} else {
#ifdef DEBUG_EMU
LOG_D(EMU, "[PGM] Got status %d\n", status);
#endif
if (pgm_err) {
LOG_E(EMU, "[PGM] recvform failed: %s", pgm_err->message);
pgm_error_free (pgm_err);
pgm_err = NULL;
}
}
} while(status != PGM_IO_STATUS_NORMAL);
return -1;
}
int pgm_link_send_msg(int group, uint8_t *data, uint32_t len)
{
int status;
size_t bytes_written = 0;
int status;
size_t bytes_written = 0;
do {
status = pgm_send(pgm_multicast_group[group].sock, data, len, &bytes_written);
} while(status == PGM_IO_STATUS_WOULD_BLOCK);
do {
status = pgm_send(pgm_multicast_group[group].sock, data, len, &bytes_written);
} while(status == PGM_IO_STATUS_WOULD_BLOCK);
if (status != PGM_IO_STATUS_NORMAL) {
return -1;
}
return bytes_written;
if (status != PGM_IO_STATUS_NORMAL) {
return -1;
}
return bytes_written;
}
static
int pgm_create_socket(int index, const char *if_addr)
{
struct pgm_addrinfo_t* res = NULL;
pgm_error_t* pgm_err = NULL;
sa_family_t sa_family = AF_INET;
int udp_encap_port = 46014 + index;
int max_tpdu = 1500;
int sqns = 100;
int port = 0;
struct pgm_sockaddr_t addr;
int blocking = 1;
int multicast_loop = 0;
int multicast_hops = 0;
int dscp, i;
struct pgm_addrinfo_t* res = NULL;
pgm_error_t* pgm_err = NULL;
sa_family_t sa_family = AF_INET;
int udp_encap_port = 46014 + index;
int max_tpdu = 1500;
int sqns = 100;
int port = 0;
struct pgm_sockaddr_t addr;
int blocking = 1;
int multicast_loop = 0;
int multicast_hops = 0;
int dscp, i;
port = udp_encap_port;
port = udp_encap_port;
/* Use PGM */
udp_encap_port = 0;
/* Use PGM */
udp_encap_port = 0;
LOG_D(EMU, "[PGM] Preparing socket for group %d and address %s\n",
index, if_addr);
LOG_D(EMU, "[PGM] Preparing socket for group %d and address %s\n",
index, if_addr);
if (!pgm_getaddrinfo(if_addr, NULL, &res, &pgm_err)) {
LOG_E(EMU, "Parsing network parameter: %s\n", pgm_err->message);
goto err_abort;
if (!pgm_getaddrinfo(if_addr, NULL, &res, &pgm_err)) {
LOG_E(EMU, "Parsing network parameter: %s\n", pgm_err->message);
goto err_abort;
}
if (udp_encap_port) {
LOG_I(EMU, "[PGM] Creating PGM/UDP socket for encapsulated port %d\n",
udp_encap_port);
if (!pgm_socket (&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_UDP, &pgm_err)) {
LOG_E(EMU, "[PGM] Socket: %s\n", pgm_err->message);
goto err_abort;
}
if (udp_encap_port) {
LOG_I(EMU, "[PGM] Creating PGM/UDP socket for encapsulated port %d\n",
udp_encap_port);
if (!pgm_socket (&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_UDP, &pgm_err)) {
LOG_E(EMU, "[PGM] Socket: %s\n", pgm_err->message);
goto err_abort;
}
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_UDP_ENCAP_UCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_UDP_ENCAP_MCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
} else {
LOG_I(EMU, "[PGM] Creating PGM/IP socket\n");
if (!pgm_socket(&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_PGM, &pgm_err)) {
LOG_E(EMU, "Creating PGM/IP socket: %s\n", pgm_err->message);
goto err_abort;
}
}
{
/* Use RFC 2113 tagging for PGM Router Assist */
const int no_router_assist = 0;
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_IP_ROUTER_ALERT, &no_router_assist,
sizeof(no_router_assist));
}
// pgm_drop_superuser();
{
/* set PGM parameters */
const int recv_only = 0,
passive = 0,
peer_expiry = pgm_secs (300),
spmr_expiry = pgm_msecs (250),
nak_bo_ivl = pgm_msecs (10),
nak_rpt_ivl = pgm_secs (2),
nak_rdata_ivl = pgm_secs (2),
nak_data_retries = 50,
nak_ncf_retries = 50,
ambient_spm = pgm_secs(30);
const int heartbeat_spm[] = {
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (1300),
pgm_secs (7),
pgm_secs (16),
pgm_secs (25),
pgm_secs (30)
};
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RECV_ONLY, &recv_only, sizeof(recv_only));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PASSIVE, &passive, sizeof(passive));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MTU, &max_tpdu, sizeof(max_tpdu));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RXW_SQNS, &sqns, sizeof(sqns));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PEER_EXPIRY, &peer_expiry, sizeof(peer_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SPMR_EXPIRY, &spmr_expiry, sizeof(spmr_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_BO_IVL, &nak_bo_ivl, sizeof(nak_bo_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RPT_IVL, &nak_rpt_ivl, sizeof(nak_rpt_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RDATA_IVL, &nak_rdata_ivl, sizeof(nak_rdata_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_DATA_RETRIES, &nak_data_retries, sizeof(nak_data_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_NCF_RETRIES, &nak_ncf_retries, sizeof(nak_ncf_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_AMBIENT_SPM, &ambient_spm, sizeof(ambient_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_HEARTBEAT_SPM, &heartbeat_spm, sizeof(heartbeat_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_TXW_SQNS, &sqns, sizeof(sqns));
}
/* create global session identifier */
memset (&addr, 0, sizeof(addr));
/* sa_port should be in host byte order */
addr.sa_port = port;
addr.sa_addr.sport = DEFAULT_DATA_SOURCE_PORT + index;
if (!pgm_gsi_create_from_hostname(&addr.sa_addr.gsi, &pgm_err)) {
LOG_E(EMU, "[PGM] Creating GSI: %s\n", pgm_err->message);
goto err_abort;
}
LOG_D(EMU, "[PGM] Created GSI %s\n", pgm_tsi_print(&addr.sa_addr));
/* assign socket to specified address */
{
struct pgm_interface_req_t if_req;
memset (&if_req, 0, sizeof(if_req));
if_req.ir_interface = res->ai_recv_addrs[0].gsr_interface;
if_req.ir_scope_id = 0;
if (AF_INET6 == sa_family) {
struct sockaddr_in6 sa6;
memcpy (&sa6, &res->ai_recv_addrs[0].gsr_group, sizeof(sa6));
if_req.ir_scope_id = sa6.sin6_scope_id;
}
if (!pgm_bind3(pgm_multicast_group[index].sock, &addr, sizeof(addr),
&if_req, sizeof(if_req), /* tx interface */
&if_req, sizeof(if_req), /* rx interface */
&pgm_err))
{
LOG_E(EMU, "[PGM] Error: %s\n", pgm_err->message);
goto err_abort;
}
}
/* join IP multicast groups */
{
struct group_req req;
struct sockaddr_in addr_in;
memset(&req, 0, sizeof(req));
/* Interface index */
req.gr_interface = res->ai_recv_addrs[0].gsr_interface;
addr_in.sin_family = AF_INET;
addr_in.sin_port = htons(port);
for (i = 0; i < MULTICAST_LINK_NUM_GROUPS; i++) {
addr_in.sin_addr.s_addr = inet_addr(multicast_group_list[i]);
memcpy(&req.gr_group, &addr_in, sizeof(addr_in));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_JOIN_GROUP, &req,
sizeof(struct group_req));
}
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SEND_GROUP, &req,
sizeof(struct group_req));
}
pgm_freeaddrinfo(res);
res = NULL;
/* set IP parameters */
multicast_hops = 64;
dscp = 0x2e << 2; /* Expedited Forwarding PHB for network elements, no ECN. */
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_LOOP, &multicast_loop, sizeof(multicast_loop));
PGM_UDP_ENCAP_UCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_HOPS, &multicast_hops, sizeof(multicast_hops));
if (AF_INET6 != sa_family)
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_TOS,
&dscp, sizeof(dscp));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_NOBLOCK,
&blocking, sizeof(blocking));
PGM_UDP_ENCAP_MCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
} else {
LOG_I(EMU, "[PGM] Creating PGM/IP socket\n");
if (!pgm_connect(pgm_multicast_group[index].sock, &pgm_err)) {
LOG_E(EMU, "[PGM] Connecting socket: %s\n", pgm_err->message);
goto err_abort;
if (!pgm_socket(&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_PGM, &pgm_err)) {
LOG_E(EMU, "Creating PGM/IP socket: %s\n", pgm_err->message);
goto err_abort;
}
}
{
/* Use RFC 2113 tagging for PGM Router Assist */
const int no_router_assist = 0;
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_IP_ROUTER_ALERT, &no_router_assist,
sizeof(no_router_assist));
}
// pgm_drop_superuser();
{
/* set PGM parameters */
const int recv_only = 0,
passive = 0,
peer_expiry = pgm_secs (300),
spmr_expiry = pgm_msecs (250),
nak_bo_ivl = pgm_msecs (10),
nak_rpt_ivl = pgm_secs (2),
nak_rdata_ivl = pgm_secs (2),
nak_data_retries = 50,
nak_ncf_retries = 50,
ambient_spm = pgm_secs(30);
const int heartbeat_spm[] = {
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (1300),
pgm_secs (7),
pgm_secs (16),
pgm_secs (25),
pgm_secs (30)
};
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RECV_ONLY, &recv_only, sizeof(recv_only));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PASSIVE, &passive, sizeof(passive));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MTU, &max_tpdu, sizeof(max_tpdu));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RXW_SQNS, &sqns, sizeof(sqns));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PEER_EXPIRY, &peer_expiry, sizeof(peer_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SPMR_EXPIRY, &spmr_expiry, sizeof(spmr_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_BO_IVL, &nak_bo_ivl, sizeof(nak_bo_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RPT_IVL, &nak_rpt_ivl, sizeof(nak_rpt_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RDATA_IVL, &nak_rdata_ivl, sizeof(nak_rdata_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_DATA_RETRIES, &nak_data_retries, sizeof(nak_data_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_NCF_RETRIES, &nak_ncf_retries, sizeof(nak_ncf_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_AMBIENT_SPM, &ambient_spm, sizeof(ambient_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_HEARTBEAT_SPM, &heartbeat_spm, sizeof(heartbeat_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_TXW_SQNS, &sqns, sizeof(sqns));
}
/* create global session identifier */
memset (&addr, 0, sizeof(addr));
/* sa_port should be in host byte order */
addr.sa_port = port;
addr.sa_addr.sport = DEFAULT_DATA_SOURCE_PORT + index;
if (!pgm_gsi_create_from_hostname(&addr.sa_addr.gsi, &pgm_err)) {
LOG_E(EMU, "[PGM] Creating GSI: %s\n", pgm_err->message);
goto err_abort;
}
LOG_D(EMU, "[PGM] Created GSI %s\n", pgm_tsi_print(&addr.sa_addr));
/* assign socket to specified address */
{
struct pgm_interface_req_t if_req;
memset (&if_req, 0, sizeof(if_req));
if_req.ir_interface = res->ai_recv_addrs[0].gsr_interface;
if_req.ir_scope_id = 0;
if (AF_INET6 == sa_family) {
struct sockaddr_in6 sa6;
memcpy (&sa6, &res->ai_recv_addrs[0].gsr_group, sizeof(sa6));
if_req.ir_scope_id = sa6.sin6_scope_id;
}
return 0;
if (!pgm_bind3(pgm_multicast_group[index].sock, &addr, sizeof(addr),
&if_req, sizeof(if_req), /* tx interface */
&if_req, sizeof(if_req), /* rx interface */
&pgm_err)) {
LOG_E(EMU, "[PGM] Error: %s\n", pgm_err->message);
goto err_abort;
}
}
/* join IP multicast groups */
{
struct group_req req;
struct sockaddr_in addr_in;
memset(&req, 0, sizeof(req));
/* Interface index */
req.gr_interface = res->ai_recv_addrs[0].gsr_interface;
addr_in.sin_family = AF_INET;
addr_in.sin_port = htons(port);
for (i = 0; i < MULTICAST_LINK_NUM_GROUPS; i++) {
addr_in.sin_addr.s_addr = inet_addr(multicast_group_list[i]);
memcpy(&req.gr_group, &addr_in, sizeof(addr_in));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_JOIN_GROUP, &req,
sizeof(struct group_req));
}
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SEND_GROUP, &req,
sizeof(struct group_req));
}
pgm_freeaddrinfo(res);
res = NULL;
/* set IP parameters */
multicast_hops = 64;
dscp = 0x2e << 2; /* Expedited Forwarding PHB for network elements, no ECN. */
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_LOOP, &multicast_loop, sizeof(multicast_loop));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_HOPS, &multicast_hops, sizeof(multicast_hops));
if (AF_INET6 != sa_family)
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_TOS,
&dscp, sizeof(dscp));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_NOBLOCK,
&blocking, sizeof(blocking));
if (!pgm_connect(pgm_multicast_group[index].sock, &pgm_err)) {
LOG_E(EMU, "[PGM] Connecting socket: %s\n", pgm_err->message);
goto err_abort;
}
return 0;
err_abort:
if (NULL != pgm_multicast_group[index].sock) {
pgm_close(pgm_multicast_group[index].sock, FALSE);
pgm_multicast_group[index].sock = NULL;
}
if (NULL != res) {
pgm_freeaddrinfo(res);
res = NULL;
}
if (NULL != pgm_err) {
pgm_error_free(pgm_err);
pgm_err = NULL;
}
exit(EXIT_FAILURE);
if (NULL != pgm_multicast_group[index].sock) {
pgm_close(pgm_multicast_group[index].sock, FALSE);
pgm_multicast_group[index].sock = NULL;
}
if (NULL != res) {
pgm_freeaddrinfo(res);
res = NULL;
}
if (NULL != pgm_err) {
pgm_error_free(pgm_err);
pgm_err = NULL;
}
exit(EXIT_FAILURE);
}
#endif
+5 -5
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
+7 -7
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,23 +14,23 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file proto.h
* \brief
* \brief
* \author Navid Nikaein
* \date 2011
* \version 1.0
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
+19 -12
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,26 +14,26 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file socket.c
* \brief
* \author Lionel Gauthier
* \brief
* \author Lionel Gauthier
* \date 2011
* \version 1.0
* \version 1.0
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
*/
#include <stdio.h>
#include <stdlib.h>
@@ -55,20 +55,24 @@
void
socket_setnonblocking (int sockP)
{
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int opts;
opts = fcntl (sockP, F_GETFL);
if (opts < 0) {
perror ("fcntl(F_GETFL)");
exit (EXIT_FAILURE);
}
opts = (opts | O_NONBLOCK);
if (fcntl (sockP, F_SETFL, opts) < 0) {
perror ("fcntl(F_SETFL)");
exit (EXIT_FAILURE);
}
return;
}
@@ -76,7 +80,7 @@ socket_setnonblocking (int sockP)
int
make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP)
{
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int sock;
unsigned int length = sizeof (struct sockaddr_in);
@@ -87,6 +91,7 @@ make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP)
/* Create the socket. */
sock = socket (PF_INET, typeP, 0);
if (sock < 0) {
fprintf (stderr, "ERROR: %s line %d socket %m", __FILE__, __LINE__);
exit (EXIT_FAILURE);
@@ -96,15 +101,17 @@ make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP)
name.sin_family = AF_INET;
name.sin_port = htons (*portP);
name.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) {
close (sock);
fprintf (stderr, "ERROR: %s line %d bind port %d %m", __FILE__, __LINE__, *portP);
exit (EXIT_FAILURE);
}
if (ptr_addressP != NULL) {
getsockname (sock, (struct sockaddr *) ptr_addressP, &length);
}
msg("[SOCKET] bound socket port %d\n", *portP);
return sock;
}
+10 -10
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,26 +14,26 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file socket.h
* \brief
* \brief
* \author Lionel Gauthier
* \date 2011
* \version 1.0
* \version 1.0
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
*/
#ifndef __SOCKET_H__
# define __SOCKET_H__
@@ -46,7 +46,7 @@
# endif
# include "stdint.h"
public_socket (void socket_setnonblocking (int sockP);
)
)
public_socket (int make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP);
)
)
#endif
+7 -7
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -30,10 +30,10 @@
* \brief specifies the variables for phy emulation
* \author Navid Nikaein and Raymomd Knopp and Hicham Anouar
* \date 2011
* \version 1.0
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
*/
#ifndef USER_MODE
#include <rtai_posix.h>
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-103
View File
@@ -1,103 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 # -Wno-packed-bitfield-compat
LFLAGS = -lm -lblas -lrt
CFLAGS += -m32 -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
CFLAGS += -DNO_RRM -DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
all: colabsim
include $(TOP_DIR)/PHY/Makefile.inc
#SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) ${UTIL_incl}
#EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
colabsim : $(OBJ) colabsim.c
@echo "Compiling colabsim.c ..."
@$(CC) colabsim.c -o colabsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f colabsim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
-10
View File
@@ -1,10 +0,0 @@
* TDD mode 1
* [du]lsch_ue_col for collaborative links
* Define TBS_FIX (pilots for several CH)
* Document output result file format
* Add end-to-end HARQ strategy
* AMC?
* Describe placement of data in LTE frame
* Automatic RB allocation
* MR bler statistics
File diff suppressed because it is too large Load Diff
@@ -1,86 +0,0 @@
function r = read_results(f)
%r = read_results(f)
%
%Reads colabsim simulation results from file f.
%
%Arguments:
% f - results file (produced with -r option to colabsim)
%
%Returns:
% r - results structure with the following fields:
% n_relays: number of relays
% channel_model: the used channel model as a string
% n_tests: the number of tests done (each with different SNR)
% n_pdu: the number of sent MAC PDUs for each test
% n_harq: the maximum number of HARQ rounds
% tests: struct array of length n_tests containing the following fields:
% snr_hop{1,2}: SNRs for each link in hop {1,2}
% n_frames_hop{1,2}: number of transmitted LTE frames in hop {1,2}
% n_bits_hop{1,2}: number of correctly received information bits in hop {1,2}
% n_pdu_success_hop{1,2}: number of correctly received MAC PDUs in hop {1,2}
% ber_hop1: vector of average raw BER at relays
% ber_hop2: average raw BER at destination CH
% n_harq_tries_hop{1,2}: number of transmitted MAC PDUs in each HARQ round in hop {1,2}
% n_harq_success_hop{1,2}: number of successfully decoded MAC PDUs in each HARQ round in hop {1,2}
% mcs_hop{1,2}: MCS used in each transmission in hop {1,2}
% tbs_hop{1,2}: TBS used in each transmission in hop {1,2}
% n_rb_hop{1,2}: number of resource blocks used in each transmission in hop {1,2}
% n_transmissions: distribution of the number of required transmissions in each hop for the
% successfully decoded MAC PDUs, n_transmissions(n1,n2) is the number of successfully decoded
% MAC PDUs that required n1 transmissions in hop 1 and n2 transmissions in hop 2
% relay_activity: number of transmissions with different cooperation level of relays,
% for n_relays==2 there are four values: [0 MR1 MR2 MR1+MR2], this is for all transmissions
% over hop 2, even if the PDU was not finally received at the destination CH
fid = fopen(f, 'r');
A = mread(fid, 1, 5);
r.n_relays = A(1);
r.channel_model = parse_channel(A(2));
r.n_tests = A(3);
r.n_pdu = A(4);
r.n_harq = A(5);
n_relays = A(1);
n_tests = A(3);
n_pdu = A(4);
n_harq = A(5);
test_row = 1;
for test = 1:n_tests
r.tests(test).snr_hop1 = mread(fid, 1, n_relays);
r.tests(test).snr_hop2 = mread(fid, 1, n_relays);
A = mread(fid, 1, 6);
r.tests(test).n_frames_hop1 = A(1);
r.tests(test).n_frames_hop2 = A(2);
r.tests(test).n_bits_hop1 = A(3);
r.tests(test).n_bits_hop2 = A(4);
r.tests(test).n_pdu_success_hop1 = A(5);
r.tests(test).n_pdu_success_hop2 = A(6);
A = mread(fid, 1, n_relays+1);
r.tests(test).ber_hop1 = A(1:end-1);
r.tests(test).ber_hop2 = A(end);
r.tests(test).n_harq_tries_hop1 = mread(fid, 1, n_harq);
r.tests(test).n_harq_success_hop1 = mread(fid, 1, n_harq);
r.tests(test).n_harq_tries_hop2 = mread(fid, 1, n_harq);
r.tests(test).n_harq_success_hop2 = mread(fid, 1, n_harq);
r.tests(test).mcs_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).mcs_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).tbs_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).tbs_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).n_rb_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).n_rb_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).n_transmissions = mread(fid, n_harq, n_harq);
r.tests(test).relay_activity = mread(fid, 1, 2^n_relays);
end
fclose(fid);
function s = parse_channel(c)
s = sprintf('%d', c);
function A = mread(fid, nrow, ncol)
A = fscanf(fid, '%f', [ncol,nrow])';
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -1,149 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -rdynamic -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat
LFLAGS = -lm -lblas -lxml2 -lrt
CFLAGS += -m32 -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
# Debugging flags
#CFLAGS += -DDEBUG_DLSCH_CODING
#CFLAGS += -DDEBUG_DLSCH_DECODING
#CFLAGS += -DDEBUG_LOGMAP
# Always use this flag with relaysim. Will be fixed in future versions.
CFLAGS += -DREL_AMPLIFY_FORWARD
# Use this flag if you want to run relaysim with only 1 relay node.
#CFLAGS += -DSINGLE_RELAY
# This is a flag to use different patterns for RVI (redundancy versions)
# Normally it is (0,0,1,1). If you use this flag, it is used as (0,1,1,0).
CFLAGS += -DRVI_PATTERN_ALT
# This flag is used in relayQMFsim where relays are Quantize-Forward relays.
# with this option you get results which assumes there is no error in the first link (Source-Relays).
# This kind of an upper bound to the performance of QMF relays in this scenario after LLR adjustment at the destination.
#CFLAGS += -DQF_UPPER_BOUND
CFLAGS += -DNO_RRM #-DOPENAIR2 -DPHY_ABSTRACTION
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef ENABLE_FXP
CFLAGS += -DENABLE_FXP # Fxp only
else
ifdef ENABLE_FLP
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
else
ifdef ENABLE_FULL_FLP
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
else
CFLAGS += -DENABLE_FXP # Fxp only by default
endif
endif
endif
ifdef COMPARE_FLP_AND_FXP
CFLAGS += -DCOMPARE_FLP_AND_FXP
endif
include $(TOP_DIR)/PHY/Makefile.inc
#SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
OBJ += openair_hw.o
all: relaysim
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
$(CC) -c $(CFLAGS) -o $@ $<
relaysim : $(OBJ) relaysim.c
@echo "Compiling relaysim.c ..."
$(CC) relaysim.c -o relaysim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f relaysim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
@@ -1,145 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <execinfo.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "SIMULATION/TOOLS/defs.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "MAC_INTERFACE/extern.h"
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
#include "ARCH/COMMON/defs.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h"
TX_RX_VARS dummy_tx_rx_vars;
int pci_buffers[2*NB_ANTENNAS_RX];
int openair_fd,fc;
unsigned int bigphys_top;
unsigned int mem_base;
int setup_oai_hw(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *phy_vars_ue,
PHY_VARS_eNB *phy_vars_eNB) {
int i,j;
frame_parms->dual_tx = 0;
frame_parms->freq_idx = 0;
fc = 0;
printf("Opening /dev/openair0\n");
if ((openair_fd = open("/dev/openair0", O_RDWR)) <0) {
fprintf(stderr,"Error %d opening /dev/openair0\n",openair_fd);
exit(-1);
}
ioctl(openair_fd,openair_DUMP_CONFIG,frame_parms);
sleep(1);
// ioctl(openair_fd,openair_GET_BUFFER,(void *)&fc);
ioctl(openair_fd,openair_GET_VARS,&dummy_tx_rx_vars);
ioctl(openair_fd,openair_GET_BIGPHYSTOP,(void *)&bigphys_top);
if (dummy_tx_rx_vars.TX_DMA_BUFFER[0]==NULL) {
printf("pci_buffers not allocated\n");
close(openair_fd);
exit(-1);
}
printf("BIGPHYS top 0x%x\n",bigphys_top);
printf("RX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[0]);
printf("TX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[0]);
mem_base = (unsigned int) mmap(0,
BIGPHYS_NUMPAGES*4096,
PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_FIXED,//MAP_SHARED,
openair_fd,
0);
if (mem_base != -1)
msg("MEM base= 0x%x\n",mem_base);
else {
msg("Could not map physical memory\n");
close(openair_fd);
exit(-1);
}
if (phy_vars_ue) {
// replace RX signal buffers with mmaped HW versions
for (i=0;i<frame_parms->nb_antennas_rx;i++) {
free(phy_vars_ue->lte_ue_common_vars.rxdata[i]);
phy_vars_ue->lte_ue_common_vars.rxdata[i] = (int32_t*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("rxdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.rxdata[i]);
}
for (i=0;i<frame_parms->nb_antennas_tx;i++) {
free(phy_vars_ue->lte_ue_common_vars.txdata[i]);
phy_vars_ue->lte_ue_common_vars.txdata[i] = (int32_t*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("txdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.txdata[i]);
}
}
if (phy_vars_eNB) {
// replace RX signal buffers with mmaped HW versions
for (i=0;i<frame_parms->nb_antennas_rx;i++) {
free(phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i] = (int32_t*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("rxdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
}
for (i=0;i<frame_parms->nb_antennas_tx;i++) {
free(phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i] = (int32_t*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("txdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
for (j=0;j<16;j++) {
printf("txbuffer %d: %x\n",j,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j]);
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j] = 16-j;
}
// msync(openair_fd);
}
}
return(openair_fd);
}
@@ -1,11 +0,0 @@
This file is created by Emre Atsan. emre.atsan@epfl.ch, ARNI, EPFL, CH.
------------------------------------------------------------
Link level simulations for CONECT project Diamond Relay Network Scenario.
We assume Half-Duplex relays and a proper scheduling in which two relays never transmit at the same time.
* relaysim: This file is an extension to dlsim with additional channels created for the second source-relay and relay-destination paths. Relays are AF (Amplify-Forward relays in this simulation).
* relayQMFsim: Similar to relaysim, except relays are Quantize-Forward relays.
File diff suppressed because it is too large Load Diff
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -1,174 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = ../..
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1
CFLAGS += -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA #-O2
CFLAGS += -DTBS_FIX
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef OPENAIR2
CFLAGS += -DOPENAIR2
endif
CFLAGS += -I$(OPENAIR2_DIR) -I$(OPENAIR3_DIR)/MESH -I$(OPENAIR2_DIR)/COMMON -I$(OPENAIR2_DIR)/LAYER2/RLC -I$(OPENAIR2_DIR)/UTIL/MEM -I$(OPENAIR2_DIR)/UTIL/MATH -I$(OPENAIR2_DIR)/UTIL/LISTS -I$(OPENAIR2_DIR)/LAYER2/RLC/AM -I$(OPENAIR2_DIR)/LAYER2/RLC/UM_v6.1.0_LITE -I$(OPENAIR2_DIR)/LAYER2/RLC/TM -I$(OPENAIR2_DIR)/UTIL/TIMER
PHY_OBJS = $(TOP_DIR)/PHY/LTE_TRANSPORT/pss.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pilots.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_coding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_demodulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_decoding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/uci_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/lte_mcs.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pbch.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/srs_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/drs_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_demodulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_coding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_decoding.o
#PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/rar_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/phich.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pcfich.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/ofdm_mod.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep_ul.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_time.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_adjust_sync.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_est_freq_offset.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ue_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_eNB_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/adjust_gain.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_cell_spec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_ul_ref.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_segmentation.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte_lte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/crc_byte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_turbo_decoder_sse.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_rate_matching.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/rate_matching.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi_lte.o
PHY_OBJS += $(TOP_DIR)/PHY/INIT/lte_init.o
ifdef MeNBMUE
#PHY_OBJS += $(TOP_DIR)/PHY/INIT/secsys_init.o
endif
PHY_OBJS += $(TOP_DIR)/PHY/INIT/init_top.o
ifdef OPENAIR2
PHY_OBJS += $(TOP_DIR)/MAC_INTERFACE/init.o
endif
ifdef EMOS
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation_emos.o
endif
ifdef OPENAIR2
PHY_OBJS += $(OPENAIR2_DIR)/PHY_INTERFACE/mac_phy_primitives.o
endif
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
TOOLS_OBJS = $(TOP_DIR)/PHY/TOOLS/file_output.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/fft.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/log2_approx.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_sv.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_vv.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cdot_prod.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/signal_energy.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/dB_routines.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/sqrt.o
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/lte_dfts.o
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_common.o
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
ifdef MeNBMUE
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_MeNbMue.o
endif
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(LAYER2_OBJ)
OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
all: dlsim dlsim2 ulsim ulsim2 physim physim_secsys relays_sim relays_sim_dl relays_sim_harq relays_sim_harq2
test:
echo $(OPENAIR2_DIR) $(LAYER2_OBJ)
$(OBJ) : %.o : %.c
$(CC) -c $(CFLAGS) -I$(TOP_DIR) -o $@ $<
dlsim : $(OBJ2) dlsim.c
$(CC) dlsim.c -I$(TOP_DIR) -o dlsim $(CFLAGS) $(OBJ2) -lm
dlsim2 : $(OBJ2) dlsim2.c
$(CC) dlsim2.c -I$(TOP_DIR) -o dlsim2 $(CFLAGS) $(OBJ2) -lm
dlsim_secsys : $(OBJ2) dlsim_secsys.c
$(CC) dlsim_secsys.c -I$(TOP_DIR) -o dlsim_secsys $(CFLAGS) $(OBJ2) -lm
ulsim : $(OBJ2) ulsim.c
$(CC) ulsim.c -I$(TOP_DIR) -o ulsim $(CFLAGS) $(OBJ2) -lm
ulsim2 : $(OBJ2) ulsim2.c
$(CC) ulsim2.c -I$(TOP_DIR) -o ulsim2 $(CFLAGS) $(OBJ2) -lm
physim : $(OBJ) phy_procedures_sim.c
$(CC) phy_procedures_sim.c -I$(TOP_DIR) -o physim $(CFLAGS) $(OBJ) -lm
physim_secsys : $(OBJ) phy_procedures_sim_secsys.c
$(CC) phy_procedures_sim_secsys.c -I$(TOP_DIR) -o physim_secsys $(CFLAGS) $(OBJ) -lm
relays_sim : $(OBJ2) relays_sim.c
$(CC) relays_sim.c -I$(TOP_DIR) -o relaysim $(CFLAGS) $(OBJ2) -lm
relays_sim_dl : $(OBJ2) relays_sim_dl.c
$(CC) relays_sim_dl.c -I$(TOP_DIR) -o relaysim_dl $(CFLAGS) $(OBJ2) -lm
relays_sim_harq : $(OBJ2) relays_sim_harq.c
$(CC) relays_sim_harq.c -I$(TOP_DIR) -o relaysim_harq $(CFLAGS) $(OBJ2) -lm
relays_sim_harq2 : $(OBJ2) relays_sim_harq2.c
$(CC) relays_sim_harq2.c -I$(TOP_DIR) -o relaysim_harq2 $(CFLAGS) $(OBJ2) -lm
clean:
rm -f dlsim dlsim2 dlsim_secsys
rm -f $(OBJ)
rm -f *.o
rm -f *.exe*
showcflags:
@echo $(CFLAGS)
@@ -1,19 +0,0 @@
This file contains the details of the simulators used for BLER and Throughput measurements for a 2 Relay Distributed System:
1. relays_sim: To plot the overall BLER vs Uplink SNR, Uplink BLER vs Uplink SNR for a fixed value of downlink SNR. It also plots Throughput vs Uplink SNR for the entire system.
2. relays_sim_harq: HARQ Scheme 1: First the downlink phase transmits,even if one of the two relays decode, the signal is forwarded to destination otherwise retransmission at phase 1. If destination do not decode correctly, then retransmissions in the phase 2 take place.
It implements harq scheme 1 for cooperative schemes and plots the Uplink BLER vs Uplink SNR, overall BLER vs Uplink SNR and overall Throughput vs Uplink SNR.
3. relays_sim_harq2: HARQ Scheme 2: First the downlink phase transmits,even if one of the two relays decode, the signal is forwarded to destination otherwise retransmission at phase 1.If destination do not decode correctly, then two cases arise: If both the relays had decoded correctly, then retransmission in phase 2 takes place otherwise if only 1 relay had forwarded then retransmission takes place in phase 1.
It implements harq scheme 2 for cooperative schemes and plots the Uplink BLER vs Uplink SNR, overall BLER vs Uplink SNR and overall Throughput vs Uplink SNR.
Flags to change: 1. COLLABRATIVE_SCHEME: If not set, then the simulator is for a single relay case. If set, then it performs cooperative schemes
2. relay_flag: If 1, then only one relay. If 2, then 2 relays
3. diversity_scheme: If 0, then no diversity scheme. If 1, then Delay Diversity Scheme and if 2, then Distributed Alamouti Scheme
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
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-212
View File
@@ -1,212 +0,0 @@
# Doxyfile 1.3.8
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = FEMTOSIM
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= NO
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = $(OPENAIR1_DIR)/SIMULATION/LTE_FEMTO/
FILE_PATTERNS = *.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = images
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = YES
CHM_FILE = irs_openair.chm
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES = amsmath amssymb
LATEX_HEADER = header.tex
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = YES
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = OPENAIR_LTE=1 RLC_MODULE=1 RLC_C=1 RLC_MAC_C=1 RLC_RRC_C=1 RLC_AM_C=1 RLC_AM_MODULE=1 RLC_AM_REASSEMBLY_C=1 RLC_AM_IN_SDU_C=1 RLC_AM_RETRANSMIT_C=1 RLC_AM_RX_LIST_C=1 RLC_AM_SEGMENT_C=1 RLC_AM_SEGMENT_HOLES_C=1 RLC_AM_STATUS_REPORT_C=1 RLC_AM_TIMER_POLL_RETRANSMIT_C=1 RLC_AM_TIMER_POLL_REORDERING_C=1 RLC_AM_TIMER_STATUS_PROHIBIT_C=1 RLC_AM_WINDOWS_C=1 RLC_UM_MODULE=1 RLC_UM_C=1 RLC_TM_MODULE=1 RLC_UM_C=1 public_rlc(x)=x protected_rlc private_rlc(x)=x public_rlc_mac(x)=x protected_rlc_mac(x)=x private_rlc_mac(x)=x public_rlc_rrc(x)=x protected_rlc_rrc(x)=x private_rlc_rrc(x)=x public_rlc_am(x)=x protected_rlc_am(x)=x private_rlc_am(x)=x public_rlc_am_reassembly(x)=x protected_rlc_am_reassembly(x)=x private_rlc_am_reassembly(x)=x public_rlc_am_in_sdu(x)=x protected_rlc_am_in_sdu(x)=x private_rlc_am_in_sdu(x)=x private_rlc_am_receiver(x)=x protected_rlc_am_receiver(x)=x public_rlc_am_receiver(x)=x private_rlc_am_retransmit(x)=x protected_rlc_am_retransmit(x)=x public_rlc_am_retransmit(x)=x private_rlc_am_rx_list(x)=x protected_rlc_am_rx_list(x)=x public_rlc_am_rx_list(x)=x private_rlc_am_segment(x)=x protected_rlc_am_segment(x)=x public_rlc_am_segment(x)=x private_rlc_am_segments_holes(x)=x protected_rlc_am_segments_holes(x)=x public_rlc_am_segments_holes(x)=x private_rlc_am_status_report(x)=x protected_rlc_am_status_report(x)=x public_rlc_am_status_report(x)=x private_rlc_am_timer_poll_retransmit(x)=x protected_rlc_am_timer_poll_retransmit(x)=x public_rlc_am_timer_poll_retransmit(x)=x private_rlc_am_timer_reordering(x)=x protected_rlc_am_timer_reordering(x)=x public_rlc_am_timer_reordering(x)=x private_rlc_am_timer_status_prohibit(x)=x protected_rlc_am_timer_status_prohibit(x)=x public_rlc_am_timer_status_prohibit(x)=x private_rlc_am_windows(x)=x protected_rlc_am_windows(x)=x public_rlc_am_windows(x)=x public_rlc_um(x)=x protected_rlc_um(x)=x private_rlc_um(x)=x
EXPAND_AS_DEFINED = public_rlc(x)=x protected_rlc(x)=x private_rlc(x)=x public_rlc_mac(x)=x protected_rlc_mac(x)=x private_rlc_mac(x)=x public_rlc_rrc(x)=x protected_rlc_rrc(x)=x private_rlc_rrc(x)=x public_rlc_am(x)=x protected_rlc_am(x)=x private_rlc_am(x)=x public_rlc_am_reassembly(x)=x protected_rlc_am_reassembly(x)=x private_rlc_am_reassembly(x)=x public_rlc_am_in_sdu(x)=x protected_rlc_am_in_sdu(x)=x private_rlc_am_in_sdu(x)=x private_rlc_am_receiver(x)=x protected_rlc_am_receiver(x)=x public_rlc_am_receiver(x)=x private_rlc_am_retransmit(x)=x protected_rlc_am_retransmit(x)=x public_rlc_am_retransmit(x)=x private_rlc_am_rx_list(x)=x protected_rlc_am_rx_list(x)=x public_rlc_am_rx_list(x)=x private_rlc_am_segment(x)=x protected_rlc_am_segment(x)=x public_rlc_am_segment(x)=x private_rlc_am_segments_holes(x)=x protected_rlc_am_segments_holes(x)=x public_rlc_am_segments_holes(x)=x private_rlc_am_status_report(x)=x protected_rlc_am_status_report(x)=x public_rlc_am_status_report(x)=x private_rlc_am_timer_poll_retransmit(x)=x protected_rlc_am_timer_poll_retransmit(x)=x public_rlc_am_timer_poll_retransmit(x)=x private_rlc_am_timer_reordering(x)=x protected_rlc_am_timer_reordering(x)=x public_rlc_am_timer_reordering(x)=x private_rlc_am_timer_status_prohibit(x)=x protected_rlc_am_timer_status_prohibit(x)=x public_rlc_am_timer_status_prohibit(x)=x private_rlc_am_windows(x)=x protected_rlc_am_windows(x)=x public_rlc_am_windows(x)=x public_rlc_um(x)=x protected_rlc_um(x)=x private_rlc_um(x)=x
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = NO
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DOT_IMAGE_FORMAT = jpg
DOT_PATH = "/usr/bin"
DOTFILE_DIRS = ../docs/dotfiles
-147
View File
@@ -1,147 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat -O2
CFLAGS += -DNEW_FFT
LFLAGS = -lm -lblas -lxml2 -lrt
ifdef GPIB
LFLAGS += -lgpib
endif
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef ENABLE_FXP
CFLAGS += -DENABLE_FXP # Fxp only
else
ifdef ENABLE_FLP
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
else
ifdef ENABLE_FULL_FLP
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
else
CFLAGS += -DENABLE_FXP # Fxp only by default
endif
endif
endif
ifdef COMPARE_FLP_AND_FXP
CFLAGS += -DCOMPARE_FLP_AND_FXP
endif
ifdef RTAI
CFLAGS += -DRTAI_ENABLED -D__IN_RTAI__ $(shell rtai-config --lxrt-cflags)
LFLAGS += $(shell rtai-config --lxrt-ldflags) -llxrt
endif
include $(TOP_DIR)/PHY/Makefile.inc
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o #$(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
#include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS)
ifdef GPIB
OBJ += LTE_Configuration.o
endif
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
OBJ += $(LOG_DIR)/vcd_signal_dumper.o
all: femtosim
#$(OBJ)
femtosim : femtoUtils.o femtosim.c
@echo "Compiling femtosim.c"
@$(CC) -o femtosim femtosim.c femtoUtils.o $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
femtoUtils.o: $(OBJ) femtoUtils.h femtoUtils.c
@echo "Compiling femtoUtils.c"
@$(CC) -c femtoUtils.c $(CFLAGS) $(OBJ) $(LFLAGS) -L/usr/lib/libblas #-lm -lblas -DPERFECT_CE
Tester: Tester.c
@$(CC) Tester.c -o Tester $(CFLAGS)
ComparaFile: ComparaFile.c
@$(CC) ComparaFile.c -o ComparaFile
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f femtosim
rm -f *.exe*
#showflags :
#@echo $(CFLAGS)
#@echo $(LFLAGS)
-131
View File
@@ -1,131 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
void main( int argc, char **argv){
clock_t t_ini, t_fin;
time_t tiempo = time(0);
struct tm *tlocal ;
char output[128];
int i,j,h,x,z;
int interferencias[11];
interferencias[0]=-15;
interferencias[1]=-5;
interferencias[2]=-3;
interferencias[3]=-2;
interferencias[4]=-1;
interferencias[5]=0;
interferencias[6]=1;
interferencias[7]=2;
interferencias[8]=3;
interferencias[9]=5;
interferencias[10]=15;
FILE *output_fd ;
output_fd= fopen("TesterControl.txt","w");
double secs;
char **pruebas;
int n=(4*8*4*11)+1;
pruebas= (char **) malloc(n*sizeof(char *));
for(i=0;i<n; i++)
{
pruebas[i]=(char*)malloc(200*sizeof(char));
}
pruebas[0]= "./femtosim -n1000 -s0 -S25 -b0";
i=1;
x=1;
for(j=0;j<8;j++)
{
for(h=0;h<4;h++)
{
for( z=0;z<11;z++)
{
//printf(" %d %d %d %d %d %d\n",interferencias[z],x,j,h,i,n);
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b100%d -p%d,%d",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b200%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b300%d -p%d,%d",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b400%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
i++;
x++;
}
}
}
for(i=0;i<n;i++)
{
printf("\n%s",pruebas[i]);
t_ini = clock();
fprintf(output_fd,"\n%s",pruebas[i]);
tiempo = time(0);
tlocal = localtime(&tiempo);
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
fprintf(output_fd,"\n\tInicio: \t%s",output);
system(pruebas[i]);
tiempo = time(0);
tlocal = localtime(&tiempo);
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
fprintf(output_fd,"\n\tFin: \t%s",output);
}
fclose(output_fd);
}
-613
View File
@@ -1,613 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <math.h>
#include <sys/stat.h>
#include "femtoUtils.h"
#ifndef _FEMTO_UTILS
#include "PHY/types.h"
#include "SIMULATION/TOOLS/defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h" //TVT:Navid
#endif
void _parseOptions(options_t *opts, int argc, char ** argv) {
char c;
char aux[100];
//int prob_flag=0;
static struct option long_options[] =
{
{"h", no_argument, 0, 'h'},
{"s", required_argument, 0, 's'},
{"S", required_argument, 0, 'S'},
{"T", required_argument, 0, 'T'},
{"n", required_argument, 0, 'n'},
{"x", no_argument, 0, 'x'},
{"d", no_argument, 0, 'd'},
{"t", required_argument, 0, 't'},
{"y", required_argument, 0, 'y'},
{"z", required_argument, 0, 'z'},
{"I", required_argument, 0, 'I'},
{"j", required_argument, 0, 'j'},
{"N", required_argument, 0, 'N'},
{"o", required_argument, 0, 'o'},
{"g", required_argument, 0, 'g'},
{"f", no_argument, 0, 'f'},
{"a", no_argument, 0, 'a'},
{"i", no_argument, 0, 'i'},
{"b", required_argument, 0, 'b'},
{"w", required_argument, 0, 'w'},
{"k", required_argument, 0, 'k'},
{"c", required_argument, 0, 'c'},
{"e", no_argument, 0, 'e'},
{"m", required_argument, 0, 'm'},
{"A", required_argument, 0, 'A'},
{"D", no_argument, 0, 'D'},
{"p", no_argument, 0, 'p'},
{"r", required_argument, 0, 'r'},
{"p", required_argument, 0, 'p'},
{"Q", required_argument, 0, 'Q'},
{"O", required_argument, 0, 'O'},
{0, 0, 0, 0}
};
int option_index = 0;
while ((c = getopt_long (argc, argv, "hs:S:T:n:xdt:y:z:I:j:N:o:g:faib:r:R:w:c:em:A:Dp:B:k:Q:O:",long_options, &option_index)) != -1)
{
//printf("%c %s\n",c,optarg);
switch (c)
{
case 'a':
opts->awgn_flag=1;
opts->channel_model=AWGN;
sprintf(opts->parameters,"%s -a",opts->parameters);
break;
case 'i':
opts->awgn_flagi=1;
opts->channel_modeli=AWGN;
sprintf(opts->parameters,"%s -i",opts->parameters);
break;
case 'B':
opts->N_RB_DL=atoi(optarg);
break;
case 'f':
opts->fixed_channel_flag=1;
sprintf(opts->parameters,"%s -f",opts->parameters);
break;
case 'D':
if(opts->n_adj_cells==0 )
{
msg("First specify the number of adjuncts cells to estimate channel using -A #!\n");
exit(-1);
}
opts->dual_stream_UE=1;
sprintf(opts->parameters,"%s -D",opts->parameters);
break;
case 'e':
opts->dci_flag=1;
sprintf(opts->parameters,"%s -d",opts->parameters);
break;
case 'r':
opts->DLSCH_RB_ALLOC = atoi(optarg);
opts->rballocset = 1;
break;
case 's':
opts->snr_init=atof(optarg);
//opts->snr_max= opts->snr_init+5;
sprintf(opts->parameters,"%s -s%f",opts->parameters,opts->snr_init);
break;
case 'S':
opts->snr_max=atof(optarg);
sprintf(opts->parameters,"%s -S%f",opts->parameters,opts->snr_max);
break;
case 'Q':
opts->ratio=atoi(optarg);
break;
case 'O':
opts->nprb1=atoi(optarg);
opts->search_prb2=1;
break;
case 'T':
opts->snr_step=atof(optarg);
sprintf(opts->parameters,"%s -T%f",opts->parameters,opts->snr_step);
break;
case 'n':
opts->nframes=atoi(optarg);
sprintf(opts->parameters,"%s -n%d",opts->parameters,opts->nframes);
break;
case 'x':
opts->extended_prefix_flag=1;
sprintf(opts->parameters,"%s -x",opts->parameters);
if (opts->extended_prefix_flag == 0)
{
opts->nsymb = 14 ;
opts->pilot1 = 4;
opts->pilot2 = 7;
opts->pilot3 = 11;
} else
{
opts->nsymb = 12;
opts->pilot1 = 3;
opts->pilot2 = 6;
opts->pilot3 = 9;
}
break;
case 'd':
opts->frame_type= 1;
sprintf(opts->parameters,"%s -d",opts->parameters);
break;
case 't':
opts->transmission_mode=atoi(optarg);
sprintf(opts->parameters,"%s -t%d",opts->parameters,opts->transmission_mode);
if ((opts->transmission_mode!=1) && (opts->transmission_mode!=2) && (opts->transmission_mode!=6))
{
printf("Unsupported transmission mode %d\n",opts->transmission_mode);
exit(-1);
}
break;
case 'y':
opts->n_tx=atoi(optarg);
sprintf(opts->parameters,"%s -y%d",opts->parameters,opts->n_tx);
break;
case 'z':
opts->n_rx=atoi(optarg);
sprintf(opts->parameters,"%s -z%d",opts->parameters, opts->n_rx);
break;
case 'I':
opts->nInterf=atoi(optarg);
sprintf(opts->parameters,"%s -I%d",opts->parameters, opts->nInterf);
if(opts->nInterf>5 )
{
msg("Max num interferer = 5 \n");
exit(-1);
}
break;
case 'w':
if(opts->nInterf==0 )
{
msg("First specify the number of interferer with -I# \n");
exit(-1);
}
sprintf(aux,"%s",optarg);
strcpy(opts->interfLevels,aux);
sprintf(opts->parameters,"%s -w%s", opts->parameters,opts->interfLevels);
break;
case 'k':
if(opts->nInterf==0 )
{
msg("First specify the number of interferer with -I# \n");
exit(-1);
}
sprintf(aux,"%s",optarg);
strcpy(opts->interfProbability,aux);
sprintf(opts->parameters,"%s -k%s", opts->parameters,opts->interfProbability);
opts->prob_flag=1;
break;
case 'N':
opts->Nid_cell = atoi(optarg);
sprintf(opts->parameters,"%s -N%d",opts->parameters, opts->Nid_cell);
break;
case 'c':
opts->interCellId = atoi(optarg);
sprintf(opts->parameters,"%s -c%d",opts->parameters, opts->interCellId);
break;
case 'o':
opts->oversampling=atoi(optarg);
sprintf(opts->parameters,"%s -o%d",opts->parameters, opts->oversampling);
break;
case 'b':
opts->testNumber=atoi(optarg);
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->testNumber);
break;
case 'm':
opts->mcs=atoi(optarg);
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->mcs);
break;
case 'g':
sprintf(opts->parameters,"%s -g%s",opts->parameters, optarg);
switch ((char)*optarg) {
case 'A':
opts->channel_model=SCM_A;
break;
case 'B':
opts->channel_model=SCM_B;
break;
case 'C':
opts->channel_model=SCM_C;
break;
case 'D':
opts->channel_model=SCM_D;
break;
case 'E':
opts->channel_model=EPA;
break;
case 'F':
opts->channel_model=EVA;
break;
case 'G':
opts->channel_model=ETU;
break;
case 'H':
opts->channel_model=Rayleigh8;
break;
case 'I':
opts->channel_model=Rayleigh1;
break;
case 'J':
opts->channel_model=Rayleigh1_corr;
break;
case 'K':
opts->channel_model=Rayleigh1_anticorr;
break;
case 'L':
opts->channel_model=Rice8;
break;
case 'M':
opts->channel_model=Rice1;
break;
default:
msg("Unsupported channel model! [A,B,C,D,E,F,G,H,I,J,K,L,M]\n");
exit(-1);
}
break;
case 'A':
opts->n_adj_cells=atoi(optarg);
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->n_adj_cells);
break;
case 'R':
opts->num_rounds=atoi(optarg);
sprintf(opts->parameters,"%s -R%d",opts->parameters, opts->num_rounds);
if(opts->num_rounds>4 )
{
msg("Max num round = 4 \n");
exit(-1);
}
opts->fix_rounds=1;
break;
case 'p':
sprintf(aux,"%s",optarg);
strcpy(opts->power,aux);
sprintf(opts->parameters,"%s -w%s", opts->parameters,opts->power);
_parsePower(opts);
break;
default:
case 'h':
printf("-h This message\n");
printf("-s Starting SNR default value is %f\n",opts->snr_init);
printf("-S Ending SNR default value is %f\n",opts->snr_max);
printf("-T Step size of SNR, default value is %f\n",opts->snr_step);
printf("-n Number of frames, default value is %d\n",opts->nframes);
printf("-x Use extended prefix mode flag, default value is Normal\n");
printf("-d Use TDD flag\n");
printf("-t Transmission mode (1,2,6 for the moment),default value is %d\n",opts->transmission_mode);
printf("-y Number of TX antennas used in eNB, default value is %d\n",opts->n_tx);
printf("-z Number of RX antennas used in UE, default value is %d\n",opts->n_rx);
printf("-I Number of interference to apply, default value is %d \n",opts->nInterf);
printf("-w Relative strength of inteference list (in dB) separeted by ',' \n");
printf("-N Nid_cell, default value is %d \n",opts->Nid_cell);
printf("-o Oversampling factor (1,2,4,8,16), default value is %d \n",opts->oversampling);
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor), default value is AWGN\n");
// printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-i Use AWGN channel for the interference\n");
printf("-b Test Number\n");
printf("-c CellId Number for interferer\n");
printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n");
printf("-m MCS\n");
printf("-D Enable interference cancellation\n");
printf("-e Enable verification of DCI\n");
printf("-A Indicates number of interfering to estimate, by default does not estimate the channel from the interfering\n");
printf("-R Number of rounds\n");
printf("-k Probability of each interferer list (0-1) separeted by ',' \n");
printf("-f Use fixed data and channel\n");
printf("-B Number of PRBs depending on the bandwidth\n");
exit (-1);
break;
}
}
sprintf(opts->folderName,"%d_resp",opts->testNumber);
if (opts->nInterf>0)
{
_parseInterferenceLevels(opts,opts->interfLevels,opts->nInterf);
_parseInterferenceProbability(opts,opts->interfProbability,opts->nInterf);
}
}
void _printOptions(options_t *opts)
{
int i;
printf("\n----------Options----------");
printf("\nsnr_init:\t\t%f",opts->snr_init);
printf("\nsnr_max:\t\t%f",opts->snr_max);
printf("\nsnr_step:\t\t%f",opts->snr_step);
printf("\nnframes:\t\t%d",opts->nframes);
printf("\nextended_prefix_flag:\t%d",opts->extended_prefix_flag);
printf("\nframe_type:\t\t%d",opts->frame_type);
printf("\ntransmission_mode:\t%d",opts->transmission_mode);
printf("\nn_tx:\t\t\t%d",opts->n_tx);
printf("\nn_rx:\t\t\t%d",opts->n_rx);
printf("\nNid_cell:\t\t%d",opts->Nid_cell);
printf("\noversampling:\t\t%d",opts->oversampling);
printf("\nchannel_model:\t\t%d",opts->channel_model);
printf("\nchannel_modeli:\t\t%d",opts->channel_modeli);
printf("\nawgn_flag:\t\t%d",opts->awgn_flag);
printf("\nawgn_flagi:\t\t%d",opts->awgn_flagi);
printf("\nnInterf:\t\t%d",opts->nInterf);
printf("\nxx:%p",(void *)opts->outputFile);
for (i=0; i<opts->nInterf; i++)
{
printf("\n\tInterference n%d:%f (%f)",i+1,opts->dbInterf[i],opts->probabilityInterf[i]);
}
printf("\n");
}
void _parseInterferenceProbability(options_t *opts, char *interfProbability,int nInterf)
{
int i;
char * pch;
opts->probabilityInterf=(double*)malloc(sizeof(double)*nInterf);
for (i=0; i<nInterf; i++)
{
opts->probabilityInterf[i]=1.0;
}
if(opts->prob_flag)
{
pch = strtok (interfProbability,",");
i=0;
while (pch != NULL)
{
opts->probabilityInterf[i]=atof(pch);
i++;
pch = strtok (NULL,",");
}
}
}
void _parseInterferenceLevels(options_t *opts, char *interfLevels,int nInterf)
{
int i;
char * pch;
opts->dbInterf=(double*)malloc(sizeof(double)*nInterf);
for (i=0; i<nInterf; i++)
{
opts->dbInterf[i]=0.0;
}
pch = strtok (interfLevels,",");
i=0;
while (pch != NULL)
{
opts->dbInterf[i]=atof(pch);
i++;
pch = strtok (NULL,",");
}
}
void _allocData(options_t opts, data_t *data ,uint8_t n_tx,uint8_t n_rx, int Frame_length_complex_samples)
{
int i,j;
data->s_re = (double**)malloc(n_tx*sizeof(double*));
data->s_im = (double**)malloc(n_tx*sizeof(double*));
data->r_re = (double**)malloc(n_rx*sizeof(double*));
data->r_im = (double**)malloc(n_rx*sizeof(double*));
if(opts.nInterf>0)
{
data->is_re=(double***)malloc(opts.nInterf*sizeof(double**));
data->is_im=(double***)malloc(opts.nInterf*sizeof(double**));
data->ir_re=(double***)malloc(opts.nInterf*sizeof(double**));
data->ir_im=(double***)malloc(opts.nInterf*sizeof(double**));
for(i=0;i<opts.nInterf;i++)
{
data->is_re[i]=(double**)malloc(n_tx*sizeof(double*));
data->is_im[i]=(double**)malloc(n_tx*sizeof(double*));
data->ir_re[i]=(double**)malloc(n_rx*sizeof(double*));
data->ir_im[i]=(double**)malloc(n_rx*sizeof(double*));
}
}
for (i=0; i<n_tx; i++)
{
data->s_re[i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
data->s_im[i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
bzero(data->s_re[i],Frame_length_complex_samples*sizeof(double));
bzero(data->s_im[i],Frame_length_complex_samples*sizeof(double));
for(j=0;j<opts.nInterf;j++)
{
data->is_re[j][i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
data->is_im[j][i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
bzero(data->is_re[j][i],Frame_length_complex_samples*sizeof(double));
bzero(data->is_im[j][i],Frame_length_complex_samples*sizeof(double));
}
}
for (i=0; i<n_rx; i++)
{
data->r_re[i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
data->r_im[i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
bzero(data->r_re[i],Frame_length_complex_samples*sizeof(double));
bzero(data->r_im[i],Frame_length_complex_samples*sizeof(double));
for(j=0;j<opts.nInterf;j++)
{
data->ir_re[j][i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
data->ir_im[j][i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
bzero(data->ir_re[j][i],Frame_length_complex_samples*sizeof(double));
bzero(data->ir_im[j][i],Frame_length_complex_samples*sizeof(double));
}
}
}
void copyDataFixed(data_t * origin,data_t * destination,options_t *opts, int Frame_length_complex_samples)
{
int i,j;
int sizeData=4*opts->nInterf*sizeof(double**)+
(opts->nInterf+1)*2*(opts->n_tx+opts->n_rx)*(sizeof(double*)+Frame_length_complex_samples*sizeof(double));
printf("Copying sizeData: %d\n",sizeData);
opts->fixed_data_set=1;
}
void _makeOutputDir(options_t *opts)
{
int status;
char auxDir[100];
char auxFile[100];
FILE *controlFile;
status=mkdir ("testResults",S_IRWXU | S_IRWXG | S_IRWXO);
// status=chdir("testResults");
sprintf(auxDir,"%s",opts->folderName);
//status=mkdir(auxDir,S_IRWXU | S_IRWXG | S_IRWXO);
//status=chdir(auxDir);
sprintf(auxFile,"OutpuSimulation_%df_%dI_%sdB_%dch_%d.m",opts->nframes,opts->nInterf,opts->interfLevels,opts->channel_model,opts->testNumber);
sprintf(auxFile,"Bler_%d.m",opts->testNumber);
opts->outputFile =fopen(auxFile,"w");
sprintf(auxFile,"OutputBlerRound_%d.m",opts->testNumber);
opts->outputBler =fopen(auxFile,"w");
fprintf( opts->outputBler,"SNR; rate1;rate2; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err; nprb1; nprb2\n");
sprintf(auxFile,"OutputBER_%d.m",opts->testNumber);
opts->outputBer =fopen(auxFile,"w");
sprintf(auxFile,"Throughput_%d.m",opts->testNumber);
opts->outputTrougput =fopen(auxFile,"w");
controlFile=fopen("ControlTest.txt","w");
fprintf(controlFile,"Parameters\n");
fprintf(controlFile,"./femtosim %s\n\n",opts->parameters);
fprintf(controlFile,"testNumber:\t\t\n",opts->testNumber);
fprintf(controlFile,"awgn_flag:\t\t%d\n",opts->awgn_flag);
fprintf(controlFile,"snr_init:\t\t%f\n",opts->snr_init);
fprintf(controlFile,"snr_max;\t\t%f\n",opts->snr_max);
fprintf(controlFile,"snr_step:\t\t%f\n",opts->snr_step);
fprintf(controlFile,"nframes:\t\t%d\n",opts->nframes);
fprintf(controlFile,"extended_prefix_flag:\t\t%d\n",opts->extended_prefix_flag);
fprintf(controlFile,"frame_type:\t\t%d\n",opts->frame_type);
fprintf(controlFile,"transmission_mode:\t\t%d\n",opts->transmission_mode);
fprintf(controlFile,"n_tx:\t\t%d\n",opts->n_tx);
fprintf(controlFile,"n_rx:\t\t%d\n",opts->n_rx);
fprintf(controlFile,"nInterf:\t\t%d\n",opts->nInterf);
fprintf(controlFile,"interfLevels:\t\t%s\n",opts->interfLevels);
fprintf(controlFile,"Nid_cell:\t\t%d\n",opts->Nid_cell);
fprintf(controlFile,"oversampling:\t\t%d\n",opts->oversampling);
fclose(controlFile);
}
void _parsePower(options_t *opts)
{
//printf("opts->power:%s\n",opts->power);
int i;
char * pch;
pch=strtok (opts->power,",");
if (pch != NULL)
{
opts->p_a=atoi(pch);
pch=strtok (NULL,",");
opts->p_b=atoi(pch);
opts->d_offset=0;
/* pch=strtok (NULL,",");
opts->d_offset=atoi(pch); */
}
if(opts->p_a< 0 || opts->p_a>7)
{
msg("Error -> PA (0...7) (dBm6, dBm477 ,dBm3 ,dBm177 ,dB0 ,dB1 ,dB2 ,dB3 )\n");
exit(1);
}
if(opts->p_b< 0 || opts->p_b>3)
{
msg("Error -> PB (0...3)\n");
exit(1);
}
/* if(opts->d_offset< -6 || opts->d_offset>12)
{
msg("Error -> Offset (-6...12)\n");
exit(1);
}*/
}
-203
View File
@@ -1,203 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "PHY/types.h"
#include "SIMULATION/TOOLS/defs.h"
#include <stdio.h>
#ifndef _FEMTO_UTILS
#define _FEMTO_UTILS
/*! \file SIMULATION/LTE_FEMTO/femtoUtils.h
* \brief Defines structure and function headers
* \author L. Garcia
* \date 2012
* \version 0.1
* \company Eurecom
* \note
* \warning
*/
///Top-level data Structure for general options of simulation and other global variables
typedef struct {
double snr_init;
double snr_max;
double snr_step;
int nframes;
int interf_count[8];
int fixed_channel_flag;
int fixed_data_set;
int extended_prefix_flag;
///Frame type (0 FDD, 1 TDD).
uint8_t frame_type;
///Transmission mode (1 for the moment)
uint8_t transmission_mode;
///Number of Transmit antennas in node.
uint8_t n_tx;
///Number of Receive antennas in node.
uint8_t n_rx;
///Number of interference to simulate
int nInterf;
///Array with interference level in dB
double *dbInterf;
double *probabilityInterf;
char interfLevels[150];
char interfProbability[150];
uint16_t Nid_cell;
uint16_t tdd_config;
uint8_t oversampling;
SCM_t channel_model;
SCM_t channel_modeli;
int awgn_flag;
int awgn_flagi;
int nsymb;
int num_layers;
uint16_t n_rnti;
///Modulation and code scheme
uint8_t mcs,mcs2;
uint8_t pilot1,pilot2,pilot3;
///Pointer to the output file SNRvsBLER
FILE *outputFile;
///Pointer to the output file errors and trials for each SNR
FILE *outputBler;
FILE *outputBer;
FILE *outputTrougput;
uint8_t num_rounds;
uint8_t fix_rounds;
uint8_t subframe;
// int eNB_id;
/// Amplitude of QPSK symbols
int16_t amp;
///1- Analysis of errors on DCI, 0- No analysis of errors in DCI
uint8_t dci_flag;
int testNumber;
char folderName[50];
char parameters[300];
int SIZE_TXDATAF;
int SIZE_TXDATA;
int SIZE_RXDATA;
int SIZE_RXDATAF;
uint16_t interCellId;
int n_adj_cells;
uint8_t dual_stream_UE;
int perfect_ce;
int common_flag;
int TPC;
uint8_t N_RB_DL;
int rballocset;
uint32_t DLSCH_RB_ALLOC;
PA_t p_a;
uint8_t p_b;
int8_t d_offset;
int ratio;
uint32_t nprb1, nprb2;
int prob_flag;
int search_prb2;
char power[50];
} options_t;
/// Store signal data
typedef struct {
double **s_re;
double **s_im;
double **r_re;
double **r_im;
double ***is_re;
double ***is_im;
double ***ir_re;
double ***ir_im;
} data_t;
/// Parses the command line options and assigns values ​​to pilots, num_symbols, etc. modified by the options selected
void _parseOptions(options_t *opts, int argc, char ** argv);
void _printOptions(options_t *opts);
/// Interference Levels are recivend in form num,num,num this function parse the string and fill dbInterf array
void _parseInterferenceLevels(options_t *opts, char *interfLevels,int nInterf);
void _parseInterferenceProbability(options_t *opts, char *interfLevels,int nInterf);
void _parsePower(options_t *opts);
/// Allocate memory for signal data arrays
void _allocData(options_t opts,data_t *data, uint8_t n_tx,uint8_t n_rx,int Frame_length_complex_samples);
void copyDataFixed(data_t *origin,data_t *destination,options_t *opts, int Frame_length_complex_samples);
/// Generate output dir with the prefix specified in testNumber
void _makeOutputDir(options_t *opts);
/// Initializes lte_frame_parms structure and make the structures of the eNB and EU involved in the simulation, including interference, if any.
LTE_DL_FRAME_PARMS* _lte_param_init(options_t opts);
/// Set defaults values for the simulations
void _initDefaults(options_t *opts);
/// Allocate and fill UL, CCCH and DLSCH structures
void _fill_Ul_CCCH_DLSCH_Alloc(options_t opts);
/// Allocate the eNB2UE structure for transmision and interference
void _generatesRandomChannel(options_t opts);
/** @brief This function allocates structures for a particular DLSCH at eNB.
*
* modifications will be required with more than 2 users
* It's used to generate the dci. they contain informations such as the modulation and coding scheme
* either if the transmit power control is required or not and so on...
* dlsch_eNB can suport 8 users.
* Create transport channel structures for 2 transport blocks (MIMO)
*/
void _allocDLSChannel(options_t opts);
void _generateDCI(options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx);//,uint8_t **input_buffer);
uint32_t _allocRBs(options_t *opts, int ind);
void _freeMemory(data_t data,options_t opts);
void _makeSimulation(data_t data,options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx,uint32_t *NB_RB2,LTE_DL_FRAME_PARMS *frame_parms,uint8_t num_pdcch_symbols);
void _printResults(uint32_t *errs,uint32_t *round_trials,uint32_t dci_errors,double rate);
void _printFileResults(double SNR, double rate1,double rate2 , double rate,uint32_t *errs,uint32_t *round_trials,uint32_t dci_errors,options_t opts,double BER);
void _initErrsRoundsTrials(uint32_t **errs,uint32_t **trials,int allocFlag,options_t opts);
void _fillData(options_t opts,data_t data,int numSubFrames);
void _applyNoise(options_t *opts,data_t data,double sigma2,double iqim,int numSubFrames);
uint8_t _generate_dci_top(int num_ue_spec_dci,int num_common_dci,DCI_ALLOC_t *dci_alloc,options_t opts,uint8_t num_pdcch_symbols);
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
//void _apply_Multipath_Noise_Interference(options_t opts,data_t data,data_t data_fixed,double sigma2_dB,double sigma2,int numSubFrames);
void _apply_Multipath_Noise_Interference(options_t *opts,data_t data,double sigma2_dB,double sigma2,int numSubFrames,int round);
void _writeOuputOneFrame(options_t opts,uint32_t coded_bits_per_codeword,short *uncoded_ber_bit,uint32_t tbs);
void _dumpTransportBlockSegments(uint32_t C,uint32_t Cminus,uint32_t Kminus,uint32_t Kplus, uint8_t ** c_UE,uint8_t ** c_eNB);
void _applyInterference(options_t *opts,data_t data,double sigma2,double iqim,int numSubFrames,int round);
double compute_ber_soft(uint8_t* ref, int16_t* rec, int n);
void _fillPerfectChannelDescription(options_t opts,uint8_t l);
void _writeTxData(char *num,char *desc, int init, int numframes,options_t opts, int output,int senial);
#endif
File diff suppressed because it is too large Load Diff
-47
View File
@@ -1,47 +0,0 @@
\documentclass[a4paper]{book}
\usepackage{a4wide}
\usepackage{makeidx}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{float}
\usepackage{textcomp}
\usepackage{alltt}
\usepackage{amsmath}
\usepackage{amssymb}
\ifx\pdfoutput\undefined
\usepackage[ps2pdf,
pagebackref=true,
colorlinks=true,
linkcolor=blue
]{hyperref}
\usepackage{pspicture}
\else
\usepackage[pdftex,
pagebackref=true,
colorlinks=true,
linkcolor=blue
]{hyperref}
\fi
\usepackage{doxygen}
\usepackage{times}
\makeindex
\setcounter{tocdepth}{1}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\begin{titlepage}
\vspace*{7cm}
\begin{center}
{\Large openair Specifications }\\
Phyiscal, Medium-Access, Radio-link Control, Packet Data Convergence Protocol and Radio Resource Control Layers\\
\vspace*{1cm}
{\large Generated by Doxygen 1.3.8}\\
\vspace*{0.5cm}
{\small Sun Oct 31 19:27:37 2004}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
\pagenumbering{roman}
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
@@ -1,4 +0,0 @@
Bler_1
Bler_2
semilogy(s1(:,1),s1(:,2),'b',s2(:,1),s2(:,2),'r');
-31
View File
@@ -1,31 +0,0 @@
close all
fch0e
fch1e
figure;
plot(abs(ch0e),'b'); title 'Estimated 0'
hold on
plot(abs(ch1e),'r');
hold off
dlsch0_ch_ext00
dlsch1_ch_ext00
figure;
plot(abs(dl0_ch_ext00)); title 'Ext 0';
hold on
plot(abs(dl1_ch_ext00),'r');
hold off
dlsch0_rxF_comp0
dlsch1_rxF_comp0
figure;
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
figure;
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
dlsch0_rxF_llr
rho
figure;
plot(real(rho_0),'x'); title 'Rho';
figure;
plot(dl0_llr,'x'); title 'Llr';
@@ -1,37 +0,0 @@
#close all
dlsch0_rxF_comp0
dlsch1_rxF_comp0
figure;
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
figure;
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
#plot(s0(:,1),20*log(s0(:,2)));
#fch0e;
#fch0p;
#fch1e;
#fch1p;
#plot(abs(ch0e),'r');
#hold on;
#figure;plot(abs(ch0p),'b');
#hold off;
#figure;
#plot(abs(ch1e),'m');
#hold on;
#figure;plot(abs(ch1p),'g');
#hold off;
@@ -1,6 +0,0 @@
fch0e
fch1e
figure;
plot(abs(ch0e)); title 'Estimated 0'
hold on
plot(abs(ch1e),'r');
@@ -1,6 +0,0 @@
dlsch0_ch_ext00
dlsch1_ch_ext00
figure;
plot(abs(dl0_ch_ext00)); title 'Ext 0';
figure;
plot(abs(dl1_ch_ext00)); title 'Ext 1 interferer';
@@ -1,6 +0,0 @@
dlsch0_rxF_ext0
dlsch1_rxF_ext0
figure;
plot(abs(dl0_rxF_ext0)); title 'Ext 0';
figure;
plot(abs(dl1_rxF_ext0)); title 'Ext 1 interferer';
@@ -1,6 +0,0 @@
dlsch0_rxF_llr
rho
figure;
plot(real(rho_0));
figure;
plot(dl0_llr,'x');
File diff suppressed because it is too large Load Diff
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-76
View File
@@ -1,76 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = ../..
CFLAGS += -m32 -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1
CFLAGS += -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef OPENAIR2
CFLAGS += -DOPENAIR2
endif
CFLAGS += -I$(OPENAIR2_DIR) -I$(OPENAIR3_DIR)/MESH -I$(OPENAIR2_DIR)/COMMON -I$(OPENAIR2_DIR)/LAYER2/RLC -I$(OPENAIR2_DIR)/UTIL/MEM -I$(OPENAIR2_DIR)/UTIL/MATH -I$(OPENAIR2_DIR)/UTIL/LISTS -I$(OPENAIR2_DIR)/LAYER2/RLC/AM -I$(OPENAIR2_DIR)/LAYER2/RLC/UM_v6.1.0_LITE -I$(OPENAIR2_DIR)/LAYER2/RLC/TM -I$(OPENAIR2_DIR)/UTIL/TIMER -I/usr/include/X11 -I/usr/X11R6/include
include $(TOP_DIR)/PHY/Makefile.inc
include $(TOP_DIR)/SCHED/Makefile.inc
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(LAYER2_OBJ)
OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
all: dlsim dlsim2 ulsim ulsim2 physim physim_secsys
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
%.o : %.c
$(CC) -c $(CFLAGS) -I$(TOP_DIR) -o $@ $<
dlsim : $(OBJ2) dlsim.c
$(CC) dlsim.c -I$(TOP_DIR) -o dlsim $(CFLAGS) $(OBJ2) -lm -lblas
dlsim2 : $(OBJ2) dlsim2.c
$(CC) dlsim2.c -I$(TOP_DIR) -o dlsim2 $(CFLAGS) $(OBJ2) -lm -lblas
ulsim : $(OBJ2) ulsim.c ulsim_form.c
$(CC) ulsim.c ulsim_form.c -I$(TOP_DIR) -o ulsim $(CFLAGS) $(OBJ2) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm
ulsim2 : $(OBJ2) ulsim2.c
$(CC) ulsim2.c -I$(TOP_DIR) -o ulsim2 $(CFLAGS) $(OBJ2) -lm
physim : $(OBJ) phy_procedures_sim.c
$(CC) phy_procedures_sim.c -I$(TOP_DIR) -o physim $(CFLAGS) $(OBJ) -lm
clean:
rm -f dlsim dlsim2 ulsim ulsim2 physim
rm -f $(OBJ)
rm -f *.o
rm -f *.exe*
showcflags:
@echo $(CFLAGS)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+191 -191
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -35,209 +35,209 @@
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] ={gpib_device, NOADDR};
SendIFC(gpib_board);
unsigned short addlist[2] = {gpib_device, NOADDR};
SendIFC(gpib_board);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
if(ibsta & ERR)
if(ibsta & ERR) {
printf("gpib_send: Instrument enable failed! \n");
}
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
if(ibsta & ERR) {
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
void calibration(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,DCI_ALLOC_t *dci_alloc)
{
printf("gpib_send: Instrument enable failed! \n");
}
char string[256];
void *DLSCH_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
if(ibsta & ERR)
{
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
void calibration(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,DCI_ALLOC_t *dci_alloc){
char string[256];
void *DLSCH_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK DOWN");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:SETT:TMOD:DL 'E-TM1_1__20MHz'"); //EUTRA test model
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
/*
//Filter/Clipping/Power Settings
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:TYPE LTEF"); //set the filter type into LET filter
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:MODE RT"); //select a realtime filter mode
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:COFF 0.35"); // set the roll-off factor for LTE filter
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:COFS -0.3"); //set the cut of the frequency for LET filter, here -0.3 the BW is 20 MHz
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:OPT ACPN"); //selects ACP (Narrow) optimization
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:ROF 0.2"); //the roll-off factor is set to 0.2.
// the clock setting
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:SOUR EXT"); //Selects the clock source
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:MODE SAMP"); //selects clock type SAMPle
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:SYNC:MODE MAST"); //the instrument is configured to work as a master one.
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOCK:SYNC:EXEC"); //all synchronization's settings are adjusted accordingly
*/
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
//General EUTRA/LTE Downlink Settings
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CONF:MODE AUTO"); //Determines whether the configuration and scheduling of the different PDSCH allocations
//inside of the DL allocation table is performed manual or according to the configuration
//made for the DCIs
//sets the MIMO configuration to 1 TxAntenna
sprintf(string,"BB:EUTR:DL:MIMO:CONF TX%d",frame_parms->nb_antennas_tx);
gpib_send(gpib_card,gpib_device,string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:MIMO:ANTA ANT1"); //Sets the simulated antenna for path A, selesct antenna 1
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:MIMO:ANTB NONE"); //Set the Simulation antenna for path B, we Just have one antenna, so for path B, no antenna
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SYNC:TXAN ALL"); //enables all antennas port to transmit P-/S-SYNC
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:BW USER"); //selects a downlink frequency band of USER
//sets the number of resource blocks to 25
sprintf(string,"BB:EUTR:DL:NORB %d",frame_parms->N_RB_DL);
gpib_send(gpib_card,gpib_device,string);
//size of FFT
//sprintf(string,"BB:EUTR:DL:FFT %d",frame_parms->ofdm_symbol_size); //depends on the number of resource block
//gpib_send(gpib_card,gpib_device,string);
//sets the Cell ID 0
sprintf(string,"BB:EUTR:DL:PLC:CID %d",frame_parms->Nid_cell);
gpib_send(gpib_card,gpib_device,string);
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:PLC:PLID 2"); //physical layer is 2
//set the prefix of the subframes
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CPC NORM");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CPC EXT");
//DL Frame Configuration
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:VIEW:MODE PRB"); //Determines the time plan shows the allocated Physical Resource Blocks
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:BUR DUD"); //the unscheduled resource elements are filled with dummy data.
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SFS 6"); //displays subframe 6 in the allocation list view.
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALC 1");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:AOC ON");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:CONT PDSC"); //selects PDSCH as type for the selected allocation
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW1:MOD QPSK");//choose modulation QPSK
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF4:ALL1:CW:DATA USER1"); // user1 is the data source for the selected allocation
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:STAT ON"); //activates the selected allocation.
//PDCCH & PSCH configuration
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:STAT ON"); //enables PDCCH allocation
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PREC:SCH TXD");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:SCR:STAT ON"); //enables scrambling
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:FORM VAR"); //sets the PDCCH format into VAR
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:RES"); //reset the table table
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:SIT 0"); //selects the first row in the DCI table
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:APP");
//sets the n_RNTI into 1234
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:UEID %d",dci_alloc->rnti);
gpib_send(gpib_card,gpib_device,string);
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:UEID %d",dci_alloc->rnti);
gpib_send(gpib_card,gpib_device,string);
//sets the DCI format into 1
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIF F%d",dci_alloc->format);
gpib_send(gpib_card,gpib_device,string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:PFMT 0"); //Sets the PDCCH format for the selected PDCCH into 0
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:F1AM PDSC");//Selects the mode of the DCI format
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF1:ENCC:PDCC:EXTC:USER USER1"); //the DCI is dedicated to User 1
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:SESP OFF"); //the DCI is transmitted within the common or UE-specific search OFF
if(dci_alloc->format==format1){
//sets the HARQ process number
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:HPN %d",((DCI1_5MHz_TDD_t*) DLSCH_alloc_pdu)->harq_pid);
gpib_send(gpib_card,gpib_device,string);
//sets the Modulation and Coding Scheme
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:MCSR %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->mcs);
gpib_send(gpib_card,gpib_device,string);
//sets the New Data Indicator
if(((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->ndi==1)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:NDI ON");
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:NDI OFF");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
//disables Resource Allocation Header
if(((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rah==1)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RAH ON");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RAH OFF");
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK DOWN");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:SETT:TMOD:DL 'E-TM1_1__20MHz'"); //EUTRA test model
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
//sets Resource Block Assignment
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RBA %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rballoc );
/*
//Filter/Clipping/Power Settings
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:TYPE LTEF"); //set the filter type into LET filter
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:MODE RT"); //select a realtime filter mode
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:COFF 0.35"); // set the roll-off factor for LTE filter
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:COFS -0.3"); //set the cut of the frequency for LET filter, here -0.3 the BW is 20 MHz
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:OPT ACPN"); //selects ACP (Narrow) optimization
gpib_send(gpib_card,gpib_device,"BB:EUTR:FILT:PAR:LTE:ROF 0.2"); //the roll-off factor is set to 0.2.
// the clock setting
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:SOUR EXT"); //Selects the clock source
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:MODE SAMP"); //selects clock type SAMPle
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOC:SYNC:MODE MAST"); //the instrument is configured to work as a master one.
gpib_send(gpib_card,gpib_device,"BB:EUTR:CLOCK:SYNC:EXEC"); //all synchronization's settings are adjusted accordingly
*/
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
//General EUTRA/LTE Downlink Settings
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CONF:MODE AUTO"); //Determines whether the configuration and scheduling of the different PDSCH allocations
//inside of the DL allocation table is performed manual or according to the configuration
//made for the DCIs
//sets the MIMO configuration to 1 TxAntenna
sprintf(string,"BB:EUTR:DL:MIMO:CONF TX%d",frame_parms->nb_antennas_tx);
gpib_send(gpib_card,gpib_device,string);
//sets the Redundancy Version
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RV %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rv );
gpib_send(gpib_card,gpib_device,string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:MIMO:ANTA ANT1"); //Sets the simulated antenna for path A, selesct antenna 1
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:MIMO:ANTB NONE"); //Set the Simulation antenna for path B, we Just have one antenna, so for path B, no antenna
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SYNC:TXAN ALL"); //enables all antennas port to transmit P-/S-SYNC
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:BW USER"); //selects a downlink frequency band of USER
//sets the TPC Command for PUSCH
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:TPCC %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->TPC );
//sets the number of resource blocks to 25
sprintf(string,"BB:EUTR:DL:NORB %d",frame_parms->N_RB_DL);
gpib_send(gpib_card,gpib_device,string);
}
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:SIT 0");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:DEL");
//gpib_send(gpib_card,gpib_device,"AWGN:STAT ON"); // to add noise in the system
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
//size of FFT
//sprintf(string,"BB:EUTR:DL:FFT %d",frame_parms->ofdm_symbol_size); //depends on the number of resource block
//gpib_send(gpib_card,gpib_device,string);
//sets the Cell ID 0
sprintf(string,"BB:EUTR:DL:PLC:CID %d",frame_parms->Nid_cell);
gpib_send(gpib_card,gpib_device,string);
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:PLC:PLID 2"); //physical layer is 2
//set the prefix of the subframes
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CPC NORM");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:CPC EXT");
//DL Frame Configuration
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:VIEW:MODE PRB"); //Determines the time plan shows the allocated Physical Resource Blocks
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:BUR DUD"); //the unscheduled resource elements are filled with dummy data.
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SFS 6"); //displays subframe 6 in the allocation list view.
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALC 1");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:AOC ON");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:CONT PDSC"); //selects PDSCH as type for the selected allocation
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW1:MOD QPSK");//choose modulation QPSK
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF4:ALL1:CW:DATA USER1"); // user1 is the data source for the selected allocation
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ALL1:CW:STAT ON"); //activates the selected allocation.
//PDCCH & PSCH configuration
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:STAT ON"); //enables PDCCH allocation
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PREC:SCH TXD");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:SCR:STAT ON"); //enables scrambling
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:FORM VAR"); //sets the PDCCH format into VAR
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:RES"); //reset the table table
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:SIT 0"); //selects the first row in the DCI table
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:APP");
//sets the n_RNTI into 1234
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:UEID %d",dci_alloc->rnti);
gpib_send(gpib_card,gpib_device,string);
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:UEID %d",dci_alloc->rnti);
gpib_send(gpib_card,gpib_device,string);
//sets the DCI format into 1
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIF F%d",dci_alloc->format);
gpib_send(gpib_card,gpib_device,string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:PFMT 0"); //Sets the PDCCH format for the selected PDCCH into 0
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:F1AM PDSC");//Selects the mode of the DCI format
//gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF1:ENCC:PDCC:EXTC:USER USER1"); //the DCI is dedicated to User 1
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:SESP OFF"); //the DCI is transmitted within the common or UE-specific search OFF
if(dci_alloc->format==format1) {
//sets the HARQ process number
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:HPN %d",((DCI1_5MHz_TDD_t*) DLSCH_alloc_pdu)->harq_pid);
gpib_send(gpib_card,gpib_device,string);
//sets the Modulation and Coding Scheme
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:MCSR %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->mcs);
gpib_send(gpib_card,gpib_device,string);
//sets the New Data Indicator
if(((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->ndi==1)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:NDI ON");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:NDI OFF");
//disables Resource Allocation Header
if(((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rah==1)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RAH ON");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RAH OFF");
//sets Resource Block Assignment
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RBA %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rballoc );
gpib_send(gpib_card,gpib_device,string);
//sets the Redundancy Version
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:RV %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->rv );
gpib_send(gpib_card,gpib_device,string);
//sets the TPC Command for PUSCH
sprintf(string,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:ITEM1:DCIC:TPCC %d",((DCI1_5MHz_TDD_t*)DLSCH_alloc_pdu)->TPC );
gpib_send(gpib_card,gpib_device,string);
}
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:SIT 0");
gpib_send(gpib_card,gpib_device,"BB:EUTR:DL:SUBF6:ENCC:PDCC:EXTC:DEL");
//gpib_send(gpib_card,gpib_device,"AWGN:STAT ON"); // to add noise in the system
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
}
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
+3 -3
View File
@@ -1,6 +1,6 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
include $(OPENAIR_DIR)/common/utils/Makefile.inc
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
COMMON_UTILS_DIR = $(OPENAIR_DIR)/common/utils
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
@@ -110,7 +110,7 @@ CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR2_DIR) -I$(OPENAI
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
#LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS)
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) $(ITTI_DIR)/backtrace.o
ifdef GPIB
OBJ += LTE_Configuration.o
endif
File diff suppressed because it is too large Load Diff
+157 -124
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -58,14 +58,16 @@ uint32_t DLSCH_RB_ALLOC = 0x1000;
uint8_t BCCH_alloc_pdu[8];
uint64_t DLSCH_alloc_pdu_1[2];
void eNB_scheduler(uint8_t Mod_id, uint8_t cooperation_flag, uint8_t frame, uint8_t subframe) {
void eNB_scheduler(uint8_t Mod_id, uint8_t cooperation_flag, uint8_t frame, uint8_t subframe)
{
msg("Doing Scheduler for eNB, frame %d subframe %d\n",frame,subframe);
}
DCI_PDU DCI_pdu;
DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe)
{
int i,k;
uint8_t transmission_mode = PHY_vars_eNB_g[0]->transmission_mode[0];
int dci_length_bytes,dci_length;
@@ -73,13 +75,13 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
DCI_pdu.Num_ue_spec_dci = 0;
DCI_pdu.Num_common_dci = 0;
if (subframe_select(&PHY_vars_eNB_g[0]->lte_frame_parms, subframe) == SF_S)
{
if (subframe_select(&PHY_vars_eNB_g[0]->lte_frame_parms, subframe) == SF_S) {
return (&DCI_pdu);
}
// UE specific DCI
for(k=0;k<n_users;k++)
{
for(k=0; k<n_users; k++) {
switch(transmission_mode) {
case 1:
case 2:
@@ -96,7 +98,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = 0;
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0;
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->dai = 0;
((DCI1A_1_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->type = 1;
((DCI1A_1_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->vrb_type = 0;
((DCI1A_1_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->rballoc = computeRIV(PHY_vars_eNB_g[0]->lte_frame_parms.N_RB_DL, 0, 4);
@@ -108,6 +110,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
break;
case 25:
dci_length = sizeof_DCI1_5MHz_TDD_t;
dci_length_bytes = sizeof(DCI1_5MHz_TDD_t);
@@ -119,7 +122,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = 0;
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0;
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->dai = 0;
((DCI1A_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->type = 1;
((DCI1A_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->vrb_type = 0;
((DCI1A_5MHz_TDD_1_6_t*)&BCCH_alloc_pdu[0])->rballoc = computeRIV(PHY_vars_eNB_g[0]->lte_frame_parms.N_RB_DL, 18, 4);
@@ -131,6 +134,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
break;
case 50:
dci_length = sizeof_DCI1_10MHz_TDD_t;
dci_length_bytes = sizeof(DCI1_10MHz_TDD_t);
@@ -154,6 +158,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
break;
case 100:
dci_length = sizeof_DCI1_20MHz_TDD_t;
dci_length_bytes = sizeof(DCI1_20MHz_TDD_t);
@@ -178,8 +183,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
break;
}
}
else { //FDD
} else { //FDD
switch (PHY_vars_eNB_g[0]->lte_frame_parms.N_RB_DL) {
case 6:
dci_length = sizeof_DCI1_1_5MHz_FDD_t;
@@ -203,6 +207,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_1_5MHz_FDD_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
break;
case 25:
dci_length = sizeof_DCI1_5MHz_FDD_t;
dci_length_bytes = sizeof(DCI1_5MHz_FDD_t);
@@ -225,6 +230,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_5MHz_FDD_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_5MHz_FDD_t);
break;
case 50:
dci_length = sizeof_DCI1_10MHz_FDD_t;
dci_length_bytes = sizeof(DCI1_10MHz_FDD_t);
@@ -247,6 +253,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_10MHz_FDD_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_10MHz_FDD_t);
break;
case 100:
dci_length = sizeof_DCI1_20MHz_FDD_t;
dci_length_bytes = sizeof(DCI1_20MHz_FDD_t);
@@ -269,14 +276,17 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
BCCH_pdu_size_bits = sizeof_DCI1A_20MHz_FDD_t;
BCCH_pdu_size_bytes = sizeof(DCI1A_20MHz_FDD_t);
break;
}
}
}
break;
default:
printf("Unsupported Transmission Mode!!!");
exit(-1);
break;
}
// add common dci
DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits;
DCI_pdu.dci_alloc[0].L = 2;
@@ -293,12 +303,13 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].format = format1;
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].dci_pdu[0], &DLSCH_alloc_pdu_1[k], dci_length_bytes);
DCI_pdu.Num_ue_spec_dci++;
DCI_pdu.Num_ue_spec_dci++;
}
DCI_pdu.nCCE = 0;
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci;i++) {
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) {
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
}
@@ -307,15 +318,19 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) {
uint8_t DLSCH_pdu[768*8];
uint8_t *get_DLSCH_pdu(uint8_t Mod_id,uint16_t rnti,uint8_t abstraction_flag) {
uint8_t *get_DLSCH_pdu(uint8_t Mod_id,uint16_t rnti,uint8_t abstraction_flag)
{
int i;
memset(DLSCH_pdu, 0, 768);
for(i=0; i<768; i++)
DLSCH_pdu[i] = (unsigned char)(0xff);
return(DLSCH_pdu);
}
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) {
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
{
int aa, slot_offset, slot_offset_F;
int nthreads,tid;
@@ -328,18 +343,18 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
&txdata[aa][slot_offset], // output
frame_parms->log2_symbol_size, // log2_fft_size
6, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
&txdata[aa][slot_offset], // output
frame_parms->log2_symbol_size, // log2_fft_size
6, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
else {
normal_prefix_mod(&txdataF[aa][slot_offset_F],
&txdata[aa][slot_offset],
7,
frame_parms);
&txdata[aa][slot_offset],
7,
frame_parms);
}
@@ -349,108 +364,112 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
}
void lte_param_init( unsigned char transmission_mode,
unsigned char extended_prefix_flag,
uint16_t Nid_cell,
uint8_t N_RB_DL,
uint8_t osf,
uint8_t fdd_flag,
uint8_t tdd_config) {
unsigned char extended_prefix_flag,
uint16_t Nid_cell,
uint8_t N_RB_DL,
uint8_t osf,
uint8_t fdd_flag,
uint8_t tdd_config)
{
unsigned int ind,i,j;
LTE_DL_FRAME_PARMS *lte_frame_parms;
int frame_type = (fdd_flag==1) ? 0 : 1;
mac_xface = malloc(sizeof(MAC_xface));
unsigned int ind,i,j;
LTE_DL_FRAME_PARMS *lte_frame_parms;
int frame_type = (fdd_flag==1) ? 0 : 1;
mac_xface = malloc(sizeof(MAC_xface));
LOG_I(PHY,"init lte parms: Nid_cell %d, Frame_type %d, N_RB_DL %d\n", Nid_cell, frame_type, N_RB_DL);
PHY_vars_eNB_g = malloc(sizeof(PHY_VARS_eNB*));
PHY_vars_eNB_g[0] = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE*));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_UE));
LOG_I(PHY,"init lte parms: Nid_cell %d, Frame_type %d, N_RB_DL %d\n", Nid_cell, frame_type, N_RB_DL);
PHY_vars_eNB_g = malloc(sizeof(PHY_VARS_eNB*));
PHY_vars_eNB_g[0] = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE*));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_UE));
mac_xface->eNB_dlsch_ulsch_scheduler = eNB_scheduler;
mac_xface->get_dci_sdu = get_dci;
mac_xface->get_dlsch_sdu = get_DLSCH_pdu;
mac_xface->eNB_dlsch_ulsch_scheduler = eNB_scheduler;
mac_xface->get_dci_sdu = get_dci;
mac_xface->get_dlsch_sdu = get_DLSCH_pdu;
randominit(0);
set_taus_seed(0);
randominit(0);
set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNB_g[0]->lte_frame_parms);
lte_frame_parms = &(PHY_vars_eNB_g[0]->lte_frame_parms);
lte_frame_parms->frame_type = frame_type;
lte_frame_parms->tdd_config = tdd_config;
lte_frame_parms->tdd_config_S = 0;
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = Nid_cell%6;
lte_frame_parms->nb_antennas_tx = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->nb_antennas_rx = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
lte_frame_parms->phich_config_common.phich_resource = oneSixth;
lte_frame_parms->phich_config_common.phich_duration = normal;
lte_frame_parms->frame_type = frame_type;
lte_frame_parms->tdd_config = tdd_config;
lte_frame_parms->tdd_config_S = 0;
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = Nid_cell%6;
lte_frame_parms->nb_antennas_tx = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->nb_antennas_rx = (transmission_mode == 1) ? 1 : 2;
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
lte_frame_parms->phich_config_common.phich_resource = oneSixth;
lte_frame_parms->phich_config_common.phich_duration = normal;
init_frame_parms(lte_frame_parms,osf);
init_frame_parms(lte_frame_parms,osf);
phy_init_top(lte_frame_parms); //allocation
phy_init_lte_top(lte_frame_parms);
phy_init_top(lte_frame_parms); //allocation
phy_init_lte_top(lte_frame_parms);
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
memcpy(&(PHY_vars_UE_g[0]->lte_frame_parms), lte_frame_parms, sizeof(LTE_DL_FRAME_PARMS));
memcpy(&(PHY_vars_UE_g[0]->lte_frame_parms), lte_frame_parms, sizeof(LTE_DL_FRAME_PARMS));
for (i=0;i<NUMBER_OF_UE_MAX;i++) {
for (j=0;j<2;j++) {
PHY_vars_eNB_g[0]->dlsch_eNB[i][j] = new_eNB_dlsch(1,8,0);
if (!PHY_vars_eNB_g[0]->dlsch_eNB[i][j]) {
LOG_E(PHY,"Can't get eNb dlsch structures\n");
exit(-1);
}
else {
LOG_D(PHY,"dlsch_eNB[%d][%d] => %p\n",i,j,PHY_vars_eNB_g[0]->dlsch_eNB[i][j]);
PHY_vars_eNB_g[0]->dlsch_eNB[i][j]->rnti=n_rnti+i;
}
}
PHY_vars_eNB_g[0]->ulsch_eNB[1+i] = new_eNB_ulsch(8,0);
if (!PHY_vars_eNB_g[0]->ulsch_eNB[1+i]) {
LOG_E(PHY,"Can't get eNb ulsch structures\n");
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
for (j=0; j<2; j++) {
PHY_vars_eNB_g[0]->dlsch_eNB[i][j] = new_eNB_dlsch(1,8,0);
if (!PHY_vars_eNB_g[0]->dlsch_eNB[i][j]) {
LOG_E(PHY,"Can't get eNb dlsch structures\n");
exit(-1);
} else {
LOG_D(PHY,"dlsch_eNB[%d][%d] => %p\n",i,j,PHY_vars_eNB_g[0]->dlsch_eNB[i][j]);
PHY_vars_eNB_g[0]->dlsch_eNB[i][j]->rnti=n_rnti+i;
}
}
// ULSCH for RA
PHY_vars_eNB_g[0]->ulsch_eNB[0] = new_eNB_ulsch(8,0);
if (!PHY_vars_eNB_g[0]->ulsch_eNB[0]) {
PHY_vars_eNB_g[0]->ulsch_eNB[1+i] = new_eNB_ulsch(8,0);
if (!PHY_vars_eNB_g[0]->ulsch_eNB[1+i]) {
LOG_E(PHY,"Can't get eNb ulsch structures\n");
exit(-1);
}
PHY_vars_eNB_g[0]->dlsch_eNB_SI = new_eNB_dlsch(1,1,0);
LOG_D(PHY,"[eNB %d] : SI %p\n",0,PHY_vars_eNB_g[0]->dlsch_eNB_SI);
PHY_vars_eNB_g[0]->dlsch_eNB_ra = new_eNB_dlsch(1,1,0);
LOG_D(PHY,"[eNB %d] : RA %p\n",0,PHY_vars_eNB_g[0]->dlsch_eNB_ra);
PHY_vars_eNB_g[0]->rx_total_gain_eNB_dB=150;
}
// ULSCH for RA
PHY_vars_eNB_g[0]->ulsch_eNB[0] = new_eNB_ulsch(8,0);
if (!PHY_vars_eNB_g[0]->ulsch_eNB[0]) {
LOG_E(PHY,"Can't get eNb ulsch structures\n");
exit(-1);
}
PHY_vars_eNB_g[0]->dlsch_eNB_SI = new_eNB_dlsch(1,1,0);
LOG_D(PHY,"[eNB %d] : SI %p\n",0,PHY_vars_eNB_g[0]->dlsch_eNB_SI);
PHY_vars_eNB_g[0]->dlsch_eNB_ra = new_eNB_dlsch(1,1,0);
LOG_D(PHY,"[eNB %d] : RA %p\n",0,PHY_vars_eNB_g[0]->dlsch_eNB_ra);
PHY_vars_eNB_g[0]->rx_total_gain_eNB_dB=150;
phy_init_lte_ue(PHY_vars_UE_g[0],1,0);
phy_init_lte_ue(PHY_vars_UE_g[0],1,0);
phy_init_lte_eNB(PHY_vars_eNB_g[0],0,0,0);
phy_init_lte_eNB(PHY_vars_eNB_g[0],0,0,0);
LOG_I(PHY,"Done lte_param_init\n");
LOG_I(PHY,"Done lte_param_init\n");
PHY_vars_eNB_g[0]->transmission_mode[0] = transmission_mode;
dump_frame_parms(lte_frame_parms);
PHY_vars_eNB_g[0]->transmission_mode[0] = transmission_mode;
dump_frame_parms(lte_frame_parms);
}
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
char c;
@@ -490,44 +509,52 @@ int main(int argc, char **argv) {
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
logInit();
g_log->log_component[PHY].level = LOG_DEBUG;
while ((c = getopt (argc, argv, "hpFb:n:m:x:N:R:")) != -1)
{
switch (c)
{
while ((c = getopt (argc, argv, "hpFb:n:m:x:N:R:")) != -1) {
switch (c) {
case 'n':
n_frames = atoi(optarg);
break;
case 'm':
mcs = atoi(optarg);
break;
case 'p':
extended_prefix_flag=1;
break;
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
break;
case 'b':
tdd_config = atoi(optarg);
break;
case 'F':
fdd_flag = 1;
break;
default:
case 'h':
printf("%s -h(elp) -F(FDD_mode) -b tdd_config -p(extended_prefix) -N cell_id -m mcs -n n_frames -x transmission_mode(1,2,5,6)\n",argv[0]);
@@ -545,21 +572,23 @@ int main(int argc, char **argv) {
}
}
switch (N_RB_DL)
{
switch (N_RB_DL) {
case 6:
DLSCH_RB_ALLOC = 0x20;
BW = 1.92;
num_pdcch_symbols = 3;
break;
case 25:
DLSCH_RB_ALLOC = 0x1F00;
BW = 7.68;
break;
case 50:
DLSCH_RB_ALLOC = 0x1F000;
BW = 15.36;
break;
case 100:
DLSCH_RB_ALLOC = 0x1F00000;
BW = 30.72;
@@ -572,35 +601,39 @@ int main(int argc, char **argv) {
frame_parms = &PHY_vars_eNB_g[0]->lte_frame_parms;
for (frame=0;frame<n_frames;frame++) {
for (frame=0; frame<n_frames; frame++) {
PHY_vars_eNB_g[0]->frame = frame;
printf("**********Frame %d*********************\n",frame);
for (slot=-1;slot<19;slot++) {
for (slot=-1; slot<19; slot++) {
last_slot = (slot - 1)%20;
if (last_slot <0)
last_slot+=20;
next_slot = (slot + 1)%20;
printf("Slot %d\n",next_slot);
phy_procedures_eNB_lte(last_slot,next_slot,PHY_vars_eNB_g[0],0);
// OFDM generation
do_OFDM_mod(PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdataF[eNB_id],
PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[eNB_id],
next_slot,
frame_parms);
PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[eNB_id],
next_slot,
frame_parms);
}//slot
char fname[64], vname[64];
sprintf(fname, "txsig%d.m", frame);
sprintf(vname, "txs%d", frame);
write_output(fname, vname, PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
if (frame == 0)
write_output("txsigF0.m", "txsF0", PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdataF[0][0], frame_parms->ofdm_symbol_size*14*10, 1, 1);
write_output("txsigF0.m", "txsF0", PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdataF[0][0], frame_parms->ofdm_symbol_size*14*10, 1, 1);
}//frame
}
+19 -20
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -32,28 +32,27 @@
#include"gpib_send.h"
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] ={gpib_device, NOADDR};
SendIFC(gpib_board);
unsigned short addlist[2] = {gpib_device, NOADDR};
SendIFC(gpib_board);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
if(ibsta & ERR)
{
printf("gpib_send: Instrument enable failed! \n");
}
if(ibsta & ERR) {
printf("gpib_send: Instrument enable failed! \n");
}
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
if(ibsta & ERR)
{
if(ibsta & ERR) {
printf("gpib_send: Send failed! \n");
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
printf("%s \n",command_string);
}
+5 -5
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
+283 -240
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -60,7 +60,9 @@
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,lte_frame_type_t frame_type, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,uint8_t osf,uint32_t perfect_ce) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,lte_frame_type_t frame_type, uint16_t Nid_cell,uint8_t tdd_config,
uint8_t N_RB_DL,uint8_t osf,uint32_t perfect_ce)
{
LTE_DL_FRAME_PARMS *lte_frame_parms;
@@ -74,11 +76,11 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
srand(1);
randominit(1);
set_taus_seed(1);
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->Nid_cell_mbsfn = 1;
@@ -95,15 +97,9 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(lte_frame_parms); //allocation
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
PHY_vars_UE->is_secondary_ue = 0;
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
@@ -115,14 +111,14 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE->lte_gold_mbsfn_table,Nid_cell);
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB->lte_gold_mbsfn_table,Nid_cell);
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE->lte_gold_mbsfn_table,Nid_cell);
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB->lte_gold_mbsfn_table,Nid_cell);
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
PHY_vars_UE->perfect_ce = perfect_ce;
PHY_vars_UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
@@ -130,7 +126,8 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_1E[2];
#define UL_RB_ALLOC 0x1ff;
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
char c;
@@ -143,6 +140,7 @@ int main(int argc, char **argv) {
double **s_re,**s_im,**r_re,**r_im;
double iqim = 0.0;
int subframe=1;
int sched_subframe;
char fname[40];//, vname[40];
uint8_t transmission_mode = 1,n_tx=1,n_rx=2;
uint16_t Nid_cell=0;
@@ -159,25 +157,25 @@ int main(int argc, char **argv) {
LTE_DL_FRAME_PARMS *frame_parms;
int hold_channel=0;
uint16_t NB_RB=25;
int tdd_config=3;
SCM_t channel_model=MBSFN;
unsigned char *input_buffer;
unsigned short input_buffer_length;
unsigned int ret;
unsigned int trials,errs[4]={0,0,0,0};//,round_trials[4]={0,0,0,0};
unsigned int trials,errs[4]= {0,0,0,0}; //,round_trials[4]={0,0,0,0};
uint8_t N_RB_DL=25,osf=1;
double BW=5.0;
uint32_t perfect_ce = 0;
lte_frame_type_t frame_type = FDD;
lte_frame_type_t frame_type = FDD;
#ifdef XFORMS
@@ -193,112 +191,135 @@ int main(int argc, char **argv) {
logInit();
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "ahA:Cp:n:s:S:t:x:y:z:N:F:R:O:dm:i:Y")) != -1)
{
switch (c)
{
case 'a':
awgn_flag=1;
break;
case 'd':
frame_type = 0;
break;
case 'n':
n_frames = atoi(optarg);
break;
case 'm':
mcs=atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'i':
input_snr_step = atof(optarg);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p': // subframe no;
subframe=atoi(optarg);
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
switch (N_RB_DL) {
case 6:
BW=1.25;
break;
case 25:
BW=5.0;
break;
case 50:
BW=10.0;
break;
case 100:
BW=20.0;
break;
default:
printf("Unsupported Bandwidth %d\n",N_RB_DL);
exit(-1);
break;
}
break;
case 'O':
osf = atoi(optarg);
break;
case 'Y':
perfect_ce = 1;
break;
default:
case 'h':
printf("%s -h(elp) -p(subframe) -N cell_id -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -i snr increment -z RXant \n",argv[0]);
printf("-h This message\n");
printf("-a Use AWGN Channel\n");
printf("-p Use extended prefix mode\n");
printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-N Nid_cell\n");
printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
while ((c = getopt (argc, argv, "ahA:Cp:n:s:S:t:x:y:z:N:F:R:O:dm:i:Y")) != -1) {
switch (c) {
case 'a':
awgn_flag=1;
break;
case 'd':
frame_type = 0;
break;
case 'n':
n_frames = atoi(optarg);
break;
case 'm':
mcs=atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'i':
input_snr_step = atof(optarg);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p': // subframe no;
subframe=atoi(optarg);
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
switch (N_RB_DL) {
case 6:
BW=1.25;
break;
case 25:
BW=5.0;
break;
case 50:
BW=10.0;
break;
case 100:
BW=20.0;
break;
default:
printf("Unsupported Bandwidth %d\n",N_RB_DL);
exit(-1);
break;
}
break;
case 'O':
osf = atoi(optarg);
break;
case 'Y':
perfect_ce = 1;
break;
default:
case 'h':
printf("%s -h(elp) -p(subframe) -N cell_id -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -i snr increment -z RXant \n",argv[0]);
printf("-h This message\n");
printf("-a Use AWGN Channel\n");
printf("-p Use extended prefix mode\n");
printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-N Nid_cell\n");
printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
}
sched_subframe = (subframe+9)%10;
if (awgn_flag == 1)
channel_model = AWGN;
@@ -306,11 +327,12 @@ int main(int argc, char **argv) {
if ((subframe == 0) || (subframe == 5) || // TDD and FDD SFn 0,5;
((frame_type == FDD) && ((subframe == 4) || (subframe == 9))) || // FDD SFn 4,9;
((frame_type == TDD ) && ((subframe<3) || (subframe==6)))) { // TDD SFn 1,2,6;
((frame_type == TDD ) && ((subframe<3) || (subframe==6)))) { // TDD SFn 1,2,6;
printf("Illegal subframe %d for eMBMS transmission (frame_type %d)\n",subframe,frame_type);
exit(-1);
}
}
if (transmission_mode==2)
n_tx=2;
@@ -330,20 +352,23 @@ int main(int argc, char **argv) {
frame_parms = &PHY_vars_eNB->lte_frame_parms;
if (awgn_flag == 0)
sprintf(fname,"embms_%d_%d.m",mcs,N_RB_DL);
sprintf(fname,"embms_%d_%d.m",mcs,N_RB_DL);
else
sprintf(fname,"embms_awgn_%d_%d.m",mcs,N_RB_DL);
fd = fopen(fname,"w");
if (awgn_flag==0)
if (awgn_flag==0)
fprintf(fd,"SNR_%d_%d=[];errs_mch_%d_%d=[];mch_trials_%d_%d=[];\n",
mcs,N_RB_DL,
mcs,N_RB_DL,
mcs,N_RB_DL);
mcs,N_RB_DL,
mcs,N_RB_DL,
mcs,N_RB_DL);
else
fprintf(fd,"SNR_awgn_%d_%d=[];errs_mch_awgn_%d_%d=[];mch_trials_awgn_%d_%d=[];\n",
mcs,N_RB_DL,
mcs,N_RB_DL,
mcs,N_RB_DL);
mcs,N_RB_DL,
mcs,N_RB_DL,
mcs,N_RB_DL);
fflush(fd);
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0];
@@ -355,9 +380,9 @@ int main(int argc, char **argv) {
nsymb = 12;
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, AWGN %d\n",NUMBER_OF_OFDM_CARRIERS,
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb,awgn_flag);
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb,awgn_flag);
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -368,23 +393,23 @@ int main(int argc, char **argv) {
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0,
0,
0);
// Create transport channel structures for 2 transport blocks (MIMO)
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0,
0,
0);
// Create transport channel structures for 2 transport blocks (MIMO)
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,N_RB_DL,0);
if (!PHY_vars_eNB->dlsch_eNB_MCH) {
printf("Can't get eNB dlsch structures\n");
exit(-1);
}
PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
PHY_vars_eNB->lte_frame_parms.num_MBSFN_config = 1;
@@ -400,29 +425,32 @@ int main(int argc, char **argv) {
fill_eNB_dlsch_MCH(PHY_vars_eNB,mcs,1,0,0);
fill_UE_dlsch_MCH(PHY_vars_UE,mcs,1,0,0);
if (is_pmch_subframe(0,subframe,&PHY_vars_eNB->lte_frame_parms)==0) {
printf("eNB is not configured for MBSFN in subframe %d\n",subframe);
exit(-1);
}
else if (is_pmch_subframe(0,subframe,&PHY_vars_UE->lte_frame_parms)==0) {
} else if (is_pmch_subframe(0,subframe,&PHY_vars_UE->lte_frame_parms)==0) {
printf("UE is not configured for MBSFN in subframe %d\n",subframe);
exit(-1);
exit(-1);
}
input_buffer_length = PHY_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS/8;
input_buffer = (unsigned char *)malloc(input_buffer_length+4);
memset(input_buffer,0,input_buffer_length+4);
for (i=0;i<input_buffer_length+4;i++) {
for (i=0; i<input_buffer_length+4; i++) {
input_buffer[i]= (unsigned char)(taus()&0xff);
}
snr_step = input_snr_step;
for (SNR=snr0;SNR<snr1;SNR+=snr_step) {
for (SNR=snr0; SNR<snr1; SNR+=snr_step) {
PHY_vars_UE->frame_tx=0;
PHY_vars_eNB->proc[subframe].frame_tx=0;
PHY_vars_eNB->proc[sched_subframe].frame_tx=0;
PHY_vars_eNB->proc[sched_subframe].subframe_tx=subframe;
errs[0]=0;
errs[1]=0;
errs[2]=0;
@@ -434,160 +462,175 @@ int main(int argc, char **argv) {
round_trials[3] = 0;*/
printf("********************** SNR %f (step %f)\n",SNR,snr_step);
for (trials = 0;trials<n_frames;trials++) {
for (trials = 0; trials<n_frames; trials++) {
// printf("Trial %d\n",trials);
fflush(stdout);
round=0;
//if (trials%100==0)
//eNB2UE[0]->first_run = 1;
eNB2UE->first_run = 1;
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
generate_mch(PHY_vars_eNB,subframe,input_buffer,0);
generate_mch(PHY_vars_eNB,sched_subframe,input_buffer,0);
PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0], // input,
txdata[0], // output
frame_parms->log2_symbol_size, // log2_fft_size
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
txdata[0], // output
frame_parms->log2_symbol_size, // log2_fft_size
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
if (n_frames==1) {
write_output("txsigF0.m","txsF0", &PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][0][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
//if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
//write_output("txsigF1.m","txsF1", &PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][1][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
write_output("txsigF0.m","txsF0", &PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],
nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
//if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
//write_output("txsigF1.m","txsF1", &PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][1][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
}
tx_lev = 0;
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
tx_lev += signal_energy(&PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]
[subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
PHY_vars_eNB->lte_frame_parms.samples_per_tti);
tx_lev += signal_energy(&PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]
[subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
PHY_vars_eNB->lte_frame_parms.samples_per_tti);
}
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
if (n_frames==1) {
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
// write_output("txsig0.m","txs0", &PHY_vars_eNB->lte_eNB_common_vars.txdata[0][0][subframe* PHY_vars_eNB->lte_frame_parms.samples_per_tti],
// PHY_vars_eNB->lte_frame_parms.samples_per_tti,1,1);
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
// write_output("txsig0.m","txs0", &PHY_vars_eNB->lte_eNB_common_vars.txdata[0][0][subframe* PHY_vars_eNB->lte_frame_parms.samples_per_tti],
// PHY_vars_eNB->lte_frame_parms.samples_per_tti,1,1);
}
for (i=0;i<2*frame_parms->samples_per_tti;i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx;aa++) {
s_re[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[0][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)]);
s_im[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[0][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
}
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[0][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)]);
s_im[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[0][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
}
}
//Multipath channel
multipath_channel(eNB2UE,s_re,s_im,r_re,r_im,
2*frame_parms->samples_per_tti,hold_channel);
2*frame_parms->samples_per_tti,hold_channel);
//AWGN
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)) - SNR;
sigma2 = pow(10,sigma2_dB/10);
if (n_frames==1)
printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) {
//printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]);
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti)+2*i] =
(short) (r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti)+2*i+1] =
(short) (r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
//printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]);
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti)+2*i] =
(short) (r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti)+2*i+1] =
(short) (r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
}
for (l=2;l<12;l++) {
slot_fep_mbsfn(PHY_vars_UE,
l,
subframe%10,
0,
0);
for (l=2; l<12; l++) {
slot_fep_mbsfn(PHY_vars_UE,
l,
subframe%10,
0,
0);
}
for (l=2;l<12;l++) {
rx_pmch(PHY_vars_UE,
0,
subframe%10,
l);
for (l=2; l<12; l++) {
rx_pmch(PHY_vars_UE,
0,
subframe%10,
l);
}
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->nb_rb,
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->rb_alloc,
get_Qm(PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->mcs),
1,2,
PHY_vars_UE->frame_tx,subframe);
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->nb_rb,
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->rb_alloc_even,
get_Qm(PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->mcs),
1,2,
PHY_vars_UE->frame_tx,subframe);
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->Qm = get_Qm(PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->mcs);
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,1,PHY_vars_UE->dlsch_ue_MCH[0],
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G,
PHY_vars_UE->lte_ue_pdsch_vars_MCH[0]->llr[0],0,subframe<<1);
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G,
PHY_vars_UE->lte_ue_pdsch_vars_MCH[0]->llr[0],0,subframe<<1);
ret = dlsch_decoding(PHY_vars_UE,
PHY_vars_UE->lte_ue_pdsch_vars_MCH[0]->llr[0],
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue_MCH[0],
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0],
subframe,
0,0,0);
PHY_vars_UE->lte_ue_pdsch_vars_MCH[0]->llr[0],
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue_MCH[0],
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0],
subframe,
0,0,0);
if (n_frames==1)
printf("MCH decoding returns %d\n",ret);
printf("MCH decoding returns %d\n",ret);
if (ret == (1+PHY_vars_UE->dlsch_ue_MCH[0]->max_turbo_iterations))
errs[0]++;
errs[0]++;
PHY_vars_UE->frame_tx++;
PHY_vars_eNB->proc[subframe].frame_tx++;
PHY_vars_eNB->proc[sched_subframe].frame_tx++;
}
printf("errors %d/%d (Pe %e)\n",errs[round],trials,(double)errs[round]/trials);
if (awgn_flag==0)
fprintf(fd,"SNR_%d_%d = [SNR_%d_%d %f]; errs_mch_%d_%d =[errs_mch_%d_%d %d]; mch_trials_%d_%d =[mch_trials_%d_%d %d];\n",
mcs,N_RB_DL,mcs,N_RB_DL,SNR,
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
mcs,N_RB_DL,mcs,N_RB_DL,trials);
mcs,N_RB_DL,mcs,N_RB_DL,SNR,
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
mcs,N_RB_DL,mcs,N_RB_DL,trials);
else
fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %d]; errs_mch_awgn_%d =[errs_mch_awgn_%f %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
mcs,N_RB_DL,mcs,N_RB_DL,SNR,
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
mcs,N_RB_DL,mcs,N_RB_DL,trials);
mcs,N_RB_DL,mcs,N_RB_DL,SNR,
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
mcs,N_RB_DL,mcs,N_RB_DL,trials);
fflush(fd);
if (errs[0] == 0)
break;
}
}
if (n_frames==1) {
printf("Dumping PMCH files ( G %d)\n",PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G);
dump_mch(PHY_vars_UE,0,
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G,
subframe);
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G,
subframe);
}
printf("Freeing dlsch structures\n");
free_eNB_dlsch(PHY_vars_eNB->dlsch_eNB_MCH);
free_ue_dlsch(PHY_vars_UE->dlsch_ue_MCH[0]);
fclose(fd);
printf("Freeing channel I/O\n");
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
// lte_sync_time_free();
return(0);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,644 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <string.h>
#include <math.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#define DEBUG_PHY
#define BW 10.0
#define Td 1.0
#define N_TRIALS 1
/*
DCI0_5MHz_TDD0_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
*/
#define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24)
#define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,2)
#define DLSCH_RB_ALLOC 0x1fff
int number_of_cards=3;
int main(int argc, char **argv) {
int i,l,aa,sector;
double sigma2, sigma2_dB=0;
mod_sym_t **txdataF;
#ifdef IFFT_FPGA
int **txdataF2;
#endif
int **txdata,**rxdata;
double **s_re,**s_im,**r_re,**r_im;
double amps[8] = {0.3868472 , 0.3094778 , 0.1547389 , 0.0773694 , 0.0386847 , 0.0193424 , 0.0096712 , 0.0038685};
double aoa=.03,ricean_factor=0.5;
int channel_length;
struct complex **ch;
unsigned char pbch_pdu[6];
int sync_pos, sync_pos_slot;
FILE *rx_frame_file;
int result;
int freq_offset;
int subframe_offset;
char fname[40], vname[40];
int trial, n_errors=0;
unsigned int nb_rb = 25;
unsigned int first_rb = 0;
unsigned int eNb_id = 0;
unsigned int slot_offset;
int n_frames;
int slot,last_slot, next_slot;
double nf[2] = {3.0,3.0}; //currently unused
double ip =0.0;
double N0W, path_loss, path_loss_dB, tx_pwr, rx_pwr;
int rx_pwr2;
unsigned char first_call = 1;
char stats_buffer[4096];
int len;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
if (argc>1)
sigma2_dB = atoi(argv[1]);
if (argc>2)
n_frames = atoi(argv[2]);
else
n_frames = 3;
channel_length = (int) 11+2*BW*Td;
PHY_vars = malloc(sizeof(PHY_VARS));
PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface));
lte_frame_parms = &(PHY_config->lte_frame_parms);
lte_ue_common_vars = &(PHY_vars->lte_ue_common_vars);
lte_ue_dlsch_vars = &(PHY_vars->lte_ue_dlsch_vars[0]);
lte_ue_dlsch_vars_cntl = &(PHY_vars->lte_ue_dlsch_vars_cntl[0]);
lte_ue_dlsch_vars_ra = &PHY_vars->lte_ue_dlsch_vars_ra[0];
lte_ue_dlsch_vars_1A = &PHY_vars->lte_ue_dlsch_vars_1A[0];
lte_ue_pbch_vars = &(PHY_vars->lte_ue_pbch_vars[0]);
lte_ue_pdcch_vars = &(PHY_vars->lte_ue_pdcch_vars[0]);
lte_eNB_common_vars = &(PHY_vars->lte_eNB_common_vars);
lte_eNB_ulsch_vars = &(PHY_vars->lte_eNB_ulsch_vars[0]);
lte_frame_parms->N_RB_DL = 25;
lte_frame_parms->N_RB_UL = 25;
lte_frame_parms->Ncp = 1;
lte_frame_parms->Nid_cell = 0;
lte_frame_parms->nushift = 0;
lte_frame_parms->nb_antennas_tx = 2;
lte_frame_parms->nb_antennas_rx = 2;
lte_frame_parms->first_dlsch_symbol = 4;
lte_frame_parms->num_dlsch_symbols = 6;
lte_frame_parms->Csrs = 2;
lte_frame_parms->Bsrs = 0;
lte_frame_parms->kTC = 0;
lte_frame_parms->n_RRC = 0;
init_frame_parms(lte_frame_parms);
copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(NB_ANTENNAS_TX);
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
lte_gold(lte_frame_parms);
lte_sync_time_init(lte_frame_parms);
generate_ul_ref_sigs();
generate_ul_ref_sigs_rx();
generate_64qam_table();
generate_16qam_table();
generate_RIV_tables();
phy_init_lte_ue(lte_frame_parms,lte_ue_common_vars,lte_ue_dlsch_vars,lte_ue_dlsch_vars_cntl,lte_ue_dlsch_vars_ra,lte_ue_dlsch_vars_1A,lte_ue_pbch_vars,lte_ue_pdcch_vars);
phy_init_lte_eNB(lte_frame_parms,lte_eNB_common_vars,lte_eNB_ulsch_vars);
dlsch_eNb = (LTE_eNb_DLSCH_t**) malloc16(2*sizeof(LTE_eNb_DLSCH_t*));
dlsch_ue = (LTE_UE_DLSCH_t**) malloc16(2*sizeof(LTE_UE_DLSCH_t*));
ulsch_eNb = (LTE_eNb_ULSCH_t**) malloc16(2*sizeof(LTE_eNb_ULSCH_t*));
ulsch_ue = (LTE_UE_ULSCH_t**) malloc16(2*sizeof(LTE_UE_ULSCH_t*));
for (i=0;i<2;i++) {
dlsch_eNb[i] = new_eNb_dlsch(1,8);
if (!dlsch_eNb[i]) {
msg("Can't get eNb dlsch structures\n");
exit(-1);
}
dlsch_ue[i] = new_ue_dlsch(1,8);
if (!dlsch_ue) {
msg("Can't get ue dlsch structures\n");
exit(-1);
}
ulsch_eNb[i] = new_eNb_ulsch(3);
if (!ulsch_eNb[i]) {
msg("Can't get eNb ulsch structures\n");
exit(-1);
}
ulsch_ue[i] = new_ue_ulsch(3);
if (!ulsch_ue[i]) {
msg("Can't get ue ulsch structures\n");
exit(-1);
}
}
dlsch_eNb_cntl = new_eNb_dlsch(1,1);
dlsch_ue_cntl = new_ue_dlsch(1,1);
// init DCI structures for testing
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
UL_alloc_pdu.rballoc = UL_RB_ALLOC;
UL_alloc_pdu.mcs = 1;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cqi_req = 1;
CCCH_alloc_pdu.type = 0;
CCCH_alloc_pdu.vrb_type = 0;
CCCH_alloc_pdu.rballoc = CCCH_RB_ALLOC;
CCCH_alloc_pdu.ndi = 1;
CCCH_alloc_pdu.rv = 1;
CCCH_alloc_pdu.mcs = 1;
CCCH_alloc_pdu.harq_pid = 0;
printf("CCCH_RB_ALLOC = %d\n",CCCH_RB_ALLOC);
DLSCH_alloc_pdu2.rah = 0;
DLSCH_alloc_pdu2.rballoc = DLSCH_RB_ALLOC;
DLSCH_alloc_pdu2.TPC = 0;
DLSCH_alloc_pdu2.dai = 0;
DLSCH_alloc_pdu2.harq_pid = 0;
DLSCH_alloc_pdu2.tb_swap = 0;
DLSCH_alloc_pdu2.mcs1 = 4;
DLSCH_alloc_pdu2.ndi1 = 1;
DLSCH_alloc_pdu2.rv1 = 0;
// Forget second codeword
DLSCH_alloc_pdu2.tpmi = 0;
#ifdef IFFT_FPGA
txdata = (int **)malloc16(2*sizeof(int*));
txdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
txdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
bzero(txdata[0],FRAME_LENGTH_BYTES);
bzero(txdata[1],FRAME_LENGTH_BYTES);
txdataF2 = (int **)malloc16(2*sizeof(int*));
txdataF2[0] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
txdataF2[1] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX);
bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX);
#endif
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
for (i=0;i<2;i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
ch = (struct complex**) malloc(4 * sizeof(struct complex*));
for (i = 0; i<4; i++)
ch[i] = (struct complex*) malloc(channel_length * sizeof(struct complex));
randominit(0);
set_taus_seed(0);
openair_daq_vars.tdd = 1;
openair_daq_vars.rx_gain_mode = DAQ_AGC_ON;
//openair_daq_vars.dlsch_transmission_mode = 1; //SISO
openair_daq_vars.dlsch_transmission_mode = 2; //ALAMOUTI
//openair_daq_vars.dlsch_transmission_mode = 6; //LAYER1 PRECODING
lte_frame_parms->mode1_flag = (openair_daq_vars.dlsch_transmission_mode==1);
PHY_vars->rx_total_gain_dB=140;
for (mac_xface->frame=0; mac_xface->frame<n_frames; mac_xface->frame++) {
for (slot=0 ; slot<20 ; slot++) {
last_slot = (slot - 1)%20;
if (last_slot <0)
last_slot+=20;
next_slot = (slot + 1)%20;
printf("Frame %d, slot %d : eNB procedures\n",mac_xface->frame,slot);
mac_xface->is_cluster_head = 1;
phy_procedures_lte(last_slot,next_slot);
len = chbch_stats_read(stats_buffer,NULL,0,4096);
//printf("%s\n\n",stats_buffer);
printf("Frame %d, slot %d : UE procedures\n",mac_xface->frame,slot);
mac_xface->is_cluster_head = 0;
phy_procedures_lte(last_slot,next_slot);
len = chbch_stats_read(stats_buffer,NULL,0,4096);
//printf("%s\n",stats_buffer);
// write_output("eNb_txsigF0.m","eNb_txsF0", lte_eNB_common_vars->txdataF[eNb_id][0],300*120,1,4);
// write_output("eNb_txsigF1.m","eNb_txsF1", lte_eNB_common_vars->txdataF[eNb_id][1],300*120,1,4);
if (subframe_select_tdd(lte_frame_parms->tdd_config,next_slot>>1) == SF_DL) {
txdataF = lte_eNB_common_vars->txdataF[eNb_id];
#ifndef IFFT_FPGA
txdata = lte_eNB_common_vars->txdata[eNb_id];
#endif
}
else if (subframe_select_tdd(lte_frame_parms->tdd_config,next_slot>>1) == SF_UL) {
txdataF = lte_ue_common_vars->txdataF;
#ifndef IFFT_FPGA
txdata = lte_ue_common_vars->txdata;
#endif
}
else //it must be a special subframe
if (next_slot%2==0) {//DL part
txdataF = lte_eNB_common_vars->txdataF[eNb_id];
#ifndef IFFT_FPGA
txdata = lte_eNB_common_vars->txdata[eNb_id];
#endif
}
else {// UL part
txdataF = lte_ue_common_vars->txdataF;
#ifndef IFFT_FPGA
txdata = lte_ue_common_vars->txdata;
#endif
}
#ifdef IFFT_FPGA
slot_offset = (next_slot)*(lte_frame_parms->N_RB_DL*12)*((lte_frame_parms->Ncp==1) ? 6 : 7);
//write_output("eNb_txsigF0.m","eNb_txsF0", lte_eNB_common_vars->txdataF[eNb_id][0],300*120,1,4);
//write_output("eNb_txsigF1.m","eNb_txsF1", lte_eNB_common_vars->txdataF[eNb_id][1],300*120,1,4);
// do talbe lookup and write results to txdataF2
for (aa=0;aa<lte_frame_parms->nb_antennas_tx;aa++) {
l = slot_offset;
for (i=0;i<NUMBER_OF_OFDM_CARRIERS*((lte_frame_parms->Ncp==1) ? 6 : 7);i++)
if ((i%512>=1) && (i%512<=150))
txdataF2[aa][i] = ((int*)mod_table)[txdataF[aa][l++]];
else if (i%512>=362)
txdataF2[aa][i] = ((int*)mod_table)[txdataF[aa][l++]];
else
txdataF2[aa][i] = 0;
}
#ifdef DEBUG_PHY
if (next_slot <= 1) {
sprintf(fname,"eNb_frame%d_slot%d_txsigF20.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txsF0",txdataF2[0],512*6,1,1);
sprintf(fname,"eNb_frame%d_slot%d_txsigF21.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txsF1",txdataF2[1],512*6,1,1);
}
#endif
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++)
PHY_ofdm_mod(txdataF2[aa], // input
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
(lte_frame_parms->Ncp==1) ? 6 : 7, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
#else
slot_offset = (next_slot)*(lte_frame_parms->ofdm_symbol_size)*((lte_frame_parms->Ncp==1) ? 6 : 7);
//printf("Copying TX buffer for slot %d (%d) (%p,%p)\n",next_slot,slot_offset,txdataF,txdata);
#ifdef DEBUG_PHY
if (next_slot <= 1) {
sprintf(fname,"eNb_frame%d_slot%d_txsigF0.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txsF0",&txdataF[0][slot_offset],512*12,1,1);
sprintf(fname,"eNb_frame%d_slot%d_txsigF1.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txsF1",&txdataF[1][slot_offset],512*12,1,1);
}
/*
if (next_slot == 2) {
sprintf(fname,"UE_frame%d_txsigF0.m",mac_xface->frame);
write_output(fname,"UE_txsF0",&txdataF[0][slot_offset],512*12,1,1);
sprintf(fname,"UE_frame%d_txsigF1.m",mac_xface->frame);
write_output(fname,"UE_txsF1",&txdataF[1][slot_offset],512*12,1,1);
}
*/
#endif
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++) {
PHY_ofdm_mod(&txdataF[aa][slot_offset], // input
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
(lte_frame_parms->Ncp==1) ? 6 : 7, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
}
#endif
#ifdef DEBUG_PHY
if (next_slot <= 2) {
sprintf(fname,"eNb_frame%d_slot%d_txsig0.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txs0",txdata[0],640*12,1,1);
sprintf(fname,"eNb_frame%d_slot%d_txsig1.m",mac_xface->frame,next_slot);
write_output(fname,"eNb_txs1",txdata[1],640*12,1,1);
}
if ((next_slot >= 3) && (next_slot<=5)) {
sprintf(fname,"UE_frame%d_slot%d_txsig0.m",mac_xface->frame,next_slot);
write_output(fname,"UE_txs0",txdata[0],640*12,1,1);
sprintf(fname,"UE_frame%d_slot%d_txsig1.m",mac_xface->frame,next_slot);
write_output(fname,"UE_txs1",txdata[1],640*12,1,1);
}
#endif
#ifdef DAC
tx_pwr = dac_fixed_gain(s_re,
s_im,
txdata,
2,
lte_frame_parms->samples_per_tti>>1,
14,
0);
printf("tx_pwr %f dB for slot %d (subframe %d)\n",10*log10(tx_pwr),next_slot,next_slot>>1);
#else
for (i=0;i<(lte_frame_parms->samples_per_tti>>1);i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_tx;aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
#endif
// printf("channel for slot %d (subframe %d)\n",next_slot,next_slot>>1);
multipath_channel(ch,s_re,s_im,r_re,r_im,
amps,Td,BW,ricean_factor,aoa,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->nb_antennas_rx,
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*(7-lte_frame_parms->Ncp),
channel_length,
0,
1,
(first_call == 1) ? 1 : 0);
if (first_call == 1)
first_call = 0;
//write_output("channel0.m","chan0",ch[0],channel_length,1,8);
#ifdef RF
// scale by path_loss = NOW - P_noise
path_loss_dB = -70;
path_loss = pow(10,path_loss_dB/10);
// path_loss_dB = 0;
// path_loss = 1;
for (i=0;i<(lte_frame_parms->samples_per_tti>>1);i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
r_re[aa][i]=r_re[aa][i]*sqrt(path_loss);
r_im[aa][i]=r_im[aa][i]*sqrt(path_loss);
}
}
// RF model
rf_rx(r_re,
r_im,
NULL,
NULL,
0,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
1.0/7.68e6 * 1e9, // sampling time (ns)
0.0, // freq offset (Hz) (-20kHz..20kHz)
0.0, // drift (Hz) NOT YET IMPLEMENTED
nf, // noise_figure NOT YET IMPLEMENTED
(double)PHY_vars->rx_total_gain_dB-72.247, // rx_gain (dB)
200, // IP3_dBm (dBm)
&ip, // initial phase
30.0e3, // pn_cutoff (kHz)
-500.0, // pn_amp (dBc) default: 50
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
rx_pwr = signal_energy_fp(r_re,r_im,lte_frame_parms->nb_antennas_rx,lte_frame_parms->samples_per_tti>>1,0);
printf("rx_pwr (ADC in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
#endif
if (subframe_select_tdd(lte_frame_parms->tdd_config,next_slot>>1) == SF_DL)
rxdata = lte_ue_common_vars->rxdata;
else if (subframe_select_tdd(lte_frame_parms->tdd_config,next_slot>>1) == SF_UL)
rxdata = lte_eNB_common_vars->rxdata[eNb_id];
else //it must be a special subframe
if (next_slot%2==0) //DL part
rxdata = lte_ue_common_vars->rxdata;
else // UL part
rxdata = lte_eNB_common_vars->rxdata[eNb_id];
slot_offset = (next_slot)*(lte_frame_parms->samples_per_tti>>1);
#ifdef ADC
adc(r_re,
r_im,
0,
slot_offset,
rxdata,
2,
lte_frame_parms->samples_per_tti>>1,
12);
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,lte_frame_parms->samples_per_tti>>1);
printf("rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d)\n",10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1);
#else
sigma2 = pow(10,sigma2_dB/10);
for (i=0; i<(lte_frame_parms->samples_per_tti>>1); i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
((short*) rxdata[aa])[2*(slot_offset+i)] = (short) ((r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) rxdata[aa])[2*(slot_offset+i)+1] = (short) ((r_im[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
/*
if ((next_slot==4) && ((i%16)==0))
printf("rxdata (slot_offset %d): %d:%d => %d,%d\n",slot_offset,aa,i,
((short *)rxdata[aa])[slot_offset + (2*i)],
((short *)rxdata[aa])[slot_offset + 1+(2*i)]);
*/
}
}
#endif
#ifdef DEBUG_PHY
/*
if ((last_slot == 5) && (mac_xface->frame == 1)) {
write_output("ulsch_rxF_comp0.m","ulsch0_rxF_comp0",&lte_eNB_ulsch_vars[0]->rxdataF_comp[0][0][0],300*12,1,1);
write_output("ulsch_rxF_llr.m","ulsch_llr",lte_eNB_ulsch_vars[eNb_id]->llr,ulsch_ue[0]->harq_processes[0]->nb_rb*12*2*9,1,0);
write_output("drs_est0.m","drsest0",lte_eNB_ulsch_vars[0]->drs_ch_estimates[0][0],300*12,1,1);
write_output("drs_est1.m","drsest1",lte_eNB_ulsch_vars[0]->drs_ch_estimates[0][1],300*12,1,1);
}
*/
/*
if (last_slot == 5) {
sprintf(fname,"eNB_frame%d_rxsig0_subframe2.m",mac_xface->frame);
write_output(fname,"eNB_rxs0",&rxdata[0][2*lte_frame_parms->samples_per_tti],640*12,1,1);
sprintf(fname,"eNB_frame%d_rxsig1_subframe2.m",mac_xface->frame);
write_output(fname,"eNB_rxs1",&rxdata[1][2*lte_frame_parms->samples_per_tti],640*12,1,1);
}
*/
if ((last_slot == 19) && (mac_xface->frame == 1)) {
write_output("UE_rxsig0.m","UE_rxs0", lte_ue_common_vars->rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("UE_rxsig1.m","UE_rxs1", lte_ue_common_vars->rxdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("eNb_rxsig0.m","eNb_rxs0", lte_eNB_common_vars->rxdata[eNb_id][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("eNb_rxsig1.m","eNb_rxs1", lte_eNB_common_vars->rxdata[eNb_id][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
}
#endif
/*
// optional: read rx_frame from file
if ((rx_frame_file = fopen("rx_frame.dat","r")) == NULL)
{
printf("[openair][CHBCH_TEST][INFO] Cannot open rx_frame.m data file\n");
exit(0);
}
result = fread((void *)PHY_vars->rx_vars[0].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
result = fread((void *)PHY_vars->rx_vars[1].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
fclose(rx_frame_file);
*/
}
}
/*
write_output("rxsigF0.m","rxsF0", lte_eNB_common_vars->rxdataF[0][0],512*12*2,2,1);
write_output("rxsigF1.m","rxsF1", lte_eNB_common_vars->rxdataF[0][1],512*12*2,2,1);
*/
write_output("srs_seq.m","srs",lte_eNB_common_vars->srs,2*lte_frame_parms->ofdm_symbol_size,2,1);
write_output("srs_est0.m","srsest0",lte_eNB_common_vars->srs_ch_estimates[0][0],512,1,1);
write_output("srs_est1.m","srsest1",lte_eNB_common_vars->srs_ch_estimates[0][1],512,1,1);
write_output("rxsigF0_ext.m","rxsF0_ext", lte_eNB_ulsch_vars[0]->rxdataF_ext[0][0],300*12*2,2,1);
write_output("rxsigF1_ext.m","rxsF1_ext", lte_eNB_ulsch_vars[0]->rxdataF_ext[0][1],300*12*2,2,1);
write_output("drs_est0.m","drsest0",lte_eNB_ulsch_vars[0]->drs_ch_estimates[0][0],300*12,1,1);
write_output("drs_est1.m","drsest1",lte_eNB_ulsch_vars[0]->drs_ch_estimates[0][1],300*12,1,1);
write_output("PBCH_rxF0_ext.m","pbch0_ext",lte_ue_pbch_vars[0]->rxdataF_ext[0],12*4*6,1,1);
write_output("PBCH_rxF1_ext.m","pbch1_ext",lte_ue_pbch_vars[0]->rxdataF_ext[1],12*4*6,1,1);
write_output("PBCH_rxF0_comp.m","pbch0_comp",lte_ue_pbch_vars[0]->rxdataF_comp[0],12*4*6,1,1);
write_output("PBCH_rxF1_comp.m","pbch1_comp",lte_ue_pbch_vars[0]->rxdataF_comp[1],12*4*6,1,1);
write_output("PBCH_rxF_llr.m","pbch_llr",lte_ue_pbch_vars[0]->llr,12*2*6*2,1,0);
#ifdef IFFT_FPGA
free(txdataF2[0]);
free(txdataF2[1]);
free(txdataF2);
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
for (i=0;i<2;i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
lte_sync_time_free();
return(n_errors);
}
/*
for (i=1;i<4;i++)
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
*/
File diff suppressed because it is too large Load Diff
+342 -290
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -49,7 +49,7 @@
#define BW 5.0
int current_dlsch_cqi; //FIXME!
int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
@@ -58,7 +58,8 @@ PHY_VARS_UE *PHY_vars_UE;
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
{
LTE_DL_FRAME_PARMS *lte_frame_parms;
@@ -71,11 +72,11 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
randominit(0);
set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = 0;
@@ -89,15 +90,10 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
lte_frame_parms->tdd_config = 1;
lte_frame_parms->frame_type = 1;
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(lte_frame_parms); //allocation
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
phy_init_lte_top(lte_frame_parms);
@@ -107,7 +103,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
printf("Done lte_param_init\n");
@@ -116,7 +112,8 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
extern uint16_t prach_root_sequence_map0_3[838];
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
char c;
@@ -168,166 +165,209 @@ int main(int argc, char **argv) {
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "hHaA:Cr:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:")) != -1)
{
switch (c)
{
case 'a':
printf("Running AWGN simulation\n");
awgn_flag = 1;
ntrials=1;
break;
case 'd':
delay = atoi(optarg);
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
case 'H':
channel_model=Rayleigh8;
case 'I':
channel_model=Rayleigh1;
case 'J':
channel_model=Rayleigh1_corr;
case 'K':
channel_model=Rayleigh1_anticorr;
case 'L':
channel_model=Rice8;
case 'M':
channel_model=Rice1;
case 'N':
channel_model=Rayleigh1_800;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p':
preamble_tx=atoi(optarg);
break;
case 'v':
ue_speed0 = atoi(optarg);
break;
case 'V':
ue_speed1 = atoi(optarg);
while ((c = getopt (argc, argv, "hHaA:Cr:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:")) != -1) {
switch (c) {
case 'a':
printf("Running AWGN simulation\n");
awgn_flag = 1;
ntrials=1;
break;
case 'd':
delay = atoi(optarg);
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
case 'H':
channel_model=Rayleigh8;
case 'I':
channel_model=Rayleigh1;
case 'J':
channel_model=Rayleigh1_corr;
case 'K':
channel_model=Rayleigh1_anticorr;
case 'L':
channel_model=Rice8;
case 'M':
channel_model=Rice1;
case 'N':
channel_model=Rayleigh1_800;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p':
preamble_tx=atoi(optarg);
break;
case 'v':
ue_speed0 = atoi(optarg);
break;
case 'V':
ue_speed1 = atoi(optarg);
ue_speed1set = 1;
break;
case 'Z':
NCS_config = atoi(optarg);
if ((NCS_config > 15) || (NCS_config < 0))
printf("Illegal NCS_config %d, (should be 0-15)\n",NCS_config);
break;
case 'H':
printf("High-Speed Flag enabled\n");
hs_flag = 1;
break;
case 'L':
rootSequenceIndex = atoi(optarg);
if ((rootSequenceIndex < 0) || (rootSequenceIndex > 837))
printf("Illegal rootSequenceNumber %d, (should be 0-837)\n",rootSequenceIndex);
break;
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
break;
case 'O':
osf = atoi(optarg);
break;
case 'F':
break;
default:
case 'h':
printf("%s -h(elp) -a(wgn on) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",argv[0]);
printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-g [A,B,C,D,E,F,G,I,N] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) or Rayleigh1 (I) or Rayleigh1_800 (N) models (ignores delay spread and Ricean factor)\n");
printf("-z Number of RX antennas used in eNB\n");
printf("-N Nid_cell\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
// printf("-f PRACH format (0=1,1=2,2=3,3=4)\n");
printf("-d Channel delay \n");
printf("-v Starting UE velocity in km/h, runs from 'v' to 'v+50km/h'. If n_frames is 1 just 'v' is simulated \n");
printf("-V Ending UE velocity in km/h, runs from 'v' to 'V'");
printf("-L rootSequenceIndex (0-837)\n");
printf("-Z NCS_config (ZeroCorrelationZone) (0-15)\n");
printf("-H Run with High-Speed Flag enabled \n");
printf("-R Number of PRB (6,15,25,50,75,100)\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
break;
case 'Z':
NCS_config = atoi(optarg);
if ((NCS_config > 15) || (NCS_config < 0))
printf("Illegal NCS_config %d, (should be 0-15)\n",NCS_config);
break;
case 'H':
printf("High-Speed Flag enabled\n");
hs_flag = 1;
break;
case 'L':
rootSequenceIndex = atoi(optarg);
if ((rootSequenceIndex < 0) || (rootSequenceIndex > 837))
printf("Illegal rootSequenceNumber %d, (should be 0-837)\n",rootSequenceIndex);
break;
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
break;
case 'O':
osf = atoi(optarg);
break;
case 'F':
break;
default:
case 'h':
printf("%s -h(elp) -a(wgn on) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",
argv[0]);
printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-g [A,B,C,D,E,F,G,I,N] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) or Rayleigh1 (I) or Rayleigh1_800 (N) models (ignores delay spread and Ricean factor)\n");
printf("-z Number of RX antennas used in eNB\n");
printf("-N Nid_cell\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
// printf("-f PRACH format (0=1,1=2,2=3,3=4)\n");
printf("-d Channel delay \n");
printf("-v Starting UE velocity in km/h, runs from 'v' to 'v+50km/h'. If n_frames is 1 just 'v' is simulated \n");
printf("-V Ending UE velocity in km/h, runs from 'v' to 'V'");
printf("-L rootSequenceIndex (0-837)\n");
printf("-Z NCS_config (ZeroCorrelationZone) (0-15)\n");
printf("-H Run with High-Speed Flag enabled \n");
printf("-R Number of PRB (6,15,25,50,75,100)\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
}
if (transmission_mode==2)
n_tx=2;
@@ -356,7 +396,7 @@ int main(int argc, char **argv) {
txdata = PHY_vars_UE->lte_ue_common_vars.txdata;
printf("txdata %p\n",&txdata[0][subframe*frame_parms->samples_per_tti]);
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
@@ -364,25 +404,25 @@ int main(int argc, char **argv) {
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
msg("[SIM] Using SCM/101\n");
UE2eNB = new_channel_desc_scm(PHY_vars_UE->lte_frame_parms.nb_antennas_tx,
PHY_vars_eNB->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0.0,
delay,
0);
PHY_vars_eNB->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0.0,
delay,
0);
if (UE2eNB==NULL) {
msg("Problem generating channel model. Exiting.\n");
exit(-1);
}
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -394,24 +434,24 @@ int main(int argc, char **argv) {
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
PHY_vars_UE->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_UE->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
PHY_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
PHY_vars_eNB->lte_frame_parms.frame_type);
PHY_vars_eNB->lte_frame_parms.frame_type);
N_ZC = (prach_fmt <4)?839:139;
compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u);
compute_prach_seq(&PHY_vars_UE->lte_frame_parms.prach_config_common,PHY_vars_UE->lte_frame_parms.frame_type,PHY_vars_UE->X_u);
@@ -419,127 +459,138 @@ int main(int argc, char **argv) {
PHY_vars_UE->lte_ue_prach_vars[0]->amp = AMP;
PHY_vars_UE->prach_resources[0] = &prach_resources;
if (preamble_tx == 99)
preamble_tx = (uint16_t)(taus()&0x3f);
if (n_frames == 1)
printf("raPreamble %d\n",preamble_tx);
printf("raPreamble %d\n",preamble_tx);
PHY_vars_UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
PHY_vars_UE->prach_resources[0]->ra_TDD_map_index = 0;
tx_lev = generate_prach(PHY_vars_UE,
0, //eNB_id,
subframe,
0); //Nf
0, //eNB_id,
subframe,
0); //Nf
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
dump_prach_config(&PHY_vars_eNB->lte_frame_parms,subframe);
for (i=0;i<2*frame_parms->samples_per_tti;i++) {
for (aa=0;aa<1;aa++) {
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
for (aa=0; aa<1; aa++) {
if (awgn_flag == 0) {
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
}
else {
for (aarx=0;aarx<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aarx++) {
if (aa==0) {
r_re[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
r_im[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
}
else {
r_re[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
r_im[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
}
}
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
} else {
for (aarx=0; aarx<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aarx++) {
if (aa==0) {
r_re[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
r_im[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
} else {
r_re[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
r_im[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
}
}
}
}
}
for (SNR=snr0;SNR<snr1;SNR+=.2) {
for (ue_speed=ue_speed0;ue_speed<ue_speed1;ue_speed+=10) {
delay_avg = 0.0;
// max Doppler shift
UE2eNB->max_Doppler = 1.9076e9*(ue_speed/3.6)/3e8;
printf("n_frames %d SNR %f\n",n_frames,SNR);
prach_errors=0;
for (trial=0; trial<n_frames; trial++) {
sigma2_dB = 10*log10((double)tx_lev) - SNR;
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f\n",sigma2_dB,SNR,10*log10((double)tx_lev));
//AWGN
sigma2 = pow(10,sigma2_dB/10);
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
for (SNR=snr0; SNR<snr1; SNR+=.2) {
for (ue_speed=ue_speed0; ue_speed<ue_speed1; ue_speed+=10) {
delay_avg = 0.0;
// max Doppler shift
UE2eNB->max_Doppler = 1.9076e9*(ue_speed/3.6)/3e8;
printf("n_frames %d SNR %f\n",n_frames,SNR);
prach_errors=0;
if (awgn_flag == 0) {
multipath_tv_channel(UE2eNB,s_re,s_im,r_re,r_im,
2*frame_parms->samples_per_tti,0);
}
if (n_frames==1) {
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
for (trial=0; trial<n_frames; trial++) {
sigma2_dB = 10*log10((double)tx_lev) - SNR;
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f\n",sigma2_dB,SNR,10*log10((double)tx_lev));
//AWGN
sigma2 = pow(10,sigma2_dB/10);
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
if (awgn_flag == 0) {
multipath_tv_channel(UE2eNB,s_re,s_im,r_re,r_im,
2*frame_parms->samples_per_tti,0);
}
if (n_frames==1) {
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
}
for (i=0; i<frame_parms->samples_per_tti; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
rx_prach(PHY_vars_eNB,
subframe,
preamble_energy_list,
preamble_delay_list,
0, //Nf
0); //tdd_mapindex
preamble_energy_max = preamble_energy_list[0];
preamble_max = 0;
for (i=1; i<64; i++) {
if (preamble_energy_max < preamble_energy_list[i]) {
// printf("preamble %d => %d\n",i,preamble_energy_list[i]);
preamble_energy_max = preamble_energy_list[i];
preamble_max = i;
}
}
if (preamble_max!=preamble_tx)
prach_errors++;
else {
delay_avg += (double)preamble_delay_list[preamble_max];
}
if (n_frames==1) {
for (i=0; i<64; i++)
if (i==preamble_tx)
printf("****** preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
else
printf("preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
write_output("prach0.m","prach0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
write_output("prachF0.m","prachF0", &PHY_vars_eNB->lte_eNB_prach_vars.prachF[0],24576,1,1);
write_output("rxsig0.m","rxs0",
&PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],
frame_parms->samples_per_tti,1,1);
write_output("rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
write_output("prach_preamble.m","prachp",&PHY_vars_eNB->X_u[0],839,1,1);
}
}
for (i=0; i<frame_parms->samples_per_tti; i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
rx_prach(PHY_vars_eNB,
subframe,
preamble_energy_list,
preamble_delay_list,
0, //Nf
0); //tdd_mapindex
printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
//printf("(%f,%f)\n",ue_speed,(double)prach_errors/(double)n_frames);
} // UE Speed loop
//printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
// printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames);
} //SNR loop
preamble_energy_max = preamble_energy_list[0];
preamble_max = 0;
for (i=1;i<64;i++) {
if (preamble_energy_max < preamble_energy_list[i]) {
// printf("preamble %d => %d\n",i,preamble_energy_list[i]);
preamble_energy_max = preamble_energy_list[i];
preamble_max = i;
}
}
if (preamble_max!=preamble_tx)
prach_errors++;
else {
delay_avg += (double)preamble_delay_list[preamble_max];
}
if (n_frames==1) {
for (i=0;i<64;i++)
if (i==preamble_tx)
printf("****** preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
else
printf("preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
write_output("prach0.m","prach0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
write_output("prachF0.m","prachF0", &PHY_vars_eNB->lte_eNB_prach_vars.prachF[0],24576,1,1);
write_output("rxsig0.m","rxs0",
&PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],
frame_parms->samples_per_tti,1,1);
write_output("rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
write_output("prach_preamble.m","prachp",&PHY_vars_eNB->X_u[0],839,1,1);
}
}
printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
//printf("(%f,%f)\n",ue_speed,(double)prach_errors/(double)n_frames);
} // UE Speed loop
//printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
// printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames);
} //SNR loop
#ifdef IFFT_FPGA
free(txdataF2[0]);
free(txdataF2[1]);
@@ -547,31 +598,32 @@ int main(int argc, char **argv) {
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
#endif
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
lte_sync_time_free();
return(0);
}
/*
/*
for (i=1;i<4;i++)
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
*/
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -35,114 +35,113 @@
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] ={gpib_device, NOADDR};
SendIFC(gpib_board);
unsigned short addlist[2] = {gpib_device, NOADDR};
SendIFC(gpib_board);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
if(ibsta & ERR)
if(ibsta & ERR) {
printf("gpib_send: Instrument enable failed! \n");
}
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
if(ibsta & ERR) {
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
void pucchsignalG(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,PUCCH_FMT_t pucch_format)
{
printf("gpib_send: Instrument enable failed! \n");
}
char string[256];
//void *DLSCH_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
if(ibsta & ERR)
{
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
printf("gpib_send: Send failed! \n");
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
}
printf("%s \n",command_string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK UP");
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
}
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
void pucchsignalG(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,PUCCH_FMT_t pucch_format){
char string[256];
//void *DLSCH_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
//General EUTRA/LTE UPlink Settings
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:BW USER"); //set the bandwidth into 5 MHz ??
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
sprintf(string,"BB:EUTR:UL:NORB %d",frame_parms->N_RB_UL); //sets the number of resource blocks to 25
gpib_send(gpib_card,gpib_device,string);
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK UP");
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
sprintf(string,"BB:EUTR:UL:PLC:CID %d",frame_parms->Nid_cell); //sets the Cell ID 0
gpib_send(gpib_card,gpib_device,string);
//General EUTRA/LTE UPlink Settings
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC NORM"); //set the prefix of the subframes
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC EXT");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:BW USER"); //set the bandwidth into 5 MHz ??
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:GRPH OFF"); //disables group hopping
sprintf(string,"BB:EUTR:UL:NORB %d",frame_parms->N_RB_UL); //sets the number of resource blocks to 25
gpib_send(gpib_card,gpib_device,string);
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SEQH OFF"); //disables sequence hopping
sprintf(string,"BB:EUTR:UL:PLC:CID %d",frame_parms->Nid_cell); //sets the Cell ID 0
gpib_send(gpib_card,gpib_device,string);
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC NORM"); //set the prefix of the subframes
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC EXT");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:GRPH OFF"); //disables group hopping
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SEQH OFF"); //disables sequence hopping
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SRS:ANST OFF"); //disables the A/N ans SRS simultaneous transmission for UE2
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SRS:ANST OFF"); //disables the A/N ans SRS simultaneous transmission for UE2
//UL Frame Configuration pucch
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CONS 10");//10 UL subframes of a frame are configurable
//UL Frame Configuration pucch
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CONS 10");//10 UL subframes of a frame are configurable
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:STAT ON"); //Sets the allocation state to active
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:STAT ON"); //Sets the allocation state to active
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:CONT PUCC");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:CONT PUCC");
//pucch format
if(pucch_format==pucch_format1)
{
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1");
}
if(pucch_format==pucch_format1a)
{
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1A");
}
if(pucch_format==pucch_format1b)
{
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1B");
}
//pucch format
if(pucch_format==pucch_format1) {
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1");
}
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:VRB 2"); //sets the VRB Offset
if(pucch_format==pucch_format1a) {
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1A");
}
//RF signal setting
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
if(pucch_format==pucch_format1b) {
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:FORM F1B");
}
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:VRB 2"); //sets the VRB Offset
//RF signal setting
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
}
+400 -357
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -44,13 +44,14 @@
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
#include "intertask_interface_init.h"
#include "OCG_vars.h"
#include "UTIL/LOG/log_extern.h"
#define BW 5.0
int current_dlsch_cqi; //FIXME!
int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
@@ -59,7 +60,8 @@ PHY_VARS_UE *PHY_vars_UE;
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
{
LTE_DL_FRAME_PARMS *lte_frame_parms;
@@ -72,11 +74,11 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
randominit(0);
set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = 0;
@@ -90,15 +92,11 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
lte_frame_parms->tdd_config = 3;
lte_frame_parms->frame_type = 0;
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(lte_frame_parms); //allocation
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
// phy_init_top(lte_frame_parms); //allocation
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
@@ -108,7 +106,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
phy_init_lte_top(lte_frame_parms);
printf("Done lte_param_init\n");
@@ -116,7 +114,8 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
}
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
char c;
@@ -159,173 +158,212 @@ int main(int argc, char **argv) {
int32_t stat;
double stat_no_sig,stat_sig;
uint8_t N0=40;
uint8_t pucch1_thres=13;
uint8_t pucch1_thres=10;
uint16_t n1_pucch = 0;
uint16_t n2_pucch = 0;
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "har:pf:g:n:s:S:x:y:z:N:F:T:R:")) != -1)
{
switch (c)
{
case 'a':
printf("Running AWGN simulation\n");
channel_model = AWGN;
ntrials=1;
break;
case 'f':
if (atoi(optarg)==0)
pucch_format = pucch_format1;
else if (atoi(optarg)==1)
pucch_format = pucch_format1a;
else if (atoi(optarg)==2)
pucch_format = pucch_format1b;
else {
printf("Unsupported pucch_format %d\n",atoi(optarg));
exit(-1);
}
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
case 'H':
channel_model=Rayleigh8;
case 'I':
channel_model=Rayleigh1;
case 'J':
channel_model=Rayleigh1_corr;
case 'K':
channel_model=Rayleigh1_anticorr;
case 'L':
channel_model=Rice8;
case 'M':
channel_model=Rice1;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p':
extended_prefix_flag=1;
break;
case 'r':
ricean_factor = pow(10,-.1*atof(optarg));
if (ricean_factor>1) {
printf("Ricean factor must be between 0 and 1\n");
exit(-1);
}
break;
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
N0 = atoi(optarg);
break;
case 'T':
pucch1_thres = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
break;
case 'O':
osf = atoi(optarg);
break;
case 'F':
break;
default:
case 'h':
printf("%s -h(elp) -a(wgn on) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -r Ricean_FactordB -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -N CellId\n",argv[0]);
printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-p Use extended prefix mode\n");
printf("-n Number of frames to simulate\n");
printf("-r Ricean factor (dB, 0 means Rayleigh, 100 is almost AWGN\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-N Noise variance in dB\n");
printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-f PUCCH format (0=1,1=1a,2=1b), formats 2/2a/2b not supported\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
while ((c = getopt (argc, argv, "har:pf:g:n:s:S:x:y:z:N:F:T:R:")) != -1) {
switch (c) {
case 'a':
printf("Running AWGN simulation\n");
channel_model = AWGN;
ntrials=1;
break;
case 'f':
if (atoi(optarg)==0)
pucch_format = pucch_format1;
else if (atoi(optarg)==1)
pucch_format = pucch_format1a;
else if (atoi(optarg)==2)
pucch_format = pucch_format1b;
else {
printf("Unsupported pucch_format %d\n",atoi(optarg));
exit(-1);
}
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
case 'H':
channel_model=Rayleigh8;
case 'I':
channel_model=Rayleigh1;
case 'J':
channel_model=Rayleigh1_corr;
case 'K':
channel_model=Rayleigh1_anticorr;
case 'L':
channel_model=Rice8;
case 'M':
channel_model=Rice1;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
case 'p':
extended_prefix_flag=1;
break;
case 'r':
ricean_factor = pow(10,-.1*atof(optarg));
if (ricean_factor>1) {
printf("Ricean factor must be between 0 and 1\n");
exit(-1);
}
break;
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'N':
N0 = atoi(optarg);
break;
case 'T':
pucch1_thres = atoi(optarg);
break;
case 'R':
N_RB_DL = atoi(optarg);
break;
case 'O':
osf = atoi(optarg);
break;
case 'F':
break;
default:
case 'h':
printf("%s -h(elp) -a(wgn on) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -r Ricean_FactordB -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -N CellId\n",
argv[0]);
printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-p Use extended prefix mode\n");
printf("-n Number of frames to simulate\n");
printf("-r Ricean factor (dB, 0 means Rayleigh, 100 is almost AWGN\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-N Noise variance in dB\n");
printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-f PUCCH format (0=1,1=1a,2=1b), formats 2/2a/2b not supported\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
}
logInit();
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
g_log->log_component[PHY].level = LOG_DEBUG;
g_log->log_component[PHY].flag = LOG_HIGH;
@@ -364,7 +402,7 @@ int main(int argc, char **argv) {
#else
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id];
#endif
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
@@ -372,26 +410,26 @@ int main(int argc, char **argv) {
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
msg("[SIM] Using SCM/101\n");
UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0.0,
0,
0);
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0.0,
0,
0);
if (UE2eNB==NULL) {
msg("Problem generating channel model. Exiting.\n");
exit(-1);
}
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -403,11 +441,11 @@ int main(int argc, char **argv) {
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
init_ncs_cell(&PHY_vars_eNB->lte_frame_parms,PHY_vars_eNB->ncs_cell);
init_ncs_cell(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->ncs_cell);
PHY_vars_eNB->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
PHY_vars_eNB->lte_frame_parms.pucch_config_common.nRB_CQI = 0;
PHY_vars_eNB->lte_frame_parms.pucch_config_common.nCS_AN = 0;
@@ -418,88 +456,86 @@ int main(int argc, char **argv) {
pucch_payload = 1;
generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF,
frame_parms,
PHY_vars_UE->ncs_cell,
pucch_format,
&pucch_config_dedicated,
n1_pucch,
n2_pucch,
0, //shortened_format,
&pucch_payload,
AMP, //amp,
subframe); //subframe
#ifdef IFFT_FPGA_UE
frame_parms,
PHY_vars_UE->ncs_cell,
pucch_format,
&pucch_config_dedicated,
n1_pucch,
n2_pucch,
0, //shortened_format,
&pucch_payload,
AMP, //amp,
subframe); //subframe
#ifdef IFFT_FPGA_UE
tx_lev=0;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(txdataF2[aa], // input
txdata[aa], // output
frame_parms->log2_symbol_size, // log2_fft_size
2*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
else
txdata[aa], // output
frame_parms->log2_symbol_size, // log2_fft_size
2*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
else
normal_prefix_mod(txdataF2[aa],txdata[aa],2*nsymb,frame_parms);
}
tx_lev += signal_energy(&txdata[aa][OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
#else
write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
tx_lev = 0;
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input,
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
frame_parms->log2_symbol_size, // log2_fft_size
nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
else {
normal_prefix_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[eNB_id][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],
nsymb,
frame_parms);
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],subframe<<1);
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],1+(subframe<<1));
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],0);
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],1);
tx_lev = 0;
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input,
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
frame_parms->log2_symbol_size, // log2_fft_size
nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
else {
normal_prefix_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[eNB_id][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],
nsymb,
frame_parms);
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],subframe<<1);
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],1+(subframe<<1));
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],0);
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],1);
}
tx_lev += signal_energy(&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
}
#endif
write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
for (i=0;i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES;i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx;aa++) {
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
tx_lev += signal_energy(&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
}
#endif
write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
}
}
for (SNR=snr0;SNR<snr1;SNR+=.2) {
for (SNR=snr0; SNR<snr1; SNR+=.2) {
printf("n_frames %d SNR %f\n",n_frames,SNR);
@@ -512,143 +548,149 @@ int main(int argc, char **argv) {
stat_sig = 0;
for (trial=0; trial<n_frames; trial++) {
multipath_channel(UE2eNB,s_re,s_im,r_re,r_im,
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
sigma2_dB = N0;//10*log10((double)tx_lev) - SNR;
tx_gain = sqrt(pow(10.0,.1*(N0+SNR))/(double)tx_lev);
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,tx_gain %f (%f dB)\n",sigma2_dB,SNR,10*log10((double)tx_lev),tx_gain,20*log10(tx_gain));
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,tx_gain %f (%f dB)\n",sigma2_dB,SNR,10*log10((double)tx_lev),tx_gain,20*log10(tx_gain));
//AWGN
sigma2 = pow(10,sigma2_dB/10);
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
if (n_frames==1) {
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
}
if (pucch_format != pucch_format1) {
pucch_tx++;
sig=1;
}
else {
if (trial<(n_frames>>1)) {
// printf("no sig =>");
sig= 0;
}
else {
sig=1;
// printf("sig =>");
pucch_tx++;
}
pucch_tx++;
sig=1;
} else {
if (trial<(n_frames>>1)) {
//printf("no sig =>");
sig= 0;
} else {
sig=1;
//printf("sig =>");
pucch_tx++;
}
}
// sig = 1;
for (n_trials=0;n_trials<ntrials;n_trials++) {
//printf("n_trial %d\n",n_trials);
// fill measurement symbol (19) with noise
for (i=0;i<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES;i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) {
for (n_trials=0; n_trials<ntrials; n_trials++) {
//printf("n_trial %d\n",n_trials);
// fill measurement symbol (19) with noise
for (i=0; i<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
lte_eNB_I0_measurements(PHY_vars_eNB,
0,
1);
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) {
if (n_trials==0) {
// r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
// r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
}
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
lte_eNB_I0_measurements(PHY_vars_eNB,
0,
1);
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
if (n_trials==0) {
// r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
// r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
}
if (sig==1) {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
else {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
if (sig==1) {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble(
0.0,1.0)));
} else {
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
}
}
}
}
remove_7_5_kHz(PHY_vars_eNB,subframe<<1);
remove_7_5_kHz(PHY_vars_eNB,1+(subframe<<1));
remove_7_5_kHz(PHY_vars_eNB,subframe<<1);
remove_7_5_kHz(PHY_vars_eNB,1+(subframe<<1));
for (l=0;l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2;l++) {
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
&PHY_vars_eNB->lte_eNB_common_vars,
l,
subframe*2,// slot
0,
0
);
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
&PHY_vars_eNB->lte_eNB_common_vars,
l,
1+(subframe*2),//slot
0,
0
);
for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) {
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
&PHY_vars_eNB->lte_eNB_common_vars,
l,
subframe*2,// slot
0,
0
);
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
&PHY_vars_eNB->lte_eNB_common_vars,
l,
1+(subframe*2),//slot
0,
0
);
}
// if (sig == 1)
// printf("*");
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
stat = rx_pucch(PHY_vars_eNB,
pucch_format,
0,
n1_pucch,
n2_pucch,
0, //shortened_format,
&pucch_payload_rx, //payload,
subframe,
pucch1_thres);
if (trial < (n_frames>>1)) {
stat_no_sig += (2*(double)stat/n_frames);
// printf("stat (no_sig) %f\n",stat_no_sig);
}
else {
stat_sig += (2*(double)stat/n_frames);
// printf("stat (sig) %f\n",stat_sig);
}
if (pucch_format==pucch_format1) {
pucch1_missed = ((pucch_payload_rx == 0) && (sig==1)) ? (pucch1_missed+1) : pucch1_missed;
pucch1_false = ((pucch_payload_rx == 1) && (sig==0)) ? (pucch1_false+1) : pucch1_false;
/*
if ((pucch_payload_rx == 0) && (sig==1)) {
printf("EXIT\n");
exit(-1);
}*/
}
else {
pucch1_false = (pucch_payload_rx != pucch_payload) ? (pucch1_false+1) : pucch1_false;
}
// printf("sig %d\n",sig);
}
// if (sig == 1)
// printf("*");
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
stat = rx_pucch(PHY_vars_eNB,
pucch_format,
0,
n1_pucch,
n2_pucch,
0, //shortened_format,
&pucch_payload_rx, //payload,
subframe,
pucch1_thres);
if (trial < (n_frames>>1)) {
stat_no_sig += (2*(double)stat/n_frames);
// printf("stat (no_sig) %f\n",stat_no_sig);
} else {
stat_sig += (2*(double)stat/n_frames);
// printf("stat (sig) %f\n",stat_sig);
}
if (pucch_format==pucch_format1) {
pucch1_missed = ((pucch_payload_rx == 0) && (sig==1)) ? (pucch1_missed+1) : pucch1_missed;
pucch1_false = ((pucch_payload_rx == 1) && (sig==0)) ? (pucch1_false+1) : pucch1_false;
/*
if ((pucch_payload_rx == 0) && (sig==1)) {
printf("EXIT\n");
exit(-1);
}*/
} else {
pucch1_false = (pucch_payload_rx != pucch_payload) ? (pucch1_false+1) : pucch1_false;
}
// printf("sig %d\n",sig);
} // NSR
}
if (pucch_format==pucch_format1)
printf("pucch_trials %d : pucch1_false %d,pucch1_missed %d, N0 %d dB, stat_no_sig %f dB, stat_sig %f dB\n",pucch_tx,pucch1_false,pucch1_missed,PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB,10*log10(stat_no_sig),10*log10(stat_sig));
printf("pucch_trials %d : pucch1_false %d,pucch1_missed %d, N0 %d dB, stat_no_sig %f dB, stat_sig %f dB\n",pucch_tx,pucch1_false,pucch1_missed,PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB,
10*log10(stat_no_sig),10*log10(stat_sig));
else if (pucch_format==pucch_format1a)
printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
else if (pucch_format==pucch_format1b)
printf("pucch_trials %d : pucch1b_errors %d\n",pucch_tx,pucch1_false);
}
if (n_frames==1) {
//write_output("txsig0.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
write_output("txsig0pucch.m", "txs0", &txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
@@ -664,31 +706,32 @@ int main(int argc, char **argv) {
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
#endif
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
lte_sync_time_free();
return(n_errors);
}
/*
/*
for (i=1;i<4;i++)
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
*/
+344 -299
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -61,7 +61,8 @@ PHY_VARS_UE *PHY_vars_UE;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
{
// unsigned int ind;
LTE_DL_FRAME_PARMS *lte_frame_parms;
@@ -78,11 +79,11 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
randominit(0);
set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = Nid_cell%6;
@@ -97,15 +98,10 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
lte_frame_parms->tdd_config = 3;
lte_frame_parms->frame_type = frame_type;
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(lte_frame_parms); //allocation
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
phy_init_lte_top(lte_frame_parms);
@@ -113,18 +109,20 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0;i<3;i++)
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
for (i=0; i<3; i++)
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNb,0,0,0);
for (i=0;i<10;i++) {
for (i=0; i<10; i++) {
PHY_vars_UE->scan_info[0].amp[0][i] = 0;
PHY_vars_UE->scan_info[0].amp[1][i] = 0;
PHY_vars_UE->scan_info[0].amp[2][i] = 0;
}
memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1;
PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6;
@@ -136,7 +134,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
PHY_vars_eNb2->Mod_id=2;
phy_init_lte_eNB(PHY_vars_eNb1,0,0,0);
phy_init_lte_eNB(PHY_vars_eNb2,0,0,0);
phy_init_lte_top(lte_frame_parms);
@@ -153,7 +151,8 @@ mod_sym_t dummy2[2048*14];
mod_sym_t dummy3[2048*14];
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
char c;
@@ -211,161 +210,196 @@ int main(int argc, char **argv) {
logInit();
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "f:hpf:g:n:s:S:t:x:y:z:N:F:GdP:")) != -1)
{
switch (c)
{
case 'f':
write_output_file=1;
output_fd = fopen(optarg,"w");
if (output_fd==NULL) {
printf("Error opening %s\n",optarg);
exit(-1);
}
break;
case 'd':
frame_type = TDD;
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
/*
case 't':
Td= atof(optarg);
break;
*/
case 'p':
extended_prefix_flag=1;
break;
/*
case 'r':
ricean_factor = pow(10,-.1*atof(optarg));
if (ricean_factor>1) {
printf("Ricean factor must be between 0 and 1\n");
exit(-1);
}
break;
*/
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'A':
abstraction_flag=1;
ntrials=10000;
msg("Running Abstraction test\n");
pbch_file_fd=fopen(optarg,"r");
if (pbch_file_fd==NULL) {
printf("Problem with filename %s\n",optarg);
exit(-1);
}
break;
// case 'C':
// calibration_flag=1;
// msg("Running Abstraction calibration for Bias removal\n");
// break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'F':
input_fd = fopen(optarg,"r");
if (input_fd==NULL) {
printf("Problem with filename %s\n",optarg);
exit(-1);
}
break;
case 'P':
pbch_phase = atoi(optarg);
if (pbch_phase>3)
printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase);
break;
default:
case 'h':
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -N CellId\n",argv[0]);
printf("-h This message\n");
printf("-p Use extended prefix mode\n");
printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-N Nid_cell\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
while ((c = getopt (argc, argv, "f:hpf:g:n:s:S:t:x:y:z:N:F:GdP:")) != -1) {
switch (c) {
case 'f':
write_output_file=1;
output_fd = fopen(optarg,"w");
if (output_fd==NULL) {
printf("Error opening %s\n",optarg);
exit(-1);
}
break;
case 'd':
frame_type = TDD;
break;
case 'g':
switch((char)*optarg) {
case 'A':
channel_model=SCM_A;
break;
case 'B':
channel_model=SCM_B;
break;
case 'C':
channel_model=SCM_C;
break;
case 'D':
channel_model=SCM_D;
break;
case 'E':
channel_model=EPA;
break;
case 'F':
channel_model=EVA;
break;
case 'G':
channel_model=ETU;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'n':
n_frames = atoi(optarg);
break;
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
break;
/*
case 't':
Td= atof(optarg);
break;
*/
case 'p':
extended_prefix_flag=1;
break;
/*
case 'r':
ricean_factor = pow(10,-.1*atof(optarg));
if (ricean_factor>1) {
printf("Ricean factor must be between 0 and 1\n");
exit(-1);
}
break;
*/
case 'x':
transmission_mode=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
break;
case 'y':
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
break;
case 'z':
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
break;
case 'A':
abstraction_flag=1;
ntrials=10000;
msg("Running Abstraction test\n");
pbch_file_fd=fopen(optarg,"r");
if (pbch_file_fd==NULL) {
printf("Problem with filename %s\n",optarg);
exit(-1);
}
break;
// case 'C':
// calibration_flag=1;
// msg("Running Abstraction calibration for Bias removal\n");
// break;
case 'N':
Nid_cell = atoi(optarg);
break;
case 'F':
input_fd = fopen(optarg,"r");
if (input_fd==NULL) {
printf("Problem with filename %s\n",optarg);
exit(-1);
}
break;
case 'P':
pbch_phase = atoi(optarg);
if (pbch_phase>3)
printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase);
break;
default:
case 'h':
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -N CellId\n",
argv[0]);
printf("-h This message\n");
printf("-p Use extended prefix mode\n");
printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-N Nid_cell\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
}
if (transmission_mode>=2)
n_tx=2;
@@ -376,7 +410,7 @@ int main(int argc, char **argv) {
fl_initialize (&argc, argv, NULL, 0, 0);
form_ue = create_lte_phy_scope_ue();
sprintf (title, "LTE PHY SCOPE UE");
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
#endif
if (snr1set==0) {
@@ -396,7 +430,7 @@ int main(int argc, char **argv) {
txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0];
txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0];
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
s_re1 = malloc(2*sizeof(double*));
@@ -413,10 +447,10 @@ int main(int argc, char **argv) {
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
DLSCH_alloc_pdu2.rah = 0;
@@ -425,19 +459,19 @@ int main(int argc, char **argv) {
DLSCH_alloc_pdu2.dai = 0;
DLSCH_alloc_pdu2.harq_pid = 0;
DLSCH_alloc_pdu2.tb_swap = 0;
DLSCH_alloc_pdu2.mcs1 = 0;
DLSCH_alloc_pdu2.mcs1 = 0;
DLSCH_alloc_pdu2.ndi1 = 1;
DLSCH_alloc_pdu2.rv1 = 0;
// Forget second codeword
DLSCH_alloc_pdu2.tpmi = (transmission_mode==6 ? 5 : 0) ; // precoding
eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0,
0,
0);
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
BW,
0,
0,
0);
if (eNB2UE==NULL) {
@@ -445,7 +479,7 @@ int main(int argc, char **argv) {
exit(-1);
}
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -454,7 +488,7 @@ int main(int argc, char **argv) {
s_re1[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re1[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_im1[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_im1[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_im1[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_re2[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re2[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_im2[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -473,67 +507,71 @@ int main(int argc, char **argv) {
r_im2[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im2[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
pbch_pdu[0]=100;
pbch_pdu[1]=1;
pbch_pdu[2]=0;
if (PHY_vars_eNb->lte_frame_parms.frame_type == FDD) {
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
0);
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
0);
/*
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
0);
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
0);*/
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
10);
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
10);
/*
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
10);
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
10);
*/
} else {
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
1);
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
2,
2);
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
11);
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
2,
12);
}
else {
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
1);
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
2,
2);
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
11);
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
2,
12);
}
/*
generate_pilots(PHY_vars_eNb,
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc,
@@ -543,131 +581,137 @@ int main(int argc, char **argv) {
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
0);
*/
/*
/*
if (num_pdcch_symbols<3) {
printf("Less than 3 pdcch symbols\n");
// exit(-1);
}
if (pbch_phase>0) {
dummybuf[0] = dummy0;
dummybuf[1] = dummy1;
dummybuf[2] = dummy2;
dummybuf[3] = dummy3;
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
(mod_sym_t**)dummybuf,
AMP,
&PHY_vars_eNb->lte_frame_parms,
pbch_pdu,
0);
(mod_sym_t**)dummybuf,
AMP,
&PHY_vars_eNb->lte_frame_parms,
pbch_pdu,
0);
}
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
pbch_pdu,
pbch_phase);
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
AMP,
&PHY_vars_eNb->lte_frame_parms,
pbch_pdu,
pbch_phase);
*/
write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1)
write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
tx_lev = 0;
tx_lev1 = 0;
tx_lev2 = 0;
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], // input,
txdata[aa], // output
frame_parms->log2_symbol_size, // log2_fft_size
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
txdata[aa], // output
frame_parms->log2_symbol_size, // log2_fft_size
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
else {
normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],
txdata[aa],
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
frame_parms);
txdata[aa],
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
frame_parms);
}
tx_lev += signal_energy(&txdata[aa][frame_parms->samples_per_tti/2],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
}
write_output("txsig0.m","txs0", txdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
if (frame_parms->nb_antennas_tx>1)
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
for (i=0;i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES;i++) {
for (aa=0;aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx;aa++) {
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
for (SNR=snr0;SNR<snr1;SNR+=.2) {
for (SNR=snr0; SNR<snr1; SNR+=.2) {
n_errors = 0;
n_errors2 = 0;
n_alamouti = 0;
for (trial=0; trial<n_frames; trial++) {
multipath_channel(eNB2UE,s_re,s_im,r_re,r_im,
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
10*log10((double)tx_lev),
10*log10((double)tx_lev1),
10*log10((double)tx_lev2));
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
10*log10((double)tx_lev),
10*log10((double)tx_lev1),
10*log10((double)tx_lev2));
//AWGN
sigma2 = pow(10,sigma2_dB/10);
/*
if (n_frames==1) {
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
}
/*
if (n_frames==1) {
printf("rx_level data symbol %f, tx_lev %f\n",
10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)),
10*log10(tx_lev));
}
*/
for (n_trials=0;n_trials<ntrials;n_trials++) {
//printf("n_trial %d\n",n_trials);
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0;aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx;aa++) {
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
lte_sync_timefreq(PHY_vars_UE,0,2680000000);
for (n_trials=0; n_trials<ntrials; n_trials++) {
//printf("n_trial %d\n",n_trials);
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) {
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
lte_sync_timefreq(PHY_vars_UE,0,2680000000);
if (n_frames==1) {
printf("rx_level data symbol %f\n",
10*log10(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][frame_parms->samples_per_tti/2],4*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)));
}
if (n_frames==1) {
printf("rx_level data symbol %f\n",
10*log10(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][frame_parms->samples_per_tti/2],4*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)));
}
} //noise trials
} // trials
if (abstraction_flag==0) {
printf("SNR %f : n_errors2 = %d/%d (BLER %e,40ms BLER %e,%d,%d), n_alamouti %d\n", SNR,n_errors2,ntrials*(1+trial),(double)n_errors2/(ntrials*(1+trial)),pow((double)n_errors2/(ntrials*(1+trial)),4),ntrials,trial,n_alamouti);
printf("SNR %f : n_errors2 = %d/%d (BLER %e,40ms BLER %e,%d,%d), n_alamouti %d\n", SNR,n_errors2,ntrials*(1+trial),(double)n_errors2/(ntrials*(1+trial)),pow((double)n_errors2/(ntrials*(1+trial)),4),
ntrials,trial,n_alamouti);
if (write_output_file==1)
fprintf(output_fd,"%f %e\n",SNR,(double)n_errors2/(ntrials*(1+trial)));
fprintf(output_fd,"%f %e\n",SNR,(double)n_errors2/(ntrials*(1+trial)));
}
} // NSR
@@ -676,12 +720,13 @@ int main(int argc, char **argv) {
}
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
@@ -696,10 +741,10 @@ int main(int argc, char **argv) {
return(n_errors);
}
/*
/*
for (i=1;i<4;i++)
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
+61 -62
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -33,94 +33,93 @@
void gpib_send(unsigned int gpib_card, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] ={gpib_device, NOADDR};
SendIFC(gpib_card);
unsigned short addlist[2] = {gpib_device, NOADDR};
SendIFC(gpib_card);
//Enable all on GPIB bus
EnableRemote(gpib_card, addlist);
//Enable all on GPIB bus
EnableRemote(gpib_card, addlist);
if(ibsta & ERR)
{
printf("gpib_send: Instrument enable failed! \n");
}
if(ibsta & ERR) {
printf("gpib_send: Instrument enable failed! \n");
}
//Send Control Commandss
Send(gpib_card, gpib_device, command_string, strlen(command_string), NLend);
//Send Control Commandss
Send(gpib_card, gpib_device, command_string, strlen(command_string), NLend);
if(ibsta & ERR)
{
if(ibsta & ERR) {
printf("gpib_send: Send failed! \n");
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
printf("%s \n",command_string);
}
void analyzer(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,DCI_ALLOC_t *dci_alloc)
{
char string[256];
char string[256];
//Start the remote control
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal analyzer
gpib_send(gpib_card,gpib_device,"CONF:PRES");
//Start the remote control
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal analyzer
gpib_send(gpib_card,gpib_device,"CONF:PRES");
gpib_send(gpib_card,gpib_device,"CALC1:FEED 'CONS:CONS'");
gpib_send(gpib_card,gpib_device,"INIT");
gpib_send(gpib_card,gpib_device,"CALC1:FEED 'CONS:CONS'");
gpib_send(gpib_card,gpib_device,"INIT");
//select the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"CONF:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"CONF:DUPL TDD");
//select the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"CONF:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"CONF:DUPL TDD");
//set the direction into DL
gpib_send(gpib_card,gpib_device,"CONF:LDIR DL");
//set the direction into DL
gpib_send(gpib_card,gpib_device,"CONF:LDIR DL");
//carrier frequency
gpib_send(gpib_card,gpib_device,"FREQ:CENT 1.2GHZ");
//carrier frequency
gpib_send(gpib_card,gpib_device,"FREQ:CENT 1.2GHZ");
//input source
gpib_send(gpib_card,gpib_device,"INP RF");
//input source
gpib_send(gpib_card,gpib_device,"INP RF");
//RF attenuation
gpib_send(gpib_card,gpib_device,"INP:ATT 0");
//RF attenuation
gpib_send(gpib_card,gpib_device,"INP:ATT 0");
////Using a Trigger
gpib_send(gpib_card,gpib_device,"TRIG:MODE IMM"); //Selects free run trigger source
////Using a Trigger
gpib_send(gpib_card,gpib_device,"TRIG:MODE IMM"); //Selects free run trigger source
// number of frames to be selected
gpib_send(gpib_card,gpib_device,"FRAM:COUN:STAT ON");
gpib_send(gpib_card,gpib_device,"FRAM:COUN 4");
// number of frames to be selected
gpib_send(gpib_card,gpib_device,"FRAM:COUN:STAT ON");
gpib_send(gpib_card,gpib_device,"FRAM:COUN 4");
//select all the subframes
gpib_send(gpib_card,gpib_device,"SUBF:SEL ALL");
//select all the subframes
gpib_send(gpib_card,gpib_device,"SUBF:SEL ALL");
//Identifies the configuration according to the data in the PDCCH DCIs
gpib_send(gpib_card,gpib_device,"DL:FORM:PSCD PDCCH");
//Identifies the configuration according to the data in the PDCCH DCIs
gpib_send(gpib_card,gpib_device,"DL:FORM:PSCD PDCCH");
//sets the number of resource blocks to 25
sprintf(string,"CONF:DL:NORB %d",frame_parms->N_RB_DL);
gpib_send(gpib_card,gpib_device,string);
//sets the number of resource blocks to 25
sprintf(string,"CONF:DL:NORB %d",frame_parms->N_RB_DL);
gpib_send(gpib_card,gpib_device,string);
//set the prefix of the subframes
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"CONF:DL:CYCP NORM");
else
gpib_send(gpib_card,gpib_device,"CONF:DL:CYCP EXT");
//set the prefix of the subframes
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"CONF:DL:CYCP NORM");
else
gpib_send(gpib_card,gpib_device,"CONF:DL:CYCP EXT");
//select the UL/DL subframe configuration for downlink signals
sprintf(string,"CONF:DL:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
//select the UL/DL subframe configuration for downlink signals
sprintf(string,"CONF:DL:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
//Selects the configuration of a TDD special subframe
sprintf(string,"CONF:DL:TDD:UDC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
//Selects the configuration of a TDD special subframe
sprintf(string,"CONF:DL:TDD:UDC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
}
+5 -5
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
File diff suppressed because it is too large Load Diff
+112 -105
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -42,7 +42,8 @@
#define FRAME_LENGTH_COMPLEX_SAMPLES (lte_frame_parms->samples_per_tti>>1)
#define FRAME_LENGTH_BYTES (FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int))
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
int i,l,aa,sector;
double sigma2, sigma2_dB=0;
@@ -89,7 +90,7 @@ int main(int argc, char **argv) {
if (argc==2)
amp = atoi(argv[1]);
else
else
amp = 1024;
// we normalize the tx power to 0dBm, assuming the amplitude of the signal is 1024
@@ -143,13 +144,13 @@ int main(int argc, char **argv) {
bzero(txdataF2[0],FRAME_LENGTH_BYTES);
bzero(txdataF2[1],FRAME_LENGTH_BYTES);
#endif
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -161,20 +162,22 @@ int main(int argc, char **argv) {
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
for (i=0;i<2;i++) {
for (l=0;l<FRAME_LENGTH_COMPLEX_SAMPLES;l++) {
for (i=0; i<2; i++) {
for (l=0; l<FRAME_LENGTH_COMPLEX_SAMPLES; l++) {
((short*) txdata[i])[2*l] = amp * cos(M_PI/2*l);
((short*) txdata[i])[2*l+1] = amp * sin(M_PI/2*l);
}
}
tx_pwr = signal_energy(txdata[0],lte_frame_parms->samples_per_tti>>1);
printf("tx_pwr (DAC in) %d dB for slot %d (subframe %d)\n",dB_fixed(tx_pwr),next_slot,next_slot>>1);
printf("tx_pwr (DAC in) %d dB for slot %d (subframe %d)\n",dB_fixed(tx_pwr),next_slot,next_slot>>1);
channel_length = (int) 11+2*BW*Td;
ch = (struct complex**) malloc(4 * sizeof(struct complex*));
for (i = 0; i<4; i++)
ch[i] = (struct complex*) malloc(channel_length * sizeof(struct complex));
@@ -182,109 +185,112 @@ int main(int argc, char **argv) {
set_taus_seed(0);
#ifdef RF
tx_pwr = dac_fixed_gain(s_re,
s_im,
txdata,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->samples_per_tti>>1,
14,
18); //this should give 0dBm output level for input with amplitude 1024
printf("tx_pwr (DAC out) %f dB for slot %d (subframe %d)\n",10*log10(tx_pwr),next_slot,next_slot>>1);
tx_pwr = dac_fixed_gain(s_re,
s_im,
txdata,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->samples_per_tti>>1,
14,
18); //this should give 0dBm output level for input with amplitude 1024
printf("tx_pwr (DAC out) %f dB for slot %d (subframe %d)\n",10*log10(tx_pwr),next_slot,next_slot>>1);
#else
for (i=0;i<(lte_frame_parms->samples_per_tti>>1);i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_tx;aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
for (i=0; i<(lte_frame_parms->samples_per_tti>>1); i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
#endif
// printf("channel for slot %d (subframe %d)\n",next_slot,next_slot>>1);
multipath_channel(ch,s_re,s_im,r_re,r_im,
amps,Td,BW,ricean_factor,aoa,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
channel_length,
0,
.9,
(first_call == 1) ? 1 : 0);
if (first_call == 1)
first_call = 0;
// printf("channel for slot %d (subframe %d)\n",next_slot,next_slot>>1);
multipath_channel(ch,s_re,s_im,r_re,r_im,
amps,Td,BW,ricean_factor,aoa,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
channel_length,
0,
.9,
(first_call == 1) ? 1 : 0);
if (first_call == 1)
first_call = 0;
#ifdef RF
//path_loss_dB = 0;
//path_loss = 1;
for (i=0;i<(lte_frame_parms->samples_per_tti>>1);i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
r_re[aa][i]=r_re[aa][i]*sqrt(path_loss);
r_im[aa][i]=r_im[aa][i]*sqrt(path_loss);
}
}
rx_pwr = signal_energy_fp(r_re,r_im,lte_frame_parms->nb_antennas_rx,lte_frame_parms->samples_per_tti>>1,0);
printf("rx_pwr (RF in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
rx_gain = target_rx_pwr_dB - 10*log10(rx_pwr);
// RF model
rf_rx(r_re,
r_im,
NULL,
NULL,
0,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
1.0/7.68e6 * 1e9, // sampling time (ns)
0.0, // freq offset (Hz) (-20kHz..20kHz)
0.0, // drift (Hz) NOT YET IMPLEMENTED
nf, // noise_figure NOT YET IMPLEMENTED
rx_gain-66.227, // rx gain (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
200, // IP3_dBm (dBm)
&ip, // initial phase
30.0e3, // pn_cutoff (kHz)
-500.0, // pn_amp (dBc) default: 50
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
//path_loss_dB = 0;
//path_loss = 1;
rx_pwr = signal_energy_fp(r_re,r_im,lte_frame_parms->nb_antennas_rx,lte_frame_parms->samples_per_tti>>1,0);
printf("rx_pwr (ADC in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
for (i=0; i<(lte_frame_parms->samples_per_tti>>1); i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_rx; aa++) {
r_re[aa][i]=r_re[aa][i]*sqrt(path_loss);
r_im[aa][i]=r_im[aa][i]*sqrt(path_loss);
}
}
rx_pwr = signal_energy_fp(r_re,r_im,lte_frame_parms->nb_antennas_rx,lte_frame_parms->samples_per_tti>>1,0);
printf("rx_pwr (RF in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
rx_gain = target_rx_pwr_dB - 10*log10(rx_pwr);
// RF model
rf_rx(r_re,
r_im,
NULL,
NULL,
0,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
1.0/7.68e6 * 1e9, // sampling time (ns)
0.0, // freq offset (Hz) (-20kHz..20kHz)
0.0, // drift (Hz) NOT YET IMPLEMENTED
nf, // noise_figure NOT YET IMPLEMENTED
rx_gain-66.227, // rx gain (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
200, // IP3_dBm (dBm)
&ip, // initial phase
30.0e3, // pn_cutoff (kHz)
-500.0, // pn_amp (dBc) default: 50
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
rx_pwr = signal_energy_fp(r_re,r_im,lte_frame_parms->nb_antennas_rx,lte_frame_parms->samples_per_tti>>1,0);
printf("rx_pwr (ADC in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
#endif
#ifdef RF
adc(r_re,
r_im,
0,
slot_offset,
rxdata,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
12);
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,lte_frame_parms->samples_per_tti>>1);
printf("rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d)\n",10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1);
adc(r_re,
r_im,
0,
slot_offset,
rxdata,
lte_frame_parms->nb_antennas_rx,
lte_frame_parms->samples_per_tti>>1,
12);
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,lte_frame_parms->samples_per_tti>>1);
printf("rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d)\n",10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1);
#else
for (i=0; i<(lte_frame_parms->samples_per_tti>>1); i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
((short*) rxdata[aa])[2*slot_offset + (2*i)] = (short) ((r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) rxdata[aa])[2*slot_offset + (2*i)+1] = (short) ((r_im[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
}
for (i=0; i<(lte_frame_parms->samples_per_tti>>1); i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_rx; aa++) {
((short*) rxdata[aa])[2*slot_offset + (2*i)] = (short) ((r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) rxdata[aa])[2*slot_offset + (2*i)+1] = (short) ((r_im[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
}
#endif
write_output("rxsig0.m","rxs0",rxdata[0],lte_frame_parms->samples_per_tti>>1,1,1);
write_output("rxsig1.m","rxs1",rxdata[1],lte_frame_parms->samples_per_tti>>1,1,1);
write_output("rxsig0.m","rxs0",rxdata[0],lte_frame_parms->samples_per_tti>>1,1,1);
write_output("rxsig1.m","rxs1",rxdata[1],lte_frame_parms->samples_per_tti>>1,1,1);
#ifdef IFFT_FPGA
free(txdataF2[0]);
@@ -296,18 +302,19 @@ int main(int argc, char **argv) {
free(rxdata[0]);
free(rxdata[1]);
free(rxdata);
#endif
#endif
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
return(0);
}
+63 -64
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -35,100 +35,99 @@
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] ={gpib_device, NOADDR};
SendIFC(gpib_board);
unsigned short addlist[2] = {gpib_device, NOADDR};
SendIFC(gpib_board);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
//Enable all on GPIB bus
EnableRemote(gpib_board, addlist);
if(ibsta & ERR)
{
printf("gpib_send: Instrument enable failed! \n");
}
if(ibsta & ERR) {
printf("gpib_send: Instrument enable failed! \n");
}
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
//Send Control Commandss
Send(gpib_board, gpib_device, command_string, strlen(command_string), NLend);
if(ibsta & ERR)
{
if(ibsta & ERR) {
printf("gpib_send: Send failed! \n");
printf("gpib_send: Send failed! \n");
}
printf("%s \n",command_string);
}
printf("%s \n",command_string);
}
void puschsignalG(unsigned int gpib_card,unsigned int gpib_device,unsigned int freqband,LTE_DL_FRAME_PARMS *frame_parms,void *UL_alloc_pdu)
{
char string[256];
//void *UL_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
char string[256];
//void *UL_alloc_pdu = (void *)dci_alloc[0].dci_pdu;
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
//Start the configuration
gpib_send(gpib_card,gpib_device,"*RST;*CLS"); //reset and configure the signal generator
gpib_send(gpib_card,gpib_device,"BB:EUTR:PRES");
gpib_send(gpib_card,gpib_device,"BB:EUTR:STAT ON");
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
gpib_send(gpib_card,gpib_device,"POW -70dBm"); // set output signal power
//gpib_send(gpib_card,gpib_device,"FREQ 1.91"); // set frequency
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
//Selects the duplexing mode
if (frame_parms->frame_type == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL FDD");
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:DUPL TDD");
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK UP");
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
gpib_send(gpib_card,gpib_device,"BB:EUTR:LINK UP");
gpib_send(gpib_card,gpib_device,"BB:EUTR:SLEN 4"); //sequence length of the signal in number of frames
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
// General EUTRA/LTE Settings
sprintf(string,"BB:EUTR:TDD:UDC %d",frame_parms->tdd_config);
gpib_send(gpib_card,gpib_device,string); //sets the UL/DL configuration into 3
sprintf(string,"BB:EUTR:TDD:SPSC %d",frame_parms->tdd_config_S);
gpib_send(gpib_card,gpib_device,string); //sets the special subframe configuration into 0
//General EUTRA/LTE UPlink Settings
//General EUTRA/LTE UPlink Settings
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:BW USER"); //set the bandwidth into 5 MHz ??
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:BW USER"); //set the bandwidth into 5 MHz ??
sprintf(string,"BB:EUTR:UL:NORB %d",frame_parms->N_RB_UL); //sets the number of resource blocks to 25
gpib_send(gpib_card,gpib_device,string);
sprintf(string,"BB:EUTR:UL:NORB %d",frame_parms->N_RB_UL); //sets the number of resource blocks to 25
gpib_send(gpib_card,gpib_device,string);
sprintf(string,"BB:EUTR:UL:PLC:CID %d",frame_parms->Nid_cell); //sets the Cell ID 0
gpib_send(gpib_card,gpib_device,string);
sprintf(string,"BB:EUTR:UL:PLC:CID %d",frame_parms->Nid_cell); //sets the Cell ID 0
gpib_send(gpib_card,gpib_device,string);
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC NORM"); //set the prefix of the subframes
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC EXT");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:GRPH OFF"); //disables group hopping
if (frame_parms->Ncp == 0)
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC NORM"); //set the prefix of the subframes
else
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CPC EXT");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SEQH OFF"); //disables sequence hopping
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:GRPH OFF"); //disables group hopping
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SRS:ANST OFF"); //disables the A/N ans SRS simultaneous transmission for UE2
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SEQH OFF"); //disables sequence hopping
//UL Frame Configuration pusch
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:REFS:SRS:ANST OFF"); //disables the A/N ans SRS simultaneous transmission for UE2
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CONS 5");//3 UL subframes of a frame are configurable
//UL Frame Configuration pusch
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:UET UE1");
gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:CONS 5");//3 UL subframes of a frame are configurable
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:STAT ON"); //Sets the allocation state to active
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:UET UE1");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:CONT PUCS");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:STAT ON"); //Sets the allocation state to active
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:MOD QAM16");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:CONT PUCS");
//gpib_send(gpib_card,gpib_device,"BB:EUTR:UL:SUBF2:ALL0:MOD QAM16");
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
gpib_send(gpib_card,gpib_device,"FREQ 1.2GHz");
gpib_send(gpib_card,gpib_device,"SOUR:POW:POW -50");
gpib_send(gpib_card,gpib_device,"SYSTem:ERRor?");
gpib_send(gpib_card,gpib_device,"OUTP ON");
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
File diff suppressed because it is too large Load Diff
+142 -135
View File
@@ -1,5 +1,5 @@
/*******************************************************************************
OpenAirInterface
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
@@ -14,15 +14,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
@@ -45,7 +45,8 @@
#define Td 1.0
#define N_TRIALS 1
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
int i,l,aa,sector;
double sigma2, sigma2_dB=0;
@@ -113,20 +114,20 @@ int main(int argc, char **argv) {
lte_frame_parms->n_RRC = 0;
init_frame_parms(lte_frame_parms);
copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
phy_init_top(NB_ANTENNAS_TX);
lte_frame_parms->twiddle_fft = twiddle_fft;
lte_frame_parms->twiddle_ifft = twiddle_ifft;
lte_frame_parms->rev = rev;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
@@ -139,7 +140,7 @@ int main(int argc, char **argv) {
phy_init_lte_ue(lte_frame_parms,lte_ue_common_vars,lte_ue_dlsch_vars,lte_ue_pbch_vars,lte_ue_pdcch_vars);
/*
/*
txdataF = (mod_sym_t **)malloc16(2*sizeof(mod_sym_t*));
txdataF[0] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
txdataF[1] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
@@ -167,13 +168,13 @@ int main(int argc, char **argv) {
#else
txdata = lte_eNB_common_vars->txdata;
#endif
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
@@ -186,6 +187,7 @@ int main(int argc, char **argv) {
}
ch = (struct complex**) malloc(4 * sizeof(struct complex*));
for (i = 0; i<4; i++)
ch[i] = (struct complex*) malloc(channel_length * sizeof(struct complex));
@@ -197,165 +199,169 @@ int main(int argc, char **argv) {
//write_output("txsigF1.m","txsF1", lte_ue_common_vars->txdataF[1],300*120,1,4);
// do talbe lookup and write results to txdataF2
for (aa=0;aa<lte_frame_parms->nb_antennas_tx;aa++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++) {
l = 0;
for (i=0;i<FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX;i++)
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX; i++)
if ((i%512>=1) && (i%512<=150))
txdataF2[aa][i] = ((int*)mod_table)[lte_ue_common_vars->txdataF[aa][l++]];
txdataF2[aa][i] = ((int*)mod_table)[lte_ue_common_vars->txdataF[aa][l++]];
else if (i%512>=362)
txdataF2[aa][i] = ((int*)mod_table)[lte_ue_common_vars->txdataF[aa][l++]];
else
txdataF2[aa][i] = 0;
txdataF2[aa][i] = ((int*)mod_table)[lte_ue_common_vars->txdataF[aa][l++]];
else
txdataF2[aa][i] = 0;
printf("l=%d\n",l);
}
write_output("txsigF20.m","txsF20", txdataF2[0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
//write_output("txsigF21.m","txsF21", txdataF2[1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++)
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++)
PHY_ofdm_mod(txdataF2[aa], // input
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
12*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
12*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
#else
write_output("txsigF0.m","txsF0", lte_ue_common_vars->txdataF[0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
//write_output("txsigF1.m","txsF1", lte_ue_common_vars->txdataF[1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++) {
PHY_ofdm_mod(lte_ue_common_vars->txdataF[aa], // input
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
12*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
}
txdata[aa], // output
lte_frame_parms->log2_symbol_size, // log2_fft_size
12*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME, // number of symbols
lte_frame_parms->nb_prefix_samples, // number of prefix samples
lte_frame_parms->twiddle_ifft, // IFFT twiddle factors
lte_frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
}
#endif
write_output("txsig0.m","txs0", txdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel
randominit(0);
for (i=0;i<FRAME_LENGTH_COMPLEX_SAMPLES;i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_tx;aa++) {
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
n_errors = 0;
for (trial=0; trial<N_TRIALS; trial++)
{
multipath_channel(ch,s_re,s_im,r_re,r_im,
amps,Td,BW,ricean_factor,aoa,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->nb_antennas_rx,
FRAME_LENGTH_COMPLEX_SAMPLES,
channel_length,
0);
for (trial=0; trial<N_TRIALS; trial++) {
//write_output("channel0.m","chan0",ch[0],channel_length,1,8);
multipath_channel(ch,s_re,s_im,r_re,r_im,
amps,Td,BW,ricean_factor,aoa,
lte_frame_parms->nb_antennas_tx,
lte_frame_parms->nb_antennas_rx,
FRAME_LENGTH_COMPLEX_SAMPLES,
channel_length,
0);
// scale by path_loss = NOW - P_noise
//sigma2 = pow(10,sigma2_dB/10);
//N0W = -95.87;
//path_loss_dB = N0W - sigma2;
//path_loss = pow(10,path_loss_dB/10);
path_loss_dB = 0;
path_loss = 1;
//write_output("channel0.m","chan0",ch[0],channel_length,1,8);
for (i=0;i<FRAME_LENGTH_COMPLEX_SAMPLES;i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
r_re[aa][i]=r_re[aa][i]*sqrt(path_loss);
r_im[aa][i]=r_im[aa][i]*sqrt(path_loss);
// scale by path_loss = NOW - P_noise
//sigma2 = pow(10,sigma2_dB/10);
//N0W = -95.87;
//path_loss_dB = N0W - sigma2;
//path_loss = pow(10,path_loss_dB/10);
path_loss_dB = 0;
path_loss = 1;
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_rx; aa++) {
r_re[aa][i]=r_re[aa][i]*sqrt(path_loss);
r_im[aa][i]=r_im[aa][i]*sqrt(path_loss);
}
}
}
/*
// RF model
rf_rx(r_re,
r_im,
NULL,
NULL,
0,
lte_frame_parms->nb_antennas_rx,
FRAME_LENGTH_COMPLEX_SAMPLES,
1.0/7.68e6 * 1e9, // sampling time (ns)
500, // freq offset (Hz) (-20kHz..20kHz)
0.0, // drift (Hz) NOT YET IMPLEMENTED
nf, // noise_figure NOT YET IMPLEMENTED
-path_loss_dB, // rx_gain (dB)
200, // IP3_dBm (dBm)
&ip, // initial phase
30.0e3, // pn_cutoff (kHz)
-500.0, // pn_amp (dBc) default: 50
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
*/
/*
// RF model
rf_rx(r_re,
r_im,
NULL,
NULL,
0,
lte_frame_parms->nb_antennas_rx,
FRAME_LENGTH_COMPLEX_SAMPLES,
1.0/7.68e6 * 1e9, // sampling time (ns)
500, // freq offset (Hz) (-20kHz..20kHz)
0.0, // drift (Hz) NOT YET IMPLEMENTED
nf, // noise_figure NOT YET IMPLEMENTED
-path_loss_dB, // rx_gain (dB)
200, // IP3_dBm (dBm)
&ip, // initial phase
30.0e3, // pn_cutoff (kHz)
-500.0, // pn_amp (dBc) default: 50
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
//AWGN
sigma2 = pow(10,sigma2_dB/10);
//printf("sigma2 = %g\n",sigma2);
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
for (aa=0;aa<lte_frame_parms->nb_antennas_rx;aa++) {
((short*) lte_eNB_common_vars->rxdata[eNb_id][aa])[2*i] = (short) ((r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) lte_eNB_common_vars->rxdata[eNb_id][aa])[2*i+1] = (short) ((r_im[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
*/
//AWGN
sigma2 = pow(10,sigma2_dB/10);
//printf("sigma2 = %g\n",sigma2);
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<lte_frame_parms->nb_antennas_rx; aa++) {
((short*) lte_eNB_common_vars->rxdata[eNb_id][aa])[2*i] = (short) ((r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
((short*) lte_eNB_common_vars->rxdata[eNb_id][aa])[2*i+1] = (short) ((r_im[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
}
}
write_output("rxsig0.m","rxs0", lte_eNB_common_vars->rxdata[eNb_id][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("rxsig1.m","rxs1", lte_eNB_common_vars->rxdata[eNb_id][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("rxsig0.m","rxs0", lte_eNB_common_vars->rxdata[eNb_id][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
write_output("rxsig1.m","rxs1", lte_eNB_common_vars->rxdata[eNb_id][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
/*
// optional: read rx_frame from file
if ((rx_frame_file = fopen("rx_frame.dat","r")) == NULL)
{
printf("[openair][CHBCH_TEST][INFO] Cannot open rx_frame.m data file\n");
exit(0);
}
result = fread((void *)PHY_vars->rx_vars[0].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
result = fread((void *)PHY_vars->rx_vars[1].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
/*
// optional: read rx_frame from file
if ((rx_frame_file = fopen("rx_frame.dat","r")) == NULL)
{
printf("[openair][CHBCH_TEST][INFO] Cannot open rx_frame.m data file\n");
exit(0);
}
fclose(rx_frame_file);
*/
result = fread((void *)PHY_vars->rx_vars[0].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
result = fread((void *)PHY_vars->rx_vars[1].RX_DMA_BUFFER,4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
fclose(rx_frame_file);
*/
for (l=0; l<lte_frame_parms->symbols_per_tti; l++) {
for (l=0;l<lte_frame_parms->symbols_per_tti;l++) {
slot_fep_ul(lte_frame_parms,
lte_eNB_common_vars,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
eNb_id,
0);
lte_eNB_common_vars,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
eNb_id,
0);
/*
ulsch_extract_rbs_single(lte_eNB_common_vars->rxdataF,
lte_eNB_common_vars->rxdataF_ext,
first_rb,
nb_rb,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
lte_frame_parms);
lte_eNB_common_vars->rxdataF_ext,
first_rb,
nb_rb,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
lte_frame_parms);
lte_ul_channel_estimation(lte_eNB_common_vars->drs_ch_estimates[eNb_id],
lte_eNB_common_vars->rxdataF_ext,
lte_frame_parms,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
nb_rb);
lte_eNB_common_vars->rxdataF_ext,
lte_frame_parms,
l%(lte_frame_parms->symbols_per_tti/2),
l/(lte_frame_parms->symbols_per_tti/2),
nb_rb);
*/
}
@@ -379,31 +385,32 @@ int main(int argc, char **argv) {
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
#endif
for (i=0;i<2;i++) {
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
lte_sync_time_free();
return(n_errors);
}
/*
/*
for (i=1;i<4;i++)
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
*/
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-74
View File
@@ -1,74 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = ../..
OPENAIR1_TOP = ../..
OPENAIR2_TOP = ../../../openair2
OPENAIR3_TOP = ../../../openair3
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
ASN1_MSG_INC = ../../../openair2/RRC/LITE/MESSAGES
CFLAGS += -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DXFORMS
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef NAS_NETLINK
CFLAGS += -DNAS_NETLINK -DLINUX
LINUX=1
endif
CFLAGS += -DPHY_ABSTRACTION #:wq
-DEMIT_ASN_DEBUG=1
ifdef OCG
CFLAGS += -I/usr/include/libxml2 -lxml2
endif
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(ASN1_MSG_OBJS)
all: physim
$(OBJ) : %.o : %.c
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o $@ $<
$(L2_OBJS) : %.o : %.c
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o $@ $<
physim : $(OBJ) $(L2_OBJS) phy_procedures_sim.c phy_procedures_sim_form.c
$(CC) phy_procedures_sim.c phy_procedures_sim_form.c -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o physim $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(L2_OBJS) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm -lblas -lpthread
clean:
rm -f physim
rm -f $(OBJ)
rm -f $(L2_OBJS)
rm -f *.o
rm -f *.exe*
cleanl1:
rm -f physim
rm -f $(OBJ)
rm -f *.o
rm -f *.exe
cleanl2:
rm -f $(L2_OBJS)
File diff suppressed because it is too large Load Diff
@@ -1,55 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/* Form definition file generated with fdesign. */
#include <forms.h>
#include <stdlib.h>
#include "phy_procedures_sim_form.h"
FD_phy_procedures_sim *create_form_phy_procedures_sim(void)
{
FL_OBJECT *obj;
FD_phy_procedures_sim *fdui = (FD_phy_procedures_sim *) fl_calloc(1, sizeof(*fdui));
fdui->phy_procedures_sim = fl_bgn_form(FL_NO_BOX, 640, 320);
obj = fl_add_box(FL_UP_BOX,0,0,640,320,"");
fdui->pusch_constellation = obj = fl_add_xyplot(FL_POINTS_XYPLOT,50,30,220,190,"PUSCH constellation");
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
fdui->pdsch_constellation = obj = fl_add_xyplot(FL_POINTS_XYPLOT,370,30,220,190,"PDSCH constellation");
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
fdui->ch00 = obj = fl_add_xyplot(FL_IMPULSE_XYPLOT,370,240,210,60,"CH00");
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
fl_end_form();
fdui->phy_procedures_sim->fdui = fdui;
return fdui;
}
/*---------------------------------------*/
@@ -1,88 +0,0 @@
Magic: 13000
Internal Form Definition File
(do not change)
Number of forms: 1
Unit of measure: FL_COORD_PIXEL
=============== FORM ===============
Name: phy_procedures_sim
Width: 640
Height: 320
Number of Objects: 4
--------------------
class: FL_BOX
type: UP_BOX
box: 0 0 640 320
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_XYPLOT
type: POINTS_XYPLOT
box: 50 30 220 190
boxtype: FL_FLAT_BOX
colors: FL_BLACK FL_YELLOW
alignment: FL_ALIGN_BOTTOM
style: FL_NORMAL_STYLE
size: FL_TINY_SIZE
lcol: FL_BLACK
label: PUSCH constellation
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: pusch_constellation
callback:
argument:
--------------------
class: FL_XYPLOT
type: POINTS_XYPLOT
box: 370 30 220 190
boxtype: FL_FLAT_BOX
colors: FL_BLACK FL_YELLOW
alignment: FL_ALIGN_BOTTOM
style: FL_NORMAL_STYLE
size: FL_TINY_SIZE
lcol: FL_BLACK
label: PDSCH constellation
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: pdsch_constellation
callback:
argument:
--------------------
class: FL_XYPLOT
type: IMPULSE_XYPLOT
box: 370 240 210 60
boxtype: FL_FLAT_BOX
colors: FL_BLACK FL_YELLOW
alignment: FL_ALIGN_BOTTOM
style: FL_NORMAL_STYLE
size: FL_TINY_SIZE
lcol: FL_BLACK
label: CH00
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: ch00
callback:
argument:
==============================
create_the_forms
@@ -1,50 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/** Header file generated with fdesign on Tue Jul 27 16:31:42 2010.**/
#ifndef FD_phy_procedures_sim_h_
#define FD_phy_procedures_sim_h_
/** Callbacks, globals and object handlers **/
/**** Forms and Objects ****/
typedef struct {
FL_FORM *phy_procedures_sim;
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *pusch_constellation;
FL_OBJECT *pdsch_constellation;
FL_OBJECT *ch00;
} FD_phy_procedures_sim;
extern FD_phy_procedures_sim * create_form_phy_procedures_sim(void);
#endif /* FD_phy_procedures_sim_h_ */
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -1,113 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1
LFLAGS = -lm -lblas
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
CFLAGS += -DNO_RRM -DOPENAIR2 -DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
include $(TOP_DIR)/PHY/Makefile.inc
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
#include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3)
EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) #$(ASN1_MSG_OBJS)
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
all: dlsim pbchsim pdcchsim ulsim pucchsim
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
recsim : $(OBJ) recsim.c
@echo "Compiling recsim.c ..."
@$(CC) recsim.c -o recsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
recsim_eNB2UE : $(OBJ) recsim_eNB2UE.c
@echo "Compiling recsim_eNB2UE.c ..."
@$(CC) recsim_eNB2UE.c -o recsim_eNB2UE $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
recsim_eNBUE4 : $(OBJ) recsim_eNBUE4.c
@echo "Compiling recsim_eNBUE4.c ..."
@$(CC) recsim_eNBUE4.c -o recsim_eNBUE4 $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f dlsim pbchsim pdcchsim ulsim pucchsim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
@@ -1,51 +0,0 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
double s_coeffs_eNB[11] = {-0.0031, 0.0131, -0.0101, -0.0843, 0.2630, 0.6428, 0.2630, -0.0843, -0.0101, 0.0131, -0.0031};
int s_ord_fir_eNB = 11;
double r_coeffs_eNB[6] = {-0.0098, 0.0104, 0.4995, 0.4995, 0.0104, -0.0098};
int r_ord_fir_eNB = 6;
double s_coeffs_UE[9] = {0.0062, -0.0054, -0.0661, 0.2471, 0.6365, 0.2471, -0.0661, -0.0054, 0.0062};
int s_ord_fir_UE = 9;
double r_coeffs_UE[8] = {0.0050, -0.0303, 0.0163, 0.5090, 0.5090, 0.0163, -0.0303, 0.0050};
int r_ord_fir_UE = 8;/*
double s_coeffs_eNB[2] = {1, 0};
int s_ord_fir_eNB = 2;
double r_coeffs_eNB[2] = {1, 0};
int r_ord_fir_eNB = 2;
double s_coeffs_UE[2] = {1, 0};
int s_ord_fir_UE = 2;
double r_coeffs_UE[2] = {1, 0};
int r_ord_fir_UE = 2;*/
@@ -1,29 +0,0 @@
function[x]=basictls(A,B);
%TLS de base voir Overview...
%[U D V]=svd([A B]);
%m=size(A,1);d=size(B,2);n=size(A,2);
%Vdd=V((n+1):(n+d),(n+1):(n+d));
%if det(Vdd)~=0 %non singular
% x=-V(1:size(A,2),(size(A,2)+1):(n+d)) * inv(Vdd);
% x=-V(1:n,(n+1):(n+d)) / Vdd;
%else
% fprintf('\n*******Pas de solution, matrice singuliere Vdd********\n')
%end
px =[A B]' * [A B];
ar=real(px(1,1));
ai=imag(px(1,1));
br=real(px(1,2));
bi=imag(px(1,2));
cr=real(px(2,1));
ci=imag(px(2,1));
dr=real(px(2,2));
di=imag(px(2,2));
if((ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)))~=0)
x=2*br/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4))) + 2i*bi/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)));
else
x=0+1i*0;
end
@@ -1,61 +0,0 @@
close all;clear all;
vulb;cal1;
vdlb;
aue1;
aenb1;
figure(1),subplot(231),plot(real(vdl(1537:1836)))
title("dlchest et drschest")
subplot(232),plot(imag(vdl(1537:1836)))
subplot(233),plot(angle(vdl(1537:1836)),"m");
subplot(234),plot(real(vul(901:1200)),"r")
subplot(235),plot(imag(vul(901:1200)),"r")
subplot(236),plot(angle(vul(901:1200)),"m")
dec_f = 4;
figure(2),subplot(231),plot(real(aenb(1:dec_f:300)))
title("dlchest et drschest avec doquant")
subplot(232),plot(imag(aenb(1:dec_f:300)))
subplot(233),plot(angle(aenb(1:dec_f:300)),"m");
subplot(234),plot(real(aue(1:dec_f:300)),"r")
subplot(235),plot(imag(aue(1:dec_f:300)),"r")
subplot(236),plot(angle(aue(1:dec_f:300)),"m")
figure(3),subplot(131),plot(real(cal(1:dec_f:300)),"g");
title("facteur de calib")
subplot(132),plot(imag(cal(1:dec_f:300)),"g");
subplot(133),plot(angle(cal(1:dec_f:300)),"g");
figure(4),
subplot(131),plot(real(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
title("dl reconstruit")
subplot(132),plot(imag(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
subplot(133),plot(angle(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
%figure(5),
break
vdrs2;vdrs4;cal1;
vdl2;vdl4
aue1;
aenb1;
figure(20),subplot(231),plot(real(vudl2(1:300)))
title("dlchest et drschest")
subplot(232),plot(imag(vudl2(1:300)))
subplot(233),plot(angle(vudl2(1:300)),"m");
subplot(234),plot(real(vudrs2(1:300)),"r")
subplot(235),plot(imag(vudrs2(1:300)),"r")
subplot(236),plot(angle(vudrs2(1:300)),"m")
figure(21),subplot(231),plot(real(vudl4(1:300)))
title("dlchest et drschest")
subplot(232),plot(imag(vudl4(1:300)))
subplot(233),plot(angle(vudl4(1:300)),"m");
subplot(234),plot(real(vudrs4(1:300)),"r")
subplot(235),plot(imag(vudrs4(1:300)),"r")
subplot(236),plot(angle(vudrs4(1:300)),"m")
@@ -1,15 +0,0 @@
close all;clear all;
vulb;cal1;
vdlb;
aue1;
aenb1;
dec_f = 1;
figure(1),subplot(131),plot(real(aenb(1:dec_f:300))), hold on, plot(real(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
title("dlchest")
subplot(132),plot(imag(aenb(1:dec_f:300))), hold on, plot(imag(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
subplot(133),plot(angle(aenb(1:dec_f:300))); hold on, plot(angle(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
figure(2), plot(real(aenb(1:dec_f:300))), hold on, plot(real(aue(1:dec_f:300)),"r")
%figure(5),
@@ -1,124 +0,0 @@
% Comparaison Matlab FACTEUR P
clear all
clc
K=10;
SC=300;
M=1;N=1;
H_h=zeros(N,M,300,K);
G_g=zeros(M,N,300,K);
Vis=zeros(SC,N,M,8);
vudl0;
vudrs0;
vudl1;
vudrs1;
vudl2;
vudrs2;
vudl3;
vudrs3;
vudl4;
vudrs4;
vudl5;
vudrs5;
vudl6;
vudrs6;
vudl7;
vudrs7;
vudl8;
vudrs8;
vudl9;
vudrs9;
cal1;
vul1;
vdl1;
for s_c=1:SC
for n_k=1:K
eval(['H_h(1,1,' int2str(s_c) ',' int2str(n_k) ')=vudrs' int2str(n_k-1) '(' int2str(s_c) ');']);
eval(['G_g(1,1,' int2str(s_c) ',' int2str(n_k) ')=vudl' int2str(n_k-1) '(' int2str(s_c) ');']);
end
end
Psyst(1,1,:)=cal;
for s_c=1:SC
for ii= 1:N % nb antennes emission
for jj= 1:M % nb antennes reception
%if(max(abs(squeeze(H_h(ii,jj,s_c,1:K))))~=0 && max(abs(squeeze(G_g(jj,ii,s_c,1:K))))~=0)
Pud(ii,jj,s_c)=basictls(squeeze(H_h(ii,jj,s_c,1:K)),squeeze(G_g(jj,ii,s_c,1:K)) );
C=squeeze(H_h(ii,jj,s_c,1:K));
D=squeeze(G_g(jj,ii,s_c,1:K));
px =[C D]'*[C D];
ar=real(px(1,1));
ai=imag(px(1,1));
br=real(px(1,2));
bi=imag(px(1,2));
dr=real(px(2,2));
di=imag(px(2,2));
r1=2*br/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)));
r2=2*bi/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)));
Vis(s_c,ii,jj,:)=[ar ai br bi dr di r1 r2 ];
end
end
end
figure,plot(abs(cal(1:300).*vul(901:1200)));
figure,plot(abs(vdl(1537:1836)),"r");
break
figure,plot(abs(cal(1:300).*aue(1:300)));
figure,plot(abs(aenb(1:300)),"r");
A=vul(1:300);
B=vdl(1:300);
figure,plot(abs(fft(ifft(A,512),300)),"b");
figure,plot(abs(fft(ifft(B,512),300)),"b");
close all;clear all;
vul1;cal1;
vdl1;
aue1;
aenb1;
figure(1),subplot(231),plot(real(vdl(1537:1836)))
title("dlchest et drschest")
subplot(232),plot(imag(vdl(1537:1836)))
subplot(233),plot(angle(vdl(1537:1836)),"m");
subplot(234),plot(real(vul(901:1200)),"r")
subplot(235),plot(imag(vul(901:1200)),"r")
subplot(236),plot(angle(vul(901:1200)),"m")
dec_f = 4;
figure(2),subplot(231),plot(real(aenb(1:dec_f:300)))
title("dlchest et drschest avec doquant")
subplot(232),plot(imag(aenb(1:dec_f:300)))
subplot(233),plot(angle(aenb(1:dec_f:300)),"m");
subplot(234),plot(real(aue(1:dec_f:300)),"r")
subplot(235),plot(imag(aue(1:dec_f:300)),"r")
subplot(236),plot(angle(aue(1:dec_f:300)),"m")
figure(3),subplot(131),plot(real(cal(1:dec_f:300)),"g");
title("facteur de calib")
subplot(132),plot(imag(cal(1:dec_f:300)),"g");
subplot(133),plot(angle(cal(1:dec_f:300)),"g");
figure(4),
subplot(131),plot(real(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
title("dl reconstruit")
subplot(132),plot(imag(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
subplot(133),plot(angle(cal(1:dec_f:300).*aue(1:dec_f:300)),"r")
%figure(5),
%title("Dif dlchest et dlcal")
norm(vdl(1537:1836)-(cal(1:300).*aue(1:300)),2)
@@ -1,109 +0,0 @@
% Comparaison Matlab FACTEUR P
clear all
clc
K=10;
SC=300;
M=1;N=1;
H_h=zeros(N,M,300,K);
G_g=zeros(M,N,300,K);
Vis=zeros(SC,N,M,8);
vudl0;
vudrs0;
vudl1;
vudrs1;
vudl2;
vudrs2;
vudl3;
vudrs3;
vudl4;
vudrs4;
vudl5;
vudrs5;
vudl6;
vudrs6;
vudl7;
vudrs7;
vudl8;
vudrs8;
vudl9;
vudrs9;
cal1;
vul1;
vdl1;
for s_c=1:SC
for n_k=1:K
eval(['H_h(1,1,' int2str(s_c) ',' int2str(n_k) ')=vudrs' int2str(n_k-1) '(' int2str(s_c) ');']);
eval(['G_g(1,1,' int2str(s_c) ',' int2str(n_k) ')=vudl' int2str(n_k-1) '(' int2str(s_c) ');']);
end
end
Psyst(1,1,:)=cal;
for s_c=1:SC
for ii= 1:N % nb antennes emission
for jj= 1:M % nb antennes reception
%if(max(abs(squeeze(H_h(ii,jj,s_c,1:K))))~=0 && max(abs(squeeze(G_g(jj,ii,s_c,1:K))))~=0)
Pud(ii,jj,s_c)=basictls(squeeze(H_h(ii,jj,s_c,1:K)),squeeze(G_g(jj,ii,s_c,1:K)) );
C=squeeze(H_h(ii,jj,s_c,1:K));
D=squeeze(G_g(jj,ii,s_c,1:K));
px =[C D]'*[C D];
ar=real(px(1,1));
ai=imag(px(1,1));
br=real(px(1,2));
bi=imag(px(1,2));
dr=real(px(2,2));
di=imag(px(2,2));
r1=2*br/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)));
r2=2*bi/(ar-dr+sqrt((ar-dr)*(ar-dr)+((br*br+bi*bi)*4)));
Vis(s_c,ii,jj,:)=[ar ai br bi dr di r1 r2 ];
end
end
end
figure,plot(abs(cal(1:300).*vul(901:1200)));
figure,plot(abs(vdl(1537:1836)),"r");
break
figure,plot(abs(cal(1:300).*aue(1:300)));
figure,plot(abs(aenb(1:300)),"r");
A=vul(1:300);
B=vdl(1:300);
figure,plot(abs(fft(ifft(A,512),300)),"b");
figure,plot(abs(fft(ifft(B,512),300)),"b");
close all;clear all;
vul1;
vdl1;
aue1;
aenb1;
figure(1),subplot(231),plot(real(vdl(1537:1836)))
subplot(232),plot(imag(vdl(1537:1836)))
subplot(233),plot(angle(vdl(1537:1836)),"m");
subplot(234),plot(real(vul(901:1200)),"r")
subplot(235),plot(imag(vul(901:1200)),"r")
subplot(236),plot(angle(vul(901:1200)),"m")
figure(2),subplot(231),plot(real(aenb(1:300)))
subplot(232),plot(imag(aenb(1:300)))
subplot(233),plot(angle(aenb(1:300)),"m");
subplot(234),plot(real(aue(1:300)),"r")
subplot(235),plot(imag(aue(1:300)),"r")
subplot(236),plot(angle(aue(1:300)),"m")
cal1;
figure,plot(real(cal(1:300)),"m");
figure,plot(imag(cal(1:300)),"m");
figure,plot(angle(cal(1:300)),"m");
@@ -1,21 +0,0 @@
%% Verif Calibration
close all, clear all;
run("./LTE_RECIPROCITY/aue1.m");
run("./LTE_RECIPROCITY/aenb1.m");
run("./LTE_RECIPROCITY/cal1.m");
run("./LTE_RECIPROCITY/vul1.m");
run("./LTE_RECIPROCITY/vdl1.m");
ul=vul(901:1200);
dl=vdl(1537:1836);
dl_est=cal(1:300).*ul;
res=abs(dl)-abs(dl_est);
%plot(res);
figure();plot(abs(dl(50:150)),"g"),figure,plot(abs(ul(50:150)),"r");
figure,plot(abs(cal(50:150)),"r");
%figure(),plot(abs(ul),"m");
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-133
View File
@@ -1,133 +0,0 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1
LFLAGS = -lm -lblas
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
CFLAGS += -DNO_RRM -DOPENAIR2 -DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
include $(TOP_DIR)/PHY/Makefile.inc
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
#include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3)
EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) #$(ASN1_MSG_OBJS)
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
all: dlsim relay_DF_sim relay_QF_sim pbchsim pdcchsim ulsim pucchsim
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
dlsim : $(OBJ) dlsim.c
@echo "Compiling dlsim.c ..."
@$(CC) dlsim.c -o dlsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
relay_DF_sim : $(OBJ) relay_DF_sim.c
@echo "Compiling relay_DF_sim.c ..."
@$(CC) relay_DF_sim.c -o relay_DF_sim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
relay_QF_sim : $(OBJ) relay_QF_sim.c
@echo "Compiling relay_QF_sim.c ..."
@$(CC) relay_QF_sim.c -o relay_QF_sim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
framegen: $(OBJ) framegen.c
@echo "Compiling framegen.c"
@$(CC) framegen.c -o framegen $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
pbchsim : $(OBJ) pbchsim.c
@echo "Compiling pbchsim.c"
@$(CC) pbchsim.c -o pbchsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
pdcchsim : $(OBJ) pdcchsim.c
@echo "Compiling pdcchsim.c"
@$(CC) pdcchsim.c -o pdcchsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
pucchsim : $(OBJ) pucchsim.c
@echo "Compiling pucchsim.c"
@$(CC) pucchsim.c -o pucchsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
ulsim : $(OBJ) ulsim.c #ulsim_form.c
@echo "Compiling [ulsim.c]"
@$(CC) ulsim.c -o ulsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f relay_DF_sim relay_QF_sim dlsim pbchsim pdcchsim ulsim pucchsim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
-16
View File
@@ -1,16 +0,0 @@
Author : Erhan YILMAZ
Contact: erhan.yilmaz@eurecom.fr
Function: relay_DF_sim.c
In this function we intend to simulate Paralel Relay Network scenario where a single source node (eNB in the simulator) communicates with a destination node via multiple relay nodes (RNs) which are connected to the destination node via finite (but sufficent to convey decode bits) capacity backhaul links.
Each RN perform FULL decoding (i.e., decode-and-forward relaying).
- Maxumim HARQ retransmision rounds is set to 4;
- An error declared, if one of the following occurs:
1- For all RNs DCI pkts are not received correctly
2- Assuming correct DCI pkts but maxumum number of iterations for the turbo decoders at at least one of the RNs (among those who have correctly got the DCI pkts) is exceeded;
// 3- Maximum number of HARQ iterations is axceeded. //
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
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
include $(OPENAIR_HOME)/common/utils/Makefile.inc
include $(OPENAIR_DIR)/common/utils/Makefile.inc
OBJS = rf.o ../../PHY/TOOLS/file_output.o ../TOOLS/rangen_double.o
CFLAGS += -DRF_MAIN -DUSER_MODE -DDEBUG_PHY

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