Changeset 3643 in Sophya for trunk/AddOn/TAcq/tmtacq.cc
- Timestamp:
- May 27, 2009, 9:37:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/tmtacq.cc
r3639 r3643 71 71 72 72 // Fonctions appelees par le main 73 void Usage( );73 void Usage(bool fgshort=true); 74 74 int DecodeArgs(int narg, char* arg[]); 75 75 void DecodeAcqMode(); … … 99 99 static uint_4 dmaSize = 32*1024 ; 100 100 static uint_4 patternSZ=0x400; // pas utilise avec la fibre 101 static bool activate_pattern=false; // true -> on active le pattern du firmware au lieu de la fibre 101 102 static uint_4 NMaxBloc = 10; 102 103 //---------------------------- FIN parametres de controle ----------------- … … 159 160 160 161 /* --Nouvelle-Fonction-- */ 161 void Usage( )162 void Usage(bool fgshort) 162 163 { 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 163 171 cout << "\n Usage: tmtacq CardNum PaquetSize NFrameDMA NFiles NBlocPerFile \n" 164 172 << " NMaxProc DataDirPath [AcqMode] [MemZoneMgr][HardCtlC]" << endl; … … 171 179 cout << " NMaxProc=0 -> No Processing " << endl; 172 180 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; 178 194 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; 200 200 } 201 201 … … 203 203 int DecodeArgs(int narg, char* arg[]) 204 204 { 205 if ((narg>1)&&(strcmp(arg[1],"-h")==0)) { 206 Usage(false); 207 return 1; 208 } 205 209 if (narg < 8) { 206 Usage( );210 Usage(true); 207 211 return 1; 208 212 } 213 209 214 acqmode = "std"; 210 acqmode = arg[8];215 if (narg>8) acqmode = arg[8]; 211 216 savesigfits = true; 212 217 // BRDataFmtConv swapall = BR_SwapAll; … … 295 300 // uint_4 dmaSize = nbFrameDMA*PaqSZ ; // plantage 296 301 dmaSize = nbFrameDMA*1024 ; 297 patternSZ= 0x400; // pas utilise avec la fibre302 patternSZ=(sizeFrame-40)/4; // pas utilise avec la fibre 298 303 NMaxBloc = NbFiles*NBlocPerFile; 299 304 cout << "tmtacq[2] - PaqSize = " << PaqSZ << " NbPaq/Zone=" << nPaqZone << " NZones=" << nZones << endl; … … 308 313 void DecodeAcqMode() 309 314 { 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 310 326 if (acqmode == "swapall") swapall = BR_SwapAll; 311 if (acqmode == "fft1c ") swapall = BR_FFTOneChan;312 if (acqmode == "fft2c ") swapall = BR_FFTTwoChan;313 if (acqmode == "fft1c nof") { swapall = BR_FFTOneChan; savesigfits = false; }314 if (acqmode == "fft2c nof") { 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;; } 318 334 if (acqmode == "monosw") { monothr = true; swapall = BR_SwapAll; } 319 if (acqmode == "mononsw") { monothr = true; swapall = BR_Copy; }320 335 321 336 if (acqmode == "swap32") swapall = BR_Swap32 ; 337 if (acqmode == "nof32") { swapall = BR_Swap32 ; savesigfits = false; } 322 338 if (acqmode == "fft1c32") swapall = BR_FFTOneChan32; 323 339 if (acqmode == "fft2c32") swapall = BR_FFTTwoChan32; … … 325 341 if (acqmode == "fft2cnof32") { swapall = BR_FFTTwoChan32; savesigfits = false; } 326 342 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; }332 343 } 333 344 … … 342 353 TestPCIWrapperNODMA pciw(PaqSZ); 343 354 #else 344 DMAMgr dma1(card,patternSZ,dmaSize 355 DMAMgr dma1(card,patternSZ,dmaSize,activate_pattern); 345 356 if (! dma1.StatusFibre() ) { 346 357 cout << " tmtacq[3] - fibre non accrochee -> exit " << endl; … … 416 427 TestPCIWrapperNODMA pciw2(PaqSZ); 417 428 #else 418 DMAMgr dma1(cardlist[0],patternSZ,dmaSize 429 DMAMgr dma1(cardlist[0],patternSZ,dmaSize,activate_pattern); 419 430 if (! dma1.StatusFibre() ) { 420 431 cout << " tmtacq[3] - fibre non accrochee Card" << cardlist[0] << " -> exit " << endl; … … 423 434 else cout << " tmtacq[3] - fibre accrochee OK Card " << cardlist[0] << endl; 424 435 425 DMAMgr dma2(cardlist[1],patternSZ,dmaSize 436 DMAMgr dma2(cardlist[1],patternSZ,dmaSize,activate_pattern); 426 437 if (! dma1.StatusFibre() ) { 427 438 cout << " tmtacq[3] - fibre non accrochee Card" << cardlist[1] << " -> exit " << endl;
Note:
See TracChangeset
for help on using the changeset viewer.