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


Ignore:
Timestamp:
May 27, 2009, 9:37:27 PM (16 years ago)
Author:
ansari
Message:

Importation des modifs effectuees sur pc-sitr2 pour l'acquisition - Reza 27/05/2009

File:
1 edited

Legend:

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

    r3639 r3643  
    7171
    7272// Fonctions appelees par le main
    73 void Usage();
     73void Usage(bool fgshort=true);
    7474int DecodeArgs(int narg, char* arg[]);
    7575void DecodeAcqMode();
     
    9999static  uint_4 dmaSize  = 32*1024 ;
    100100static  uint_4 patternSZ=0x400;  // pas utilise avec la fibre
     101static  bool activate_pattern=false;  // true -> on active le pattern du firmware au lieu de la fibre
    101102static  uint_4 NMaxBloc = 10;
    102103//---------------------------- FIN parametres de controle -----------------
     
    159160
    160161/* --Nouvelle-Fonction-- */
    161 void Usage()
     162void Usage(bool fgshort)
    162163{
     164  if (fgshort) {
     165    cout << " Usage: tmtacq CardNum PaquetSize NFrameDMA NFiles NBlocPerFile \n"
     166         << "                 NMaxProc DataDirPath [AcqMode] [MemZoneMgr][HardCtlC]" << endl;
     167    cout << "   type tmtacq -h for detailed usage " << endl;
     168    return;
     169  }
     170
    163171   cout << "\n Usage: tmtacq CardNum PaquetSize NFrameDMA NFiles NBlocPerFile \n"
    164172        << "                 NMaxProc DataDirPath [AcqMode] [MemZoneMgr][HardCtlC]" << endl;
     
    171179   cout << "      NMaxProc=0 -> No Processing " << endl;
    172180   cout << " - DataDirPath : Subdirectory of /Raid " << endl;
    173    cout << "   Pour la version du firmware qui ne swappe pas les paquets" << endl;
    174    cout << " - AcqMode: = swapall , fft1c , fft2c, swh , nof , mxs , mono , monosw (default=std)" << endl;
    175    cout << "    swapall -> SwapAll+SaveData , swh->swap header only " << endl;
    176    cout << "    fft1c , ff2c -> reorder data for 1 channel/2channel FFT " << endl;
    177    cout << "    fft1cnof , ff2cnof -> reorder FFT data, but DONT write files " << endl;
     181   cout << " - AcqMode: Acquisition mode for the firmware V=496 (manages 64bits-byteswap)"<<endl;
     182   cout << "     (V=496) AcqMode: std=nosw, fft1c, fft2c "<<endl;
     183   cout << "     std=nosw: Standard Acquisition, Raw data "<<endl;
     184   cout << "     fft1c,fft2c: Standard Acquisition, FFT data "<<endl;
     185   cout << "     (V=496) For debug/performance measurement "<<endl;
     186   cout << "     nof,fft1cnof,fft2nof: raw/fft data, dont write files  "<<endl;
     187   cout << "     mono-> Single thread PCIEReaderChecker, copy packets" << endl;
     188   cout << "     pattern: activate pattern, and write fits files  "<<endl;
     189   cout << "     pattnof: activate pattern, NO fits files written "<<endl;
     190   cout << "     pattmono: activate pattern, Single thread, copy packets "<<endl;
     191   cout << " - MemZoneMgr: nZones,NPaq =Number of Zones and number of paquet \n"
     192        << "               in each zone (Default=4,128) "<< endl;
     193   cout << " -HardCtlC : Y y (direct interrpution by CtrlC ) default (no) " << endl;
    178194   cout << endl;
    179    cout << "   Pour la version du firmware qui swappe partiellement " << endl;
    180    cout << "  -AcqMode : swap32 ,fft1c32 , fft2c32,fft1cnof32 , fft2cnof32 " <<endl;
    181    cout << "    fft1c32 , fft2c32 -> reorder data for 1 channel/2channel FFT " << endl;
    182    cout << "    fft1cnof32 , ff2cnof32 -> reorder FFT data, but DONT write files " << endl << endl;
    183  cout << endl;
    184    cout << "   Pour la version du firmware qui ne swappe plus " << endl;
    185    cout << "  -AcqMode :  nosw,fft1cnosw , fft2cnosw" <<endl;
    186    cout << "    fft1cnosw , fft2cnosw -> reorder data for 1 channel/2channel FFT " << endl;
    187    cout << "    fft1cnofnosw , ff2cnofnosw -> reorder FFT data, but DONT write files " << endl << endl;
    188 
    189 
    190    cout << "   Option pour debug ou test performance swapp initial (std)" << endl ;
    191    cout << "    nof->Don't write signal fits files , mxs->swh+nof: swap header only + no fits " << endl;
    192    cout << "    mono->Test with a single thread PCIEReaderChecker " << endl;
    193    cout << "   monosw->Test with a single thread PCIEReaderChecker, But swap all packet " << endl;
    194    cout << endl;
    195    cout << "   mononsw->Test with a single thread PCIEReaderChecker, But no swap paquet " << endl;
    196    cout << endl;
    197    cout << " - MemZoneMgr: nZones,NPaq =Number of Zones and number of paquet in each zone (Default=8,128) "
    198  << endl;
    199    cout << " -HardCtlC : Y y (direct interrpution by CtrlC ) default (no) " << endl;
     195   cout << " - AcqMode for previous firmware with 32bits-byteswap"<<endl;
     196   cout << "     AcqMode : swap32, nof32, fft1c32 , fft2c32,fft1cnof32 , fft2cnof32 " <<endl;
     197   cout << " - AcqMode for previous firmware without any byte-swap"<<endl;
     198   cout << "     AcqMode : swapall, fft1csw , fft2csw, swapallnof, swh, mxs, monosw" << endl;
     199   return;
    200200}
    201201
     
    203203int DecodeArgs(int narg, char* arg[])
    204204{
     205  if ((narg>1)&&(strcmp(arg[1],"-h")==0))  {
     206    Usage(false);
     207    return 1;
     208  }
    205209  if (narg < 8) {
    206     Usage();
     210    Usage(true);
    207211    return 1;
    208212  }
     213
    209214  acqmode = "std";
    210   acqmode = arg[8];
     215  if (narg>8) acqmode = arg[8];
    211216  savesigfits = true;
    212217  // BRDataFmtConv swapall = BR_SwapAll;
     
    295300  // uint_4 dmaSize  = nbFrameDMA*PaqSZ ;  // plantage
    296301  dmaSize  = nbFrameDMA*1024 ;
    297   patternSZ=0x400;  // pas utilise avec la fibre
     302  patternSZ=(sizeFrame-40)/4;  // pas utilise avec la fibre
    298303  NMaxBloc = NbFiles*NBlocPerFile;
    299304  cout << "tmtacq[2] - PaqSize = " << PaqSZ << " NbPaq/Zone=" << nPaqZone << " NZones=" << nZones << endl;
     
    308313void DecodeAcqMode()
    309314{
     315  if (acqmode == "nosw")   swapall = BR_Copy ;
     316  if (acqmode == "nof")  { swapall = BR_Copy ; savesigfits = false; }
     317  if (acqmode == "fft1c")  swapall = BR_FFTOneChanNoSwap;
     318  if (acqmode == "fft2c")  swapall = BR_FFTTwoChanNoSwap;
     319  if (acqmode == "fft1cnof")  { swapall = BR_FFTOneChanNoSwap;  savesigfits = false; }
     320  if (acqmode == "fft2cnof")  { swapall = BR_FFTTwoChanNoSwap;  savesigfits = false; }
     321  if (acqmode == "mono")  { monothr = true;   swapall = BR_Copy; }
     322  if (acqmode == "patmono")  { monothr = true;   swapall = BR_Copy; activate_pattern=true; }
     323  if (acqmode == "patnof")  { savesigfits = false; swapall = BR_Copy; activate_pattern=true; }
     324  if (acqmode == "pattern")  { savesigfits = true; swapall = BR_Copy; activate_pattern=true; }
     325
    310326  if (acqmode == "swapall")  swapall = BR_SwapAll;
    311   if (acqmode == "fft1c")  swapall = BR_FFTOneChan;
    312   if (acqmode == "fft2c")  swapall = BR_FFTTwoChan;
    313   if (acqmode == "fft1cnof")  { swapall = BR_FFTOneChan;  savesigfits = false; }
    314   if (acqmode == "fft2cnof")  { swapall = BR_FFTTwoChan;  savesigfits = false; }
    315   if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "mono") )  swapall = BR_SwapHDR;
    316   if ((acqmode == "nof") || (acqmode == "mxs") || (acqmode == "mono"))  savesigfits = false;
    317   if (acqmode == "mono")  { monothr = true;   swapall = BR_SwapHDR;; }
     327  if (acqmode == "fft1csw")  swapall = BR_FFTOneChan;
     328  if (acqmode == "fft2csw")  swapall = BR_FFTTwoChan;
     329  if (acqmode == "fft1cswnof")  { swapall = BR_FFTOneChan;  savesigfits = false; }
     330  if (acqmode == "fft2cswnof")  { swapall = BR_FFTTwoChan;  savesigfits = false; }
     331  if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "monoswh") )  swapall = BR_SwapHDR;
     332  if ((acqmode == "swapallnof") || (acqmode == "mxs") )  savesigfits = false;
     333  if (acqmode == "monoswh")  { monothr = true;   swapall = BR_SwapHDR;; }
    318334  if (acqmode == "monosw")  { monothr = true;   swapall = BR_SwapAll; }
    319   if (acqmode == "mononsw")  { monothr = true;   swapall = BR_Copy; }
    320335
    321336  if (acqmode == "swap32")   swapall = BR_Swap32 ;
     337  if (acqmode == "nof32")   { swapall = BR_Swap32 ; savesigfits = false; }
    322338  if (acqmode == "fft1c32")  swapall = BR_FFTOneChan32;
    323339  if (acqmode == "fft2c32")  swapall = BR_FFTTwoChan32;
     
    325341  if (acqmode == "fft2cnof32")  { swapall = BR_FFTTwoChan32;  savesigfits = false; }
    326342
    327   if (acqmode == "nosw")   swapall = BR_Copy ;
    328   if (acqmode == "fft1cnosw")  swapall = BR_FFTOneChanNoSwap;
    329   if (acqmode == "fft2cnosw")  swapall = BR_FFTTwoChanNoSwap;
    330   if (acqmode == "fft1cnofnosw")  { swapall = BR_FFTOneChanNoSwap;  savesigfits = false; }
    331   if (acqmode == "fft2cnofnosw")  { swapall = BR_FFTTwoChanNoSwap;  savesigfits = false; }
    332343}
    333344
     
    342353  TestPCIWrapperNODMA pciw(PaqSZ);
    343354#else
    344   DMAMgr dma1(card,patternSZ,dmaSize );
     355  DMAMgr dma1(card,patternSZ,dmaSize,activate_pattern);
    345356  if (! dma1.StatusFibre() ) {
    346357    cout << " tmtacq[3] - fibre non accrochee -> exit " << endl;
     
    416427  TestPCIWrapperNODMA pciw2(PaqSZ);
    417428#else
    418   DMAMgr dma1(cardlist[0],patternSZ,dmaSize );
     429  DMAMgr dma1(cardlist[0],patternSZ,dmaSize,activate_pattern);
    419430  if (! dma1.StatusFibre() ) {
    420431    cout << " tmtacq[3] - fibre non accrochee Card" << cardlist[0] << " -> exit " << endl;
     
    423434  else cout << " tmtacq[3] - fibre accrochee OK Card " << cardlist[0] << endl;
    424435
    425   DMAMgr dma2(cardlist[1],patternSZ,dmaSize );
     436  DMAMgr dma2(cardlist[1],patternSZ,dmaSize,activate_pattern);
    426437  if (! dma1.StatusFibre() ) {
    427438    cout << " tmtacq[3] - fibre non accrochee Card" << cardlist[1] << " -> exit " << endl;
Note: See TracChangeset for help on using the changeset viewer.