Merge pull request #1375 from slsdetectorgroup/dev/xilinx_rm_powerdown
All checks were successful
Build on local RHEL9 / build (push) Successful in 1m25s
Build on RHEL9 / build (push) Successful in 3m58s
Build on RHEL8 / build (push) Successful in 4m48s
Build on local RHEL8 / build (push) Successful in 3m32s

xilinx server: remove powerdown for power regulators
This commit is contained in:
2026-02-02 13:53:53 +01:00
committed by GitHub
4 changed files with 23 additions and 18 deletions

View File

@@ -413,9 +413,16 @@ void setupDetector() {
}
LOG(logINFOBLUE, ("Powering down all dacs\n"));
for (int idac = 0; idac < NDAC; ++idac) {
for (int idac = 0; idac < NDAC_ONLY; ++idac) {
setDAC(idac, LTC2620_D_GetPowerDownValue(), 0);
}
for (int idac = NDAC_ONLY; idac < NDAC; ++idac) {
if (idac == D_PWR_EMPTY)
continue;
int min = (idac == D_PWR_IO) ? VIO_MIN_MV : POWER_RGLTR_MIN;
// will not enable power at startup (dacValues = -1)
setPower(idac, min);
}
resetFlow();
cleanFifos();
@@ -1296,6 +1303,9 @@ int getPower(enum DACINDEX ind) {
}
void setPower(enum DACINDEX ind, int val) {
if (val < 0)
return;
// validate index and get bit offset in ctrl register
int bitOffset = getBitOffsetFromDACIndex(ind);
if (bitOffset == -1) {
@@ -1303,10 +1313,6 @@ void setPower(enum DACINDEX ind, int val) {
}
uint32_t addr = CTRL_REG;
uint32_t mask = (1 << bitOffset);
if (val == -1)
return;
char *powerNames[] = {PWR_NAMES};
int pwrIndex = (int)(ind - D_PWR_D);
LOG(logINFO, ("Setting Power V%s to %d mV\n", powerNames[pwrIndex], val));
@@ -1322,16 +1328,10 @@ void setPower(enum DACINDEX ind, int val) {
LOG(logDEBUG1, ("Switching off power enable\n"));
bus_w(addr, bus_r(addr) & ~(mask));
// power down dac
LOG(logINFO, ("\tPowering down V%d\n", powerNames[pwrIndex]));
setDAC(ind, LTC2620_D_GetPowerDownValue(), 0);
//(power off is anyway done with power enable)
if (val == 0)
val = LTC2620_D_GetPowerDownValue();
int startup = dacValues[ind] == -1 ? 1 : 0;
// convert voltage to dac (power off is anyway done with power enable)
if (val != LTC2620_D_GetPowerDownValue()) {
if (val > 0) {
int dacval = -1;
if (ConvertToDifferentRange(
@@ -1339,9 +1339,8 @@ void setPower(enum DACINDEX ind, int val) {
LTC2620_D_GetMinInput(), val, &dacval) == FAIL) {
LOG(logERROR,
("\tCannot convert Power V%s to dac value. Invalid value of %d "
"mV. Is not between "
"%d and %d mV\n",
powerNames[pwrIndex], val, POWER_RGLTR_MIN, POWER_RGLTR_MAX));
"mV.n",
powerNames[pwrIndex], val));
return;
}
@@ -1351,7 +1350,7 @@ void setPower(enum DACINDEX ind, int val) {
setDAC(ind, dacval, 0);
// if valid, enable power
if (dacval >= 0) {
if (dacval >= 0 && startup == 0) {
LOG(logDEBUG1, ("Switching on power enable\n"));
bus_w(addr, bus_r(addr) | mask);
}

View File

@@ -1046,6 +1046,12 @@ TEST_CASE("v_abcd", "[.cmdcall]") {
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getPower(indices[i]);
// this is the first command touching power dacs, should not be
// -100
if (det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE(prev_val.any(-100) == false);
REQUIRE(prev_val.any(-1) == false);
}
{
std::ostringstream oss;
caller.call(cmds[i], {"0"}, -1, PUT, oss);

View File

@@ -7,6 +7,6 @@
#define APIGOTTHARD2 "0.0.0 0x250909"
#define APIMOENCH "0.0.0 0x250909"
#define APIEIGER "0.0.0 0x250909"
#define APIXILINXCTB "0.0.0 0x260122"
#define APIXILINXCTB "0.0.0 0x260128"
#define APIJUNGFRAU "0.0.0 0x250909"
#define APIMYTHEN3 "0.0.0 0x250922"