Changeset 3671 in Sophya for trunk/AddOn/TAcq/tmtacq.cc


Ignore:
Timestamp:
Nov 13, 2009, 11:54:04 AM (16 years ago)
Author:
ansari
Message:
  • Nettoyage complet des programmes d'acquisition
  • Ajout methode BRPaquet::CopyFrom() pour reduction de paquet
  • Introduction des classes BRParList , BRConfList , BRAcqConfig
  • Introduction du nouveau programme acquisition mfacq.cc (MultiFibresAcq)

Reza, 13/11/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/tmtacq.cc

    r3645 r3671  
    2929
    3030
    31 //--------------------------------------------------------
     31//-----------------------------------------------------------------------
    3232// Programme test acquisition BAORadio multi-thread
    3333//  LAL -   R. Ansari Juillet -  2008
    3434//          M.Taurigna    2009
    35 //--------------------------------------------------------
     35// == Programme reste a la version de Mai 2009 (1er tests Pittsburgh) ==
     36//-----------------------------------------------------------------------
    3637
    3738
     
    115116static  bool activate_pattern=false;  // true -> on active le pattern du firmware au lieu de la fibre
    116117static  uint_4 NMaxBloc = 10;
     118static  double nopciLossRate = 0.; // Taux de perte simule des paquets par TestPCIWrapperNODMA
    117119//---------------------------- FIN parametres de controle -----------------
    118120
     
    178180  if (fgshort) {
    179181    cout << " Usage: tmtacq CardNum PaquetSize NFrameDMA NFiles NBlocPerFile \n"
    180          << "                 NMaxProc DataDirPath [AcqMode] [MemZoneMgr][HardCtlC]" << endl;
     182        << "             NMaxProc DataDirPath [AcqMode] [MemZoneMgr] [HardCtlC] [NoPCILossRate]" << endl;
    181183    cout << "   type tmtacq -h for detailed usage " << endl;
    182184    return;
     
    184186
    185187   cout << "\n Usage: tmtacq CardNum PaquetSize NFrameDMA NFiles NBlocPerFile \n"
    186         << "                 NMaxProc DataDirPath [AcqMode] [MemZoneMgr][HardCtlC]" << endl;
     188        << "             NMaxProc DataDirPath [AcqMode] [MemZoneMgr] [HardCtlC] [NoPCILossRate]" << endl;
    187189   cout << " - CardNum : PCI-Express card number (=1 OR 2 OR 1,2)" << endl;
    188190   cout << " - PaquetSize or FrameSize (=DATA+HDR+TRL_Size)  " << endl;
     
    209211   cout << " - MemZoneMgr: nZones,NPaq =Number of Zones and number of paquet \n"
    210212        << "               in each zone (Default=4,128) "<< endl;
    211    cout << " -HardCtlC : Y y (direct interrpution by CtrlC ) default (no) " << endl;
     213   cout << " - HardCtlC : Y y (direct interrpution by CtrlC ) or no  (default=no) " << endl;
     214   cout << " - NoPCILossRate : Simulated NO-PCI loss rate (0<rate<1 default=0.) " << endl;
     215
    212216   cout << endl;
    213217   cout << " - AcqMode for previous firmware with 32bits-byteswap"<<endl;
     
    315319  }
    316320
    317   nZones = 8;  // Nombre de zones memoires
     321  nZones = 4;  // Nombre de zones memoires
    318322  nPaqZone = 128;  // 128 Paquets / zone memoire - valeur par defaut
    319323  if (narg > 9)  {
     
    333337    sigaction(SIGINT,&act,NULL);       
    334338  }
     339
     340  nopciLossRate = 0.; // Taux de perte simule des paquets par TestPCIWrapperNODMA
     341  if (narg > 11)  nopciLossRate=atof(arg[11]);
    335342
    336343  PaqSZ =sizeFrame;  // Taille de paquets
     
    360367  if (acqmode == "nosw")   swapall = BR_Copy ;
    361368  if (acqmode == "nof")  { swapall = BR_Copy ; savesigfits = false; }
    362   if (acqmode == "fft1c")  swapall = BR_FFTOneChanNoSwap;
    363   if (acqmode == "fft2c")  swapall = BR_FFTTwoChanNoSwap;
    364   if (acqmode == "fft1cnof")  { swapall = BR_FFTOneChanNoSwap;  savesigfits = false; }
    365   if (acqmode == "fft2cnof")  { swapall = BR_FFTTwoChanNoSwap;  savesigfits = false; }
     369  if (acqmode == "fft1c")  swapall = BR_FFTOneChan;
     370  if (acqmode == "fft2c")  swapall = BR_FFTTwoChan;
     371  if (acqmode == "fft1cnof")  { swapall = BR_FFTOneChan;  savesigfits = false; }
     372  if (acqmode == "fft2cnof")  { swapall = BR_FFTTwoChan;  savesigfits = false; }
    366373  if (acqmode == "mono")  { monothr = true;   swapall = BR_Copy; }
    367374  if (acqmode == "patmono")  { monothr = true;   swapall = BR_Copy; activate_pattern=true; }
     
    370377
    371378  if (acqmode == "swapall")  swapall = BR_SwapAll;
    372   if (acqmode == "fft1csw")  swapall = BR_FFTOneChan;
    373   if (acqmode == "fft2csw")  swapall = BR_FFTTwoChan;
    374   if (acqmode == "fft1cswnof")  { swapall = BR_FFTOneChan;  savesigfits = false; }
    375   if (acqmode == "fft2cswnof")  { swapall = BR_FFTTwoChan;  savesigfits = false; }
     379  if (acqmode == "fft1csw")  swapall = BR_FFTOneChanSwapAll;
     380  if (acqmode == "fft2csw")  swapall = BR_FFTTwoChanSwapAll;
     381  if (acqmode == "fft1cswnof")  { swapall = BR_FFTOneChanSwapAll;  savesigfits = false; }
     382  if (acqmode == "fft2cswnof")  { swapall = BR_FFTTwoChanSwapAll;  savesigfits = false; }
    376383  if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "monoswh") )  swapall = BR_SwapHDR;
    377384  if ((acqmode == "swapallnof") || (acqmode == "mxs") )  savesigfits = false;
     
    381388  if (acqmode == "swap32")   swapall = BR_Swap32 ;
    382389  if (acqmode == "nof32")   { swapall = BR_Swap32 ; savesigfits = false; }
    383   if (acqmode == "fft1c32")  swapall = BR_FFTOneChan32;
    384   if (acqmode == "fft2c32")  swapall = BR_FFTTwoChan32;
    385   if (acqmode == "fft1cnof32")  { swapall = BR_FFTOneChan32;  savesigfits = false; }
    386   if (acqmode == "fft2cnof32")  { swapall = BR_FFTTwoChan32;  savesigfits = false; }
     390  if (acqmode == "fft1c32")  swapall = BR_FFTOneChanSwap32;
     391  if (acqmode == "fft2c32")  swapall = BR_FFTTwoChanSwap32;
     392  if (acqmode == "fft1cnof32")  { swapall = BR_FFTOneChanSwap32;  savesigfits = false; }
     393  if (acqmode == "fft2cnof32")  { swapall = BR_FFTTwoChanSwap32;  savesigfits = false; }
    387394
    388395}
     
    398405  PCIEWrapperInterface* pciwp=NULL;
    399406#ifdef NOPCIECARD
    400   TestPCIWrapperNODMA pciw(PaqSZ);
     407  TestPCIWrapperNODMA pciw(PaqSZ,nopciLossRate);
    401408  pciwp = &pciw;
    402409#else
     
    494501
    495502#ifdef NOPCIECARD
    496   TestPCIWrapperNODMA pciw1(PaqSZ);
    497   TestPCIWrapperNODMA pciw2(PaqSZ);
     503  TestPCIWrapperNODMA pciw1(PaqSZ,nopciLossRate);
     504  TestPCIWrapperNODMA pciw2(PaqSZ,nopciLossRate);
    498505  pciwp1 = &pciw1;
    499506  pciwp2 = &pciw2;
Note: See TracChangeset for help on using the changeset viewer.