2 #include "Data_Generator.h"
4 /************************************************************************************/
6 void Data_Generator_init(DOLProcess * p)
10 // p->local->antenna_cntr = 0;
11 p->local->pulse_cntr = 0;
12 p->local->bin_cntr = 0;
13 p->local->n_firings = 0;
15 p->local->excount = 0;
17 for (i=0; i<NUMBER_OF_PULSES; i++)
19 for (j=0; j<NUMBER_OF_RANGE_BINS; j++)
21 for (k=0; k<NUMBER_OF_ANTENNA_ELEMENTS; k++)
23 (p->local->Samples[i][j][k]).real = 1.0;
24 (p->local->Samples[i][j][k]).imag = 0.0;
30 /************************************************************************************/
32 int Data_Generator_fire(DOLProcess * p)
36 // printf("\tgenerator executions: %d\n",p->local->excount);
39 // printf("\n Data Gen \n \t range: %d \n\t pulse: %d", p->local->bin_cntr, p->local->pulse_cntr);
41 CREATEPORTVAR(output_port);
42 for (beam_index = 0; beam_index < NUMBER_OF_BEAMS; beam_index++)
44 CREATEPORT(output_port, PORT_OUT, 1, beam_index, NUMBER_OF_BEAMS);
45 DOL_write((void*)output_port, &(p->local->Samples[p->local->pulse_cntr][p->local->bin_cntr][0])
46 , NUMBER_OF_ANTENNA_ELEMENTS*sizeof(ComplexNumber), p);
49 //p->local->antenna_cntr = p->local->antenna_cntr + 1;
51 // if (p->local->antenna_cntr == NUMBER_OF_ANTENNA_ELEMENTS)
53 // p->local->antenna_cntr = 0;
55 p->local->bin_cntr = p->local->bin_cntr + 1;
56 if (p->local->bin_cntr == NUMBER_OF_RANGE_BINS)
58 p->local->bin_cntr = 0;
59 // Increase pulse index
60 p->local->pulse_cntr = p->local->pulse_cntr + 1;
61 if (p->local->pulse_cntr == NUMBER_OF_PULSES)
63 p->local->pulse_cntr = 0;
64 p->local->n_firings = p->local->n_firings + 1;
69 if (p->local->n_firings == NUMBER_OF_ITERATIONS)
71 printf("\n\n:: Data generator process finished ::\n\n");
72 // printf("\ttotal number of executions: %d",p->local->excount);