types.h 1.75 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#include "platform_types.h"

/* Types of events triggering the end of the simulation */
typedef enum End_Of_Sim_Event_Type {FRAME, TRAFFIC} End_Of_Sim_Event_Type;

/* Types regrouping both user-defined and regular events */
typedef enum Event_Type {ET_DL, ET_UL, ET_S, ET_OMG, ET_OTG} Event_Type;

/* decomposition of node functions into jobs for a given event */
typedef enum Job_type { JT_OTG, JT_PDCP, JT_PHY_MAC, JT_INIT_SYNC, JT_DL, JT_UL, RN_DL, RN_UL, JT_END} Job_Type;

typedef struct Job {
    enum Job_type type;
    int exe_time; /* execution time at the worker*/
    int nid; /* node id*/
    int eNB_flag;
    int frame;
    int last_slot;
    int next_slot;
    int ctime;
} Job;

typedef struct Signal_buffers { // (s = transmit, r,r0 = receive)
  double **s_re;
  double **s_im;
  double **r_re;
  double **r_im;
  double **r_re0;
  double **r_im0;
} Signal_buffers;

/*!\brief  sybframe type : DL, UL, SF, */

typedef struct Packet_otg {
35 36 37 38 39 40 41
  unsigned int sdu_buffer_size;
  unsigned char *sdu_buffer;
  int module_id;
  int rb_id;
  int dst_id;
  u8 is_ue;
  u8 mode;
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
} Packet_otg;

typedef struct Event {
    enum Event_Type type;
    char * key;
    void * value;
    int frame;
} Event;

/*typedef struct Global_Time {
  u32 frame;
  s32 slot;
  s32 last_slot;
  s32 next_slot;
  double time_s;
  double time_ms;
};*/

typedef struct End_Of_Sim_Event {
    enum End_Of_Sim_Event_Type type;
    int value;
} End_Of_Sim_Event;

typedef struct Packet_otg_elt {
    struct Packet_otg_elt *next;
    struct Packet_otg_elt *previous;
    Packet_otg otg_pkt;
} Packet_otg_elt;

typedef struct Job_element {
72
  struct Job_element *next;
73 74 75 76
  Job job;
} Job_elt;

typedef struct Event_element {
77 78
  struct Event_element *next;
  struct Event_element *previous;
79 80
  Event event;
} Event_elt;