1 #include "Weight_Generator.h"
3 /************************************************************************************/
5 void Weight_Generator_init(DOLProcess * p)
9 //p->local->weight_counter = 0;
10 p->local->pulse_counter = 0;
11 p->local->n_firings = 0;
15 for (i=0; i<NUMBER_OF_BEAMS; i++)
17 for (j=0; j<NUMBER_OF_ANTENNA_ELEMENTS; j++)
19 (p->local->Weights[i][j]).real = 1.0;
20 (p->local->Weights[i][j]).imag = 0.0;
24 p->local->excount = 0;
28 /************************************************************************************/
30 int Weight_Generator_fire(DOLProcess * p)
35 // printf("\n \t\t weight gen \t %d \n", p->local->pulse_counter);
37 CREATEPORTVAR(output_port);
38 for (beam_index = 0; beam_index < NUMBER_OF_BEAMS; beam_index++)
40 CREATEPORT(output_port, PORT_OUT, 1, beam_index, NUMBER_OF_BEAMS);
41 DOL_write((void*)output_port, &(p->local->Weights[beam_index][0]), NUMBER_OF_ANTENNA_ELEMENTS*sizeof(ComplexNumber), p);
44 //p->local->weight_counter = p->local->weight_counter + 1;
46 // if (p->local->weight_counter == NUMBER_OF_ANTENNA_ELEMENTS)
48 // p->local->weight_counter = 0;
49 p->local->pulse_counter = p->local->pulse_counter + 1;
50 if (p->local->pulse_counter == (NUMBER_OF_RANGE_BINS * NUMBER_OF_PULSES))
52 p->local->pulse_counter = 0;
53 p->local->n_firings = p->local->n_firings + 1;
57 if (p->local->n_firings == NUMBER_OF_ITERATIONS)
59 printf("\n\n:: Weight generator finished ::\n\n");
60 // printf("\ttotal number of executions: %d",p->local->excount);