| 252 | | portRxDataOut1A = new standardInterfaces_i::complexShort_u("RX_Data_1_A"); |
| 253 | | portRxDataOut2A = new standardInterfaces_i::complexShort_u("RX_Data_2_A"); |
| 254 | | portRxDataOut1B = new standardInterfaces_i::complexShort_u("RX_Data_1_B"); |
| 255 | | portRxDataOut2B = new standardInterfaces_i::complexShort_u("RX_Data_2_B"); |
| | 252 | portRxDataOut1A = new standardInterfaces_i::complexShort_u("RX_Data_1_B"); |
| | 253 | portRxDataOut2A = new standardInterfaces_i::complexShort_u("RX_Data_2_B"); |
| | 254 | portRxDataOut1B = new standardInterfaces_i::complexShort_u("RX_Data_1_A"); |
| | 255 | portRxDataOut2B = new standardInterfaces_i::complexShort_u("RX_Data_2_A"); |
| | 256 | |
| | 257 | channel_0_thread = new omni_thread(CIREN_SIM_i::do_channel_0_process, (void *) this); |
| | 258 | channel_0_thread->start(); |
| | 259 | channel_1_thread = new omni_thread(CIREN_SIM_i::do_channel_1_process, (void *) this); |
| | 260 | channel_1_thread->start(); |
| 301 | | // I_out_0.length(1024); //must define length of output |
| 302 | | // Q_out_0.length(1024); //must define length of output |
| 303 | | |
| 304 | | // I_out_1.length(1024); //must define length of output |
| 305 | | // Q_out_1.length(1024); //must define length of output |
| 306 | | |
| | 293 | I_out_0.length(I_in_0_length); //must define length of output |
| | 294 | Q_out_0.length(Q_in_0_length); //must define length of output |
| | 295 | |
| | 296 | I_out_1.length(I_in_0_length); //must define length of output |
| | 297 | Q_out_1.length(Q_in_0_length); //must define length of output |
| | 298 | |
| | 299 | for (int i = 0; i < I_in_0_length; ++i) { |
| | 300 | I_out_0[i] = (*I_in_0)[i]; |
| | 301 | I_out_1[i] = (*I_in_0)[i]; |
| | 302 | |
| | 303 | Q_out_0[i] = (*Q_in_0)[i]; |
| | 304 | Q_out_1[i] = (*Q_in_0)[i]; |
| | 305 | } |
| | 323 | |
| | 324 | while(1) |
| | 325 | { |
| | 326 | portTxDataInB->getData(I_in_1, Q_in_1); |
| | 327 | |
| | 328 | I_in_1_length = I_in_1->length(); |
| | 329 | Q_in_1_length = Q_in_1->length(); |
| | 330 | |
| | 331 | I_out_2.length(I_in_1_length); //must define length of output |
| | 332 | Q_out_2.length(Q_in_1_length); //must define length of output |
| | 333 | |
| | 334 | I_out_3.length(I_in_1_length); //must define length of output |
| | 335 | Q_out_3.length(Q_in_1_length); //must define length of output |
| | 336 | |
| | 337 | for (int i = 0; i < I_in_1_length; ++i) { |
| | 338 | I_out_2[i] = (*I_in_1)[i]; |
| | 339 | I_out_3[i] = (*I_in_1)[i]; |
| | 340 | |
| | 341 | Q_out_2[i] = (*Q_in_1)[i]; |
| | 342 | Q_out_3[i] = (*Q_in_1)[i]; |
| | 343 | } |
| | 344 | |
| | 345 | /*insert code here to do work*/ |
| | 346 | |
| | 347 | portTxDataInB->bufferEmptied(); |
| | 348 | portRxDataOut1B->pushPacket(I_out_2, Q_out_2); |
| | 349 | portRxDataOut2B->pushPacket(I_out_3, Q_out_3); |
| | 350 | |
| | 351 | } |
| | 352 | |
| | 353 | rx_thread->exit(); |
| | 354 | } |
| | 355 | |
| | 356 | void CIREN_SIM_i::channel_0_process() |
| | 357 | { |
| | 358 | PortTypes::ShortSequence I_out_0, Q_out_0; |
| | 359 | PortTypes::ShortSequence I_out_1, Q_out_1; |
| | 360 | |
| | 361 | I_out_0.length(1024); //must define length of output |
| | 362 | Q_out_0.length(1024); //must define length of output |
| | 363 | I_out_1.length(1024); //must define length of output |
| | 364 | Q_out_1.length(1024); //must define length of output |
| | 365 | |
| | 366 | for (unsigned int i=0; i<1024; i++){ |
| | 367 | I_out_0[i] = 0; |
| | 368 | Q_out_0[i] = 0; |
| | 369 | I_out_1[i] = 0; |
| | 370 | Q_out_1[i] = 0; |
| | 371 | } |
| | 372 | |
| | 373 | while(1) |
| | 374 | { |
| | 375 | |
| | 376 | for (int i = 0; i < 1024; ++i) { |
| | 377 | I_out_0[i] = 0; |
| | 378 | I_out_0[i] = 0; |
| | 379 | |
| | 380 | Q_out_1[i] = 0; |
| | 381 | Q_out_1[i] = 0; |
| | 382 | } |
| | 383 | |
| | 384 | /*insert code here to do work*/ |
| | 385 | |
| | 386 | portRxDataOut1A->pushPacket(I_out_0, Q_out_0); |
| | 387 | portRxDataOut2A->pushPacket(I_out_1, Q_out_1); |
| | 388 | |
| | 389 | } |
| | 390 | |
| | 391 | channel_0_thread->exit(); |
| | 392 | } |
| | 393 | |
| | 394 | void CIREN_SIM_i::channel_1_process() |
| | 395 | { |
| | 396 | PortTypes::ShortSequence I_out_2, Q_out_2; |
| | 397 | PortTypes::ShortSequence I_out_3, Q_out_3; |
| 342 | | //portTxDataInB->getData(I_in_1, Q_in_1); |
| 343 | | I_in_1_length = I_in_1->length(); |
| 344 | | Q_in_1_length = Q_in_1->length(); |
| 345 | | |
| 346 | | // I_out_2.length(1024); //must define length of output |
| 347 | | // Q_out_2.length(1024); //must define length of output |
| 348 | | |
| 349 | | // I_out_3.length(1024); //must define length of output |
| 350 | | // Q_out_3.length(1024); //must define length of output |
| | 413 | |
| | 414 | for (int i = 0; i < 1024; ++i) { |
| | 415 | I_out_2[i] = 0; |
| | 416 | I_out_3[i] = 0; |
| | 417 | |
| | 418 | Q_out_2[i] = 0; |
| | 419 | Q_out_3[i] = 0; |
| | 420 | } |