1010/ [Mythen3] Check bad-channel flags before shifting the channel register (#1629)

* [Mythen3] Check bad-channel flags before shifting the channel register

The bad-channel test in setChannelRegisterChip ran after the register
was divided by two, so the mask 0x38 hit the LSB of the counter 0 trim
instead of the flags. Every channel with an odd trim value was logged
as a bad channel, 1280 lines per module, which made setAllTrimbits
about 190 ms slower for odd values. Test the flags where they were set.

Also remove an unused message buffer in validate_writePatternWord and
log the client pattern file name at debug level instead of printing it
on every pattern load.

* check is back

* m3 binary in

* fixed binary versions

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
This commit is contained in:
authored and GitHub committed 2026-10-22 16:30:34 +02:00
1 parent 6df1aba669
commit 95c99d0789
3 files changed
+10 -8

No files matched your search

@@ -304,8 +304,6 @@ patternParameters *setChannelRegisterChip(int ichip, char *mask,
chanReg |= (0x1 << (3 + icounter));
}
}
chanReg /= 2;
// deserialize
if (chanReg & CHAN_REG_BAD_CHANNEL_MSK) {
LOG(logINFOBLUE,
("badchannel [chanReg:0x%x modCounter:%d, modChan:%d, "
@@ -313,6 +311,8 @@ patternParameters *setChannelRegisterChip(int ichip, char *mask,
chanReg, ichip * NCHAN + ich * NCOUNTERS,
ichip * NCHAN_1_COUNTER + ich, ichip, ich));
}
chanReg /= 2;
// deserialize
for (int i = 0; i < 23; i++) {
patword = clearBit(SIGNAL_clk, patword);
pat->word[iaddr++] = patword;
@@ -170,10 +170,12 @@ int validate_writePatternWord(char *message, int addr, uint64_t word) {
uint64_t retval = readPatternWord(addr);
LOG(logDEBUG1, ("Pattern word (addr:0x%x) retval: 0x%llx\n", addr,
(long long int)retval));
char mode[128];
memset(mode, 0, sizeof(mode));
sprintf(mode, "set pattern word for addr 0x%x", addr);
validate64(&ret, message, word, retval, "set pattern word", HEX);
// runs for every pattern word: only build the message on a mismatch
if (retval != word) {
char mode[64];
sprintf(mode, "set pattern word for addr 0x%x", addr);
validate64(&ret, message, word, retval, mode, HEX);
}
#endif
return ret;
}
@@ -835,7 +837,7 @@ int loadPattern(char *message, enum TLogLevel printLevel,
int ret = OK;
memset(clientPatternfile, 0, MAX_STR_LENGTH);
memcpy(clientPatternfile, patfname, MAX_STR_LENGTH);
printf("Client Pattern File:%s\n", clientPatternfile);
LOG(logDEBUG1, ("Client Pattern File:%s\n", clientPatternfile));
#ifdef MYTHEN3D
trimmingPrint = printLevel;
#endif
+1 -1
View File
@@ -9,4 +9,4 @@
#define APIEIGER "10.1.0 0x260807"
#define APIXILINXCTB "10.0.0 0x250828"
#define APIJUNGFRAU "10.1.0 0x261002"
#define APIMYTHEN3 "10.0.0 0x250828"
#define APIMYTHEN3 "10.1.0 0x261022"