ctb, moench, eiger, gotthard: get number of channels for moench and ctb, others removed unnecessary variables in shm, added moench virtual sever (#86)

This commit is contained in:
Dhanya Thattil
2020-03-10 09:08:08 +01:00
committed by GitHub
parent 013836bea5
commit 758afad02c
16 changed files with 156 additions and 304 deletions

View File

@ -2177,9 +2177,26 @@ int calculateDataBytes(){
return dataBytes;
}
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
int getTotalNumberOfChannels() {
int nchanx = 0, nchany = 0;
getTotalNumberOfChannels(&nchanx, &nchany);
return nchanx * nchany;
}
int getNumberOfChannels(int* nchanx, int* nchany) {
uint32_t mask = enableTenGigabitEthernet(-1) ? adcEnableMask_10g : adcEnableMask_1g;
// count number of channels in x, each adc has 25 channels each
int nchanTop = __builtin_popcount(mask & 0xF0F0F0F0) * NCHANS_PER_ADC;
int nchanBot = __builtin_popcount(mask & 0x0F0F0F0F) * NCHANS_PER_ADC;
*nchanx = nchanTop > 0 ? nchanTop : nchanBot;
// if both top and bottom adcs enabled, rows = 2
int nrows = 1;
if (nchanTop > 0 && nchanBot > 0) {
nrows = 2;
}
*nchany = nSamples / NSAMPLES_PER_ROW * nrows;
}
int getNumberOfChips(){return NCHIP;}
int getNumberOfDACs(){return NDAC;}
int getNumberOfChannelsPerChip(){return NCHAN;}

View File

@ -59,6 +59,7 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
#define CLK_FREQ (156.25) /* MHz */
#define NSAMPLES_PER_ROW (25)
#define NCHANS_PER_ADC (25)
/** Default Parameters */
#define DEFAULT_PATTERN_FILE ("DefaultPattern.txt")