ctb: add patternstart command, xilinx: fix frequency (#1307)
Some checks failed
Build on RHEL9 / build (push) Failing after 3m9s
Build on RHEL8 / build (push) Failing after 5m11s

* add patternstart command for CTB, block end of execution udp packets if pattern was started by patternstart command

* update docs

* Dhanya's comments

* more Dhanya comments

* refactored

* fixed tests for startpatttern, also clkfrequency not properly used in server

* xilinx: fixed setfrequency, tick clock (with sync clock), clkfrequency set from getfrequency to get the exact value

* xilinx freq in kHz, updated default values and prints

---------

Co-authored-by: Martin Mueller <martin.mueller@psi.ch>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
Martin Mueller
2025-09-23 12:13:46 +02:00
committed by GitHub
parent e7a91d38f2
commit 2d8f93a426
17 changed files with 124 additions and 59 deletions

View File

@@ -623,28 +623,43 @@ uint64_t getPatternBitMask() {
return getU64BitReg(PATTERN_SET_LSB_REG, PATTERN_SET_MSB_REG);
}
#ifdef MYTHEN3D
void startPattern() {
LOG(logINFOBLUE, ("Starting Pattern\n"));
#ifdef MYTHEN3D
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_PATTERN_MSK);
usleep(1);
while (bus_r(PAT_STATUS_REG) & PAT_STATUS_RUN_BUSY_MSK) {
usleep(1);
}
LOG(logINFOBLUE, ("Pattern done\n"));
}
#endif
#ifdef XILINX_CHIPTESTBOARDD
void startPattern() {
LOG(logINFOBLUE, ("Starting Pattern\n"));
#elif CHIPTESTBOARDD
// we only want to run the pattern here. No acquisition, no UDP packets
// disable 10G UDP temporarily
// except if the pattern explicitly contains udp trigger points
uint32_t conf_reg_tmp = bus_r(CONFIG_REG);
if ((bus_r(STREAMING_CTRL_REG) & STREAMING_CTRL_ENA_MSK) == 0) {
bus_w(CONFIG_REG, conf_reg_tmp & ~CONFIG_GB10_SND_UDP_MSK);
}
// run the pattern, wait till done
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_ACQSTN_MSK);
bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_STRT_ACQSTN_MSK);
usleep(1);
while (bus_r(STATUS_REG) & STATUS_RN_BSY_MSK) {
usleep(1);
}
// go back to original config
bus_w(CONFIG_REG, conf_reg_tmp);
#elif XILINX_CHIPTESTBOARDD
bus_w(FLOW_CONTROL_REG, bus_r(FLOW_CONTROL_REG) | START_F_MSK);
usleep(1);
while (bus_r(FLOW_CONTROL_REG) & RSM_BUSY_MSK) {
usleep(1);
}
#endif
LOG(logINFOBLUE, ("Pattern done\n"));
}
#endif
char *getPatternFileName() { return clientPatternfile; }