reset for remerging
This commit is contained in:
@@ -63,33 +63,6 @@ void randominit(unsigned seed_init)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
// this need to be integrated with the existing rng, like taus: navid
|
||||
LOG_D(PHY,"Initializing random number generator, seed %x\n",seed_init);
|
||||
|
||||
seed_init = 62110;
|
||||
|
||||
if (seed_init == 0) {
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
seed = (unsigned int) rand();
|
||||
} else {
|
||||
seed = seed_init;
|
||||
}
|
||||
|
||||
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
|
||||
|
||||
for (i=1; i<=97; i++) {
|
||||
seed = a*seed; /* mod 2**32 */
|
||||
ir[i]= seed; /* initialize the shuffle table */
|
||||
}
|
||||
|
||||
iy=1;
|
||||
}
|
||||
#endif
|
||||
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
|
||||
|
||||
double uniformrandom(void)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef __SIMULATION_TOOLS_DEFS_H__
|
||||
#define __SIMULATION_TOOLS_DEFS_H__
|
||||
#include "PHY/defs_common.h"
|
||||
|
||||
#include <pthread.h>
|
||||
/** @defgroup _numerical_ Useful Numerical Functions
|
||||
*@{
|
||||
The present clause specifies several numerical functions for testing of digital communication systems.
|
||||
@@ -181,6 +181,31 @@ typedef enum {
|
||||
EPA_high,
|
||||
} SCM_t;
|
||||
|
||||
#include "platform_constants.h"
|
||||
|
||||
typedef struct {
|
||||
channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
double r_re_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_im_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_re_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
double r_im_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
int RU_output_mask[NUMBER_OF_UE_MAX];
|
||||
int UE_output_mask[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX];
|
||||
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t subframe_mutex;
|
||||
int subframe_ru_mask;
|
||||
int subframe_UE_mask;
|
||||
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
double ru_amp[NUMBER_OF_RU_MAX];
|
||||
pthread_t rfsim_thread;
|
||||
} sim_t;
|
||||
|
||||
|
||||
/**
|
||||
\brief This routine initializes a new channel descriptor
|
||||
\param nb_tx Number of TX antennas
|
||||
@@ -373,6 +398,20 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
double N_RB2sampling_rate(uint16_t N_RB);
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
|
||||
#include "targets/RT/USER/rfsim.h"
|
||||
|
||||
void do_DL_sig(sim_t *sim,
|
||||
uint16_t subframe,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id);
|
||||
|
||||
void do_UL_sig(sim_t *sim,
|
||||
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,int ru_id,uint8_t CC_id);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -65,35 +65,6 @@ void set_taus_seed(unsigned int seed_init)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
struct drand48_data buffer;
|
||||
unsigned long result = 0;
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
|
||||
return;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
} else {
|
||||
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s0 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s1 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s2 = result;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user