Commit b13452ce authored by Raymond Knopp's avatar Raymond Knopp

integration of full channel simulation in Sidelink path

parent cc7037d8
......@@ -1967,7 +1967,7 @@ add_executable(lte-softmodem-stub-nos1
target_link_libraries (lte-softmodem-stub-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 SIMU ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group z dl)
......@@ -1994,6 +1994,8 @@ add_executable(lte-softmodem-stub
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-stub.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
......@@ -2014,7 +2016,7 @@ add_executable(lte-softmodem-stub
target_link_libraries (lte-softmodem-stub
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY SIMU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group z dl)
......@@ -2023,7 +2025,7 @@ target_link_libraries (lte-softmodem-stub ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-stub pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-stub ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-stub ${T_LIB})
target_link_libraries (lte-softmodem-stub ${LAPACK_LIBRARIES} ${ATLAS_LIBRARIES})
# rrh
......
......@@ -420,10 +420,14 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
}
void slsch_codingmodulation() {
void slsch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
SLSCH_t *slsch=ue->slsch;
AssertFatal(slsch!=NULL,"ue->slsch is null\n");
// G=
}
void check_and_generate_pssch(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
AssertFatal(frame_tx<1024 && frame_tx>0,"frame %d is illegal\n",frame_tx);
......
......@@ -51,14 +51,14 @@
*/
void set_taus_seed(unsigned int seed_type);
/*! \fn inline unsigned int taus(unsigned int comp);
/*! \fn inline unsigned int tausc(unsigned int comp);
* \brief compute random number
* \param[in] integer
* \param[out]
* \note
* @ingroup _oml
*/
unsigned int taus(unsigned int comp);
unsigned int tausc(unsigned int comp);
/*! \fn void init_seeds(int seed);
......
......@@ -50,7 +50,7 @@ unsigned int s0[MAX_NUM_COMPS], s1[MAX_NUM_COMPS], s2[MAX_NUM_COMPS], b[MAX_NUM_
inline unsigned int taus(unsigned int comp)
inline unsigned int tausc(unsigned int comp)
{
b[comp] = (((s0[comp] << 13) ^ s0[comp]) >> 19);
......
......@@ -288,6 +288,8 @@ void init_UE_stub(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_ifa
}
init_timer_thread();
init_sl_channel();
for (inst=0;inst<nb_inst;inst++) {
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
......@@ -300,6 +302,7 @@ void init_UE_stub(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_ifa
multicast_link_start(ue_stub_rx_handler,0,emul_iface);
}
......@@ -757,8 +760,28 @@ static void *UE_thread_rxn_txnp4(void *arg) {
}
#include "openair1/SIMULATION/TOOLS/defs.h"
unsigned int emulator_absSF;
channel_desc_t *UE2UE[NUMBER_OF_UE_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
void init_sl_channel(void) {
for (int UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
for (int UE_id2 = 1; UE_id2 < NB_UE_INST; UE_id2++) {
UE2UE[UE_id][UE_id2][0] =
new_channel_desc_scm(PHY_vars_UE_g[UE_id][0]->frame_parms.nb_antennas_tx,
PHY_vars_UE_g[UE_id][0]->frame_parms.nb_antennas_rx,
AWGN,
N_RB2sampling_rate(PHY_vars_UE_g[UE_id][0]->frame_parms.N_RB_UL),
N_RB2channel_bandwidth(PHY_vars_UE_g[UE_id][0]->frame_parms.N_RB_DL),
0.0,
0,
0);
random_channel(UE2UE[UE_id][UE_id2][0],0);
}
}
}
void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
......@@ -785,10 +808,19 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
for (int i=0;i<sizeof(SLSCH_t);i++) printf("%x ",((uint8_t*)slsch)[i]);
printf("\n");
int frame = pdu->header.absSF/10;
int subframe = pdu->header.absSF%10;
if (UE->sidelink_l2_emulation == 2) {
// do simulation here
UE->slsch = slsch;
check_and_generate_pscch(UE,frame,subframe);
check_and_generate_pssch(UE,frame,subframe);
do_SL_sig(UE2UE,subframe,&UE->frame_parms,frame,0);
rx_slcch(UE,frame,subframe);
}
ue_send_sl_sdu(0,
0,
pdu->header.absSF/10,
pdu->header.absSF%10,
frame,subframe,
pdu->payload,
slsch->payload_length,
0,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment